Pumps can now be hand cranked and fixed grate infinite lava
This commit is contained in:
parent
ca9e694a68
commit
39bda36b9b
3 changed files with 16 additions and 9 deletions
|
@ -190,7 +190,7 @@ public class PartPipe extends PartFramedConnection<EnumPipeMaterial, IFluidPipe,
|
|||
@Override
|
||||
protected boolean canConnectTo(TileEntity tile, ForgeDirection dir)
|
||||
{
|
||||
return tile instanceof IFluidHandler;
|
||||
return tile instanceof IFluidHandler && (((IFluidHandler) tile).canFill(dir.getOpposite(), null) || ((IFluidHandler) tile).canDrain(dir.getOpposite(), null));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -390,7 +390,7 @@ public class TileGrate extends TileAdvanced implements IFluidHandler
|
|||
|
||||
if (drainedAmount > 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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
@ -78,14 +78,17 @@ public class TilePump extends TileMechanical implements IFluidHandler, IRotatabl
|
|||
|
||||
@Override
|
||||
public int getPressure(ForgeDirection dir)
|
||||
{
|
||||
if (getPower() > 0)
|
||||
{
|
||||
if (dir == getDirection())
|
||||
{
|
||||
return (int) (((double) getPower() / (double) maximumPower) * 100);
|
||||
return (int) Math.max((((double) getPower() / (double) maximumPower) * 100), 2);
|
||||
}
|
||||
else if (dir == getDirection().getOpposite())
|
||||
{
|
||||
return (int) -(((double) getPower() / (double) maximumPower) * 100);
|
||||
return (int) -Math.max((((double) getPower() / (double) maximumPower) * 100), 2);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue