diff --git a/common/mekanism/client/gui/GuiDigitalMiner.java b/common/mekanism/client/gui/GuiDigitalMiner.java index 908375589..762495f49 100644 --- a/common/mekanism/client/gui/GuiDigitalMiner.java +++ b/common/mekanism/client/gui/GuiDigitalMiner.java @@ -155,7 +155,7 @@ public class GuiDigitalMiner extends GuiMekanism fontRenderer.drawString(tileEntity.getInvName(), 69, 6, 0x404040); fontRenderer.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 2, 0x404040); - fontRenderer.drawString(tileEntity.running ? MekanismUtils.localize("gui.digitalMiner.running") : MekanismUtils.localize("gui.digitalMiner.idle"), 9, 10, 0x00CD00); + fontRenderer.drawString(tileEntity.running ? MekanismUtils.localize("gui.digitalMiner.running") : MekanismUtils.localize("gui.idle"), 9, 10, 0x00CD00); fontRenderer.drawString(tileEntity.searcher.state.desc, 9, 19, 0x00CD00); fontRenderer.drawString(MekanismUtils.localize("gui.eject") + ": " + MekanismUtils.localize("gui." + (tileEntity.doEject ? "on" : "off")), 9, 30, 0x00CD00); diff --git a/common/mekanism/client/gui/GuiGasTank.java b/common/mekanism/client/gui/GuiGasTank.java index 0b0d5dc58..d464cc8a0 100644 --- a/common/mekanism/client/gui/GuiGasTank.java +++ b/common/mekanism/client/gui/GuiGasTank.java @@ -1,6 +1,12 @@ package mekanism.client.gui; +import java.util.ArrayList; + +import mekanism.api.Coord4D; +import mekanism.common.PacketHandler; +import mekanism.common.PacketHandler.Transmission; import mekanism.common.inventory.container.ContainerGasTank; +import mekanism.common.network.PacketTileEntity; import mekanism.common.tile.TileEntityGasTank; import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils.ResourceType; @@ -37,6 +43,9 @@ public class GuiGasTank extends GuiMekanism fontRenderer.drawString("Gas: " + (tileEntity.gasTank.getGas() != null ? tileEntity.gasTank.getGas().getGas().getLocalizedName() : "None"), 45, 49, 0x404040); fontRenderer.drawString(MekanismUtils.localize("container.inventory"), 8, ySize - 96 + 2, 0x404040); + String name = tileEntity.dumping ? "Dumping..." : MekanismUtils.localize("gui.idle"); + fontRenderer.drawString(name, 156-fontRenderer.getStringWidth(name), 73, 0x404040); + super.drawGuiContainerForegroundLayer(mouseX, mouseY); } @@ -50,6 +59,9 @@ public class GuiGasTank extends GuiMekanism int guiWidth = (width - xSize) / 2; int guiHeight = (height - ySize) / 2; drawTexturedModalRect(guiWidth, guiHeight, 0, 0, xSize, ySize); + + int displayInt = tileEntity.dumping ? 18 : 10; + drawTexturedModalRect(guiWidth + 160, guiHeight + 73, 176, displayInt, 8, 8); if(tileEntity.gasTank.getGas() != null) { @@ -57,4 +69,23 @@ public class GuiGasTank extends GuiMekanism drawTexturedModalRect(guiWidth + 65, guiHeight + 17, 176, 0, scale, 20); } } + + @Override + protected void mouseClicked(int x, int y, int button) + { + super.mouseClicked(x, y, button); + + int xAxis = (x - (width - xSize) / 2); + int yAxis = (y - (height - ySize) / 2); + + if(xAxis > 160 && xAxis < 169 && yAxis > 73 && yAxis < 82) + { + ArrayList data = new ArrayList(); + data.add(0); + + PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data)); + mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F); + + } + } } diff --git a/common/mekanism/common/tile/TileEntityGasTank.java b/common/mekanism/common/tile/TileEntityGasTank.java index 876aa3194..ffa950ad2 100644 --- a/common/mekanism/common/tile/TileEntityGasTank.java +++ b/common/mekanism/common/tile/TileEntityGasTank.java @@ -12,7 +12,11 @@ import mekanism.api.gas.IGasHandler; import mekanism.api.gas.IGasItem; import mekanism.api.gas.ITubeConnection; import mekanism.common.IRedstoneControl; +import mekanism.common.PacketHandler; +import mekanism.common.PacketHandler.Transmission; +import mekanism.common.network.PacketTileEntity; import mekanism.common.util.MekanismUtils; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -30,6 +34,8 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH /** How fast this tank can output gas. */ public int output = 16; + public boolean dumping; + /** This machine's current RedstoneControl type. */ public RedstoneControl controlType; @@ -68,6 +74,11 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH } } } + + if(!worldObj.isRemote && dumping) + { + gasTank.draw(8, true); + } } @Override @@ -139,6 +150,23 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH @Override public void handlePacketData(ByteArrayDataInput dataStream) { + if(!worldObj.isRemote) + { + int type = dataStream.readInt(); + + if(type == 0) + { + dumping = !dumping; + } + + for(EntityPlayer player : playersUsing) + { + PacketHandler.sendPacket(Transmission.SINGLE_CLIENT, new PacketTileEntity().setParams(Coord4D.get(this), getNetworkedData(new ArrayList())), player); + } + + return; + } + super.handlePacketData(dataStream); if(dataStream.readBoolean()) @@ -149,6 +177,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH gasTank.setGas(null); } + dumping = dataStream.readBoolean(); controlType = RedstoneControl.values()[dataStream.readInt()]; MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord); @@ -160,6 +189,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH super.readFromNBT(nbtTags); gasTank.read(nbtTags.getCompoundTag("gasTank")); + dumping = nbtTags.getBoolean("dumping"); controlType = RedstoneControl.values()[nbtTags.getInteger("controlType")]; } @@ -169,6 +199,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH super.writeToNBT(nbtTags); nbtTags.setCompoundTag("gasTank", gasTank.write(new NBTTagCompound())); + nbtTags.setBoolean("dumping", dumping); nbtTags.setInteger("controlType", controlType.ordinal()); } @@ -187,6 +218,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH data.add(false); } + data.add(dumping); data.add(controlType.ordinal()); return data; diff --git a/resources/assets/mekanism/gui/GuiElectrolyticSeparator.png b/resources/assets/mekanism/gui/GuiElectrolyticSeparator.png index 3e8fd23f7..13b91156d 100644 Binary files a/resources/assets/mekanism/gui/GuiElectrolyticSeparator.png and b/resources/assets/mekanism/gui/GuiElectrolyticSeparator.png differ diff --git a/resources/assets/mekanism/gui/GuiGasTank.png b/resources/assets/mekanism/gui/GuiGasTank.png index 30c3aad8c..5308566c1 100644 Binary files a/resources/assets/mekanism/gui/GuiGasTank.png and b/resources/assets/mekanism/gui/GuiGasTank.png differ diff --git a/resources/assets/mekanism/lang/en_US.lang b/resources/assets/mekanism/lang/en_US.lang index affd73b65..246ebc686 100644 --- a/resources/assets/mekanism/lang/en_US.lang +++ b/resources/assets/mekanism/lang/en_US.lang @@ -264,6 +264,7 @@ gui.state=State gui.on=On gui.off=Off gui.filters=Filters +gui.idle=Idle gui.chemicalInfuser.short=C. Infuser gui.chemicalCombiner.short=C. Combiner @@ -338,7 +339,6 @@ gui.digitalMiner.pull=Pull gui.digitalMiner.silk=Silk gui.digitalMiner.toMine=To mine gui.digitalMiner.running=Running -gui.digitalMiner.idle=Idle gui.digitalMiner.inverse=Inverse mode //Item and block tooltip text