mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-26 14:52:58 +00:00
Move Pressure Disperser to main module; going to be shared by both turbine and boiler
This commit is contained in:
1 parent
269cd2b406
commit
e23409e2a5
17 files changed
+225
-250
No files matched your search
@@ -0,0 +1,74 @@
|
||||
package mekanism.common.tile;
|
||||
|
||||
import mekanism.common.content.boiler.BoilerSteamTank;
|
||||
import mekanism.common.content.boiler.BoilerTank;
|
||||
import mekanism.common.content.boiler.BoilerWaterTank;
|
||||
import mekanism.common.util.PipeUtils;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
public class TileEntityBoilerValve extends TileEntityBoilerCasing implements IFluidHandler
|
||||
{
|
||||
public BoilerTank waterTank;
|
||||
public BoilerTank steamTank;
|
||||
|
||||
public TileEntityBoilerValve()
|
||||
{
|
||||
super("Boiler Valve");
|
||||
waterTank = new BoilerWaterTank(this);
|
||||
steamTank = new BoilerSteamTank(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTankInfo[] getTankInfo(ForgeDirection from)
|
||||
{
|
||||
return ((!worldObj.isRemote && structure != null) || (worldObj.isRemote && clientHasStructure)) ? new FluidTankInfo[] {waterTank.getInfo(), steamTank.getInfo()} : PipeUtils.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
return waterTank.fill(resource, doFill);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
|
||||
{
|
||||
if(structure != null && structure.steamStored != null)
|
||||
{
|
||||
if(resource.getFluid() == structure.steamStored.getFluid())
|
||||
{
|
||||
return steamTank.drain(resource.amount, doDrain);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
|
||||
{
|
||||
if(structure != null)
|
||||
{
|
||||
return steamTank.drain(maxDrain, doDrain);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFill(ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(ForgeDirection from, Fluid fluid)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user