Fixed "dump excess mode" making gas levels jump up and down, fixed a few particles issues

This commit is contained in:
Aidan C. Brady 2015-03-28 21:44:18 -04:00
parent f10a352230
commit ac41365c86
2 changed files with 12 additions and 16 deletions

View file

@ -199,7 +199,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
if(dumpRight == GasMode.DUMPING_EXCESS && leftTank.getNeeded() < output)
{
leftTank.draw(output, true);
leftTank.draw(output-leftTank.getNeeded(), true);
if(worldObj.rand.nextInt(3) == 2)
{
@ -236,15 +236,14 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
if(dumpRight == GasMode.DUMPING_EXCESS && rightTank.getNeeded() < output)
{
rightTank.draw(output, true);
rightTank.draw(output-rightTank.getNeeded(), true);
if(worldObj.rand.nextInt(3) == 2)
{
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getParticlePacket(0, new ArrayList())), new Range4D(Coord4D.get(this)));
Mekanism.packetHandler.sendToReceivers(new TileEntityMessage(Coord4D.get(this), getParticlePacket(1, new ArrayList())), new Range4D(Coord4D.get(this)));
}
}
}
}
}
@ -315,7 +314,6 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
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);
}
else if(type == 1)
{
@ -395,16 +393,6 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
return InventoryUtils.EMPTY;
}
/**
* Gets the scaled energy level for the GUI.
* @param i - multiplier
* @return
*/
public int getScaledEnergyLevel(int i)
{
return (int)(electricityStored*i / BASE_MAX_ENERGY);
}
@Override
public void handlePacketData(ByteBuf dataStream)
{
@ -511,10 +499,18 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
public ArrayList getParticlePacket(int type, ArrayList data)
{
super.getNetworkedData(data);
data.add(1);
data.add(type);
return data;
}
@Override
public boolean canSetFacing(int side)
{
return side != 0 && side != 1;
}
@Override
public void readFromNBT(NBTTagCompound nbtTags)

View file

@ -93,7 +93,7 @@ public class TileEntityGasTank extends TileEntityContainerBlock implements IGasH
if(!worldObj.isRemote && dumping == GasMode.DUMPING_EXCESS && gasTank.getNeeded() < output)
{
gasTank.draw(output, true);
gasTank.draw(output-gasTank.getNeeded(), true);
}
if(!worldObj.isRemote)