Reduced the amount of packets sent by fluid nodes
This commit is contained in:
parent
0949b970d6
commit
ced69ff4ee
1 changed files with 15 additions and 1 deletions
|
@ -44,6 +44,20 @@ public abstract class TileFluidNode extends TileBase implements IPacketReceiverW
|
||||||
/** Bitmask that handles connections for the renderer **/
|
/** Bitmask that handles connections for the renderer **/
|
||||||
public byte renderSides = 0;
|
public byte renderSides = 0;
|
||||||
|
|
||||||
|
protected boolean markTankUpdate;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateEntity()
|
||||||
|
{
|
||||||
|
super.updateEntity();
|
||||||
|
|
||||||
|
if (markTankUpdate)
|
||||||
|
{
|
||||||
|
sendTankUpdate();
|
||||||
|
markTankUpdate = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFromNBT(NBTTagCompound nbt)
|
public void readFromNBT(NBTTagCompound nbt)
|
||||||
{
|
{
|
||||||
|
@ -124,7 +138,7 @@ public abstract class TileFluidNode extends TileBase implements IPacketReceiverW
|
||||||
{
|
{
|
||||||
if (!FluidUtility.matchExact(prevStack, getInternalTank().getFluid()))
|
if (!FluidUtility.matchExact(prevStack, getInternalTank().getFluid()))
|
||||||
{
|
{
|
||||||
sendTankUpdate();
|
markTankUpdate = true;
|
||||||
prevStack = tank.getFluid() != null ? tank.getFluid().copy() : null;
|
prevStack = tank.getFluid() != null ? tank.getFluid().copy() : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue