Started on sorter GUI!
This commit is contained in:
parent
b49defae88
commit
b8935f8f7a
7 changed files with 85 additions and 8 deletions
|
@ -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")));
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
@ -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);
|
||||
}
|
||||
}
|
BIN
resources/assets/mekanism/gui/GuiItemStackFilter.png
Normal file
BIN
resources/assets/mekanism/gui/GuiItemStackFilter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
BIN
resources/assets/mekanism/gui/GuiLogisticalSorter.png
Normal file
BIN
resources/assets/mekanism/gui/GuiLogisticalSorter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
BIN
resources/assets/mekanism/gui/GuiOreDictFilter.png
Normal file
BIN
resources/assets/mekanism/gui/GuiOreDictFilter.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
Loading…
Reference in a new issue