Tiered tank and storage blocks, GUI improvements, refactoring, cell nerf and misc organisation (#1932)

Tanks, storage blocks and variouse stuff. Thanks to Dimmerworld!!
This commit is contained in:
Justin Vitale 2020-01-03 08:24:46 +11:00 committed by drcrazy
parent 2fc9557516
commit 9328c47bed
207 changed files with 1830 additions and 928 deletions

View file

@ -32,9 +32,9 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import org.apache.commons.lang3.Validate;
import techreborn.TechReborn;
import techreborn.blockentity.*;
import techreborn.blockentity.cable.CableBlockEntity;
import techreborn.blockentity.fusionReactor.FusionControlComputerBlockEntity;
import techreborn.blockentity.machine.multiblock.casing.MachineCasingBlockEntity;
import techreborn.blockentity.machine.multiblock.FusionControlComputerBlockEntity;
import techreborn.blockentity.generator.LightningRodBlockEntity;
import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
import techreborn.blockentity.generator.SolarPanelBlockEntity;
@ -45,16 +45,22 @@ import techreborn.blockentity.generator.basic.WindMillBlockEntity;
import techreborn.blockentity.lighting.LampBlockEntity;
import techreborn.blockentity.machine.iron.IronAlloyFurnaceBlockEntity;
import techreborn.blockentity.machine.iron.IronFurnaceBlockEntity;
import techreborn.blockentity.machine.misc.AlarmBlockEntity;
import techreborn.blockentity.machine.misc.ChargeOMatBlockEntity;
import techreborn.blockentity.machine.multiblock.*;
import techreborn.blockentity.machine.tier1.*;
import techreborn.blockentity.machine.tier3.*;
import techreborn.blockentity.storage.AdjustableSUBlockEntity;
import techreborn.blockentity.storage.HighVoltageSUBlockEntity;
import techreborn.blockentity.storage.LowVoltageSUBlockEntity;
import techreborn.blockentity.storage.MediumVoltageSUBlockEntity;
import techreborn.blockentity.storage.idsu.InterdimensionalSUBlockEntity;
import techreborn.blockentity.storage.lesu.LSUStorageBlockEntity;
import techreborn.blockentity.storage.lesu.LapotronicSUBlockEntity;
import techreborn.blockentity.storage.energy.AdjustableSUBlockEntity;
import techreborn.blockentity.storage.energy.HighVoltageSUBlockEntity;
import techreborn.blockentity.storage.energy.LowVoltageSUBlockEntity;
import techreborn.blockentity.storage.energy.MediumVoltageSUBlockEntity;
import techreborn.blockentity.storage.energy.idsu.InterdimensionalSUBlockEntity;
import techreborn.blockentity.storage.energy.lesu.LSUStorageBlockEntity;
import techreborn.blockentity.storage.energy.lesu.LapotronicSUBlockEntity;
import techreborn.blockentity.storage.fluid.CreativeQuantumTankBlockEntity;
import techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity;
import techreborn.blockentity.storage.item.*;
import techreborn.blockentity.storage.fluid.QuantumTankBlockEntity;
import techreborn.blockentity.transformers.EVTransformerBlockEntity;
import techreborn.blockentity.transformers.HVTransformerBlockEntity;
import techreborn.blockentity.transformers.LVTransformerBlockEntity;
@ -68,10 +74,18 @@ public class TRBlockEntities {
private static List<BlockEntityType<?>> TYPES = new ArrayList<>();
public static final BlockEntityType<ThermalGeneratorBlockEntity> THERMAL_GEN = register(ThermalGeneratorBlockEntity.class, "thermal_generator", TRContent.Machine.THERMAL_GENERATOR);
public static final BlockEntityType<StorageUnitBaseBlockEntity> STORAGE_UNIT = register(StorageUnitBaseBlockEntity.class, "storage_unit", TRContent.StorageUnit.values());
public static final BlockEntityType<TankUnitBaseBlockEntity> TANK_UNIT = register(TankUnitBaseBlockEntity.class, "tank_unit", TRContent.TankUnit.values());
public static final BlockEntityType<QuantumTankBlockEntity> QUANTUM_TANK = register(QuantumTankBlockEntity.class, "quantum_tank", TRContent.Machine.QUANTUM_TANK);
public static final BlockEntityType<QuantumChestBlockEntity> QUANTUM_CHEST = register(QuantumChestBlockEntity.class, "quantum_chest", TRContent.Machine.QUANTUM_CHEST);
public static final BlockEntityType<DigitalChestBlockEntity> DIGITAL_CHEST = register(DigitalChestBlockEntity.class, "digital_chest", TRContent.Machine.DIGITAL_CHEST);
public static final BlockEntityType<CreativeQuantumChestBlockEntity> CREATIVE_QUANTUM_CHEST = register(CreativeQuantumChestBlockEntity.class, "creative_quantum_chest", TRContent.Machine.CREATIVE_QUANTUM_CHEST);
public static final BlockEntityType<CreativeQuantumTankBlockEntity> CREATIVE_QUANTUM_TANK = register(CreativeQuantumTankBlockEntity.class, "creative_quantum_tank", TRContent.Machine.CREATIVE_QUANTUM_TANK);
public static final BlockEntityType<ThermalGeneratorBlockEntity> THERMAL_GEN = register(ThermalGeneratorBlockEntity.class, "thermal_generator", TRContent.Machine.THERMAL_GENERATOR);
public static final BlockEntityType<IndustrialCentrifugeBlockEntity> INDUSTRIAL_CENTRIFUGE = register(IndustrialCentrifugeBlockEntity.class, "industrial_centrifuge", TRContent.Machine.INDUSTRIAL_CENTRIFUGE);
public static final BlockEntityType<RollingMachineBlockEntity> ROLLING_MACHINE = register(RollingMachineBlockEntity.class, "rolling_machine", TRContent.Machine.ROLLING_MACHINE);
public static final BlockEntityType<IndustrialBlastFurnaceBlockEntity> INDUSTRIAL_BLAST_FURNACE = register(IndustrialBlastFurnaceBlockEntity.class, "industrial_blast_furnace", TRContent.Machine.INDUSTRIAL_BLAST_FURNACE);
@ -106,8 +120,6 @@ public class TRBlockEntities {
public static final BlockEntityType<CompressorBlockEntity> COMPRESSOR = register(CompressorBlockEntity.class, "compressor", TRContent.Machine.COMPRESSOR);
public static final BlockEntityType<ElectricFurnaceBlockEntity> ELECTRIC_FURNACE = register(ElectricFurnaceBlockEntity.class, "electric_furnace", TRContent.Machine.ELECTRIC_FURNACE);
public static final BlockEntityType<SolarPanelBlockEntity> SOLAR_PANEL = register(SolarPanelBlockEntity.class, "solar_panel", TRContent.SolarPanels.values());
public static final BlockEntityType<CreativeQuantumTankBlockEntity> CREATIVE_QUANTUM_TANK = register(CreativeQuantumTankBlockEntity.class, "creative_quantum_tank", TRContent.Machine.CREATIVE_QUANTUM_TANK);
public static final BlockEntityType<CreativeQuantumChestBlockEntity> CREATIVE_QUANTUM_CHEST = register(CreativeQuantumChestBlockEntity.class, "creative_quantum_chest", TRContent.Machine.CREATIVE_QUANTUM_CHEST);
public static final BlockEntityType<WaterMillBlockEntity> WATER_MILL = register(WaterMillBlockEntity.class, "water_mill", TRContent.Machine.WATER_MILL);
public static final BlockEntityType<WindMillBlockEntity> WIND_MILL = register(WindMillBlockEntity.class, "wind_mill", TRContent.Machine.WIND_MILL);
public static final BlockEntityType<RecyclerBlockEntity> RECYCLER = register(RecyclerBlockEntity.class, "recycler", TRContent.Machine.RECYCLER);

View file

@ -33,13 +33,15 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.ItemStack;
import reborncore.api.blockentity.IUpgrade;
import reborncore.common.fluid.FluidValue;
import reborncore.common.powerSystem.PowerAcceptorBlockEntity;
import team.reborn.energy.EnergySide;
import team.reborn.energy.EnergyTier;
import techreborn.TechReborn;
import techreborn.blockentity.ChargeOMatBlockEntity;
import techreborn.blockentity.DigitalChestBlockEntity;
import techreborn.blockentity.IndustrialCentrifugeBlockEntity;
import techreborn.blockentity.machine.misc.ChargeOMatBlockEntity;
import techreborn.blockentity.storage.fluid.CreativeQuantumTankBlockEntity;
import techreborn.blockentity.storage.fluid.QuantumTankBlockEntity;
import techreborn.blockentity.machine.tier3.IndustrialCentrifugeBlockEntity;
import techreborn.blockentity.generator.LightningRodBlockEntity;
import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity;
import techreborn.blockentity.generator.advanced.*;
@ -49,16 +51,25 @@ import techreborn.blockentity.generator.basic.WindMillBlockEntity;
import techreborn.blockentity.machine.multiblock.*;
import techreborn.blockentity.machine.tier1.*;
import techreborn.blockentity.machine.tier3.*;
import techreborn.blockentity.storage.AdjustableSUBlockEntity;
import techreborn.blockentity.storage.energy.AdjustableSUBlockEntity;
import techreborn.blockentity.storage.item.CreativeQuantumChestBlockEntity;
import techreborn.blockentity.storage.item.DigitalChestBlockEntity;
import techreborn.blockentity.storage.item.QuantumChestBlockEntity;
import techreborn.blocks.*;
import techreborn.blocks.cable.CableBlock;
import techreborn.blocks.generator.*;
import techreborn.blocks.lighting.BlockLamp;
import techreborn.blocks.storage.*;
import techreborn.blocks.tier0.IronAlloyFurnaceBlock;
import techreborn.blocks.tier0.IronFurnaceBlock;
import techreborn.blocks.tier1.BlockPlayerDetector;
import techreborn.blocks.tier3.BlockCreativeQuantumChest;
import techreborn.blocks.misc.BlockAlarm;
import techreborn.blocks.misc.BlockMachineCasing;
import techreborn.blocks.misc.BlockMachineFrame;
import techreborn.blocks.misc.BlockStorage;
import techreborn.blocks.storage.OldBlock;
import techreborn.blocks.storage.energy.*;
import techreborn.blocks.machine.tier0.IronAlloyFurnaceBlock;
import techreborn.blocks.machine.tier0.IronFurnaceBlock;
import techreborn.blocks.machine.tier1.BlockPlayerDetector;
import techreborn.blocks.storage.item.StorageUnitBlock;
import techreborn.blocks.storage.fluid.TankUnitBlock;
import techreborn.blocks.transformers.BlockEVTransformer;
import techreborn.blocks.transformers.BlockHVTransformer;
import techreborn.blocks.transformers.BlockLVTransformer;
@ -254,6 +265,63 @@ public class TRContent {
}
}
public enum StorageUnit implements ItemConvertible {
CRUDE(TechRebornConfig.crudeStorageUnitMaxStorage),
BASIC(TechRebornConfig.basicStorageUnitMaxStorage),
ADVANCED(TechRebornConfig.advancedStorageUnitMaxStorage),
INDUSTRIAL(TechRebornConfig.industrialStorageUnitMaxStorage),
QUANTUM(TechRebornConfig.quantumStorageUnitMaxStorage),
CREATIVE(Integer.MAX_VALUE);
public final String name;
public final Block block;
// How many blocks it can hold
public int capacity;
StorageUnit(int capacity) {
name = this.toString().toLowerCase(Locale.ROOT);
block = new StorageUnitBlock(this);
this.capacity = capacity;
InitUtils.setup(block, name + "_storage_unit");
}
@Override
public Item asItem() {
return block.asItem();
}
}
public enum TankUnit implements ItemConvertible {
BASIC(TechRebornConfig.basicTankUnitCapacity),
ADVANCED(TechRebornConfig.advancedTankUnitMaxStorage),
INDUSTRIAL(TechRebornConfig.industrialTankUnitCapacity),
QUANTUM(TechRebornConfig.quantumTankUnitCapacity),
CREATIVE(Integer.MAX_VALUE / 1000);
public final String name;
public final Block block;
// How many blocks it can hold
public FluidValue capacity;
TankUnit(int capacity) {
name = this.toString().toLowerCase(Locale.ROOT);
block = new TankUnitBlock(this);
this.capacity = FluidValue.BUCKET.multiply(capacity);
InitUtils.setup(block, name + "_tank_unit");
}
@Override
public Item asItem() {
return block.asItem();
}
}
public enum Cables implements ItemConvertible {
COPPER(128, 12.0, true, EnergyTier.MEDIUM),
TIN(32, 12.0, true, EnergyTier.LOW),
@ -433,13 +501,16 @@ public class TRContent {
THERMAL_GENERATOR(new GenericGeneratorBlock(EGui.THERMAL_GENERATOR, ThermalGeneratorBlockEntity::new)),
WATER_MILL(new GenericGeneratorBlock(null, WaterMillBlockEntity::new)),
WIND_MILL(new GenericGeneratorBlock(null, WindMillBlockEntity::new)),
CREATIVE_QUANTUM_CHEST(new BlockCreativeQuantumChest()),
CREATIVE_QUANTUM_TANK(new GenericMachineBlock(EGui.QUANTUM_TANK, CreativeQuantumTankBlockEntity::new)),
DIGITAL_CHEST(new GenericMachineBlock(EGui.DIGITAL_CHEST, DigitalChestBlockEntity::new)),
QUANTUM_CHEST(new GenericMachineBlock(EGui.QUANTUM_CHEST, QuantumChestBlockEntity::new)),
QUANTUM_TANK(new GenericMachineBlock(EGui.QUANTUM_TANK, QuantumTankBlockEntity::new)),
//TODO DEPRECATED
DIGITAL_CHEST(new OldBlock(null, DigitalChestBlockEntity::new)),
QUANTUM_CHEST(new OldBlock(null, QuantumChestBlockEntity::new)),
QUANTUM_TANK(new OldBlock(null, QuantumTankBlockEntity::new)),
CREATIVE_QUANTUM_CHEST(new OldBlock(null, CreativeQuantumChestBlockEntity::new)),
CREATIVE_QUANTUM_TANK(new OldBlock(null, CreativeQuantumTankBlockEntity::new)),
ADJUSTABLE_SU(new AdjustableSUBlock()),
CHARGE_O_MAT(new GenericMachineBlock(EGui.CHARGEBENCH, ChargeOMatBlockEntity::new)),
INTERDIMENSIONAL_SU(new InterdimensionalSUBlock()),
@ -629,6 +700,7 @@ public class TRContent {
INDUSTRIAL_CIRCUIT,
MACHINE_PARTS,
BASIC_DISPLAY,
DIGITAL_DISPLAY,
DATA_STORAGE_CORE,