diff --git a/common/mekanism/client/gui/GuiLogisticalSorter.java b/common/mekanism/client/gui/GuiLogisticalSorter.java index 624756c1b..6134f9e41 100644 --- a/common/mekanism/client/gui/GuiLogisticalSorter.java +++ b/common/mekanism/client/gui/GuiLogisticalSorter.java @@ -1,6 +1,6 @@ package mekanism.client.gui; -import mekanism.common.inventory.container.ContainerLogisticalSorter; +import mekanism.common.inventory.container.ContainerItemStackFilter; import mekanism.common.tileentity.TileEntityLogisticalSorter; import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils.ResourceType; @@ -19,7 +19,7 @@ public class GuiLogisticalSorter extends GuiMekanism public GuiLogisticalSorter(InventoryPlayer inventory, TileEntityLogisticalSorter tentity) { - super(new ContainerLogisticalSorter(inventory, tentity)); + super(new ContainerItemStackFilter(inventory, tentity)); tileEntity = tentity; guiElements.add(new GuiRedstoneControl(this, tileEntity, MekanismUtils.getResource(ResourceType.GUI, "GuiLogisticalSorter.png"))); diff --git a/common/mekanism/common/CommonProxy.java b/common/mekanism/common/CommonProxy.java index 703155bda..be4f08a2e 100644 --- a/common/mekanism/common/CommonProxy.java +++ b/common/mekanism/common/CommonProxy.java @@ -9,7 +9,7 @@ import mekanism.common.inventory.container.ContainerElectricPump; import mekanism.common.inventory.container.ContainerEnergyCube; import mekanism.common.inventory.container.ContainerFactory; import mekanism.common.inventory.container.ContainerGasTank; -import mekanism.common.inventory.container.ContainerLogisticalSorter; +import mekanism.common.inventory.container.ContainerItemStackFilter; import mekanism.common.inventory.container.ContainerMetallurgicInfuser; import mekanism.common.inventory.container.ContainerRobitCrafting; import mekanism.common.inventory.container.ContainerRobitInventory; @@ -283,7 +283,7 @@ public class CommonProxy case 25: return new ContainerRobitRepair(player.inventory, world); case 26: - return new ContainerLogisticalSorter(player.inventory, (TileEntityLogisticalSorter)tileEntity); + return new ContainerItemStackFilter(player.inventory, (TileEntityLogisticalSorter)tileEntity); } return null; diff --git a/common/mekanism/common/inventory/container/ContainerLogisticalSorter.java b/common/mekanism/common/inventory/container/ContainerItemStackFilter.java similarity index 87% rename from common/mekanism/common/inventory/container/ContainerLogisticalSorter.java rename to common/mekanism/common/inventory/container/ContainerItemStackFilter.java index 10a06264a..1b7812c89 100644 --- a/common/mekanism/common/inventory/container/ContainerLogisticalSorter.java +++ b/common/mekanism/common/inventory/container/ContainerItemStackFilter.java @@ -9,15 +9,14 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; -public class ContainerLogisticalSorter extends Container +public class ContainerItemStackFilter extends Container { private TileEntityLogisticalSorter tileEntity; - public ContainerLogisticalSorter(InventoryPlayer inventory, TileEntityLogisticalSorter tentity) + public ContainerItemStackFilter(InventoryPlayer inventory, TileEntityLogisticalSorter tentity) { tileEntity = tentity; - addSlotToContainer(new SlotStorageTank(tentity, EnumGas.NONE, true, 0, 8, 8)); - addSlotToContainer(new SlotStorageTank(tentity, EnumGas.NONE, true, 1, 8, 40)); + addSlotToContainer(new Slot(tentity, 0, 8, 8)); int slotX; diff --git a/common/mekanism/common/network/PacketLogisticalSorterGui.java b/common/mekanism/common/network/PacketLogisticalSorterGui.java new file mode 100644 index 000000000..1a1f5b15b --- /dev/null +++ b/common/mekanism/common/network/PacketLogisticalSorterGui.java @@ -0,0 +1,78 @@ +package mekanism.common.network; + +import java.io.DataOutputStream; +import java.util.ArrayList; + +import mekanism.api.Object3D; +import mekanism.common.ITileNetwork; +import mekanism.common.PacketHandler; +import mekanism.common.PacketHandler.Transmission; +import mekanism.common.tileentity.TileEntityDynamicTank; +import mekanism.common.tileentity.TileEntityLogisticalSorter; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +import com.google.common.io.ByteArrayDataInput; + +import cpw.mods.fml.common.FMLCommonHandler; + +public class PacketLogisticalSorterGui implements IMekanismPacket +{ + public Object3D object3D; + + public int filterIndex; + + @Override + public String getName() + { + return "LogisticalSorterGui"; + } + + @Override + public IMekanismPacket setParams(Object... data) + { + object3D = (Object3D)data[0]; + filterIndex = (Integer)data[1]; + + return this; + } + + @Override + public void read(ByteArrayDataInput dataStream, EntityPlayer player, World world) throws Exception + { + int x = dataStream.readInt(); + int y = dataStream.readInt(); + int z = dataStream.readInt(); + + int id = dataStream.readInt(); + + int index = dataStream.readInt(); + + World worldServer = FMLCommonHandler.instance().getMinecraftServerInstance().worldServerForDimension(id); + + if(worldServer != null && worldServer.getBlockTileEntity(x, y, z) instanceof ITileNetwork) + { + TileEntity tileEntity = worldServer.getBlockTileEntity(x, y, z); + + if(tileEntity instanceof TileEntityLogisticalSorter) + { + ((TileEntityDynamicTank)tileEntity).sendStructure = true; + } + + PacketHandler.sendPacket(Transmission.ALL_CLIENTS, new PacketTileEntity().setParams(Object3D.get(worldServer.getBlockTileEntity(x, y, z)), ((ITileNetwork)worldServer.getBlockTileEntity(x, y, z)).getNetworkedData(new ArrayList()))); + } + } + + @Override + public void write(DataOutputStream dataStream) throws Exception + { + dataStream.writeInt(object3D.xCoord); + dataStream.writeInt(object3D.yCoord); + dataStream.writeInt(object3D.zCoord); + + dataStream.writeInt(object3D.dimensionId); + + dataStream.writeInt(filterIndex); + } +} diff --git a/resources/assets/mekanism/gui/GuiItemStackFilter.png b/resources/assets/mekanism/gui/GuiItemStackFilter.png new file mode 100644 index 000000000..68289861b Binary files /dev/null and b/resources/assets/mekanism/gui/GuiItemStackFilter.png differ diff --git a/resources/assets/mekanism/gui/GuiLogisticalSorter.png b/resources/assets/mekanism/gui/GuiLogisticalSorter.png new file mode 100644 index 000000000..68289861b Binary files /dev/null and b/resources/assets/mekanism/gui/GuiLogisticalSorter.png differ diff --git a/resources/assets/mekanism/gui/GuiOreDictFilter.png b/resources/assets/mekanism/gui/GuiOreDictFilter.png new file mode 100644 index 000000000..0e1145567 Binary files /dev/null and b/resources/assets/mekanism/gui/GuiOreDictFilter.png differ