mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-24 05:44:24 +00:00
Giant multiblock refactor
This commit is contained in:
1 parent
201111cb83
commit
aa47599278
259 files changed
+10117
-6495
No files matched your search
@@ -13,13 +13,11 @@ package forestry.farming.triggers;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidTankInfo;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
|
||||
import forestry.api.core.ITileStructure;
|
||||
import forestry.core.fluids.TankManager;
|
||||
import forestry.core.fluids.ITankManager;
|
||||
import forestry.core.triggers.Trigger;
|
||||
import forestry.farming.gadgets.TileFarmPlain;
|
||||
import forestry.farming.gadgets.TileHatch;
|
||||
import forestry.farming.multiblock.TileHatch;
|
||||
|
||||
import buildcraft.api.statements.IStatementContainer;
|
||||
import buildcraft.api.statements.IStatementParameter;
|
||||
@@ -48,16 +46,13 @@ public class TriggerLowLiquid extends Trigger {
|
||||
return false;
|
||||
}
|
||||
|
||||
ITileStructure central = ((TileHatch) tile).getCentralTE();
|
||||
if (central == null || !(central instanceof TileFarmPlain)) {
|
||||
TileHatch tileHatch = (TileHatch) tile;
|
||||
ITankManager tankManager = tileHatch.getFarmController().getTankManager();
|
||||
|
||||
IFluidTank tank = tankManager.getTank(0);
|
||||
if (tank.getCapacity() == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
TankManager tankManager = ((TileFarmPlain) central).getTankManager();
|
||||
FluidTankInfo info = tankManager.getTankInfo(0);
|
||||
if (info.fluid == null) {
|
||||
return true;
|
||||
}
|
||||
return ((float) info.fluid.amount / info.capacity) <= threshold;
|
||||
return ((float) tank.getFluidAmount() / tank.getCapacity()) <= threshold;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user