Move most int fluid values to FluidValue.

This has been done to make it easier in the future to move to a new fluid system.
Some work is still needed (in recipes mainly) to move away fully away from mb. This should work identically to the old system for now.
This commit is contained in:
modmuss50 2019-12-12 12:42:33 +00:00
parent 2fe94ddbf0
commit 5e5e997b93
19 changed files with 125 additions and 130 deletions

View file

@ -30,6 +30,7 @@ import net.minecraft.util.math.BlockPos;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.fluid.FluidValue;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.IInventoryAccess;
import reborncore.common.util.RebornInventory;
@ -50,7 +51,7 @@ import javax.annotation.Nullable;
public class FluidReplicatorBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public MultiblockChecker multiblockChecker;
public static final int TANK_CAPACITY = 16_000;
public static final FluidValue TANK_CAPACITY = FluidValue.BUCKET.multiply(16);
public Tank tank;
int ticksSinceLastChange;

View file

@ -34,6 +34,7 @@ import net.minecraft.util.math.Direction;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.fluid.FluidValue;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.Tank;
@ -48,7 +49,7 @@ import javax.annotation.Nullable;
public class IndustrialGrinderBlockEntity extends GenericMachineBlockEntity implements IContainerProvider{
public static final int TANK_CAPACITY = 16_000;
public static final FluidValue TANK_CAPACITY = FluidValue.BUCKET.multiply(16);
public Tank tank;
public MultiblockChecker multiblockChecker;
int ticksSinceLastChange;

View file

@ -34,6 +34,7 @@ import net.minecraft.util.math.Direction;
import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.fluid.FluidValue;
import reborncore.common.recipes.RecipeCrafter;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.Tank;
@ -48,7 +49,7 @@ import javax.annotation.Nullable;
public class IndustrialSawmillBlockEntity extends GenericMachineBlockEntity implements IContainerProvider {
public static final int TANK_CAPACITY = 16_000;
public static final FluidValue TANK_CAPACITY = FluidValue.BUCKET.multiply(16);
public Tank tank;
public MultiblockChecker multiblockChecker;
int ticksSinceLastChange;

View file

@ -24,6 +24,7 @@
package techreborn.blockentity.machine.tier3;
import reborncore.common.fluid.FluidValue;
import techreborn.init.TRBlockEntities;
public class CreativeQuantumTankBlockEntity extends QuantumTankBlockEntity {
@ -36,7 +37,7 @@ public class CreativeQuantumTankBlockEntity extends QuantumTankBlockEntity {
public void tick() {
super.tick();
if (!tank.isEmpty() && !tank.isFull()) {
tank.setFluidAmount(Integer.MAX_VALUE);
tank.setFluidAmount(FluidValue.INFINITE);
}
}

View file

@ -37,6 +37,7 @@ import reborncore.client.containerBuilder.IContainerProvider;
import reborncore.client.containerBuilder.builder.BuiltContainer;
import reborncore.client.containerBuilder.builder.ContainerBuilder;
import reborncore.common.blockentity.MachineBaseBlockEntity;
import reborncore.common.fluid.FluidValue;
import reborncore.common.util.RebornInventory;
import reborncore.common.util.Tank;
import techreborn.config.TechRebornConfig;
@ -50,7 +51,7 @@ import java.util.List;
public class QuantumTankBlockEntity extends MachineBaseBlockEntity
implements InventoryProvider, IToolDrop, IListInfoProvider, IContainerProvider {
public Tank tank = new Tank("QuantumTankBlockEntity", TechRebornConfig.quantumTankMaxStorage, this);
public Tank tank = new Tank("QuantumTankBlockEntity", FluidValue.INFINITE, this);
public RebornInventory<QuantumTankBlockEntity> inventory = new RebornInventory<>(3, "QuantumTankBlockEntity", 64, this);
public QuantumTankBlockEntity(){
@ -132,7 +133,7 @@ public class QuantumTankBlockEntity extends MachineBaseBlockEntity
info.add(new LiteralText("Empty"));
}
}
info.add(new LiteralText("Capacity " + this.tank.getCapacity() + " mb"));
info.add(new LiteralText("Capacity " + this.tank.getCapacity()));
}
// IContainerProvider