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
|
@Override
|
||||||
protected boolean canConnectTo(TileEntity tile, ForgeDirection dir)
|
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
|
@Override
|
||||||
|
|
|
@ -390,7 +390,7 @@ public class TileGrate extends TileAdvanced implements IFluidHandler
|
||||||
|
|
||||||
if (drainedAmount > amount)
|
if (drainedAmount > amount)
|
||||||
{
|
{
|
||||||
return new FluidStack(fluidType, drainedAmount);
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -398,6 +398,10 @@ public class TileGrate extends TileAdvanced implements IFluidHandler
|
||||||
}
|
}
|
||||||
|
|
||||||
TileGrate.this.resetPath();
|
TileGrate.this.resetPath();
|
||||||
|
|
||||||
|
if (drainedAmount > 0)
|
||||||
|
return new FluidStack(fluidType, drainedAmount);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class TilePump extends TileMechanical implements IFluidHandler, IRotatabl
|
||||||
@Override
|
@Override
|
||||||
public boolean canDrain(ForgeDirection from, Fluid fluid)
|
public boolean canDrain(ForgeDirection from, Fluid fluid)
|
||||||
{
|
{
|
||||||
return false;
|
return from == this.getDirection();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -79,13 +79,16 @@ public class TilePump extends TileMechanical implements IFluidHandler, IRotatabl
|
||||||
@Override
|
@Override
|
||||||
public int getPressure(ForgeDirection dir)
|
public int getPressure(ForgeDirection dir)
|
||||||
{
|
{
|
||||||
if (dir == getDirection())
|
if (getPower() > 0)
|
||||||
{
|
{
|
||||||
return (int) (((double) getPower() / (double) maximumPower) * 100);
|
if (dir == getDirection())
|
||||||
}
|
{
|
||||||
else if (dir == getDirection().getOpposite())
|
return (int) Math.max((((double) getPower() / (double) maximumPower) * 100), 2);
|
||||||
{
|
}
|
||||||
return (int) -(((double) getPower() / (double) maximumPower) * 100);
|
else if (dir == getDirection().getOpposite())
|
||||||
|
{
|
||||||
|
return (int) -Math.max((((double) getPower() / (double) maximumPower) * 100), 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue