From c0dba3c3663f4afcd20e51ca97a376512fdd007f Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Fri, 3 Jan 2014 00:43:55 -0500 Subject: [PATCH] Fixed GUI issue, fixed particles --- .../client/gui/GuiElectrolyticSeparator.java | 8 +-- .../TileEntityElectrolyticSeparator.java | 51 +++++++++++------- .../mekanism/render/ElectrolyticSeparator.png | Bin 4736 -> 4529 bytes 3 files changed, 38 insertions(+), 21 deletions(-) diff --git a/common/mekanism/client/gui/GuiElectrolyticSeparator.java b/common/mekanism/client/gui/GuiElectrolyticSeparator.java index f5fa9c71e..cc196e1ba 100644 --- a/common/mekanism/client/gui/GuiElectrolyticSeparator.java +++ b/common/mekanism/client/gui/GuiElectrolyticSeparator.java @@ -66,10 +66,12 @@ public class GuiElectrolyticSeparator extends GuiContainer int yAxis = (mouseY - (height - ySize) / 2); fontRenderer.drawString(tileEntity.getInvName(), 45, 6, 0x404040); - String name = tileEntity.leftTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.leftTank.getGas().getGas().getLocalizedName(); + + String name = tileEntity.dumpLeft ? "Dumping..." : tileEntity.leftTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.leftTank.getGas().getGas().getLocalizedName(); fontRenderer.drawString(name, 21, 73, 0x404040); - name = tileEntity.rightTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.rightTank.getGas().getGas().getLocalizedName(); - fontRenderer.drawString(name, 152-(name.length()*5), 73, 0x404040); + + name = tileEntity.dumpRight ? "Dumping..." : tileEntity.rightTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.rightTank.getGas().getGas().getLocalizedName(); + fontRenderer.drawString(name, 156-fontRenderer.getStringWidth(name), 73, 0x404040); if(xAxis >= 6 && xAxis <= 22 && yAxis >= 11 && yAxis <= 69) { diff --git a/common/mekanism/common/tileentity/TileEntityElectrolyticSeparator.java b/common/mekanism/common/tileentity/TileEntityElectrolyticSeparator.java index 09bebe618..b41e78e74 100644 --- a/common/mekanism/common/tileentity/TileEntityElectrolyticSeparator.java +++ b/common/mekanism/common/tileentity/TileEntityElectrolyticSeparator.java @@ -147,7 +147,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp if(worldObj.rand.nextInt(3) == 2) { - PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getParticlePacket(new ArrayList())), Coord4D.get(this), 40D); + PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getParticlePacket(0, new ArrayList())), Coord4D.get(this), 40D); } } } @@ -174,7 +174,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp if(worldObj.rand.nextInt(3) == 2) { - PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getParticlePacket(new ArrayList())), Coord4D.get(this), 40D); + PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getParticlePacket(1, new ArrayList())), Coord4D.get(this), 40D); } } } @@ -219,22 +219,36 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp } } - public void spawnParticle() + public void spawnParticle(int type) { - switch(facing) + if(type == 0) { - case 3: - worldObj.spawnParticle("smoke", xCoord+0.1, yCoord+1, zCoord+0.25, 0.0D, 0.0D, 0.0D); - break; - case 4: - worldObj.spawnParticle("smoke", xCoord+0.75, yCoord+1, zCoord+0.1, 0.0D, 0.0D, 0.0D); - break; - case 2: - worldObj.spawnParticle("smoke", xCoord+0.9, yCoord+1, zCoord+0.75, 0.0D, 0.0D, 0.0D); - break; - case 5: - worldObj.spawnParticle("smoke", xCoord+0.25, yCoord+1, zCoord+0.9, 0.0D, 0.0D, 0.0D); - break; + ForgeDirection side = ForgeDirection.getOrientation(facing); + + double x = xCoord + (side.offsetX == 0 ? 0.5 : Math.max(side.offsetX, 0)); + double z = zCoord + (side.offsetZ == 0 ? 0.5 : Math.max(side.offsetZ, 0)); + + worldObj.spawnParticle("smoke", x, yCoord + 0.5, z, 0.0D, 0.0D, 0.0D); + System.out.println(x + " " + (yCoord+0.5) + " " + z); + + } + else if(type == 1) + { + switch(facing) + { + case 3: + worldObj.spawnParticle("smoke", xCoord+0.9, yCoord+1, zCoord+0.75, 0.0D, 0.0D, 0.0D); + break; + case 4: + worldObj.spawnParticle("smoke", xCoord+0.25, yCoord+1, zCoord+0.9, 0.0D, 0.0D, 0.0D); + break; + case 2: + worldObj.spawnParticle("smoke", xCoord+0.1, yCoord+1, zCoord+0.25, 0.0D, 0.0D, 0.0D); + break; + case 5: + worldObj.spawnParticle("smoke", xCoord+0.75, yCoord+1, zCoord+0.1, 0.0D, 0.0D, 0.0D); + break; + } } } @@ -390,7 +404,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp } else if(type == 1) { - spawnParticle(); + spawnParticle(dataStream.readInt()); } } @@ -437,10 +451,11 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp return data; } - public ArrayList getParticlePacket(ArrayList data) + public ArrayList getParticlePacket(int type, ArrayList data) { super.getNetworkedData(data); data.add(1); + data.add(type); return data; } diff --git a/resources/assets/mekanism/render/ElectrolyticSeparator.png b/resources/assets/mekanism/render/ElectrolyticSeparator.png index c00b7e5e8f9498bb0287408743aca1ede0ee2ca9..1e369ee9a7d0d4468c74fd9413823657d8637a30 100644 GIT binary patch delta 3456 zcmbu8dpy&P7stPw)s}=PDPtoNo`-ZnZbL3J*CH!2oLLOCyn1 z%AKK}o+=j_fIc99I3l922K5xI9a~)ReNx`wnm<$SaaN^#aQHGqvbI@`iYhPX zdG9a1y~kj_EcM2X8y3HZg@Iwaji%`(B_;F*m#D?Dp`q4ej>J7EI?@Y|=dE~_=`7`= zBpM%`K86v)t0!57leLG&!Y#z>x#D@@#W4w?&&#suqpVR2Wu=xGmTwvraxpHh@fZeE zh$sHx(8c3+=TcZp_6`kSp3?L_yD=p zs<1F3P9{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