Re-add the Exporter

This commit is contained in:
raoulvdberge
2019-10-17 17:41:23 +02:00
parent ad800fbd1a
commit d5ad673a40
25 changed files with 798 additions and 188 deletions

View File

@@ -122,6 +122,7 @@ public class ClientSetup {
ScreenManager.registerFactory(RSContainers.FLUID_STORAGE_BLOCK, FluidStorageBlockScreen::new);
ScreenManager.registerFactory(RSContainers.EXTERNAL_STORAGE, ExternalStorageScreen::new);
ScreenManager.registerFactory(RSContainers.IMPORTER, ImporterScreen::new);
ScreenManager.registerFactory(RSContainers.EXPORTER, ExporterScreen::new);
ClientRegistry.registerKeyBinding(RSKeyBindings.FOCUS_SEARCH_BAR);
ClientRegistry.registerKeyBinding(RSKeyBindings.CLEAR_GRID_CRAFTING_MATRIX);

View File

@@ -114,6 +114,7 @@ public final class RS {
API.instance().getNetworkNodeRegistry().add(ExternalStorageNetworkNode.ID, (tag, world, pos) -> readAndReturn(tag, new ExternalStorageNetworkNode(world, pos)));
API.instance().getNetworkNodeRegistry().add(ImporterNetworkNode.ID, (tag, world, pos) -> readAndReturn(tag, new ImporterNetworkNode(world, pos)));
API.instance().getNetworkNodeRegistry().add(ExporterNetworkNode.ID, (tag, world, pos) -> readAndReturn(tag, new ExporterNetworkNode(world, pos)));
API.instance().getGridManager().add(GridBlockGridFactory.ID, new GridBlockGridFactory());
@@ -157,6 +158,7 @@ public final class RS {
e.getRegistry().register(new ExternalStorageBlock());
e.getRegistry().register(new ImporterBlock());
e.getRegistry().register(new ExporterBlock());
}
@SubscribeEvent
@@ -184,6 +186,7 @@ public final class RS {
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(ExternalStorageTile::new, RSBlocks.EXTERNAL_STORAGE).build(null).setRegistryName(RS.ID, "external_storage")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(ImporterTile::new, RSBlocks.IMPORTER).build(null).setRegistryName(RS.ID, "importer")));
e.getRegistry().register(registerTileDataParameters(TileEntityType.Builder.create(ExporterTile::new, RSBlocks.EXPORTER).build(null).setRegistryName(RS.ID, "exporter")));
}
private <T extends TileEntity> TileEntityType<T> registerTileDataParameters(TileEntityType<T> t) {
@@ -204,6 +207,7 @@ public final class RS {
e.getRegistry().register(IForgeContainerType.create(new PositionalTileContainerFactory<FluidStorageContainer, FluidStorageTile>((windowId, inv, tile) -> new FluidStorageContainer(tile, inv.player, windowId))).setRegistryName(RS.ID, "fluid_storage_block"));
e.getRegistry().register(IForgeContainerType.create(new PositionalTileContainerFactory<ExternalStorageContainer, ExternalStorageTile>((windowId, inv, tile) -> new ExternalStorageContainer(tile, inv.player, windowId))).setRegistryName(RS.ID, "external_storage"));
e.getRegistry().register(IForgeContainerType.create(new PositionalTileContainerFactory<ImporterContainer, ImporterTile>((windowId, inv, tile) -> new ImporterContainer(tile, inv.player, windowId))).setRegistryName(RS.ID, "importer"));
e.getRegistry().register(IForgeContainerType.create(new PositionalTileContainerFactory<ExporterContainer, ExporterTile>((windowId, inv, tile) -> new ExporterContainer(tile, inv.player, windowId))).setRegistryName(RS.ID, "exporter"));
}
@SubscribeEvent
@@ -273,6 +277,7 @@ public final class RS {
e.getRegistry().register(BlockUtils.createBlockItemFor(RSBlocks.EXTERNAL_STORAGE));
e.getRegistry().register(BlockUtils.createBlockItemFor(RSBlocks.IMPORTER));
e.getRegistry().register(BlockUtils.createBlockItemFor(RSBlocks.EXPORTER));
}
/* TODO

View File

@@ -7,7 +7,9 @@ public final class RSBlocks {
@ObjectHolder(RS.ID + ":importer")
public static final ImporterBlock IMPORTER = null;
public static final BlockExporter EXPORTER = new BlockExporter();
@ObjectHolder(RS.ID + ":exporter")
public static final ExporterBlock EXPORTER = null;
public static final BlockDetector DETECTOR = new BlockDetector();
public static final BlockDestructor DESTRUCTOR = new BlockDestructor();
public static final BlockConstructor CONSTRUCTOR = new BlockConstructor();

View File

@@ -27,7 +27,8 @@ public final class RSContainers {
//@ObjectHolder(RS.ID + ":disk_manipulator")
public static final ContainerType<DiskManipulatorContainer> DISK_MANIPULATOR = null;
//@ObjectHolder(RS.ID + ":exporter")
@ObjectHolder(RS.ID + ":exporter")
public static final ContainerType<ExporterContainer> EXPORTER = null;
@ObjectHolder(RS.ID + ":external_storage")

View File

@@ -9,8 +9,6 @@ public class RSOldConfig {
public int crafterManagerUsage;
public int destructorUsage;
public int detectorUsage;
public int exporterUsage;
public int importerUsage;
public int interfaceUsage;
public int fluidInterfaceUsage;
public int relayUsage;
@@ -89,8 +87,6 @@ public class RSOldConfig {
crafterManagerUsage = config.getInt("crafterManager", ENERGY, 4, 0, Integer.MAX_VALUE, "The energy used by Crafter Managers");
destructorUsage = config.getInt("destructor", ENERGY, 1, 0, Integer.MAX_VALUE, "The energy used by Destructors");
detectorUsage = config.getInt("detector", ENERGY, 2, 0, Integer.MAX_VALUE, "The energy used by Detectors");
exporterUsage = config.getInt("exporter", ENERGY, 1, 0, Integer.MAX_VALUE, "The energy used by Exporters");
importerUsage = config.getInt("importer", ENERGY, 1, 0, Integer.MAX_VALUE, "The energy used by Importers");
interfaceUsage = config.getInt("interface", ENERGY, 3, 0, Integer.MAX_VALUE, "The energy used by Interfaces");
fluidInterfaceUsage = config.getInt("fluidInterface", ENERGY, 3, 0, Integer.MAX_VALUE, "The energy used by Fluid Interfaces");
relayUsage = config.getInt("relay", ENERGY, 1, 0, Integer.MAX_VALUE, "The energy used by Relays");

View File

@@ -33,8 +33,9 @@ public class RSTiles {
//@ObjectHolder(RS.ID + ":disk_manipulator")
public static final TileEntityType<TileDiskManipulator> DISK_MANIPULATOR = null;
//@ObjectHolder(RS.ID + ":exporter")
public static final TileEntityType<TileExporter> EXPORTER = null;
@ObjectHolder(RS.ID + ":exporter")
public static final TileEntityType<ExporterTile> EXPORTER = null;
@ObjectHolder(RS.ID + ":external_storage")
public static final TileEntityType<ExternalStorageTile> EXTERNAL_STORAGE = null;

View File

@@ -9,7 +9,7 @@ import com.raoulvdberge.refinedstorage.inventory.item.UpgradeItemHandler;
import com.raoulvdberge.refinedstorage.inventory.listener.NetworkNodeFluidInventoryListener;
import com.raoulvdberge.refinedstorage.inventory.listener.NetworkNodeInventoryListener;
import com.raoulvdberge.refinedstorage.item.UpgradeItem;
import com.raoulvdberge.refinedstorage.tile.TileExporter;
import com.raoulvdberge.refinedstorage.tile.ExporterTile;
import com.raoulvdberge.refinedstorage.tile.config.IComparable;
import com.raoulvdberge.refinedstorage.tile.config.IType;
import com.raoulvdberge.refinedstorage.util.StackUtils;
@@ -26,7 +26,7 @@ import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.IItemHandlerModifiable;
import net.minecraftforge.items.ItemHandlerHelper;
public class NetworkNodeExporter extends NetworkNode implements IComparable, IType {
public class ExporterNetworkNode extends NetworkNode implements IComparable, IType {
public static final ResourceLocation ID = new ResourceLocation(RS.ID, "exporter");
private static final String NBT_COMPARE = "Compare";
@@ -36,20 +36,21 @@ public class NetworkNodeExporter extends NetworkNode implements IComparable, ITy
private BaseItemHandler itemFilters = new BaseItemHandler(9).addListener(new NetworkNodeInventoryListener(this));
private FluidInventory fluidFilters = new FluidInventory(9).addListener(new NetworkNodeFluidInventoryListener(this));
private UpgradeItemHandler upgrades = (UpgradeItemHandler) new UpgradeItemHandler(4 /* TODO, ItemUpgrade.TYPE_SPEED, ItemUpgrade.TYPE_CRAFTING, ItemUpgrade.TYPE_STACK*/).addListener(new NetworkNodeInventoryListener(this));
private UpgradeItemHandler upgrades = (UpgradeItemHandler) new UpgradeItemHandler(4, UpgradeItem.Type.SPEED, UpgradeItem.Type.CRAFTING, UpgradeItem.Type.STACK)
.addListener(new NetworkNodeInventoryListener(this));
private int compare = IComparer.COMPARE_NBT;
private int type = IType.ITEMS;
private int filterSlot;
public NetworkNodeExporter(World world, BlockPos pos) {
public ExporterNetworkNode(World world, BlockPos pos) {
super(world, pos);
}
@Override
public int getEnergyUsage() {
return RS.INSTANCE.config.exporterUsage + upgrades.getEnergyUsage();
return RS.SERVER_CONFIG.getExporter().getUsage() + upgrades.getEnergyUsage();
}
@Override
@@ -219,7 +220,7 @@ public class NetworkNodeExporter extends NetworkNode implements IComparable, ITy
@Override
public int getType() {
return world.isRemote ? TileExporter.TYPE.getValue() : type;
return world.isRemote ? ExporterTile.TYPE.getValue() : type;
}
@Override

View File

@@ -53,7 +53,7 @@ public class ImporterNetworkNode extends NetworkNode implements IComparable, IWh
@Override
public int getEnergyUsage() {
return RS.INSTANCE.config.importerUsage + upgrades.getEnergyUsage();
return RS.SERVER_CONFIG.getImporter().getUsage() + upgrades.getEnergyUsage();
}
@Override

View File

@@ -1,59 +0,0 @@
package com.raoulvdberge.refinedstorage.block;
public class BlockExporter extends CableBlock {
/* TODO
public BlockExporter() {
super(createBuilder("exporter").tileEntity(TileExporter::new).create());
}
@Override
@OnlyIn(Dist.CLIENT)
public void registerModels(IModelRegistration modelRegistration) {
modelRegistration.setModel(this, 0, new ModelResourceLocation(info.getId(), "direction=north,down=false,east=true,north=false,south=false,up=false,west=true"));
registerCover(modelRegistration);
}
@Override
@Nullable
public BlockDirection getDirection() {
return BlockDirection.ANY;
}
@Override
public List<CollisionGroup> getCollisions(TileEntity tile, BlockState state) {
List<CollisionGroup> groups = super.getCollisions(tile, state);
switch (state.getValue(getDirection().getProperty())) {
case NORTH:
groups.add(ConstantsExporter.LINE_NORTH);
break;
case EAST:
groups.add(ConstantsExporter.LINE_EAST);
break;
case SOUTH:
groups.add(ConstantsExporter.LINE_SOUTH);
break;
case WEST:
groups.add(ConstantsExporter.LINE_WEST);
break;
case UP:
groups.add(ConstantsExporter.LINE_UP);
break;
case DOWN:
groups.add(ConstantsExporter.LINE_DOWN);
break;
}
return groups;
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, BlockState state, PlayerEntity player, EnumHand hand, Direction side, float hitX, float hitY, float hitZ) {
if (!canAccessGui(state, world, pos, hitX, hitY, hitZ)) {
return false;
}
return openNetworkGui(RSGui.EXPORTER, player, world, pos, side);
}*/
}

View File

@@ -0,0 +1,126 @@
package com.raoulvdberge.refinedstorage.block;
import com.raoulvdberge.refinedstorage.RS;
import com.raoulvdberge.refinedstorage.block.info.BlockDirection;
import com.raoulvdberge.refinedstorage.container.ExporterContainer;
import com.raoulvdberge.refinedstorage.container.factory.PositionalTileContainerProvider;
import com.raoulvdberge.refinedstorage.tile.ExporterTile;
import com.raoulvdberge.refinedstorage.util.BlockUtils;
import com.raoulvdberge.refinedstorage.util.NetworkUtils;
import net.minecraft.block.BlockState;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraftforge.fml.network.NetworkHooks;
import javax.annotation.Nullable;
public class ExporterBlock extends CableBlock {
private static final VoxelShape LINE_NORTH_1 = makeCuboidShape(6, 6, 0, 10, 10, 2);
private static final VoxelShape LINE_NORTH_2 = makeCuboidShape(5, 5, 2, 11, 11, 4);
private static final VoxelShape LINE_NORTH_3 = makeCuboidShape(3, 3, 4, 13, 13, 6);
private static final VoxelShape LINE_NORTH = VoxelShapes.or(LINE_NORTH_1, LINE_NORTH_2, LINE_NORTH_3);
private static final VoxelShape LINE_EAST_1 = makeCuboidShape(14, 6, 6, 16, 10, 10);
private static final VoxelShape LINE_EAST_2 = makeCuboidShape(12, 5, 5, 14, 11, 11);
private static final VoxelShape LINE_EAST_3 = makeCuboidShape(10, 3, 3, 12, 13, 13);
private static final VoxelShape LINE_EAST = VoxelShapes.or(LINE_EAST_1, LINE_EAST_2, LINE_EAST_3);
private static final VoxelShape LINE_SOUTH_1 = makeCuboidShape(6, 6, 14, 10, 10, 16);
private static final VoxelShape LINE_SOUTH_2 = makeCuboidShape(5, 5, 12, 11, 11, 14);
private static final VoxelShape LINE_SOUTH_3 = makeCuboidShape(3, 3, 10, 13, 13, 12);
private static final VoxelShape LINE_SOUTH = VoxelShapes.or(LINE_SOUTH_1, LINE_SOUTH_2, LINE_SOUTH_3);
private static final VoxelShape LINE_WEST_1 = makeCuboidShape(0, 6, 6, 2, 10, 10);
private static final VoxelShape LINE_WEST_2 = makeCuboidShape(2, 5, 5, 4, 11, 11);
private static final VoxelShape LINE_WEST_3 = makeCuboidShape(4, 3, 3, 6, 13, 13);
private static final VoxelShape LINE_WEST = VoxelShapes.or(LINE_WEST_1, LINE_WEST_2, LINE_WEST_3);
private static final VoxelShape LINE_UP_1 = makeCuboidShape(6, 14, 6, 10, 16, 10);
private static final VoxelShape LINE_UP_2 = makeCuboidShape(5, 12, 5, 11, 14, 11);
private static final VoxelShape LINE_UP_3 = makeCuboidShape(3, 10, 3, 13, 12, 13);
private static final VoxelShape LINE_UP = VoxelShapes.or(LINE_UP_1, LINE_UP_2, LINE_UP_3);
private static final VoxelShape LINE_DOWN_1 = makeCuboidShape(6, 0, 6, 10, 2, 10);
private static final VoxelShape LINE_DOWN_2 = makeCuboidShape(5, 2, 5, 11, 4, 11);
private static final VoxelShape LINE_DOWN_3 = makeCuboidShape(3, 4, 3, 13, 6, 13);
private static final VoxelShape LINE_DOWN = VoxelShapes.or(LINE_DOWN_1, LINE_DOWN_2, LINE_DOWN_3);
public ExporterBlock() {
super(BlockUtils.DEFAULT_GLASS_PROPERTIES);
this.setRegistryName(RS.ID, "exporter");
}
@Override
public BlockDirection getDirection() {
return BlockDirection.ANY;
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext ctx) {
VoxelShape shape = super.getShape(state, world, pos, ctx);
Direction direction = state.get(getDirection().getProperty());
if (direction == Direction.NORTH) {
shape = VoxelShapes.or(shape, LINE_NORTH);
}
if (direction == Direction.EAST) {
shape = VoxelShapes.or(shape, LINE_EAST);
}
if (direction == Direction.SOUTH) {
shape = VoxelShapes.or(shape, LINE_SOUTH);
}
if (direction == Direction.WEST) {
shape = VoxelShapes.or(shape, LINE_WEST);
}
if (direction == Direction.UP) {
shape = VoxelShapes.or(shape, LINE_UP);
}
if (direction == Direction.DOWN) {
shape = VoxelShapes.or(shape, LINE_DOWN);
}
return shape;
}
@Nullable
@Override
public TileEntity createTileEntity(BlockState state, IBlockReader world) {
return new ExporterTile();
}
@Override
@SuppressWarnings("deprecation")
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
if (!world.isRemote) {
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
(ServerPlayerEntity) player,
new PositionalTileContainerProvider<ExporterTile>(
new TranslationTextComponent("gui.refinedstorage.exporter"),
(tile, windowId, inventory, p) -> new ExporterContainer(tile, player, windowId),
pos
),
pos
));
}
return true;
}
}

View File

@@ -67,7 +67,6 @@ public class ImporterBlock extends CableBlock {
return BlockDirection.ANY;
}
@Override
public VoxelShape getShape(BlockState state, IBlockReader world, BlockPos pos, ISelectionContext ctx) {
VoxelShape shape = super.getShape(state, world, pos, ctx);

View File

@@ -13,6 +13,8 @@ public class ServerConfig {
private StorageBlock storageBlock;
private FluidStorageBlock fluidStorageBlock;
private ExternalStorage externalStorage;
private Importer importer;
private Exporter exporter;
private Upgrades upgrades;
public ServerConfig() {
@@ -23,6 +25,8 @@ public class ServerConfig {
storageBlock = new StorageBlock();
fluidStorageBlock = new FluidStorageBlock();
externalStorage = new ExternalStorage();
importer = new Importer();
exporter = new Exporter();
upgrades = new Upgrades();
spec = builder.build();
@@ -60,6 +64,14 @@ public class ServerConfig {
return externalStorage;
}
public Importer getImporter() {
return importer;
}
public Exporter getExporter() {
return exporter;
}
public ForgeConfigSpec getSpec() {
return spec;
}
@@ -323,4 +335,36 @@ public class ServerConfig {
return usage.get();
}
}
public class Importer {
private final ForgeConfigSpec.IntValue usage;
public Importer() {
builder.push("importer");
usage = builder.comment("The energy used by the Importer").defineInRange("usage", 1, 0, Integer.MAX_VALUE);
builder.pop();
}
public int getUsage() {
return usage.get();
}
}
public class Exporter {
private final ForgeConfigSpec.IntValue usage;
public Exporter() {
builder.push("exporter");
usage = builder.comment("The energy used by the Exporter").defineInRange("usage", 1, 0, Integer.MAX_VALUE);
builder.pop();
}
public int getUsage() {
return usage.get();
}
}
}

View File

@@ -3,13 +3,13 @@ package com.raoulvdberge.refinedstorage.container;
import com.raoulvdberge.refinedstorage.RSContainers;
import com.raoulvdberge.refinedstorage.container.slot.filter.FilterSlot;
import com.raoulvdberge.refinedstorage.container.slot.filter.FluidFilterSlot;
import com.raoulvdberge.refinedstorage.tile.TileExporter;
import com.raoulvdberge.refinedstorage.tile.ExporterTile;
import com.raoulvdberge.refinedstorage.tile.config.IType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraftforge.items.SlotItemHandler;
public class ExporterContainer extends BaseContainer {
public ExporterContainer(TileExporter exporter, PlayerEntity player, int windowId) {
public ExporterContainer(ExporterTile exporter, PlayerEntity player, int windowId) {
super(RSContainers.EXPORTER, exporter, player, windowId);
for (int i = 0; i < 4; ++i) {

View File

@@ -1,37 +0,0 @@
package com.raoulvdberge.refinedstorage.render.constants;
import com.raoulvdberge.refinedstorage.render.collision.CollisionGroup;
import com.raoulvdberge.refinedstorage.util.CollisionUtils;
import net.minecraft.util.math.AxisAlignedBB;
public final class ConstantsExporter {
public static final AxisAlignedBB LINE_NORTH_1_AABB = CollisionUtils.getBounds(6, 6, 0, 10, 10, 2);
public static final AxisAlignedBB LINE_NORTH_2_AABB = CollisionUtils.getBounds(5, 5, 2, 11, 11, 4);
public static final AxisAlignedBB LINE_NORTH_3_AABB = CollisionUtils.getBounds(3, 3, 4, 13, 13, 6);
public static final CollisionGroup LINE_NORTH = new CollisionGroup().addItem(LINE_NORTH_1_AABB).addItem(LINE_NORTH_2_AABB).addItem(LINE_NORTH_3_AABB).setCanAccessGui(true);
public static final AxisAlignedBB LINE_EAST_1_AABB = CollisionUtils.getBounds(14, 6, 6, 16, 10, 10);
public static final AxisAlignedBB LINE_EAST_2_AABB = CollisionUtils.getBounds(12, 5, 5, 14, 11, 11);
public static final AxisAlignedBB LINE_EAST_3_AABB = CollisionUtils.getBounds(10, 3, 3, 12, 13, 13);
public static final CollisionGroup LINE_EAST = new CollisionGroup().addItem(LINE_EAST_1_AABB).addItem(LINE_EAST_2_AABB).addItem(LINE_EAST_3_AABB).setCanAccessGui(true);
public static final AxisAlignedBB LINE_SOUTH_1_AABB = CollisionUtils.getBounds(6, 6, 14, 10, 10, 16);
public static final AxisAlignedBB LINE_SOUTH_2_AABB = CollisionUtils.getBounds(5, 5, 12, 11, 11, 14);
public static final AxisAlignedBB LINE_SOUTH_3_AABB = CollisionUtils.getBounds(3, 3, 10, 13, 13, 12);
public static final CollisionGroup LINE_SOUTH = new CollisionGroup().addItem(LINE_SOUTH_1_AABB).addItem(LINE_SOUTH_2_AABB).addItem(LINE_SOUTH_3_AABB).setCanAccessGui(true);
public static final AxisAlignedBB LINE_WEST_1_AABB = CollisionUtils.getBounds(0, 6, 6, 2, 10, 10);
public static final AxisAlignedBB LINE_WEST_2_AABB = CollisionUtils.getBounds(2, 5, 5, 4, 11, 11);
public static final AxisAlignedBB LINE_WEST_3_AABB = CollisionUtils.getBounds(4, 3, 3, 6, 13, 13);
public static final CollisionGroup LINE_WEST = new CollisionGroup().addItem(LINE_WEST_1_AABB).addItem(LINE_WEST_2_AABB).addItem(LINE_WEST_3_AABB).setCanAccessGui(true);
public static final AxisAlignedBB LINE_UP_1_AABB = CollisionUtils.getBounds(6, 14, 6, 10, 16, 10);
public static final AxisAlignedBB LINE_UP_2_AABB = CollisionUtils.getBounds(5, 12, 5, 11, 14, 11);
public static final AxisAlignedBB LINE_UP_3_AABB = CollisionUtils.getBounds(3, 10, 3, 13, 12, 13);
public static final CollisionGroup LINE_UP = new CollisionGroup().addItem(LINE_UP_1_AABB).addItem(LINE_UP_2_AABB).addItem(LINE_UP_3_AABB).setCanAccessGui(true);
public static final AxisAlignedBB LINE_DOWN_1_AABB = CollisionUtils.getBounds(6, 0, 6, 10, 2, 10);
public static final AxisAlignedBB LINE_DOWN_2_AABB = CollisionUtils.getBounds(5, 2, 5, 11, 4, 11);
public static final AxisAlignedBB LINE_DOWN_3_AABB = CollisionUtils.getBounds(3, 4, 3, 13, 6, 13);
public static final CollisionGroup LINE_DOWN = new CollisionGroup().addItem(LINE_DOWN_1_AABB).addItem(LINE_DOWN_2_AABB).addItem(LINE_DOWN_3_AABB).setCanAccessGui(true);
}

View File

@@ -5,22 +5,23 @@ import com.raoulvdberge.refinedstorage.container.ExporterContainer;
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.ExactModeSideButton;
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.RedstoneModeSideButton;
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.TypeSideButton;
import com.raoulvdberge.refinedstorage.tile.TileExporter;
import com.raoulvdberge.refinedstorage.tile.ExporterTile;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
public class GuiExporter extends BaseScreen<ExporterContainer> {
public GuiExporter(ExporterContainer container, PlayerInventory playerInventory) {
super(container, 211, 137, playerInventory, null);
public class ExporterScreen extends BaseScreen<ExporterContainer> {
public ExporterScreen(ExporterContainer container, PlayerInventory playerInventory, ITextComponent title) {
super(container, 211, 137, playerInventory, title);
}
@Override
public void onPostInit(int x, int y) {
addSideButton(new RedstoneModeSideButton(this, TileExporter.REDSTONE_MODE));
addSideButton(new RedstoneModeSideButton(this, ExporterTile.REDSTONE_MODE));
addSideButton(new TypeSideButton(this, TileExporter.TYPE));
addSideButton(new TypeSideButton(this, ExporterTile.TYPE));
addSideButton(new ExactModeSideButton(this, TileExporter.COMPARE));
addSideButton(new ExactModeSideButton(this, ExporterTile.COMPARE));
}
@Override
@@ -36,7 +37,7 @@ public class GuiExporter extends BaseScreen<ExporterContainer> {
@Override
public void renderForeground(int mouseX, int mouseY) {
renderString(7, 7, I18n.format("gui.refinedstorage:exporter"));
renderString(7, 7, title.getFormattedText());
renderString(7, 43, I18n.format("container.inventory"));
}
}

View File

@@ -40,7 +40,7 @@ public class ImporterScreen extends BaseScreen<ImporterContainer> {
@Override
public void renderForeground(int mouseX, int mouseY) {
renderString(7, 7, I18n.format("gui.refinedstorage.importer"));
renderString(7, 7, title.getFormattedText());
renderString(7, 43, I18n.format("container.inventory"));
}
}

View File

@@ -1,7 +1,7 @@
package com.raoulvdberge.refinedstorage.tile;
import com.raoulvdberge.refinedstorage.RSTiles;
import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNodeExporter;
import com.raoulvdberge.refinedstorage.apiimpl.network.node.ExporterNetworkNode;
import com.raoulvdberge.refinedstorage.tile.config.IComparable;
import com.raoulvdberge.refinedstorage.tile.config.IType;
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter;
@@ -10,11 +10,11 @@ import net.minecraft.world.World;
import javax.annotation.Nonnull;
public class TileExporter extends NetworkNodeTile<NetworkNodeExporter> {
public static final TileDataParameter<Integer, TileExporter> COMPARE = IComparable.createParameter();
public static final TileDataParameter<Integer, TileExporter> TYPE = IType.createParameter();
public class ExporterTile extends NetworkNodeTile<ExporterNetworkNode> {
public static final TileDataParameter<Integer, ExporterTile> COMPARE = IComparable.createParameter();
public static final TileDataParameter<Integer, ExporterTile> TYPE = IType.createParameter();
public TileExporter() {
public ExporterTile() {
super(RSTiles.EXPORTER);
dataManager.addWatchedParameter(COMPARE);
@@ -23,7 +23,7 @@ public class TileExporter extends NetworkNodeTile<NetworkNodeExporter> {
@Override
@Nonnull
public NetworkNodeExporter createNode(World world, BlockPos pos) {
return new NetworkNodeExporter(world, pos);
public ExporterNetworkNode createNode(World world, BlockPos pos) {
return new ExporterNetworkNode(world, pos);
}
}

View File

@@ -1,87 +1,115 @@
{
"forge_marker": 1,
"defaults": {
"textures": {
"cable": "refinedstorage:blocks/cable",
"particle": "refinedstorage:blocks/cable",
"border": "refinedstorage:blocks/cable_part_border"
"multipart": [
{
"apply": {
"model": "refinedstorage:block/cable_core"
}
},
"model": "refinedstorage:cable_core",
"uvlock": false,
"transform": "forge:default-block"
{
"when": {
"north": true
},
"variants": {
"direction": {
"north": {
"submodel": "refinedstorage:exporter"
"apply": {
"model": "refinedstorage:block/cable_extension"
}
},
"east": {
"submodel": "refinedstorage:exporter",
{
"when": {
"east": true
},
"apply": {
"model": "refinedstorage:block/cable_extension",
"y": 90
}
},
"south": {
"submodel": "refinedstorage:exporter",
{
"when": {
"south": true
},
"apply": {
"model": "refinedstorage:block/cable_extension",
"x": 180
}
},
"west": {
"submodel": "refinedstorage:exporter",
{
"when": {
"west": true
},
"apply": {
"model": "refinedstorage:block/cable_extension",
"y": 270
}
},
"up": {
"submodel": "refinedstorage:exporter",
{
"when": {
"up": true
},
"apply": {
"model": "refinedstorage:block/cable_extension",
"x": 270
}
},
"down": {
"submodel": "refinedstorage:exporter",
{
"when": {
"down": true
},
"apply": {
"model": "refinedstorage:block/cable_extension",
"x": 90
}
},
"north": {
"true": {
"submodel": "refinedstorage:cable_extension"
{
"when": {
"direction": "north"
},
"false": {
"apply": {
"model": "refinedstorage:block/exporter"
}
},
"east": {
"true": {
"submodel": "refinedstorage:cable_extension",
{
"when": {
"direction": "east"
},
"apply": {
"model": "refinedstorage:block/exporter",
"y": 90
},
"false": {
}
},
"south": {
"true": {
"submodel": "refinedstorage:cable_extension",
{
"when": {
"direction": "south"
},
"apply": {
"model": "refinedstorage:block/exporter",
"x": 180
},
"false": {
}
},
"west": {
"true": {
"submodel": "refinedstorage:cable_extension",
{
"when": {
"direction": "west"
},
"apply": {
"model": "refinedstorage:block/exporter",
"y": 270
},
"false": {
}
},
"up": {
"true": {
"submodel": "refinedstorage:cable_extension",
{
"when": {
"direction": "up"
},
"apply": {
"model": "refinedstorage:block/exporter",
"x": 270
},
"false": {
}
},
"down": {
"true": {
"submodel": "refinedstorage:cable_extension",
{
"when": {
"direction": "down"
},
"apply": {
"model": "refinedstorage:block/exporter",
"x": 90
},
"false": {
}
}
}
]
}

View File

@@ -22,7 +22,7 @@
"gui.refinedstorage.disk_drive.disks": "Disks",
"gui.refinedstorage.external_storage": "External Storage",
"gui.refinedstorage.importer": "Importer",
"gui.refinedstorage:exporter": "Exporter",
"gui.refinedstorage.exporter": "Exporter",
"gui.refinedstorage:detector": "Detector",
"gui.refinedstorage:destructor": "Destructor",
"gui.refinedstorage:constructor": "Constructor",
@@ -188,7 +188,7 @@
"block.refinedstorage:disk_manipulator": "Disk Manipulator",
"block.refinedstorage.external_storage": "External Storage",
"block.refinedstorage.importer": "Importer",
"block.refinedstorage:exporter": "Exporter",
"block.refinedstorage.exporter": "Exporter",
"block.refinedstorage:detector": "Detector",
"block.refinedstorage.machine_casing": "Machine Casing",
"block.refinedstorage:destructor": "Destructor",

View File

@@ -1,4 +1,7 @@
{
"textures": {
"border": "refinedstorage:block/cable_part_border"
},
"elements": [
{
"name": "Line1",

View File

@@ -0,0 +1,441 @@
{
"parent": "block/block",
"textures": {
"cable": "refinedstorage:block/cable",
"border": "refinedstorage:block/cable_part_border"
},
"elements": [
{
"name": "Core",
"from": [
6,
6,
6
],
"to": [
10,
10,
10
],
"faces": {
"north": {
"uv": [
6,
6,
10,
10
],
"texture": "#cable"
},
"east": {
"uv": [
6,
6,
10,
10
],
"texture": "#cable"
},
"south": {
"uv": [
6,
6,
10,
10
],
"texture": "#cable"
},
"west": {
"uv": [
6,
6,
10,
10
],
"texture": "#cable"
},
"up": {
"uv": [
6,
6,
10,
10
],
"texture": "#cable"
},
"down": {
"uv": [
6,
6,
10,
10
],
"texture": "#cable"
}
}
},
{
"name": "Part1",
"from": [
10,
6,
6
],
"to": [
16,
10,
10
],
"rotation": {
"angle": 0,
"axis": "y",
"origin": [
16,
8,
9
]
},
"faces": {
"north": {
"uv": [
0,
6,
6,
10
],
"texture": "#cable"
},
"east": {
"uv": [
6,
6,
10,
10
],
"texture": "#cable"
},
"south": {
"uv": [
10,
6,
16,
10
],
"texture": "#cable"
},
"west": {
"uv": [
6,
6,
10,
10
],
"texture": "#cable"
},
"up": {
"uv": [
10,
6,
16,
10
],
"texture": "#cable"
},
"down": {
"uv": [
10,
6,
16,
10
],
"texture": "#cable"
}
}
},
{
"name": "Part2",
"from": [
0,
6,
6
],
"to": [
6,
10,
10
],
"rotation": {
"angle": 0,
"axis": "y",
"origin": [
6,
8,
9
]
},
"faces": {
"north": {
"uv": [
10,
6,
16,
10
],
"texture": "#cable"
},
"east": {
"uv": [
6,
6,
10,
10
],
"texture": "#cable"
},
"south": {
"uv": [
0,
6,
6,
10
],
"texture": "#cable"
},
"west": {
"uv": [
6,
6,
10,
10
],
"texture": "#cable"
},
"up": {
"uv": [
0,
6,
6,
10
],
"texture": "#cable"
},
"down": {
"uv": [
0,
6,
6,
10
],
"texture": "#cable"
}
}
},
{
"name": "Line1",
"from": [
6,
6,
0
],
"to": [
10,
10,
2
],
"faces": {
"north": {
"uv": [
0,
0,
4,
4
],
"texture": "#border"
},
"east": {
"uv": [
0,
0,
2,
4
],
"texture": "#border"
},
"south": {
"uv": [
0,
0,
4,
4
],
"texture": "#border"
},
"west": {
"uv": [
0,
0,
2,
4
],
"texture": "#border"
},
"up": {
"uv": [
0,
0,
4,
2
],
"texture": "#border"
},
"down": {
"uv": [
0,
0,
4,
2
],
"texture": "#border"
}
}
},
{
"name": "Line2",
"from": [
5,
5,
2
],
"to": [
11,
11,
4
],
"faces": {
"north": {
"uv": [
0,
0,
6,
6
],
"texture": "#border"
},
"east": {
"uv": [
0,
0,
2,
6
],
"texture": "#border"
},
"south": {
"uv": [
0,
0,
6,
6
],
"texture": "#border"
},
"west": {
"uv": [
0,
0,
2,
6
],
"texture": "#border"
},
"up": {
"uv": [
0,
0,
6,
2
],
"texture": "#border"
},
"down": {
"uv": [
0,
0,
6,
2
],
"texture": "#border"
}
}
},
{
"name": "Line3",
"from": [
3,
3,
4
],
"to": [
13,
13,
6
],
"faces": {
"north": {
"uv": [
0,
0,
10,
10
],
"texture": "#border"
},
"east": {
"uv": [
0,
0,
2,
10
],
"texture": "#border"
},
"south": {
"uv": [
0,
0,
10,
10
],
"texture": "#border"
},
"west": {
"uv": [
0,
0,
2,
10
],
"texture": "#border"
},
"up": {
"uv": [
0,
0,
10,
2
],
"texture": "#border"
},
"down": {
"uv": [
0,
0,
10,
2
],
"texture": "#border"
}
}
}
]
}

View File

@@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "refinedstorage:exporter"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View File

@@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "refinedstorage:external_storage"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View File

@@ -0,0 +1,19 @@
{
"type": "minecraft:block",
"pools": [
{
"rolls": 1,
"entries": [
{
"type": "minecraft:item",
"name": "refinedstorage:importer"
}
],
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
]
}
]
}

View File

@@ -5,10 +5,10 @@
"item": "refinedstorage:cable"
},
{
"item": "#construction_core"
"item": "refinedstorage:construction_core"
},
{
"item": "#improved_processor"
"item": "refinedstorage:improved_processor"
}
],
"result": {