Fixed gutter consuming water above it even when it's full

This commit is contained in:
Calclavia 2014-03-01 23:27:06 +08:00
parent 9ad8de5d19
commit 983f8a6876

View file

@ -19,26 +19,20 @@ import calclavia.lib.utility.WorldUtility;
*/
public class TileGutter extends TilePressurizedNode implements IPressurizedNode
{
@Override
public void updateEntity()
{
super.updateEntity();
// TODO: Packet before doing.
if (!this.worldObj.isRemote)
sendTankUpdate();
}
@Override
public void refresh()
{
/**
* Drain block above if it is a fluid.
*/
FluidStack drain = FluidUtility.drainBlock(worldObj, new Vector3(this).translate(0, 1, 0), true);
Vector3 drainPos = new Vector3(this).translate(0, 1, 0);
FluidStack drain = FluidUtility.drainBlock(worldObj, drainPos, false);
if (drain != null)
fill(ForgeDirection.UP, drain, true);
{
if (fill(ForgeDirection.UP, drain, true) > 0)
FluidUtility.drainBlock(worldObj, drainPos, true);
}
super.refresh();
}