From 1d4f383e8ded559d53e5d5d3efd9fe40314db26d Mon Sep 17 00:00:00 2001 From: DarkGuardsman Date: Thu, 25 Jul 2013 12:51:00 -0400 Subject: [PATCH] Changed construction pump to need redstone input --- .../pump/TileEntityConstructionPump.java | 32 +++++++------------ 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/minecraft/dark/fluid/common/pump/TileEntityConstructionPump.java b/src/minecraft/dark/fluid/common/pump/TileEntityConstructionPump.java index 35abb320..1190c2ef 100644 --- a/src/minecraft/dark/fluid/common/pump/TileEntityConstructionPump.java +++ b/src/minecraft/dark/fluid/common/pump/TileEntityConstructionPump.java @@ -54,36 +54,28 @@ public class TileEntityConstructionPump extends TileEntityMachine implements IFl public void updateEntity() { super.updateEntity(); - if (!worldObj.isRemote) + if (!worldObj.isRemote && this.ticks % 10 == 0 && this.canRun() && this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) { - if (this.ticks % 10 == 0 && this.canRun()) - { - this.rotation += 1; - if (rotation >= 7) - { - rotation = 0; - } - boolean called = false; + this.rotation = Math.max(Math.min(this.rotation + 1, 7), 0); - TileEntity inputTile = VectorHelper.getTileEntityFromSide(worldObj, new Vector3(this), getFacing(true)); - TileEntity outputTile = VectorHelper.getTileEntityFromSide(worldObj, new Vector3(this), getFacing(false)); - if (inputTile instanceof INetworkPipe && ((INetworkPipe) inputTile).getTileNetwork() instanceof NetworkFluidTiles) + TileEntity inputTile = VectorHelper.getTileEntityFromSide(worldObj, new Vector3(this), getFacing(true)); + TileEntity outputTile = VectorHelper.getTileEntityFromSide(worldObj, new Vector3(this), getFacing(false)); + if (inputTile instanceof INetworkPipe && ((INetworkPipe) inputTile).getTileNetwork() instanceof NetworkFluidTiles) + { + if (outputTile instanceof IFluidHandler) { - if (outputTile instanceof IFluidHandler) + for (IFluidHandler tank : ((NetworkFluidTiles) ((INetworkPipe) inputTile).getTileNetwork()).connectedTanks) { - for (IFluidHandler tank : ((NetworkFluidTiles) ((INetworkPipe) inputTile).getTileNetwork()).connectedTanks) + if (tank instanceof TileEntityDrain) { - if (tank instanceof TileEntityDrain) - { - ((TileEntityDrain) tank).requestLiquid(this, null, liquidRequest * FluidContainerRegistry.BUCKET_VOLUME); - called = true; - } + ((TileEntityDrain) tank).requestLiquid(this, null, liquidRequest * FluidContainerRegistry.BUCKET_VOLUME); } + } } - } + } }