From 39bda36b9b314bf400ffc87f8d00e356a903e119 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Mon, 24 Feb 2014 22:06:15 +0800 Subject: [PATCH] Pumps can now be hand cranked and fixed grate infinite lava --- .../mechanical/fluid/pipe/PartPipe.java | 2 +- .../mechanical/fluid/transport/TileGrate.java | 6 +++++- .../mechanical/fluid/transport/TilePump.java | 17 ++++++++++------- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/PartPipe.java b/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/PartPipe.java index aee7307f..ea808ba3 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/PartPipe.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/PartPipe.java @@ -190,7 +190,7 @@ public class PartPipe extends PartFramedConnection amount) { - return new FluidStack(fluidType, drainedAmount); + break; } } } @@ -398,6 +398,10 @@ public class TileGrate extends TileAdvanced implements IFluidHandler } TileGrate.this.resetPath(); + + if (drainedAmount > 0) + return new FluidStack(fluidType, drainedAmount); + return null; } diff --git a/mechanical/src/main/java/resonantinduction/mechanical/fluid/transport/TilePump.java b/mechanical/src/main/java/resonantinduction/mechanical/fluid/transport/TilePump.java index fcf482f5..9d609791 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/fluid/transport/TilePump.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/fluid/transport/TilePump.java @@ -50,7 +50,7 @@ public class TilePump extends TileMechanical implements IFluidHandler, IRotatabl @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { - return false; + return from == this.getDirection(); } @Override @@ -79,13 +79,16 @@ public class TilePump extends TileMechanical implements IFluidHandler, IRotatabl @Override public int getPressure(ForgeDirection dir) { - if (dir == getDirection()) + if (getPower() > 0) { - return (int) (((double) getPower() / (double) maximumPower) * 100); - } - else if (dir == getDirection().getOpposite()) - { - return (int) -(((double) getPower() / (double) maximumPower) * 100); + if (dir == getDirection()) + { + return (int) Math.max((((double) getPower() / (double) maximumPower) * 100), 2); + } + else if (dir == getDirection().getOpposite()) + { + return (int) -Math.max((((double) getPower() / (double) maximumPower) * 100), 2); + } } return 0;