Add Tank tiles
This commit is contained in:
parent
99fca02856
commit
ef2eace03c
8 changed files with 17 additions and 18 deletions
|
@ -8,6 +8,7 @@
|
|||
*/
|
||||
package buildcraft.core.fluids;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
|
@ -19,8 +20,8 @@ public class RestrictedTank extends Tank {
|
|||
|
||||
private final Fluid[] acceptedFluids;
|
||||
|
||||
public RestrictedTank(String name, int capacity, Fluid... acceptedFluids) {
|
||||
super(name, capacity);
|
||||
public RestrictedTank(String name, int capacity, TileEntity tile, Fluid... acceptedFluids) {
|
||||
super(name, capacity, tile);
|
||||
this.acceptedFluids = acceptedFluids;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
package buildcraft.core.fluids;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -22,8 +22,8 @@ public class SingleUseTank extends Tank {
|
|||
|
||||
private Fluid acceptedFluid;
|
||||
|
||||
public SingleUseTank(String name, int capacity) {
|
||||
super(name, capacity);
|
||||
public SingleUseTank(String name, int capacity, TileEntity tile) {
|
||||
super(name, capacity, tile);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -12,6 +12,7 @@ import buildcraft.core.gui.tooltips.ToolTip;
|
|||
import buildcraft.core.gui.tooltips.ToolTipLine;
|
||||
import java.util.Locale;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
||||
|
@ -23,9 +24,10 @@ public class Tank extends FluidTank {
|
|||
|
||||
private final String name;
|
||||
|
||||
public Tank(String name, int capacity) {
|
||||
public Tank(String name, int capacity, TileEntity tile) {
|
||||
super(capacity);
|
||||
this.name = name;
|
||||
this.tile = tile;
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
|
|
|
@ -45,8 +45,8 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
|
|||
public static float COOLDOWN_RATE = 0.05F;
|
||||
public static int MAX_COOLANT_PER_TICK = 40;
|
||||
int burnTime = 0;
|
||||
private Tank tankFuel;
|
||||
private Tank tankCoolant;
|
||||
private Tank tankFuel = new Tank("tankFuel", MAX_LIQUID, this);
|
||||
private Tank tankCoolant = new Tank("tankCoolant", MAX_LIQUID, this);
|
||||
private TankManager tankManager = new TankManager();
|
||||
private Fuel currentFuel = null;
|
||||
public int penaltyCooling = 0;
|
||||
|
@ -55,8 +55,6 @@ public class TileEngineIron extends TileEngineWithInventory implements IFluidHan
|
|||
|
||||
public TileEngineIron() {
|
||||
super(1);
|
||||
tankFuel = new Tank("tankFuel", MAX_LIQUID);
|
||||
tankCoolant = new Tank("tankCoolant", MAX_LIQUID);
|
||||
tankManager.add(tankFuel);
|
||||
tankManager.add(tankCoolant);
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class TileFloodGate extends TileBuildCraft implements IFluidHandler {
|
|||
private final TreeMap<Integer, Deque<BlockIndex>> pumpLayerQueues = new TreeMap<Integer, Deque<BlockIndex>>();
|
||||
private final Set<BlockIndex> visitedBlocks = new HashSet<BlockIndex>();
|
||||
private Deque<BlockIndex> fluidsFound = new LinkedList<BlockIndex>();
|
||||
private final Tank tank;
|
||||
private final Tank tank = new Tank("tank", MAX_LIQUID, this);
|
||||
private int rebuildDelay;
|
||||
private int tick = Utils.RANDOM.nextInt();
|
||||
private boolean powered = false;
|
||||
|
@ -53,7 +53,6 @@ public class TileFloodGate extends TileBuildCraft implements IFluidHandler {
|
|||
}
|
||||
|
||||
public TileFloodGate() {
|
||||
tank = new Tank("tank", MAX_LIQUID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -54,7 +54,7 @@ public class TilePump extends TileBuildCraft implements IMachine, IPowerReceptor
|
|||
public static int MAX_LIQUID = FluidContainerRegistry.BUCKET_VOLUME * 16;
|
||||
EntityBlock tube;
|
||||
private TreeMap<Integer, Deque<BlockIndex>> pumpLayerQueues = new TreeMap<Integer, Deque<BlockIndex>>();
|
||||
SingleUseTank tank;
|
||||
SingleUseTank tank = new SingleUseTank("tank", MAX_LIQUID, this);
|
||||
double tubeY = Double.NaN;
|
||||
int aimY = 0;
|
||||
private PowerHandler powerHandler;
|
||||
|
@ -66,7 +66,6 @@ public class TilePump extends TileBuildCraft implements IMachine, IPowerReceptor
|
|||
public TilePump() {
|
||||
powerHandler = new PowerHandler(this, Type.MACHINE);
|
||||
initPowerProvider();
|
||||
tank = new SingleUseTank("tank", MAX_LIQUID);
|
||||
}
|
||||
|
||||
private void initPowerProvider() {
|
||||
|
|
|
@ -45,9 +45,9 @@ import net.minecraftforge.fluids.IFluidHandler;
|
|||
public class TileRefinery extends TileBuildCraft implements IFluidHandler, IPowerReceptor, IInventory, IMachine {
|
||||
|
||||
public static int LIQUID_PER_SLOT = FluidContainerRegistry.BUCKET_VOLUME * 4;
|
||||
public SingleUseTank tank1 = new SingleUseTank("tank1", LIQUID_PER_SLOT);
|
||||
public SingleUseTank tank2 = new SingleUseTank("tank2", LIQUID_PER_SLOT);
|
||||
public SingleUseTank result = new SingleUseTank("result", LIQUID_PER_SLOT);
|
||||
public SingleUseTank tank1 = new SingleUseTank("tank1", LIQUID_PER_SLOT, this);
|
||||
public SingleUseTank tank2 = new SingleUseTank("tank2", LIQUID_PER_SLOT, this);
|
||||
public SingleUseTank result = new SingleUseTank("result", LIQUID_PER_SLOT, this);
|
||||
public TankManager<SingleUseTank> tankManager = new TankManager<SingleUseTank>(tank1, tank2, result);
|
||||
public float animationSpeed = 1;
|
||||
private int animationStage = 0;
|
||||
|
|
|
@ -32,7 +32,7 @@ import net.minecraftforge.fluids.IFluidHandler;
|
|||
|
||||
public class TileTank extends TileBuildCraft implements IFluidHandler {
|
||||
|
||||
public final Tank tank = new Tank("tank", FluidContainerRegistry.BUCKET_VOLUME * 16);
|
||||
public final Tank tank = new Tank("tank", FluidContainerRegistry.BUCKET_VOLUME * 16, this);
|
||||
public final TankManager tankManager = new TankManager(tank);
|
||||
public boolean hasUpdate = false;
|
||||
public SafeTimeTracker tracker = new SafeTimeTracker();
|
||||
|
|
Loading…
Add table
Reference in a new issue