Fixed GUI issue, fixed particles

This commit is contained in:
Aidan C. Brady 2014-01-03 00:43:55 -05:00
parent eb6db2dda1
commit c0dba3c366
3 changed files with 38 additions and 21 deletions

View file

@ -66,10 +66,12 @@ public class GuiElectrolyticSeparator extends GuiContainer
int yAxis = (mouseY - (height - ySize) / 2); int yAxis = (mouseY - (height - ySize) / 2);
fontRenderer.drawString(tileEntity.getInvName(), 45, 6, 0x404040); 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); 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) if(xAxis >= 6 && xAxis <= 22 && yAxis >= 11 && yAxis <= 69)
{ {

View file

@ -147,7 +147,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
if(worldObj.rand.nextInt(3) == 2) 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) 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: ForgeDirection side = ForgeDirection.getOrientation(facing);
worldObj.spawnParticle("smoke", xCoord+0.1, yCoord+1, zCoord+0.25, 0.0D, 0.0D, 0.0D);
break; double x = xCoord + (side.offsetX == 0 ? 0.5 : Math.max(side.offsetX, 0));
case 4: double z = zCoord + (side.offsetZ == 0 ? 0.5 : Math.max(side.offsetZ, 0));
worldObj.spawnParticle("smoke", xCoord+0.75, yCoord+1, zCoord+0.1, 0.0D, 0.0D, 0.0D);
break; worldObj.spawnParticle("smoke", x, yCoord + 0.5, z, 0.0D, 0.0D, 0.0D);
case 2: System.out.println(x + " " + (yCoord+0.5) + " " + z);
worldObj.spawnParticle("smoke", xCoord+0.9, yCoord+1, zCoord+0.75, 0.0D, 0.0D, 0.0D);
break; }
case 5: else if(type == 1)
worldObj.spawnParticle("smoke", xCoord+0.25, yCoord+1, zCoord+0.9, 0.0D, 0.0D, 0.0D); {
break; 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) else if(type == 1)
{ {
spawnParticle(); spawnParticle(dataStream.readInt());
} }
} }
@ -437,10 +451,11 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
return data; return data;
} }
public ArrayList getParticlePacket(ArrayList data) public ArrayList getParticlePacket(int type, ArrayList data)
{ {
super.getNetworkedData(data); super.getNetworkedData(data);
data.add(1); data.add(1);
data.add(type);
return data; return data;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB