Item\Fluid storages went to enum.

This commit is contained in:
drcrazy 2018-09-25 02:41:30 +03:00
parent 809c02934a
commit f7ecfd0574

View file

@ -171,13 +171,8 @@ public class TRContent {
// Machines - generators
// Machines - storage
public static Block CREATIVE_QUANTUM_CHEST;
public static Block CREATIVE_QUANTUM_TANK;
public static Block DIGITAL_CHEST;
public static Block QUANTUM_CHEST;
public static Block QUANTUM_TANK;
// Machines - energy storage & transformers
public static Block ADJUSTABLE_SU;
@ -488,10 +483,21 @@ public class TRContent {
SOLID_FUEL_GENEREATOR(new BlockSolidFuelGenerator()),
THERMAL_GENERATOR(new BlockThermalGenerator()),
WATER_MILL(new BlockWaterMill()),
WIND_MILL(new BlockWindMill())
WIND_MILL(new BlockWindMill()),
CREATIVE_QUANTUM_CHEST(new BlockCreativeQuantumChest(), ItemBlockQuantumChest.class),
CREATIVE_QUANTUM_TANK(new BlockCreativeQuantumTank(), ItemBlockQuantumTank.class),
DIGITAL_CHEST(new BlockDigitalChest(), ItemBlockDigitalChest.class),
QUANTUM_CHEST(new BlockQuantumChest(), ItemBlockQuantumChest.class),
QUANTUM_TANK(new BlockQuantumTank(), ItemBlockQuantumTank.class)
;
public final String name;
public final Block block;
@ -501,6 +507,12 @@ public class TRContent {
InitUtils.setup(block, name);
}
private <B extends Block, IB extends ItemBlock> Machine(B block, Class<IB> itemBlock) {
this.name = this.toString().toLowerCase();
this.block = block;
InitUtils.setup(block, name);
}
public ItemStack getStack() {
return new ItemStack(block);
}
@ -845,23 +857,6 @@ public class TRContent {
RUBBER_SAPLING = new BlockRubberSapling();
registerBlock(RUBBER_SAPLING, ItemBlockRubberSapling.class, "rubber_sapling");
// Machines - storage
CREATIVE_QUANTUM_CHEST = new BlockCreativeQuantumChest();
registerBlock(CREATIVE_QUANTUM_CHEST, ItemBlockQuantumChest.class, "creative_quantum_chest");
CREATIVE_QUANTUM_TANK = new BlockCreativeQuantumTank();
registerBlock(CREATIVE_QUANTUM_TANK, ItemBlockQuantumTank.class, "creative_quantum_tank");
DIGITAL_CHEST = new BlockDigitalChest();
registerBlock(DIGITAL_CHEST, ItemBlockDigitalChest.class, "digital_chest");
QUANTUM_CHEST = new BlockQuantumChest();
registerBlock(QUANTUM_CHEST, ItemBlockQuantumChest.class, "quantum_chest");
QUANTUM_TANK = new BlockQuantumTank();
registerBlock(QUANTUM_TANK, ItemBlockQuantumTank.class, "quantum_tank");
// Machines - energy storage & transformers
ADJUSTABLE_SU = new BlockAdjustableSU();
registerBlock(ADJUSTABLE_SU, ItemBlockAdjustableSU.class, "adjustable_su");