From 3835cda4afee0a536a4fcf4964ab5470f8fac540 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Mon, 12 Feb 2024 00:26:38 -0500 Subject: [PATCH 01/27] Refactored easy containers --- .../blocks/blocks/VEBlocks.java | 144 ++++++------ .../containers/AirCompressorContainer.java | 62 ----- .../containers/AqueoulizerContainer.java | 31 --- .../containers/BlastFurnaceContainer.java | 30 --- .../CentrifugalAgitatorContainer.java | 32 --- .../CentrifugalSeparatorContainer.java | 30 --- .../CombustionGeneratorContainer.java | 28 --- .../containers/CompressorContainer.java | 37 --- .../blocks/containers/CrusherContainer.java | 30 --- .../containers/DimensionalLaserContainer.java | 61 ----- .../containers/DistillationUnitContainer.java | 63 ----- .../containers/ElectricFurnaceContainer.java | 55 ----- .../containers/ElectrolyzerContainer.java | 31 --- .../FluidElectrolyzerContainer.java | 59 ----- .../containers/FluidMixerContainer.java | 31 --- .../containers/GasFiredFurnaceContainer.java | 30 --- .../HydroponicIncubatorContainer.java | 31 --- .../ImplosionCompressorContainer.java | 73 ------ .../PrimitiveBlastFurnaceContainer.java | 29 --- .../PrimitiveSolarPanelContainer.java | 63 ----- .../PrimitiveStirlingGeneratorContainer.java | 52 ----- .../blocks/containers/PumpContainer.java | 55 ----- .../blocks/containers/SawmillContainer.java | 64 ------ .../containers/SolarPanelContainer.java | 67 ------ .../StirlingGeneratorContainer.java | 55 ----- .../blocks/containers/VEContainer.java | 2 + .../blocks/containers/VEContainerFactory.java | 62 +++++ .../blocks/containers/VEContainers.java | 215 ++++++++++++++++++ .../blocks/containers/tank/TankContainer.java | 2 +- .../blocks/inventory/slots/VEInsertSlot.java | 2 +- .../blocks/screens/AirCompressorScreen.java | 6 +- .../blocks/screens/AqueoulizerScreen.java | 6 +- .../blocks/screens/BlastFurnaceScreen.java | 6 +- .../screens/CentrifugalAgitatorScreen.java | 6 +- .../screens/CentrifugalSeparatorScreen.java | 6 +- .../screens/CombustionGeneratorScreen.java | 6 +- .../blocks/screens/CompressorScreen.java | 6 +- .../blocks/screens/CrusherScreen.java | 6 +- .../screens/DimensionalLaserScreen.java | 6 +- .../screens/DistillationUnitScreen.java | 6 +- .../blocks/screens/ElectricFurnaceScreen.java | 6 +- .../blocks/screens/ElectrolyzerScreen.java | 6 +- .../screens/FluidElectrolyzerScreen.java | 6 +- .../blocks/screens/FluidMixerScreen.java | 6 +- .../blocks/screens/GasFiredFurnaceScreen.java | 6 +- .../screens/HydroponicIncubatorScreen.java | 6 +- .../screens/ImplosionCompressorScreen.java | 6 +- .../screens/PrimitiveBlastFurnaceScreen.java | 6 +- .../screens/PrimitiveSolarPanelScreen.java | 6 +- .../PrimitiveStirlingGeneratorScreen.java | 6 +- .../blocks/screens/PumpScreen.java | 6 +- .../blocks/screens/SawmillScreen.java | 6 +- .../blocks/screens/SolarPanelScreen.java | 6 +- .../screens/StirlingGeneratorScreen.java | 6 +- .../blocks/tiles/AirCompressorTile.java | 5 +- .../blocks/tiles/AqueoulizerTile.java | 4 +- .../blocks/tiles/BlastFurnaceTile.java | 4 +- .../blocks/tiles/CentrifugalAgitatorTile.java | 4 +- .../tiles/CentrifugalSeparatorTile.java | 4 +- .../blocks/tiles/CombustionGeneratorTile.java | 4 +- .../blocks/tiles/CompressorTile.java | 4 +- .../blocks/tiles/CrusherTile.java | 5 +- .../blocks/tiles/DimensionalLaserTile.java | 4 +- .../blocks/tiles/DistillationUnitTile.java | 10 +- .../blocks/tiles/ElectricFurnaceTile.java | 6 +- .../blocks/tiles/ElectrolyzerTile.java | 4 +- .../blocks/tiles/FluidElectrolyzerTile.java | 4 +- .../blocks/tiles/FluidMixerTile.java | 4 +- .../blocks/tiles/GasFiredFurnaceTile.java | 5 +- .../blocks/tiles/HydroponicIncubatorTile.java | 5 +- .../blocks/tiles/ImplosionCompressorTile.java | 4 +- .../tiles/PrimitiveBlastFurnaceTile.java | 4 +- .../blocks/tiles/PrimitiveSolarPanelTile.java | 4 +- .../tiles/PrimitiveStirlingGeneratorTile.java | 5 +- .../blocks/tiles/PumpTile.java | 5 +- .../blocks/tiles/SawmillTile.java | 4 +- .../blocks/tiles/SolarPanelTile.java | 4 +- .../blocks/tiles/StirlingGeneratorTile.java | 6 +- .../blocks/tiles/VETileFactoryBuilder.java | 44 ++++ .../compat/jei/VoluminousEnergyPlugin.java | 22 +- 80 files changed, 528 insertions(+), 1320 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/AirCompressorContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/AqueoulizerContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/BlastFurnaceContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/CentrifugalAgitatorContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/CentrifugalSeparatorContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/CombustionGeneratorContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/CompressorContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/CrusherContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/DimensionalLaserContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/DistillationUnitContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/ElectricFurnaceContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/ElectrolyzerContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/FluidElectrolyzerContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/FluidMixerContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/GasFiredFurnaceContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/HydroponicIncubatorContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/ImplosionCompressorContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/PrimitiveBlastFurnaceContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/PrimitiveSolarPanelContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/PrimitiveStirlingGeneratorContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/PumpContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/SawmillContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/SolarPanelContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/StirlingGeneratorContainer.java create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactoryBuilder.java diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java index d42b14757..5752e6792 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java @@ -47,143 +47,143 @@ public class VEBlocks { public static RegistryObject SOLARIUM_MACHINE_CASING_BLOCK = VE_BLOCKS_REGISTRY.register("solarium_machine_casing", SolariumMachineCasingBlock::new); //Primitive Blast - public static RegistryObject PRIMITIVE_BLAST_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("primitiveblastfurnace", PrimitiveBlastFurnaceBlock::new); + public static RegistryObject PRIMITIVE_BLAST_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("primitiveblastfurnace", PrimitiveBlastFurnaceBlock::new); public static RegistryObject> PRIMITIVE_BLAST_FURNACE_TILE = VE_TILE_REGISTRY.register("primitiveblastfurnace", () -> BlockEntityType.Builder.of(PrimitiveBlastFurnaceTile::new,VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get()).build(null) ); - public static RegistryObject> PRIMITIVE_BLAST_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("primitiveblastfurnace", () -> + public static RegistryObject> PRIMITIVE_BLAST_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("primitiveblastfurnace", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new PrimitiveBlastFurnaceContainer(id,VoluminousEnergy.proxy.getClientWorld(),pos,inv,VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); //Primitive Stirling - public static RegistryObject PRIMITIVE_STIRLING_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("primitivestirlinggenerator", PrimitiveStirlingGeneratorBlock::new); + public static RegistryObject PRIMITIVE_STIRLING_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("primitivestirlinggenerator", PrimitiveStirlingGeneratorBlock::new); public static RegistryObject> PRIMITIVE_STIRLING_GENERATOR_TILE = VE_TILE_REGISTRY.register("primitivestirlinggenerator", () -> BlockEntityType.Builder.of(PrimitiveStirlingGeneratorTile::new,VEBlocks.PRIMITIVE_STIRLING_GENERATOR_BLOCK.get()).build(null)); - public static RegistryObject> PRIMITIVE_STIRLING_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("primitivestirlinggenerator", () -> + public static RegistryObject> PRIMITIVE_STIRLING_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("primitivestirlinggenerator", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new PrimitiveStirlingGeneratorContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); //Crusher - public static RegistryObject CRUSHER_BLOCK = VE_BLOCKS_REGISTRY.register("crusher", CrusherBlock::new); + public static RegistryObject CRUSHER_BLOCK = VE_BLOCKS_REGISTRY.register("crusher", CrusherBlock::new); public static RegistryObject> CRUSHER_TILE = VE_TILE_REGISTRY.register("crusher", () -> BlockEntityType.Builder.of(CrusherTile::new,VEBlocks.CRUSHER_BLOCK.get()).build(null)); - public static RegistryObject> CRUSHER_CONTAINER = VE_CONTAINER_REGISTRY.register("crusher", () -> + public static RegistryObject> CRUSHER_CONTAINER = VE_CONTAINER_REGISTRY.register("crusher", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new CrusherContainer(id,VoluminousEnergy.proxy.getClientWorld(),pos,inv,VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.CRUSHER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); //Electrolyzer - public static RegistryObject ELECTROLYZER_BLOCK = VE_BLOCKS_REGISTRY.register("electrolyzer", ElectrolyzerBlock::new); + public static RegistryObject ELECTROLYZER_BLOCK = VE_BLOCKS_REGISTRY.register("electrolyzer", ElectrolyzerBlock::new); public static RegistryObject> ELECTROLYZER_TILE = VE_TILE_REGISTRY.register("electrolyzer", () -> BlockEntityType.Builder.of(ElectrolyzerTile::new,VEBlocks.ELECTROLYZER_BLOCK.get()).build(null)); - public static RegistryObject> ELECTROLYZER_CONTAINER = VE_CONTAINER_REGISTRY.register("electrolyzer", () -> + public static RegistryObject> ELECTROLYZER_CONTAINER = VE_CONTAINER_REGISTRY.register("electrolyzer", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new ElectrolyzerContainer(id,VoluminousEnergy.proxy.getClientWorld(),pos,inv,VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.ELECTROLYZER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Centrifugal Agitator - public static RegistryObject CENTRIFUGAL_AGITATOR_BLOCK = VE_BLOCKS_REGISTRY.register("centrifugal_agitator", CentrifugalAgitatorBlock::new); + public static RegistryObject CENTRIFUGAL_AGITATOR_BLOCK = VE_BLOCKS_REGISTRY.register("centrifugal_agitator", CentrifugalAgitatorBlock::new); public static RegistryObject> CENTRIFUGAL_AGITATOR_TILE = VE_TILE_REGISTRY.register("centrifugal_agitator", () -> BlockEntityType.Builder.of(CentrifugalAgitatorTile::new,VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get()).build(null)); - public static RegistryObject> CENTRIFUGAL_AGITATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("centrifugal_agitator", () -> + public static RegistryObject> CENTRIFUGAL_AGITATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("centrifugal_agitator", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new CentrifugalAgitatorContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.CENTRIFUGAL_AGITATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Compressor - public static RegistryObject COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("compressor", CompressorBlock::new); + public static RegistryObject COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("compressor", CompressorBlock::new); public static RegistryObject> COMPRESSOR_TILE = VE_TILE_REGISTRY.register("compressor", () -> BlockEntityType.Builder.of(CompressorTile::new,VEBlocks.COMPRESSOR_BLOCK.get()).build(null)); - public static RegistryObject> COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("compressor", () -> + public static RegistryObject> COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("compressor", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new CompressorContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.COMPRESSOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Stirling Generator - public static RegistryObject STIRLING_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("stirling_generator", StirlingGeneratorBlock::new); + public static RegistryObject STIRLING_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("stirling_generator", StirlingGeneratorBlock::new); public static RegistryObject> STIRLING_GENERATOR_TILE = VE_TILE_REGISTRY.register("stirling_generator", () -> BlockEntityType.Builder.of(StirlingGeneratorTile::new,VEBlocks.STIRLING_GENERATOR_BLOCK.get()).build(null)); - public static RegistryObject> STIRLING_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("stirling_generator", () -> + public static RegistryObject> STIRLING_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("stirling_generator", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new StirlingGeneratorContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.STIRLING_GENERATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Combustion Generator - public static RegistryObject COMBUSTION_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("combustion_generator", CombustionGeneratorBlock::new); + public static RegistryObject COMBUSTION_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("combustion_generator", CombustionGeneratorBlock::new); public static RegistryObject> COMBUSTION_GENERATOR_TILE = VE_TILE_REGISTRY.register("combustion_generator", () -> BlockEntityType.Builder.of(CombustionGeneratorTile::new,VEBlocks.COMBUSTION_GENERATOR_BLOCK.get()).build(null)); - public static RegistryObject> COMBUSTION_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("combustion_generator", () -> + public static RegistryObject> COMBUSTION_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("combustion_generator", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new CombustionGeneratorContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.COMBUSTION_GENERATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Aqueoulizer - public static RegistryObject AQUEOULIZER_BLOCK = VE_BLOCKS_REGISTRY.register("aqueoulizer", AqueoulizerBlock::new); + public static RegistryObject AQUEOULIZER_BLOCK = VE_BLOCKS_REGISTRY.register("aqueoulizer", AqueoulizerBlock::new); public static RegistryObject> AQUEOULIZER_TILE = VE_TILE_REGISTRY.register("aqueoulizer", () -> BlockEntityType.Builder.of(AqueoulizerTile::new,VEBlocks.AQUEOULIZER_BLOCK.get()).build(null)); - public static RegistryObject> AQUEOULIZER_CONTAINER = VE_CONTAINER_REGISTRY.register("aqueoulizer", () -> + public static RegistryObject> AQUEOULIZER_CONTAINER = VE_CONTAINER_REGISTRY.register("aqueoulizer", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new AqueoulizerContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.AQUEOULIZER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Air Compressor - public static RegistryObject AIR_COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("air_compressor", AirCompressorBlock::new); + public static RegistryObject AIR_COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("air_compressor", AirCompressorBlock::new); public static RegistryObject> AIR_COMPRESSOR_TILE = VE_TILE_REGISTRY.register("air_compressor", () -> BlockEntityType.Builder.of(AirCompressorTile::new,VEBlocks.AIR_COMPRESSOR_BLOCK.get()).build(null)); - public static RegistryObject> AIR_COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("air_compressor", () -> + public static RegistryObject> AIR_COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("air_compressor", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new AirCompressorContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.AIR_COMPRESSOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Distillation Unit - public static RegistryObject DISTILLATION_UNIT_BLOCK = VE_BLOCKS_REGISTRY.register("distillation_unit", DistillationUnitBlock::new); + public static RegistryObject DISTILLATION_UNIT_BLOCK = VE_BLOCKS_REGISTRY.register("distillation_unit", DistillationUnitBlock::new); public static RegistryObject> DISTILLATION_UNIT_TILE = VE_TILE_REGISTRY.register("distillation_unit", () -> BlockEntityType.Builder.of(DistillationUnitTile::new,VEBlocks.DISTILLATION_UNIT_BLOCK.get()).build(null)); - public static RegistryObject> DISTILLATION_UNIT_CONTAINER = VE_CONTAINER_REGISTRY.register("distillation_unit", () -> + public static RegistryObject> DISTILLATION_UNIT_CONTAINER = VE_CONTAINER_REGISTRY.register("distillation_unit", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new DistillationUnitContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.DISTILLATION_UNIT_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Pump - public static RegistryObject PUMP_BLOCK = VE_BLOCKS_REGISTRY.register("pump", PumpBlock::new); + public static RegistryObject PUMP_BLOCK = VE_BLOCKS_REGISTRY.register("pump", PumpBlock::new); public static RegistryObject> PUMP_TILE = VE_TILE_REGISTRY.register("pump", () -> BlockEntityType.Builder.of(PumpTile::new,VEBlocks.PUMP_BLOCK.get()).build(null)); - public static RegistryObject> PUMP_CONTAINER = VE_CONTAINER_REGISTRY.register("pump", () -> + public static RegistryObject> PUMP_CONTAINER = VE_CONTAINER_REGISTRY.register("pump", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new PumpContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.PUMP_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Gas Fired Furnace - public static RegistryObject GAS_FIRED_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("gas_fired_furnace", GasFiredFurnaceBlock::new); + public static RegistryObject GAS_FIRED_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("gas_fired_furnace", GasFiredFurnaceBlock::new); public static RegistryObject> GAS_FIRED_FURNACE_TILE = VE_TILE_REGISTRY.register("gas_fired_furnace", () -> BlockEntityType.Builder.of(GasFiredFurnaceTile::new,VEBlocks.GAS_FIRED_FURNACE_BLOCK.get()).build(null)); - public static RegistryObject> GAS_FIRED_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("gas_fired_furnace", () -> + public static RegistryObject> GAS_FIRED_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("gas_fired_furnace", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new GasFiredFurnaceContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.GAS_FIRED_FURNACE_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Electric Furnace - public static RegistryObject ELECTRIC_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("electric_furnace", ElectricFurnaceBlock::new); + public static RegistryObject ELECTRIC_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("electric_furnace", ElectricFurnaceBlock::new); public static RegistryObject> ELECTRIC_FURNACE_TILE = VE_TILE_REGISTRY.register("electric_furnace", () -> BlockEntityType.Builder.of(ElectricFurnaceTile::new,VEBlocks.ELECTRIC_FURNACE_BLOCK.get()).build(null)); - public static RegistryObject> ELECTRIC_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("electric_furnace", () -> + public static RegistryObject> ELECTRIC_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("electric_furnace", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new ElectricFurnaceContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.ELECTRIC_FURNACE_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Battery Box @@ -197,53 +197,53 @@ public class VEBlocks { })); // Primitive Solar Panel - public static RegistryObject PRIMITIVE_SOLAR_PANEL_BLOCK = VE_BLOCKS_REGISTRY.register("primitive_solar_panel", PrimitiveSolarPanelBlock::new); + public static RegistryObject PRIMITIVE_SOLAR_PANEL_BLOCK = VE_BLOCKS_REGISTRY.register("primitive_solar_panel", PrimitiveSolarPanelBlock::new); public static RegistryObject> PRIMITIVE_SOLAR_PANEL_TILE = VE_TILE_REGISTRY.register("primitive_solar_panel", () -> BlockEntityType.Builder.of(PrimitiveSolarPanelTile::new,VEBlocks.PRIMITIVE_SOLAR_PANEL_BLOCK.get()).build(null)); - public static RegistryObject> PRIMITIVE_SOLAR_PANEL_CONTAINER = VE_CONTAINER_REGISTRY.register("primitive_solar_panel", () -> + public static RegistryObject> PRIMITIVE_SOLAR_PANEL_CONTAINER = VE_CONTAINER_REGISTRY.register("primitive_solar_panel", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new PrimitiveSolarPanelContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Solar Panel - public static RegistryObject SOLAR_PANEL_BLOCK = VE_BLOCKS_REGISTRY.register("solar_panel", SolarPanelBlock::new); + public static RegistryObject SOLAR_PANEL_BLOCK = VE_BLOCKS_REGISTRY.register("solar_panel", SolarPanelBlock::new); public static RegistryObject> SOLAR_PANEL_TILE = VE_TILE_REGISTRY.register("solar_panel", () -> BlockEntityType.Builder.of(SolarPanelTile::new,VEBlocks.SOLAR_PANEL_BLOCK.get()).build(null)); - public static RegistryObject> SOLAR_PANEL_CONTAINER = VE_CONTAINER_REGISTRY.register("solar_panel", () -> + public static RegistryObject> SOLAR_PANEL_CONTAINER = VE_CONTAINER_REGISTRY.register("solar_panel", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new SolarPanelContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.SOLAR_PANEL_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Centrifugal Separator - public static RegistryObject CENTRIFUGAL_SEPARATOR_BLOCK = VE_BLOCKS_REGISTRY.register("centrifugal_separator", CentrifugalSeparatorBlock::new); + public static RegistryObject CENTRIFUGAL_SEPARATOR_BLOCK = VE_BLOCKS_REGISTRY.register("centrifugal_separator", CentrifugalSeparatorBlock::new); public static RegistryObject> CENTRIFUGAL_SEPARATOR_TILE = VE_TILE_REGISTRY.register("centrifugal_separator", () -> BlockEntityType.Builder.of(CentrifugalSeparatorTile::new,VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get()).build(null)); - public static RegistryObject> CENTRIFUGAL_SEPARATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("centrifugal_separator", () -> + public static RegistryObject> CENTRIFUGAL_SEPARATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("centrifugal_separator", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new CentrifugalSeparatorContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Implosion Compressor - public static RegistryObject IMPLOSION_COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("implosion_compressor", ImplosionCompressorBlock::new); + public static RegistryObject IMPLOSION_COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("implosion_compressor", ImplosionCompressorBlock::new); public static RegistryObject> IMPLOSION_COMPRESSOR_TILE = VE_TILE_REGISTRY.register("implosion_compressor", () -> BlockEntityType.Builder.of(ImplosionCompressorTile::new,VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get()).build(null)); - public static RegistryObject> IMPLOSION_COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("implosion_compressor", () -> + public static RegistryObject> IMPLOSION_COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("implosion_compressor", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new ImplosionCompressorContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.IMPLOSION_COMPRESSOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Blast Furnace - public static RegistryObject BLAST_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("blast_furnace", BlastFurnaceBlock::new); + public static RegistryObject BLAST_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("blast_furnace", BlastFurnaceBlock::new); public static RegistryObject> BLAST_FURNACE_TILE = VE_TILE_REGISTRY.register("blast_furnace", () -> BlockEntityType.Builder.of(BlastFurnaceTile::new,VEBlocks.BLAST_FURNACE_BLOCK.get()).build(null)); - public static RegistryObject> BLAST_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("blast_furnace", () -> + public static RegistryObject> BLAST_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("blast_furnace", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new BlastFurnaceContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.BLAST_FURNACE_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Tooling Station @@ -257,53 +257,53 @@ public class VEBlocks { })); // Sawmill - public static RegistryObject SAWMILL_BLOCK = VE_BLOCKS_REGISTRY.register("sawmill", SawmillBlock::new); + public static RegistryObject SAWMILL_BLOCK = VE_BLOCKS_REGISTRY.register("sawmill", SawmillBlock::new); public static RegistryObject> SAWMILL_TILE = VE_TILE_REGISTRY.register("sawmill", () -> BlockEntityType.Builder.of(SawmillTile::new,VEBlocks.SAWMILL_BLOCK.get()).build(null)); - public static RegistryObject> SAWMILL_CONTAINER = VE_CONTAINER_REGISTRY.register("sawmill", () -> + public static RegistryObject> SAWMILL_CONTAINER = VE_CONTAINER_REGISTRY.register("sawmill", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new SawmillContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.SAWMILL_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Dimensional Laser - public static RegistryObject DIMENSIONAL_LASER_BLOCK = VE_BLOCKS_REGISTRY.register("dimensional_laser", DimensionalLaserBlock::new); + public static RegistryObject DIMENSIONAL_LASER_BLOCK = VE_BLOCKS_REGISTRY.register("dimensional_laser", DimensionalLaserBlock::new); public static RegistryObject> DIMENSIONAL_LASER_TILE = VE_TILE_REGISTRY.register("dimensional_laser", () -> BlockEntityType.Builder.of(DimensionalLaserTile::new,VEBlocks.DIMENSIONAL_LASER_BLOCK.get()).build(null)); - public static RegistryObject> DIMENSIONAL_LASER_CONTAINER = VE_CONTAINER_REGISTRY.register("dimensional_laser", () -> + public static RegistryObject> DIMENSIONAL_LASER_CONTAINER = VE_CONTAINER_REGISTRY.register("dimensional_laser", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new DimensionalLaserContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.DIMENSIONAL_LASER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Fluid Electrolyzer - public static RegistryObject FLUID_ELECTROLYZER_BLOCK = VE_BLOCKS_REGISTRY.register("fluid_electrolyzer", FluidElectrolyzerBlock::new); + public static RegistryObject FLUID_ELECTROLYZER_BLOCK = VE_BLOCKS_REGISTRY.register("fluid_electrolyzer", FluidElectrolyzerBlock::new); public static RegistryObject> FLUID_ELECTROLYZER_TILE = VE_TILE_REGISTRY.register("fluid_electrolyzer", () -> BlockEntityType.Builder.of(FluidElectrolyzerTile::new,VEBlocks.FLUID_ELECTROLYZER_BLOCK.get()).build(null)); - public static RegistryObject> FLUID_ELECTROLYZER_CONTAINER = VE_CONTAINER_REGISTRY.register("fluid_electrolyzer", () -> + public static RegistryObject> FLUID_ELECTROLYZER_CONTAINER = VE_CONTAINER_REGISTRY.register("fluid_electrolyzer", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new FluidElectrolyzerContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.FLUID_ELECTROLYZER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Fluid Mixer - public static RegistryObject FLUID_MIXER_BLOCK = VE_BLOCKS_REGISTRY.register("fluid_mixer", FluidMixerBlock::new); + public static RegistryObject FLUID_MIXER_BLOCK = VE_BLOCKS_REGISTRY.register("fluid_mixer", FluidMixerBlock::new); public static RegistryObject> FLUID_MIXER_TILE = VE_TILE_REGISTRY.register("fluid_mixer", () -> BlockEntityType.Builder.of(FluidMixerTile::new,VEBlocks.FLUID_MIXER_BLOCK.get()).build(null)); - public static RegistryObject> FLUID_MIXER_CONTAINER = VE_CONTAINER_REGISTRY.register("fluid_mixer", () -> + public static RegistryObject> FLUID_MIXER_CONTAINER = VE_CONTAINER_REGISTRY.register("fluid_mixer", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new FluidMixerContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.FLUID_MIXER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Hydroponic Incubator - public static RegistryObject HYDROPONIC_INCUBATOR_BLOCK = VE_BLOCKS_REGISTRY.register("hydroponic_incubator", HydroponicIncubatorBlock::new); + public static RegistryObject HYDROPONIC_INCUBATOR_BLOCK = VE_BLOCKS_REGISTRY.register("hydroponic_incubator", HydroponicIncubatorBlock::new); public static RegistryObject> HYDROPONIC_INCUBATOR_TILE = VE_TILE_REGISTRY.register("hydroponic_incubator", () -> BlockEntityType.Builder.of(HydroponicIncubatorTile::new,VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get()).build(null)); - public static RegistryObject> HYDROPONIC_INCUBATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("hydroponic_incubator", () -> + public static RegistryObject> HYDROPONIC_INCUBATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("hydroponic_incubator", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new HydroponicIncubatorContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.HYDROPONIC_INCUBATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Tanks (Tile/Block) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/AirCompressorContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/AirCompressorContainer.java deleted file mode 100644 index 0a340be2f..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/AirCompressorContainer.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import com.veteam.voluminousenergy.blocks.tiles.IVEPoweredTileEntity; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.AIR_COMPRESSOR_CONTAINER; - -public class AirCompressorContainer extends VEContainer { - - private static final int NUMBER_OF_SLOTS = 3; - - public AirCompressorContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(AIR_COMPRESSOR_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.AIR_COMPRESSOR_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler handler) { - addSlot(new VEBucketSlot(handler, 0, 70, 18)); // Air Compressor bucket input slot - addSlot(new VEBucketSlot(handler, 1, 70, 49)); // Air Compressor bucket output slot - addSlot(new VEInsertSlot(handler, 2, 154, -14)); // Upgrade Slot - } - - @Nonnull - @Override - public @NotNull ItemStack quickMoveStack(final @NotNull Player player, final int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogicWithUpgradeSlot(index, NUMBER_OF_SLOTS, ((IVEPoweredTileEntity) this.tileEntity).getUpgradeSlotId(), slotStack) != null) - return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - - slot.onTake(player, slotStack); - } - return returnStack; - } -} - diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/AqueoulizerContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/AqueoulizerContainer.java deleted file mode 100644 index 9a2a335b3..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/AqueoulizerContainer.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.AQUEOULIZER_CONTAINER; - -public class AqueoulizerContainer extends VEContainer { - - public static final int NUMBER_OF_SLOTS = 6; - - public AqueoulizerContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(AQUEOULIZER_CONTAINER.get(), id,world,pos,inventory,player,VEBlocks.AQUEOULIZER_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler handler) { - addSlot(new VEBucketSlot(handler, 0, 38, 18)); // Bucket input; input tank - addSlot(new VEBucketSlot(handler, 1, 38, 49)); // Bucket output; input tank - addSlot(new VEBucketSlot(handler, 2, 137, 18)); // Bucket insert; output tank - addSlot(new VEBucketSlot(handler, 3, 137, 49)); // Bucket output; output tank - addSlot(new VEInsertSlot(handler, 4, 96, 32)); // Item to be dissolved - addSlot(new VEInsertSlot(handler, 5, 130,-14)); // Upgrade Slot - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/BlastFurnaceContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/BlastFurnaceContainer.java deleted file mode 100644 index 9f68cac41..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/BlastFurnaceContainer.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.BLAST_FURNACE_CONTAINER; - -public class BlastFurnaceContainer extends VEContainer { - - public static final int NUMBER_OF_SLOTS = 6; - - public BlastFurnaceContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(BLAST_FURNACE_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.BLAST_FURNACE_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEInsertSlot(h, 0, 38, 18)); // Fluid input slot - addSlot(new VEInsertSlot(h, 1,38,49)); // Extract fluid from heat tank - addSlot(new VEInsertSlot(h, 2, 80,25)); // First input slot - addSlot(new VEInsertSlot(h, 3, 80,43)); // Second input slot - addSlot(new VEInsertSlot(h, 4, 134,34)); // Third input slot - addSlot(new VEInsertSlot(h, 5,130,-14)); // Upgrade slot - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/CentrifugalAgitatorContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/CentrifugalAgitatorContainer.java deleted file mode 100644 index 196736df3..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/CentrifugalAgitatorContainer.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK; -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.CENTRIFUGAL_AGITATOR_CONTAINER; - -public class CentrifugalAgitatorContainer extends VEContainer { - - private static final int NUMBER_OF_SLOTS = 7; - - public CentrifugalAgitatorContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(CENTRIFUGAL_AGITATOR_CONTAINER.get(), id,world,pos,inventory,player,CENTRIFUGAL_AGITATOR_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEBucketSlot(h, 0, 38, 18)); // Bucket insert; input tank - addSlot(new VEBucketSlot(h, 1, 38, 49)); // Bucket extract; input tank - addSlot(new VEBucketSlot(h, 2, 96, 18)); // Bucket insert; first output tank - addSlot(new VEBucketSlot(h, 3, 96, 49)); // Bucket extract; first output tank - addSlot(new VEBucketSlot(h, 4, 137, 18)); // Bucket insert; second output tank - addSlot(new VEBucketSlot(h, 5, 137, 49)); // Bucket extract; second output tank - addSlot(new VEInsertSlot(h, 6, 130, -14)); // Upgrade slot - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/CentrifugalSeparatorContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/CentrifugalSeparatorContainer.java deleted file mode 100644 index ae303fc2e..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/CentrifugalSeparatorContainer.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEOutputSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; - -public class CentrifugalSeparatorContainer extends VEContainer { - - public static final int NUMBER_OF_SLOTS = 7; - - public CentrifugalSeparatorContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(VEBlocks.CENTRIFUGAL_SEPARATOR_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEInsertSlot(h, 0, 53, 24)); // Primary input slot - addSlot(new VEInsertSlot(h,1,53,42)); // Empty Bucket slot - addSlot(new VEOutputSlot(h, 2,99,33)); //Main Output - addSlot(new VEOutputSlot(h, 3, 117,15)); //RNG #1 Slot - addSlot(new VEOutputSlot(h,4, 135, 33)); //RNG #2 Slot - addSlot(new VEOutputSlot(h,5,117,51)); //RNG #3 Slot - addSlot(new VEInsertSlot(h,6,155, -14)); // Upgrade Slot - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/CombustionGeneratorContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/CombustionGeneratorContainer.java deleted file mode 100644 index 769b9104f..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/CombustionGeneratorContainer.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.COMBUSTION_GENERATOR_CONTAINER; - -public class CombustionGeneratorContainer extends VEContainer { - - private static final int NUMBER_OF_SLOTS = 4; - - public CombustionGeneratorContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(COMBUSTION_GENERATOR_CONTAINER.get(), id,world,pos,inventory,player,VEBlocks.COMBUSTION_GENERATOR_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEBucketSlot(h, 0, 38, 18)); // Oxidizer input slot - addSlot(new VEBucketSlot(h, 1, 38, 49)); // Extract fluid from oxidizer slot - addSlot(new VEBucketSlot(h, 2, 138, 18)); // Fuel input slot - addSlot(new VEBucketSlot(h, 3, 138, 49)); // Extract fluid from fuel output - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/CompressorContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/CompressorContainer.java deleted file mode 100644 index 65745c992..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/CompressorContainer.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.TileEntitySlots.CompressorInputSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEOutputSlot; -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.wrapper.InvWrapper; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.COMPRESSOR_CONTAINER; - -public class CompressorContainer extends VEContainer { - public static final int NUMBER_OF_SLOTS = 3; - - public CompressorContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(COMPRESSOR_CONTAINER.get(), id, world, pos, inventory, player, VEBlocks.COMPRESSOR_BLOCK.get()); - this.tileEntity = (VETileEntity) world.getBlockEntity(pos); - this.tileEntity.getCapability(ForgeCapabilities.ITEM_HANDLER); - this.playerEntity = player; - this.playerInventory = new InvWrapper(inventory); - - - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new CompressorInputSlot(h, 0, 80, 13, world)); - addSlot(new VEOutputSlot(h, 1, 80, 58));//Main Output - addSlot(new VEInsertSlot(h, 2, 154, -14));//Upgrade slot - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/CrusherContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/CrusherContainer.java deleted file mode 100644 index 3a29d687d..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/CrusherContainer.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.TileEntitySlots.CrusherInputSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEOutputSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.CRUSHER_CONTAINER; - -public class CrusherContainer extends VEContainer { - - public static final int NUMBER_OF_SLOTS = 4; - - public CrusherContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(CRUSHER_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.CRUSHER_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new CrusherInputSlot(h, 0, 80, 13, world)); - addSlot(new VEOutputSlot(h, 1,71,58));//Main Output - addSlot(new VEOutputSlot(h, 2, 89,58));//RNG Slot - addSlot(new VEInsertSlot(h, 3,154, -14));//Upgrade Slot - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/DimensionalLaserContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/DimensionalLaserContainer.java deleted file mode 100644 index f658e968f..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/DimensionalLaserContainer.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.DIMENSIONAL_LASER_CONTAINER; - -public class DimensionalLaserContainer extends VEContainer { - - private static final int NUMBER_OF_SLOTS = 4; - - public DimensionalLaserContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(DIMENSIONAL_LASER_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.DIMENSIONAL_LASER_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEBucketSlot(h, 0, 138, 18)); // Bucket top slot - addSlot(new VEBucketSlot(h, 1,138,49)); // Bucket bottom slot - addSlot(new VEInsertSlot(h, 2, 38,33)); // RFID chip slot - addSlot(new VEInsertSlot(h, 3, 130,-14)); // Upgrade slot - } - - @Nonnull - @Override - public @NotNull ItemStack quickMoveStack(final @NotNull Player player, final int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogicWithUpgradeSlot(index, NUMBER_OF_SLOTS, 3, slotStack) != null) return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - - slot.onTake(player, slotStack); - } - return returnStack; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/DistillationUnitContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/DistillationUnitContainer.java deleted file mode 100644 index e03e90991..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/DistillationUnitContainer.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.DISTILLATION_UNIT_CONTAINER; - -public class DistillationUnitContainer extends VEContainer { - - private static final int NUMBER_OF_SLOTS = 8; - - public DistillationUnitContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(DISTILLATION_UNIT_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.DISTILLATION_UNIT_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEBucketSlot(h, 0, 38, 18)); // Fluid input slot - addSlot(new VEBucketSlot(h, 1,38,49)); // Extract fluid from input - addSlot(new VEBucketSlot(h, 2, 96,11)); // Top slot for first output - addSlot(new VEBucketSlot(h, 3, 96,42)); // Bottom slot for first output - addSlot(new VEBucketSlot(h, 4, 137,11)); // Top slot for from second output - addSlot(new VEBucketSlot(h, 5, 137,42)); // Bottom slot for second output - addSlot(new VEInsertSlot(h, 6, 122,64)); // Item Output Slot - addSlot(new VEInsertSlot(h, 7,130,-14)); // Upgrade slot - } - - @Nonnull - @Override - public @NotNull ItemStack quickMoveStack(final @NotNull Player player, final int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogicWithUpgradeSlot(index, NUMBER_OF_SLOTS, 7, slotStack) != null) return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - slot.onTake(player, slotStack); - } - return returnStack; - } - -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ElectricFurnaceContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/ElectricFurnaceContainer.java deleted file mode 100644 index a4dd193d1..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ElectricFurnaceContainer.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; - -public class ElectricFurnaceContainer extends VEContainer { - - private static final int NUMBER_OF_SLOTS = 3; - - public ElectricFurnaceContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(VEBlocks.ELECTRIC_FURNACE_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.ELECTRIC_FURNACE_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEInsertSlot(h, 0, 53,33)); // Furnace Input Slot - addSlot(new VEInsertSlot(h, 1,116,33)); // Furnace Output Slot - addSlot(new VEInsertSlot(h,2,154, -14));// Upgrade Slot - } - - @Nonnull - @Override - public @NotNull ItemStack quickMoveStack(final @NotNull Player player, final int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogicWithUpgradeSlot(index, NUMBER_OF_SLOTS, 2, slotStack) != null) return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - slot.onTake(player, slotStack); - } - return returnStack; - } - -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ElectrolyzerContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/ElectrolyzerContainer.java deleted file mode 100644 index 65e4d5ba3..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ElectrolyzerContainer.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.TileEntitySlots.ElectrolyzerInputSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEOutputSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; - -public class ElectrolyzerContainer extends VEContainer { - - public static final int NUMBER_OF_SLOTS = 7; - - public ElectrolyzerContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(VEBlocks.ELECTROLYZER_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.ELECTROLYZER_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new ElectrolyzerInputSlot(h, 0, 71, 13, world)); - addSlot(new VEInsertSlot(h,1,89,13)); // Empty Bucket slot - addSlot(new VEOutputSlot(h, 2,53,57)); //Main Output - addSlot(new VEOutputSlot(h, 3, 71,57)); //RNG #1 Slot - addSlot(new VEOutputSlot(h,4, 89, 57)); //RNG #2 Slot - addSlot(new VEOutputSlot(h,5,107,57)); //RNG #3 Slot - addSlot(new VEInsertSlot(h,6,154, -14)); // Upgrade Slot - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/FluidElectrolyzerContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/FluidElectrolyzerContainer.java deleted file mode 100644 index 804c0697a..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/FluidElectrolyzerContainer.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; - -public class FluidElectrolyzerContainer extends VEContainer { - - public static final int NUMBER_OF_SLOTS = 7; - - public FluidElectrolyzerContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(VEBlocks.FLUID_ELECTROLYZER_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.FLUID_ELECTROLYZER_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEBucketSlot(h,0,38,18)); // Top input bucket - addSlot(new VEBucketSlot(h,1,38,49)); // Bottom input bucket - addSlot(new VEBucketSlot(h,2,96,18)); // Top output0 bucket - addSlot(new VEBucketSlot(h,3,96,49)); // Bottom output0 bucket - addSlot(new VEBucketSlot(h,4,137,18)); // Top output1 bucket - addSlot(new VEBucketSlot(h,5,137,49)); // Bottom output1 bucket - addSlot(new VEInsertSlot(h, 6,130,-14)); // Upgrade slot - } - - @Nonnull - @Override - public @NotNull ItemStack quickMoveStack(final @NotNull Player player, final int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogicWithUpgradeSlot(index, NUMBER_OF_SLOTS, this.getUpgradeSlotId(), slotStack) != null) return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - slot.onTake(player, slotStack); - } - return returnStack; - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/FluidMixerContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/FluidMixerContainer.java deleted file mode 100644 index 2422d23fb..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/FluidMixerContainer.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; - - -public class FluidMixerContainer extends VEContainer { - - private static final int NUMBER_OF_SLOTS = 7; - - public FluidMixerContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(VEBlocks.FLUID_MIXER_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.FLUID_MIXER_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEBucketSlot(h,0,38,18)); // Top input0 bucket - addSlot(new VEBucketSlot(h,1,38,49)); // Bottom input0 bucket - addSlot(new VEBucketSlot(h,2,86,18)); // Top input1 bucket - addSlot(new VEBucketSlot(h,3,86,49)); // Bottom input1 bucket - addSlot(new VEBucketSlot(h,4,136,18)); // Top output0 bucket - addSlot(new VEBucketSlot(h,5,136,49)); // Bottom output0 bucket - addSlot(new VEInsertSlot(h, 6,130,-14)); // Upgrade slot - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/GasFiredFurnaceContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/GasFiredFurnaceContainer.java deleted file mode 100644 index 507d38985..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/GasFiredFurnaceContainer.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.GAS_FIRED_FURNACE_CONTAINER; - -public class GasFiredFurnaceContainer extends VEContainer { - - private static final int NUMBER_OF_SLOTS = 5; - - public GasFiredFurnaceContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(GAS_FIRED_FURNACE_CONTAINER.get(), id, world, pos, inventory, player, VEBlocks.GAS_FIRED_FURNACE_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEBucketSlot(h, 0, 8, 18)); // Fluid input slot - addSlot(new VEBucketSlot(h, 1, 8, 49)); // Extract fluid from input - addSlot(new VEInsertSlot(h, 2, 53, 33)); // Item input slot - addSlot(new VEInsertSlot(h, 3, 116, 33)); // Item output slot - addSlot(new VEInsertSlot(h, 4, 154, -14)); // Upgrade slot - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/HydroponicIncubatorContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/HydroponicIncubatorContainer.java deleted file mode 100644 index acd2947e8..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/HydroponicIncubatorContainer.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; - -public class HydroponicIncubatorContainer extends VEContainer { - - public static final int NUMBER_OF_SLOTS = 8; - - public HydroponicIncubatorContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(VEBlocks.HYDROPONIC_INCUBATOR_CONTAINER.get(), id,world,pos,inventory,player,VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEBucketSlot(h, 0, 38, 18)); // Bucket top slot - addSlot(new VEBucketSlot(h, 1, 38, 49)); // Bucket bottom slot - addSlot(new VEInsertSlot(h, 2, 83, 34)); // Primary input - addSlot(new VEInsertSlot(h, 3, 123, 8)); // Primary output - addSlot(new VEInsertSlot(h, 4, 123, 26)); // RNG0 output - addSlot(new VEInsertSlot(h, 5, 123, 44)); // RNG1 output - addSlot(new VEInsertSlot(h, 6, 123, 62)); // RNG2 output - addSlot(new VEInsertSlot(h, 7, 154,-14)); // Upgrade slot - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ImplosionCompressorContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/ImplosionCompressorContainer.java deleted file mode 100644 index 47fd4bf6c..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ImplosionCompressorContainer.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEOutputSlot; -import com.veteam.voluminousenergy.blocks.screens.ImplosionCompressorScreen; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.IMPLOSION_COMPRESSOR_CONTAINER; - -public class ImplosionCompressorContainer extends VEContainer { - - private ImplosionCompressorScreen screen; - public static final int NUMBER_OF_SLOTS = 4; - - public ImplosionCompressorContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(IMPLOSION_COMPRESSOR_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get()); - } - - @Nonnull - @Override - public @NotNull ItemStack quickMoveStack(final @NotNull Player player, final int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogicWithUpgradeSlot(index, NUMBER_OF_SLOTS, 3, slotStack) != null) return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - slot.onTake(player, slotStack); - } - return returnStack; - } - - - // Unauthorized call to this method can be dangerous. Can't not be public AFAIK. :( - public void setScreen(ImplosionCompressorScreen screen){ - this.screen = screen; - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEInsertSlot(h, 0, 53, 23)); // Main input - addSlot(new VEInsertSlot(h, 1, 53, 41)); // Gunpowder slot - addSlot(new VEOutputSlot(h, 2,116,33)); //Main Output - addSlot(new VEInsertSlot(h, 3,154, -14)); //Upgrade slot - } - - public void updateDirectionButton(int direction, int slotId){ this.screen.updateButtonDirection(direction,slotId); } - - @Override -public void updateStatusButton(boolean status, int slotId){ - this.screen.updateBooleanButton(status, slotId); - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/PrimitiveBlastFurnaceContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/PrimitiveBlastFurnaceContainer.java deleted file mode 100644 index 862507010..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/PrimitiveBlastFurnaceContainer.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.TileEntitySlots.PrimitiveBlastFurnaceSlots.PrimitiveBlastFurnaceInsertSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.TileEntitySlots.PrimitiveBlastFurnaceSlots.PrimitiveBlastFurnaceOutputSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.PRIMITIVE_BLAST_FURNACE_CONTAINER; - -public class PrimitiveBlastFurnaceContainer extends VEContainer { - - private static final int NUMBER_OF_SLOTS = 3; - - public PrimitiveBlastFurnaceContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(PRIMITIVE_BLAST_FURNACE_CONTAINER.get(), id,world,pos,inventory,player,VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new PrimitiveBlastFurnaceInsertSlot(h, 0, 53, 33, world)); - addSlot(new PrimitiveBlastFurnaceOutputSlot(h, 1,116,33)); - addSlot(new VEInsertSlot(h,2,154, -14)); - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/PrimitiveSolarPanelContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/PrimitiveSolarPanelContainer.java deleted file mode 100644 index 77d4c3626..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/PrimitiveSolarPanelContainer.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.PRIMITIVE_SOLAR_PANEL_CONTAINER; - -public class PrimitiveSolarPanelContainer extends VEContainer { - - public PrimitiveSolarPanelContainer(int windowID, Level world, BlockPos pos, Inventory playerInventory, Player player) { - super(PRIMITIVE_SOLAR_PANEL_CONTAINER.get(), windowID,world,pos,playerInventory,player,VEBlocks.PRIMITIVE_SOLAR_PANEL_BLOCK.get()); - } - - // We need an empty call here - @Override - protected void addSlotsToGUI(IItemHandler h) {} - - @Override - public @NotNull ItemStack quickMoveStack(@NotNull Player playerIn, int index) { - ItemStack itemstack = ItemStack.EMPTY; - Slot slot = this.slots.get(index); - if (slot != null && slot.hasItem()) { - ItemStack stack = slot.getItem(); - itemstack = stack.copy(); - if (index == 0) { - if (!this.moveItemStackTo(stack, 1, 37, true)) { - return ItemStack.EMPTY; - } - slot.onQuickCraft(stack, itemstack); - } else { - if (index < 28) { - if (!this.moveItemStackTo(stack, 28, 37, false)) { - return ItemStack.EMPTY; - } - } else if (index < 37 && !this.moveItemStackTo(stack, 1, 28, false)) { - return ItemStack.EMPTY; - } - } - - if (stack.isEmpty()) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - - if (stack.getCount() == itemstack.getCount()) { - return ItemStack.EMPTY; - } - - slot.onTake(playerIn, stack); - } - - return itemstack; - } - -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/PrimitiveStirlingGeneratorContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/PrimitiveStirlingGeneratorContainer.java deleted file mode 100644 index 00c1b3a44..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/PrimitiveStirlingGeneratorContainer.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.SlotItemHandler; -import org.jetbrains.annotations.NotNull; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.PRIMITIVE_STIRLING_GENERATOR_CONTAINER; - -public class PrimitiveStirlingGeneratorContainer extends VEContainer { - - public static final int NUMBER_OF_SLOTS = 1; - - public PrimitiveStirlingGeneratorContainer(int windowID, Level world, BlockPos pos, Inventory playerInventory, Player player) { - super(PRIMITIVE_STIRLING_GENERATOR_CONTAINER.get(), windowID,world,pos,playerInventory,player,VEBlocks.PRIMITIVE_STIRLING_GENERATOR_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new SlotItemHandler(h, 0, 80, 35)); - } - - @Override - public @NotNull ItemStack quickMoveStack(@NotNull Player player, int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogic(index, NUMBER_OF_SLOTS, slotStack) != null) return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - slot.onTake(player, slotStack); - } - return returnStack; - } - -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/PumpContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/PumpContainer.java deleted file mode 100644 index bab1a9efd..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/PumpContainer.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.PUMP_CONTAINER; - -public class PumpContainer extends VEContainer { - - private static final int NUMBER_OF_SLOTS = 2; - - public PumpContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(PUMP_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.PUMP_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEBucketSlot(h, 0, 70, 18)); // Pump bucket input slot - addSlot(new VEBucketSlot(h, 1, 70, 49)); // Pump bucket output slot - } - - @Nonnull - @Override - public @NotNull ItemStack quickMoveStack(final @NotNull Player player, final int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogic(index, NUMBER_OF_SLOTS, slotStack) != null) return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - slot.onTake(player, slotStack); - } - return returnStack; - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/SawmillContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/SawmillContainer.java deleted file mode 100644 index 0e6792b4f..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/SawmillContainer.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.SAWMILL_CONTAINER; - -public class SawmillContainer extends VEContainer { - - public static final int NUMBER_OF_SLOTS = 6; - - public SawmillContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(SAWMILL_CONTAINER.get(), id,world,pos,inventory,player,VEBlocks.SAWMILL_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEInsertSlot(h, 0, 44, 32)); // Log input slot - addSlot(new VEInsertSlot(h, 1, 80, 24)); // Plank Output - addSlot(new VEInsertSlot(h, 2, 80, 42)); // Secondary Output - addSlot(new VEBucketSlot(h, 3, 115, 18)); // Bucket Input - addSlot(new VEBucketSlot(h, 4, 115, 49)); // Bucket Output - addSlot(new VEInsertSlot(h, 5, 154, -14)); // Upgrade Slot - } - - @Nonnull - @Override - public @NotNull ItemStack quickMoveStack(final @NotNull Player player, final int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogicWithUpgradeSlot(index, NUMBER_OF_SLOTS, 5, slotStack) != null) - return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - - slot.onTake(player, slotStack); - } - return returnStack; - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/SolarPanelContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/SolarPanelContainer.java deleted file mode 100644 index 537bc51c8..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/SolarPanelContainer.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.SOLAR_PANEL_CONTAINER; - -public class SolarPanelContainer extends VEContainer { - - public SolarPanelContainer(int windowID, Level world, BlockPos pos, Inventory playerInventory, Player player) { - super(SOLAR_PANEL_CONTAINER.get(), windowID,world,pos,playerInventory,player,VEBlocks.SOLAR_PANEL_BLOCK.get()); - - - } - - // We need an empty slot add here - @Override - protected void addSlotsToGUI(IItemHandler h) { - - } - - @Override - public @NotNull ItemStack quickMoveStack(@NotNull Player playerIn, int index) { - ItemStack itemstack = ItemStack.EMPTY; - Slot slot = this.slots.get(index); - if (slot != null && slot.hasItem()) { - ItemStack stack = slot.getItem(); - itemstack = stack.copy(); - if (index == 0) { - if (!this.moveItemStackTo(stack, 1, 37, true)) { - return ItemStack.EMPTY; - } - slot.onQuickCraft(stack, itemstack); - } else { - if (index < 28) { - if (!this.moveItemStackTo(stack, 28, 37, false)) { - return ItemStack.EMPTY; - } - } else if (index < 37 && !this.moveItemStackTo(stack, 1, 28, false)) { - return ItemStack.EMPTY; - } - } - - if (stack.isEmpty()) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - - if (stack.getCount() == itemstack.getCount()) { - return ItemStack.EMPTY; - } - - slot.onTake(playerIn, stack); - } - - return itemstack; - } - -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/StirlingGeneratorContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/StirlingGeneratorContainer.java deleted file mode 100644 index 90da2ba8e..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/StirlingGeneratorContainer.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.TileEntitySlots.StirlingGeneratorInputSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; - -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.STIRLING_GENERATOR_CONTAINER; - -public class StirlingGeneratorContainer extends VEContainer { - - public static final int NUMBER_OF_SLOTS = 1; - - public StirlingGeneratorContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(STIRLING_GENERATOR_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.STIRLING_GENERATOR_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new StirlingGeneratorInputSlot(h, 0, 80, 35, world)); - } - - @Nonnull - @Override - public @NotNull ItemStack quickMoveStack(final @NotNull Player player, final int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogic(index, NUMBER_OF_SLOTS, slotStack) != null) return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - slot.onTake(player, slotStack); - } - return returnStack; - } - -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java index 83a82aeec..b412dc090 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java @@ -186,6 +186,8 @@ public ItemStack quickMoveStack(final @NotNull Player player, final int index) { ItemStack returnStack = ItemStack.EMPTY; final Slot slot = this.slots.get(index); + VoluminousEnergy.LOGGER.info("testing!"); + int numberOfSlots = this.tileEntity.getSlotManagers().size() + (this.tileEntity instanceof IVEPoweredTileEntity ? 1 : 0); // TODO why is this a dangling if? diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java new file mode 100644 index 000000000..f8ea0ebfd --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java @@ -0,0 +1,62 @@ +package com.veteam.voluminousenergy.blocks.containers; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Block; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.items.SlotItemHandler; +import net.minecraftforge.registries.RegistryObject; + +import java.util.ArrayList; +import java.util.List; + +public class VEContainerFactory { + + // private int numSlots = 0; // TODO this needs to be pulled from the client later:tm: + private RegistryObject> menuTypeRegistryObject; + private RegistryObject block; + private final List slots = new ArrayList<>(); + + public int numberOfSlots() { + return VEContainerFactory.this.slots.size(); + } + + public VEContainer create(int id, Level world, BlockPos pos, Inventory inventory, Player player) { + return new VEContainer(menuTypeRegistryObject.get(), id, world, pos, inventory, player, block.get()) { + @Override + protected void addSlotsToGUI(IItemHandler h) { + for (Slot slot : VEContainerFactory.this.slots) { + addSlot(new SlotItemHandler(h, slot.index, slot.x, slot.y)); + } + } + }; + } + + public static class VEContainerFactoryBuilder { + + private VEContainerFactory factory; + + public VEContainerFactoryBuilder create(RegistryObject> menuRegistry, RegistryObject blockRegistry) { + this.factory = new VEContainerFactory(); + this.factory.menuTypeRegistryObject = menuRegistry; + this.factory.block = blockRegistry; + return this; + } + + public VEContainerFactoryBuilder addSlot(int index, int x, int y) { + this.factory.slots.add(new Slot(index, x, y)); + return this; + } + + public VEContainerFactory build() { + return this.factory; + } + } + + private record Slot(int index, int x, int y) { + + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java new file mode 100644 index 000000000..f53be9306 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java @@ -0,0 +1,215 @@ +package com.veteam.voluminousenergy.blocks.containers; + +import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory.VEContainerFactoryBuilder; +import com.veteam.voluminousenergy.blocks.inventory.slots.TileEntitySlots.StirlingGeneratorInputSlot; +import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; +import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; +import net.minecraftforge.items.SlotItemHandler; + +import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.*; + +public class VEContainers { + + public static final VEContainerFactory AIR_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() + .create(AIR_COMPRESSOR_CONTAINER, AIR_COMPRESSOR_BLOCK) + .addSlot(0, 70, 18) // Air Compressor bucket input slot + .addSlot(1, 70, 49) // Air Compressor bucket output slot + .addSlot(2, 154, -14) // Upgrade Slot + .build(); + + public static final VEContainerFactory AQUEOULIZER_FACTORY = new VEContainerFactoryBuilder() + .create(AQUEOULIZER_CONTAINER, AQUEOULIZER_BLOCK) + .addSlot(0, 38, 18) // Bucket input; input tank + .addSlot(1, 38, 49) // Bucket output; input tank + .addSlot(2, 137, 18) // Bucket insert; output tank + .addSlot(3, 137, 49) // Bucket output; output tank + .addSlot(4, 96, 32) // Item to be dissolved + .addSlot(5, 130, -14) // Upgrade Slot + .build(); + + // TODO Decide if battery box can or should be converted. Put it here + + public static final VEContainerFactory BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() + .create(BLAST_FURNACE_CONTAINER, BLAST_FURNACE_BLOCK) + .addSlot(0, 38, 18) // Fluid input slot + .addSlot(1, 38, 49) // Extract fluid from heat tank + .addSlot(2, 80, 25) // First input slot + .addSlot(3, 80, 43) // Second input slot + .addSlot(4, 134, 34) // Third input slot + .addSlot(5, 130, -14) // Upgrade slot. + .build(); + + public static final VEContainerFactory CENTRIFUGAL_AGITATOR_FACTORY = new VEContainerFactoryBuilder() + .create(CENTRIFUGAL_AGITATOR_CONTAINER, CENTRIFUGAL_AGITATOR_BLOCK) + .addSlot(0, 38, 18) // Bucket insert; input tank + .addSlot(1, 38, 49) // Bucket extract; input tank + .addSlot(2, 96, 18) // Bucket insert; first output tank + .addSlot(3, 96, 49) // Bucket extract; first output tank + .addSlot(4, 137, 18) // Bucket insert; second output tank + .addSlot(5, 137, 49) // Bucket extract; second output tank + .addSlot(6, 130, -14) // Upgrade slot + .build(); + + public static final VEContainerFactory CENTRIFUGAL_SEPARATOR_FACTORY = new VEContainerFactoryBuilder() + .create(CENTRIFUGAL_SEPARATOR_CONTAINER, CENTRIFUGAL_SEPARATOR_BLOCK) + .addSlot(0, 53, 24) // Primary input slot + .addSlot(1, 53, 42) // Empty Bucket slot + .addSlot(2, 99, 33) //Main Output + .addSlot(3, 117, 15) //RNG #1 Slot + .addSlot(4, 135, 33) //RNG #2 Slot + .addSlot(5, 117, 51) //RNG #3 Slot + .addSlot(6, 155, -14) // Upgrade Slot + .build(); + + public static final VEContainerFactory COMBUSTION_GENERATOR_FACTORY = new VEContainerFactoryBuilder() + .create(COMBUSTION_GENERATOR_CONTAINER, COMBUSTION_GENERATOR_BLOCK) + .addSlot(0, 38, 18) // Oxidizer input slot + .addSlot(1, 38, 49) // Extract fluid from oxidizer slot + .addSlot(2, 138, 18) // Fuel input slot + .addSlot(3, 138, 49) // Extract fluid from fuel output + .build(); + + public static final VEContainerFactory COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() + .create(COMPRESSOR_CONTAINER, COMPRESSOR_BLOCK) + .addSlot(0, 80, 13) + .addSlot(1, 80, 58) //Main Output + .addSlot(2, 154, -14) //Upgrade slot + .build(); + + public static final VEContainerFactory CRUSHER_FACTORY = new VEContainerFactoryBuilder() + .create(CRUSHER_CONTAINER, CRUSHER_BLOCK) + .addSlot(0, 80, 13) + .addSlot(1, 80, 58) //Main Output + .addSlot(2, 154, -14) //Upgrade slot + .build(); + + public static final VEContainerFactory DIMENSIONAL_LASER_FACTORY = new VEContainerFactoryBuilder() + .create(DIMENSIONAL_LASER_CONTAINER, DIMENSIONAL_LASER_BLOCK) + .addSlot(0, 138, 18) // Bucket top slot + .addSlot(1, 138, 49) // Bucket bottom slot + .addSlot(2, 38, 33) // RFID chip slot + .addSlot(3, 130, -14) // Upgrade slot + .build(); + + public static final VEContainerFactory DISTILLATION_UNIT_FACTORY = new VEContainerFactoryBuilder() + .create(DISTILLATION_UNIT_CONTAINER, DISTILLATION_UNIT_BLOCK) + .addSlot(0, 38, 18) // Fluid input slot + .addSlot(1, 38, 49) // Extract fluid from input + .addSlot(2, 96, 11) // Top slot for first output + .addSlot(3, 96, 42) // Bottom slot for first output + .addSlot(4, 137, 11) // Top slot for from second output + .addSlot(5, 137, 42) // Bottom slot for second output + .addSlot(6, 122, 64) // Item Output Slot + .addSlot(7, 130, -14) // Upgrade slot + .build(); + + public static final VEContainerFactory ELECTRIC_FURNACE_FACTORY = new VEContainerFactoryBuilder() + .create(ELECTRIC_FURNACE_CONTAINER, ELECTRIC_FURNACE_BLOCK) + .addSlot(0, 53, 33) // Furnace Input Slot + .addSlot(1, 116, 33) // Furnace Output Slot + .addSlot(2, 154, -14)// Upgrade Slot + .build(); + + public static final VEContainerFactory ELECTROLYZER_FACTORY = new VEContainerFactoryBuilder() + .create(ELECTROLYZER_CONTAINER, ELECTROLYZER_BLOCK) + .addSlot(0, 71, 13) + .addSlot(1, 89, 13) // Empty Bucket slot + .addSlot(2, 53, 57) //Main Output + .addSlot(3, 71, 57) //RNG #1 Slot + .addSlot(4, 89, 57) //RNG #2 Slot + .addSlot(5, 107, 57) //RNG #3 Slot + .addSlot(6, 154, -14) // Upgrade Slot + .build(); + + public static final VEContainerFactory FLUID_ELECTROLYZER_FACTORY = new VEContainerFactoryBuilder() + .create(FLUID_ELECTROLYZER_CONTAINER, FLUID_ELECTROLYZER_BLOCK) + .addSlot(0, 38, 18) // Top input bucket + .addSlot(1, 38, 49) // Bottom input bucket + .addSlot(2, 96, 18) // Top output0 bucket + .addSlot(3, 96, 49) // Bottom output0 bucket + .addSlot(4, 137, 18) // Top output1 bucket + .addSlot(5, 137, 49) // Bottom output1 bucket + .addSlot(6, 130, -14) // Upgrade slot + .build(); + + public static final VEContainerFactory FLUID_MIXER_FACTORY = new VEContainerFactoryBuilder() + .create(FLUID_MIXER_CONTAINER, FLUID_MIXER_BLOCK) + .addSlot(0, 38, 18) // Top input0 bucket + .addSlot(1, 38, 49) // Bottom input0 bucket + .addSlot(2, 86, 18) // Top input1 bucket + .addSlot(3, 86, 49) // Bottom input1 bucket + .addSlot(4, 136, 18) // Top output0 bucket + .addSlot(5, 136, 49) // Bottom output0 bucket + .addSlot(6, 130, -14) // Upgrade slot + .build(); + + public static final VEContainerFactory GAS_FIRED_FURNACE_FACTORY = new VEContainerFactoryBuilder() + .create(GAS_FIRED_FURNACE_CONTAINER, GAS_FIRED_FURNACE_BLOCK) + .addSlot(0, 8, 18) // Fluid input slot + .addSlot(1, 8, 49) // Extract fluid from input + .addSlot(2, 53, 33) // Item input slot + .addSlot(3, 116, 33) // Item output slot + .addSlot(4, 154, -14) // Upgrade slot + .build(); + + public static final VEContainerFactory HYDROPONIC_INCUBATOR_FACTORY = new VEContainerFactoryBuilder() + .create(HYDROPONIC_INCUBATOR_CONTAINER, HYDROPONIC_INCUBATOR_BLOCK) + .addSlot(0, 38, 18) // Bucket top slot + .addSlot(1, 38, 49) // Bucket bottom slot + .addSlot(2, 83, 34) // Primary input + .addSlot(3, 123, 8) // Primary output + .addSlot(4, 123, 26) // RNG0 output + .addSlot(5, 123, 44) // RNG1 output + .addSlot(6, 123, 62) // RNG2 output + .addSlot(7, 154, -14) // Upgrade slot + .build(); + + public static final VEContainerFactory IMPLOSION_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() + .create(IMPLOSION_COMPRESSOR_CONTAINER, IMPLOSION_COMPRESSOR_BLOCK) + .addSlot(0, 53, 23) // Main input + .addSlot(1, 53, 41) // Gunpowder slot + .addSlot(2, 116, 33) //Main Output + .addSlot(3, 154, -14) //Upgrade slot + .build(); + + public static final VEContainerFactory PRIMITIVE_BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() + .create(PRIMITIVE_BLAST_FURNACE_CONTAINER, PRIMITIVE_BLAST_FURNACE_BLOCK) + .addSlot(0, 53, 33) + .addSlot(1, 116, 33) + .addSlot(2, 154, -14) + .build(); + + public static final VEContainerFactory PRIMITIVE_SOLAR_PANEL_FACTORY = new VEContainerFactoryBuilder() + .create(PRIMITIVE_SOLAR_PANEL_CONTAINER, PRIMITIVE_SOLAR_PANEL_BLOCK) + .build(); + + public static final VEContainerFactory PRIMITIVE_STIRLING_GENERATOR_FACTORY = new VEContainerFactoryBuilder() + .create(PRIMITIVE_STIRLING_GENERATOR_CONTAINER, PRIMITIVE_STIRLING_GENERATOR_BLOCK) + .addSlot(0, 80, 35) + .build(); + + public static final VEContainerFactory PUMP_FACTORY = new VEContainerFactoryBuilder() + .create(PUMP_CONTAINER, PUMP_BLOCK) + .addSlot(0, 70, 18) // Pump bucket input slot + .addSlot(1, 70, 49) // Pump bucket output slot + .build(); + + public static final VEContainerFactory SAWMILL_FACTORY = new VEContainerFactoryBuilder() + .create(SAWMILL_CONTAINER,SAWMILL_BLOCK) + .addSlot(0, 44, 32) // Log input slot + .addSlot(1, 80, 24) // Plank Output + .addSlot(2, 80, 42) // Secondary Output + .addSlot(3, 115, 18) // Bucket Input + .addSlot(4, 115, 49) // Bucket Output + .addSlot(5, 154, -14) // Upgrade Slot + .build(); + + public static final VEContainerFactory SOLAR_PANEL_FACTORY = new VEContainerFactoryBuilder() + .create(SOLAR_PANEL_CONTAINER,SOLAR_PANEL_BLOCK) + .build(); + + public static final VEContainerFactory STIRLING_GENERATOR_FACTORY = new VEContainerFactoryBuilder() + .create(STIRLING_GENERATOR_CONTAINER,STIRLING_GENERATOR_BLOCK) + .addSlot(0, 80, 35) + .build(); +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java index 94bd0b57f..da6064760 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java @@ -25,7 +25,7 @@ public TankContainer(int id, Level world, BlockPos pos, Inventory inventory, Pla } @Override - protected void addSlotsToGUI(IItemHandler h) { + public void addSlotsToGUI(IItemHandler h) { addSlot(new VEInsertSlot(h, 0, 70, 19)); // Bucket top slot addSlot(new VEInsertSlot(h, 1, 70, 50)); // Bucket bottom slot } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEInsertSlot.java b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEInsertSlot.java index 7699fbf08..5d53604b0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEInsertSlot.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEInsertSlot.java @@ -7,7 +7,7 @@ import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.SlotItemHandler; -public class VEInsertSlot extends SlotItemHandler { +public class VEInsertSlot extends SlotItemHandler { public VEInsertSlot(IItemHandler itemHandler, int index, int xPos, int yPos){ super(itemHandler, index, xPos, yPos); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java index 8cd29766a..345bd0dbe 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.AirCompressorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.AirCompressorTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; @@ -13,13 +13,13 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -public class AirCompressorScreen extends VEContainerScreen { +public class AirCompressorScreen extends VEContainerScreen { private AirCompressorTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/air_compressor_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public AirCompressorScreen(AirCompressorContainer screenContainer, Inventory inv, Component titleIn){ + public AirCompressorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (AirCompressorTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java index d3d85bc0a..006495f87 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.AqueoulizerContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.AqueoulizerTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; @@ -19,13 +19,13 @@ import java.util.Arrays; import java.util.List; -public class AqueoulizerScreen extends VEContainerScreen { +public class AqueoulizerScreen extends VEContainerScreen { private final AqueoulizerTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/aqueoulizer_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public AqueoulizerScreen(AqueoulizerContainer screenContainer, Inventory inv, Component titleIn) { + public AqueoulizerScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); tileEntity = (AqueoulizerTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java index c34a31368..444c2d8f3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.BlastFurnaceContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.BlastFurnaceTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; @@ -17,13 +17,13 @@ import java.util.Arrays; import java.util.List; -public class BlastFurnaceScreen extends VEContainerScreen { +public class BlastFurnaceScreen extends VEContainerScreen { private BlastFurnaceTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/blast_furnace_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); private static final ResourceLocation MULTIBLOCK_WARN = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/multiblock_invalid_warning.png"); - public BlastFurnaceScreen(BlastFurnaceContainer screenContainer, Inventory inv, Component titleIn){ + public BlastFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (BlastFurnaceTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java index 5d5590423..8df0e2be1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.CentrifugalAgitatorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.CentrifugalAgitatorTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; @@ -17,13 +17,13 @@ import java.util.Arrays; import java.util.List; -public class CentrifugalAgitatorScreen extends VEContainerScreen { +public class CentrifugalAgitatorScreen extends VEContainerScreen { private final CentrifugalAgitatorTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/centrifugal_agitator_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public CentrifugalAgitatorScreen(CentrifugalAgitatorContainer screenContainer, Inventory inv, Component titleIn){ + public CentrifugalAgitatorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (CentrifugalAgitatorTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java index a96715850..f907b577c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.CentrifugalSeparatorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.CentrifugalSeparatorTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; @@ -16,13 +16,13 @@ import java.util.Arrays; import java.util.List; -public class CentrifugalSeparatorScreen extends VEContainerScreen { +public class CentrifugalSeparatorScreen extends VEContainerScreen { private CentrifugalSeparatorTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/centrifugal_separator_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public CentrifugalSeparatorScreen(CentrifugalSeparatorContainer screenContainer, Inventory inv, Component titleIn){ + public CentrifugalSeparatorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (CentrifugalSeparatorTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java index ae25197ad..f44cb56dd 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.CombustionGeneratorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.CombustionGeneratorTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; @@ -18,13 +18,13 @@ import java.util.Arrays; import java.util.List; -public class CombustionGeneratorScreen extends VEContainerScreen { +public class CombustionGeneratorScreen extends VEContainerScreen { private CombustionGeneratorTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/combustion_generator_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public CombustionGeneratorScreen(CombustionGeneratorContainer screenContainer, Inventory inv, Component titleIn){ + public CombustionGeneratorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (CombustionGeneratorTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java index 85030cb7a..7faaec5a2 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.CompressorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.CompressorTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; @@ -16,14 +16,14 @@ import java.util.Arrays; import java.util.List; -public class CompressorScreen extends VEContainerScreen { +public class CompressorScreen extends VEContainerScreen { private CompressorTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/compressor_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public CompressorScreen(CompressorContainer screenContainer, Inventory inv, Component titleIn){ + public CompressorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (CompressorTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java index eca5b2522..8ce23349b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.CrusherContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.CrusherTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; @@ -16,13 +16,13 @@ import java.util.Arrays; import java.util.List; -public class CrusherScreen extends VEContainerScreen { +public class CrusherScreen extends VEContainerScreen { private final CrusherTile tileEntity; private final static ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/crushergui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public CrusherScreen(CrusherContainer screenContainer, Inventory inv, Component titleIn){ + public CrusherScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (CrusherTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java index a27ddaba1..74581c2d0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.DimensionalLaserContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.DimensionalLaserTile; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; @@ -23,14 +23,14 @@ import java.util.Arrays; import java.util.List; -public class DimensionalLaserScreen extends VEContainerScreen { +public class DimensionalLaserScreen extends VEContainerScreen { private final DimensionalLaserTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/dimensional_laser_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); private static final ResourceLocation MULTIBLOCK_WARN = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/multiblock_invalid_warning.png"); - public DimensionalLaserScreen(DimensionalLaserContainer screenContainer, Inventory inv, Component titleIn) { + public DimensionalLaserScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); tileEntity = (DimensionalLaserTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java index d0b956aa9..d5a3d5368 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.DistillationUnitContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.DistillationUnitTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; @@ -17,14 +17,14 @@ import java.util.Arrays; import java.util.List; -public class DistillationUnitScreen extends VEContainerScreen { +public class DistillationUnitScreen extends VEContainerScreen { private DistillationUnitTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/distillation_unit_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); private static final ResourceLocation MULTIBLOCK_WARN = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/multiblock_invalid_warning.png"); - public DistillationUnitScreen(DistillationUnitContainer screenContainer, Inventory inv, Component titleIn){ + public DistillationUnitScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (DistillationUnitTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java index 770ad92a0..b98ae6467 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.ElectricFurnaceContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.ElectricFurnaceTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; @@ -19,14 +19,14 @@ import java.util.Arrays; import java.util.List; -public class ElectricFurnaceScreen extends VEContainerScreen { +public class ElectricFurnaceScreen extends VEContainerScreen { private ElectricFurnaceTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/electric_furnace_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public ElectricFurnaceScreen(ElectricFurnaceContainer screenContainer, Inventory inv, Component titleIn){ + public ElectricFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (ElectricFurnaceTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java index dded3b35d..81d443716 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.ElectrolyzerContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.ElectrolyzerTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; @@ -16,13 +16,13 @@ import java.util.Arrays; import java.util.List; -public class ElectrolyzerScreen extends VEContainerScreen { +public class ElectrolyzerScreen extends VEContainerScreen { private ElectrolyzerTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/electrolyzer_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public ElectrolyzerScreen(ElectrolyzerContainer screenContainer, Inventory inv, Component titleIn){ + public ElectrolyzerScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (ElectrolyzerTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java index e66de062a..310e9910a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.FluidElectrolyzerContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.FluidElectrolyzerTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; @@ -17,13 +17,13 @@ import java.util.Arrays; import java.util.List; -public class FluidElectrolyzerScreen extends VEContainerScreen { +public class FluidElectrolyzerScreen extends VEContainerScreen { private final FluidElectrolyzerTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/fluid_electrolyzer_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public FluidElectrolyzerScreen(FluidElectrolyzerContainer screenContainer, Inventory inv, Component titleIn){ + public FluidElectrolyzerScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (FluidElectrolyzerTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java index 4a49f6d49..e400f60b2 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.FluidMixerContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.FluidMixerTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; @@ -18,13 +18,13 @@ import java.util.Arrays; import java.util.List; -public class FluidMixerScreen extends VEContainerScreen { +public class FluidMixerScreen extends VEContainerScreen { private final FluidMixerTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/fluid_mixer_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public FluidMixerScreen(FluidMixerContainer screenContainer, Inventory inv, Component titleIn){ + public FluidMixerScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (FluidMixerTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java index b89913152..3239e7544 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.GasFiredFurnaceContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.GasFiredFurnaceTile; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; @@ -16,13 +16,13 @@ import java.util.Arrays; import java.util.List; -public class GasFiredFurnaceScreen extends VEContainerScreen { +public class GasFiredFurnaceScreen extends VEContainerScreen { private GasFiredFurnaceTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID,"textures/gui/gas_fired_furnace_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public GasFiredFurnaceScreen(GasFiredFurnaceContainer screenContainer, Inventory inv, Component titleIn){ + public GasFiredFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (GasFiredFurnaceTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java index 8d1482561..1f730c5fa 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.HydroponicIncubatorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.HydroponicIncubatorTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; @@ -18,13 +18,13 @@ import java.util.Arrays; import java.util.List; -public class HydroponicIncubatorScreen extends VEContainerScreen { +public class HydroponicIncubatorScreen extends VEContainerScreen { private final HydroponicIncubatorTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/hydroponic_incubator_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public HydroponicIncubatorScreen(HydroponicIncubatorContainer screenContainer, Inventory inv, Component titleIn){ + public HydroponicIncubatorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (HydroponicIncubatorTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java index 5a1b5023d..1c0ed73a0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.ImplosionCompressorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.ImplosionCompressorTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; @@ -19,14 +19,14 @@ import java.util.Arrays; import java.util.List; -public class ImplosionCompressorScreen extends VEContainerScreen { +public class ImplosionCompressorScreen extends VEContainerScreen { private ImplosionCompressorTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/implosion_compressor_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public ImplosionCompressorScreen(ImplosionCompressorContainer screenContainer, Inventory inv, Component titleIn){ + public ImplosionCompressorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (ImplosionCompressorTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java index 7a82577b4..e76dde62f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.PrimitiveBlastFurnaceContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.PrimitiveBlastFurnaceTile; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotBoolButton; @@ -18,13 +18,13 @@ import java.util.Arrays; import java.util.List; -public class PrimitiveBlastFurnaceScreen extends VEContainerScreen { +public class PrimitiveBlastFurnaceScreen extends VEContainerScreen { private PrimitiveBlastFurnaceTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID,"textures/gui/primitiveblastgui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public PrimitiveBlastFurnaceScreen(PrimitiveBlastFurnaceContainer screenContainer, Inventory inv, Component titleIn) { + public PrimitiveBlastFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); tileEntity = (PrimitiveBlastFurnaceTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java index 26ff6555a..e8c604e95 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.PrimitiveSolarPanelContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.PrimitiveSolarPanelTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; @@ -14,12 +14,12 @@ import net.minecraft.world.entity.player.Inventory; import org.jetbrains.annotations.NotNull; -public class PrimitiveSolarPanelScreen extends VEContainerScreen { +public class PrimitiveSolarPanelScreen extends VEContainerScreen { private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/solar_panel_gui.png"); private final PrimitiveSolarPanelTile tileEntity; - public PrimitiveSolarPanelScreen(PrimitiveSolarPanelContainer container, Inventory inv, Component name) { + public PrimitiveSolarPanelScreen(VEContainer container, Inventory inv, Component name) { super(container, inv, name); tileEntity = (PrimitiveSolarPanelTile) container.getTileEntity(); container.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java index 19bafe7f8..4b150ed61 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.PrimitiveStirlingGeneratorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.PrimitiveStirlingGeneratorTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; @@ -20,14 +20,14 @@ import java.util.Arrays; import java.util.List; -public class PrimitiveStirlingGeneratorScreen extends VEContainerScreen { +public class PrimitiveStirlingGeneratorScreen extends VEContainerScreen { private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/primitivestirlinggenerator_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); private PrimitiveStirlingGeneratorTile tileEntity; - public PrimitiveStirlingGeneratorScreen(PrimitiveStirlingGeneratorContainer container, Inventory inv, Component name) { + public PrimitiveStirlingGeneratorScreen(VEContainer container, Inventory inv, Component name) { super(container, inv, name); tileEntity = (PrimitiveStirlingGeneratorTile) container.getTileEntity(); container.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java index 160aefd37..5af8302db 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.PumpContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.PumpTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; @@ -17,13 +17,13 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -public class PumpScreen extends VEContainerScreen { +public class PumpScreen extends VEContainerScreen { private PumpTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/air_compressor_gui.png"); - public PumpScreen(PumpContainer screenContainer, Inventory inv, Component titleIn){ + public PumpScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (PumpTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java index a0348423a..cd44dcef7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.SawmillContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.SawmillTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; @@ -17,13 +17,13 @@ import java.util.Arrays; import java.util.List; -public class SawmillScreen extends VEContainerScreen { +public class SawmillScreen extends VEContainerScreen { private SawmillTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/sawmill_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public SawmillScreen(SawmillContainer screenContainer, Inventory inv, Component titleIn){ + public SawmillScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (SawmillTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java index efaecad25..02fffae90 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.SolarPanelContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.SolarPanelTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; @@ -14,12 +14,12 @@ import net.minecraft.world.entity.player.Inventory; import org.jetbrains.annotations.NotNull; -public class SolarPanelScreen extends VEContainerScreen { +public class SolarPanelScreen extends VEContainerScreen { private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/solar_panel_gui.png"); private final SolarPanelTile tileEntity; - public SolarPanelScreen(SolarPanelContainer container, Inventory inv, Component name) { + public SolarPanelScreen(VEContainer container, Inventory inv, Component name) { super(container, inv, name); tileEntity = (SolarPanelTile) container.getTileEntity(); container.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java index 049237634..87bdad9de 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.StirlingGeneratorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.StirlingGeneratorTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; @@ -20,13 +20,13 @@ import java.util.Arrays; import java.util.List; -public class StirlingGeneratorScreen extends VEContainerScreen { +public class StirlingGeneratorScreen extends VEContainerScreen { private final StirlingGeneratorTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/stirling_generator.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public StirlingGeneratorScreen(StirlingGeneratorContainer screenContainer, Inventory inv, Component titleIn) { + public StirlingGeneratorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); tileEntity = (StirlingGeneratorTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java index 84999c4fe..7b3ea6d14 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java @@ -1,8 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.AirCompressorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.fluids.VEFluids; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; @@ -130,7 +129,7 @@ public boolean addAirToTank(int multiplier) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new AirCompressorContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.AIR_COMPRESSOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } public FluidStack getAirTankFluid() { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java index 41295938c..585fde3d4 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.AqueoulizerContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.AqueoulizerRecipe; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -57,7 +57,7 @@ public void tick() { @Nonnull @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new AqueoulizerContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.AQUEOULIZER_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java index 19e70b463..6d247bd33 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.BlastFurnaceContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.IndustrialBlastingRecipe; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -77,7 +77,7 @@ public void tick() { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new BlastFurnaceContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.BLAST_FURNACE_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } public FluidStack getFluidStackFromTank(int num) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java index f05b60c0d..b98cb64e3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.CentrifugalAgitatorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.CentrifugalAgitatorRecipe; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -69,7 +69,7 @@ public List getSlotManagers() { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new CentrifugalAgitatorContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.CENTRIFUGAL_AGITATOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java index 8e0207678..9f4f6685e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.CentrifugalSeparatorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.CentrifugalSeparatorRecipe; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -39,7 +39,7 @@ public CentrifugalSeparatorTile(BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new CentrifugalSeparatorContainer(i,level,worldPosition,playerInventory,playerEntity); + return VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java index 97b845102..493cfa42f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.CombustionGeneratorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorOxidizerRecipe; import com.veteam.voluminousenergy.recipe.RecipeCache; @@ -211,7 +211,7 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new CombustionGeneratorContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.COMBUSTION_GENERATOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java index 8d8020868..af23d7245 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.CompressorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.CompressorRecipe; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -44,7 +44,7 @@ public CompressorTile(BlockEntityType type, BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new CompressorContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.COMPRESSOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java index 89eaafeb1..dafdaaecd 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java @@ -1,9 +1,8 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.CrusherContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.CrusherRecipe; -import com.veteam.voluminousenergy.recipe.RecipeCache; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -106,7 +105,7 @@ protected void onContentsChanged(final int slot) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new CrusherContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.CRUSHER_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java index e53b82daf..61310ef9e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.achievements.triggers.VECriteriaTriggers; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.DimensionalLaserContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.items.tools.RFIDChip; import com.veteam.voluminousenergy.persistence.ChunkFluid; @@ -226,7 +226,7 @@ public List getRelationalTanks() { @Nullable @Override public AbstractContainerMenu createMenu(int id, @Nonnull Inventory playerInventory, @Nonnull Player player) { - return new DimensionalLaserContainer(id, level, worldPosition, playerInventory, player); + return VEContainers.DIMENSIONAL_LASER_FACTORY.create(id, level, worldPosition, playerInventory, player); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java index a0fd4770c..afbe74e7f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java @@ -1,10 +1,8 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.DistillationUnitContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.DistillationRecipe; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.RelationalTank; @@ -15,11 +13,7 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.BucketItem; -import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Fluid; -import net.minecraft.world.level.material.Fluids; import net.minecraftforge.fluids.capability.templates.FluidTank; import net.minecraftforge.items.ItemStackHandler; import org.jetbrains.annotations.NotNull; @@ -77,7 +71,7 @@ public List getSlotManagers() { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new DistillationUnitContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.DISTILLATION_UNIT_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java index 610ab0ead..1f79099b3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java @@ -1,9 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.ElectricFurnaceContainer; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; -import com.veteam.voluminousenergy.recipe.RecipeCache; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -225,7 +223,7 @@ private void generateXP(int craftedAmount, float experience) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new ElectricFurnaceContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.ELECTRIC_FURNACE_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.java index f7030ad9a..9becfae56 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.ElectrolyzerContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.ElectrolyzerRecipe; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -40,7 +40,7 @@ public ElectrolyzerTile(BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new ElectrolyzerContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.ELECTROLYZER_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java index c77698ca3..9bd508ed7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.FluidElectrolyzerContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.FluidElectrolyzerRecipe; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -68,7 +68,7 @@ public List getSlotManagers() { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new FluidElectrolyzerContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.FLUID_ELECTROLYZER_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java index ddc7d9da9..d8c5a1bef 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.FluidMixerContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.FluidMixerRecipe; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -64,7 +64,7 @@ public List getSlotManagers() { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new FluidMixerContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.FLUID_MIXER_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java index f53534140..e8d933d0c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java @@ -1,8 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.GasFiredFurnaceContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; import com.veteam.voluminousenergy.recipe.RecipeCache; @@ -282,7 +281,7 @@ private void generateXP(int craftedAmount, float experience) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new GasFiredFurnaceContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.GAS_FIRED_FURNACE_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } public int progressFuelCounterPX(int px) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java index e220c3e4e..dd923e4c8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.HydroponicIncubatorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.HydroponicIncubatorRecipe; import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; import com.veteam.voluminousenergy.recipe.VEFluidRecipe; @@ -19,7 +19,6 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.templates.FluidTank; @@ -83,7 +82,7 @@ public HydroponicIncubatorTile(BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new HydroponicIncubatorContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.HYDROPONIC_INCUBATOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } public FluidStack getFluidStackFromTank(int num) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java index dc49d24af..2419bf6b4 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.ImplosionCompressorContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.ImplosionCompressorRecipe; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -44,7 +44,7 @@ public ImplosionCompressorTile(BlockPos pos, BlockState state) { @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new ImplosionCompressorContainer(i,level,worldPosition,playerInventory,playerEntity); + return VEContainers.IMPLOSION_COMPRESSOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java index ce3cee6a7..f2085b38b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.PrimitiveBlastFurnaceContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.PrimitiveBlastFurnaceRecipe; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -52,7 +52,7 @@ public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new PrimitiveBlastFurnaceContainer(i,level,worldPosition,playerInventory,playerEntity); + return VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java index e6d3b508a..cf207007d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.PrimitiveSolarPanelContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.tools.Config; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.player.Inventory; @@ -22,7 +22,7 @@ public PrimitiveSolarPanelTile(BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player playerEntity){ - return new PrimitiveSolarPanelContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } public int getGeneration(){ diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java index cfd2f5a40..0188a2076 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java @@ -2,8 +2,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.PrimitiveStirlingGeneratorContainer; -import com.veteam.voluminousenergy.recipe.RecipeCache; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.StirlingGeneratorRecipe; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; @@ -128,7 +127,7 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate @Nullable @Override public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player playerEntity) { - return new PrimitiveStirlingGeneratorContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Nonnull diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java index 206d2368d..cf095c633 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.PumpContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -17,7 +17,6 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Fluid; @@ -221,7 +220,7 @@ public LazyOptional getCapability(@Nonnull Capability cap, @Nullable D @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new PumpContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.PUMP_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java index 3d1ce1b9f..aac50edad 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.SawmillContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.VEFluidSawmillRecipe; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; @@ -250,7 +250,7 @@ private void coreTickProcessing(@Nullable VEFluidSawmillRecipe VEFluidSawmillRec @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new SawmillContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.SAWMILL_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } public FluidStack getFluidStackFromTank(int num){ diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java index 4e2c53ca1..5393dbdef 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.SolarPanelContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.tools.Config; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.player.Inventory; @@ -22,7 +22,7 @@ public SolarPanelTile(BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player playerEntity){ - return new SolarPanelContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.SOLAR_PANEL_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } public int getGeneration(){ diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java index 852beaa58..24046a939 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java @@ -1,9 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.StirlingGeneratorContainer; -import com.veteam.voluminousenergy.recipe.RecipeCache; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.StirlingGeneratorRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.sounds.VESounds; @@ -163,7 +161,7 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new StirlingGeneratorContainer(i, level, worldPosition, playerInventory, playerEntity); + return VEContainers.STIRLING_GENERATOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactoryBuilder.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactoryBuilder.java new file mode 100644 index 000000000..d4161b7c5 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactoryBuilder.java @@ -0,0 +1,44 @@ +package com.veteam.voluminousenergy.blocks.tiles; + +import com.veteam.voluminousenergy.util.RegistryLookups; +import net.minecraft.core.BlockPos; +import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.MenuProvider; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import org.apache.commons.lang3.NotImplementedException; +import org.jetbrains.annotations.Nullable; + +import javax.annotation.Nonnull; + +public class VETileFactoryBuilder { + + + + + public static class VETileEntity extends BlockEntity implements MenuProvider { + + public VETileEntity(BlockEntityType entityType, BlockPos blockPos, BlockState blockState) { + super(entityType, blockPos, blockState); + } + + @Override + public @Nonnull Component getDisplayName() { + ResourceLocation name = RegistryLookups.getBlockEntityTypeKey(this); + if (name == null) + throw new NotImplementedException("Missing registry name for class: " + this.getClass().getName()); + return Component.nullToEmpty(name.getPath()); + } + @Nullable + @Override + public AbstractContainerMenu createMenu(int i, Inventory inventory, Player player) { + return null; + } + } + +} diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java index 077ecae2b..f55775841 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java @@ -182,18 +182,18 @@ public void registerGuiHandlers(IGuiHandlerRegistration registration) { @Override public void registerRecipeTransferHandlers(IRecipeTransferRegistration registration) { - registration.addRecipeTransferHandler(CrusherContainer.class, VEBlocks.CRUSHER_CONTAINER.get(), CrushingCategory.RECIPE_TYPE, 0, 1, CrusherContainer.NUMBER_OF_SLOTS, 36); - registration.addRecipeTransferHandler(ElectrolyzerContainer.class, VEBlocks.ELECTROLYZER_CONTAINER.get(), ElectrolyzingCategory.RECIPE_TYPE, 0, 2, ElectrolyzerContainer.NUMBER_OF_SLOTS, 36); - registration.addRecipeTransferHandler(CompressorContainer.class, VEBlocks.COMPRESSOR_CONTAINER.get(), CompressingCategory.RECIPE_TYPE, 0, 1, CompressorContainer.NUMBER_OF_SLOTS, 36); - registration.addRecipeTransferHandler(PrimitiveStirlingGeneratorContainer.class, VEBlocks.PRIMITIVE_STIRLING_GENERATOR_CONTAINER.get(), StirlingCategory.RECIPE_TYPE, 0, 1, PrimitiveStirlingGeneratorContainer.NUMBER_OF_SLOTS, 36); - registration.addRecipeTransferHandler(StirlingGeneratorContainer.class, VEBlocks.STIRLING_GENERATOR_CONTAINER.get(), StirlingCategory.RECIPE_TYPE, 0, 1, StirlingGeneratorContainer.NUMBER_OF_SLOTS, 36); - registration.addRecipeTransferHandler(AqueoulizerContainer.class, VEBlocks.AQUEOULIZER_CONTAINER.get(), AqueoulizingCategory.RECIPE_TYPE, 3, 2, AqueoulizerContainer.NUMBER_OF_SLOTS, 36); - registration.addRecipeTransferHandler(CentrifugalSeparatorContainer.class, VEBlocks.CENTRIFUGAL_SEPARATOR_CONTAINER.get(), CentrifugalSeparationCategory.RECIPE_TYPE, 0, 2, CentrifugalSeparatorContainer.NUMBER_OF_SLOTS, 36); - registration.addRecipeTransferHandler(ImplosionCompressorContainer.class, VEBlocks.IMPLOSION_COMPRESSOR_CONTAINER.get(), ImplosionCompressionCategory.RECIPE_TYPE, 0, 2, ImplosionCompressorContainer.NUMBER_OF_SLOTS, 36); - registration.addRecipeTransferHandler(BlastFurnaceContainer.class, VEBlocks.BLAST_FURNACE_CONTAINER.get(), IndustrialBlastingCategory.RECIPE_TYPE, 2, 3, BlastFurnaceContainer.NUMBER_OF_SLOTS, 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.CRUSHER_CONTAINER.get(), CrushingCategory.RECIPE_TYPE, 0, 1, VEContainers.CRUSHER_FACTORY.numberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.ELECTROLYZER_CONTAINER.get(), ElectrolyzingCategory.RECIPE_TYPE, 0, 2, VEContainers.ELECTROLYZER_FACTORY.numberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.COMPRESSOR_CONTAINER.get(), CompressingCategory.RECIPE_TYPE, 0, 1, VEContainers.COMPRESSOR_FACTORY.numberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.PRIMITIVE_STIRLING_GENERATOR_CONTAINER.get(), StirlingCategory.RECIPE_TYPE, 0, 1, VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY.numberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.STIRLING_GENERATOR_CONTAINER.get(), StirlingCategory.RECIPE_TYPE, 0, 1, VEContainers.STIRLING_GENERATOR_FACTORY.numberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.AQUEOULIZER_CONTAINER.get(), AqueoulizingCategory.RECIPE_TYPE, 3, 2, VEContainers.AQUEOULIZER_FACTORY.numberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.CENTRIFUGAL_SEPARATOR_CONTAINER.get(), CentrifugalSeparationCategory.RECIPE_TYPE, 0, 2, VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY.numberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.IMPLOSION_COMPRESSOR_CONTAINER.get(), ImplosionCompressionCategory.RECIPE_TYPE, 0, 2, VEContainers.IMPLOSION_COMPRESSOR_FACTORY.numberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.BLAST_FURNACE_CONTAINER.get(), IndustrialBlastingCategory.RECIPE_TYPE, 2, 3, VEContainers.BLAST_FURNACE_FACTORY.numberOfSlots(), 36); registration.addRecipeTransferHandler(ToolingStationContainer.class, VEBlocks.TOOLING_STATION_CONTAINER.get(), ToolingCategory.RECIPE_TYPE, 3, 2, ToolingStationContainer.NUMBER_OF_SLOTS, 36); - registration.addRecipeTransferHandler(SawmillContainer.class, VEBlocks.SAWMILL_CONTAINER.get(), SawmillCategory.RECIPE_TYPE, 0, 3, SawmillContainer.NUMBER_OF_SLOTS, 36); - registration.addRecipeTransferHandler(PrimitiveBlastFurnaceContainer.class, VEBlocks.PRIMITIVE_BLAST_FURNACE_CONTAINER.get(), PrimitiveBlastingCategory.RECIPE_TYPE, 0, 2, 3, 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.SAWMILL_CONTAINER.get(), SawmillCategory.RECIPE_TYPE, 0, 3, VEContainers.SAWMILL_FACTORY.numberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.PRIMITIVE_BLAST_FURNACE_CONTAINER.get(), PrimitiveBlastingCategory.RECIPE_TYPE, 0, 2, VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY.numberOfSlots(), 36); // TODO: Transfer helper for the Fluid Electrolyzer // TODO: Fluid Mixer // TODO: Hydroponic Incubator From 259956d0e330c674e65afcc7b905e0620ed480ad Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Mon, 12 Feb 2024 00:43:32 -0500 Subject: [PATCH 02/27] Updated BatteryBox container --- .../blocks/blocks/VEBlocks.java | 10 +-- .../containers/BatteryBoxContainer.java | 77 ------------------- .../blocks/containers/VEContainer.java | 8 ++ .../blocks/containers/VEContainers.java | 36 +++++++-- .../blocks/screens/BatteryBoxScreen.java | 6 +- .../blocks/tiles/BatteryBoxTile.java | 9 +-- .../packets/BatteryBoxSendOutPowerPacket.java | 4 +- .../packets/BatteryBoxSlotPairPacket.java | 4 +- 8 files changed, 52 insertions(+), 102 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/BatteryBoxContainer.java diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java index 5752e6792..3d5d86ae4 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java @@ -187,13 +187,13 @@ public class VEBlocks { })); // Battery Box - public static RegistryObject BATTERY_BOX_BLOCK = VE_BLOCKS_REGISTRY.register("battery_box", BatteryBoxBlock::new); + public static RegistryObject BATTERY_BOX_BLOCK = VE_BLOCKS_REGISTRY.register("battery_box", BatteryBoxBlock::new); public static RegistryObject> BATTERY_BOX_TILE = VE_TILE_REGISTRY.register("battery_box", () -> BlockEntityType.Builder.of(BatteryBoxTile::new,VEBlocks.BATTERY_BOX_BLOCK.get()).build(null)); - public static RegistryObject> BATTERY_BOX_CONTAINER = VE_CONTAINER_REGISTRY.register("battery_box", () -> + public static RegistryObject> BATTERY_BOX_CONTAINER = VE_CONTAINER_REGISTRY.register("battery_box", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new BatteryBoxContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.BATTERY_BOX_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Primitive Solar Panel @@ -247,10 +247,10 @@ public class VEBlocks { })); // Tooling Station - public static RegistryObject TOOLING_STATION_BLOCK = VE_BLOCKS_REGISTRY.register("tooling_station", ToolingStationBlock::new); + public static RegistryObject TOOLING_STATION_BLOCK = VE_BLOCKS_REGISTRY.register("tooling_station", ToolingStationBlock::new); public static RegistryObject> TOOLING_STATION_TILE = VE_TILE_REGISTRY.register("tooling_station", () -> BlockEntityType.Builder.of(ToolingStationTile::new,VEBlocks.TOOLING_STATION_BLOCK.get()).build(null)); - public static RegistryObject> TOOLING_STATION_CONTAINER = VE_CONTAINER_REGISTRY.register("tooling_station", () -> + public static RegistryObject> TOOLING_STATION_CONTAINER = VE_CONTAINER_REGISTRY.register("tooling_station", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); return new ToolingStationContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/BatteryBoxContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/BatteryBoxContainer.java deleted file mode 100644 index 37d2452a5..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/BatteryBoxContainer.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import com.veteam.voluminousenergy.blocks.screens.BatteryBoxScreen; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; - -public class BatteryBoxContainer extends VEContainer { - - private static final int NUMBER_OF_SLOTS = 12; - - public BatteryBoxContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(VEBlocks.BATTERY_BOX_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.BATTERY_BOX_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEInsertSlot(h, 0, 35,17)); - addSlot(new VEInsertSlot(h, 1,53,17)); - addSlot(new VEInsertSlot(h,2,71, 17)); - addSlot(new VEInsertSlot(h,3,89, 17)); - addSlot(new VEInsertSlot(h,4,107, 17)); - addSlot(new VEInsertSlot(h,5,125, 17)); - - //Bottom Slots - addSlot(new VEInsertSlot(h,6,35, 54)); - addSlot(new VEInsertSlot(h, 7,53,54)); - addSlot(new VEInsertSlot(h,8,71, 54)); - addSlot(new VEInsertSlot(h,9,89, 54)); - addSlot(new VEInsertSlot(h,10,107, 54)); - addSlot(new VEInsertSlot(h,11,125, 54)); - } - - @Nonnull - @Override - public @NotNull ItemStack quickMoveStack(final @NotNull Player player, final int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogic(index, NUMBER_OF_SLOTS, slotStack) != null) return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - - slot.onTake(player, slotStack); - } - return returnStack; - } - - public void updateSendOutPowerButton(boolean status){ - if(this.screen instanceof BatteryBoxScreen batteryBoxScreen) { - batteryBoxScreen.updateSendOutPowerButton(status); - } - } - - -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java index b412dc090..f073e6bfc 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java @@ -1,6 +1,7 @@ package com.veteam.voluminousenergy.blocks.containers; import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.screens.BatteryBoxScreen; import com.veteam.voluminousenergy.blocks.screens.VEContainerScreen; import com.veteam.voluminousenergy.blocks.tiles.IVEPoweredTileEntity; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; @@ -119,6 +120,13 @@ public int powerScreen(int px){ return (((stored*100/max*100)/100)*px)/100; } + // For the battery box. Might remove later + public void updateSendOutPowerButton(boolean status){ + if(this.screen instanceof BatteryBoxScreen batteryBoxScreen) { + batteryBoxScreen.updateSendOutPowerButton(status); + } + } + public ItemStack handleCoreQuickMoveStackLogicWithUpgradeSlot(final int index, final int containerSlots, final int upgradeSlotId, ItemStack slotStack){ if (index < containerSlots) { // Container --> Inventory if (!moveItemStackTo(slotStack, containerSlots, this.slots.size(), true)) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java index f53be9306..9338c21f6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java @@ -1,10 +1,8 @@ package com.veteam.voluminousenergy.blocks.containers; import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory.VEContainerFactoryBuilder; -import com.veteam.voluminousenergy.blocks.inventory.slots.TileEntitySlots.StirlingGeneratorInputSlot; import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraftforge.items.SlotItemHandler; import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.*; @@ -27,7 +25,22 @@ public class VEContainers { .addSlot(5, 130, -14) // Upgrade Slot .build(); - // TODO Decide if battery box can or should be converted. Put it here + public static final VEContainerFactory BATTERY_BOX_FACTORY = new VEContainerFactoryBuilder() + .create(BATTERY_BOX_CONTAINER, BATTERY_BOX_BLOCK) + .addSlot(0, 35, 17) + .addSlot(1, 53, 17) + .addSlot(2, 71, 17) + .addSlot(3, 89, 17) + .addSlot(4, 107, 17) + .addSlot(5, 125, 17) + //Bottom Slots + .addSlot(6, 35, 54) + .addSlot(7, 53, 54) + .addSlot(8, 71, 54) + .addSlot(9, 89, 54) + .addSlot(10, 107, 54) + .addSlot(11, 125, 54) + .build(); public static final VEContainerFactory BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(BLAST_FURNACE_CONTAINER, BLAST_FURNACE_BLOCK) @@ -195,7 +208,7 @@ public class VEContainers { .build(); public static final VEContainerFactory SAWMILL_FACTORY = new VEContainerFactoryBuilder() - .create(SAWMILL_CONTAINER,SAWMILL_BLOCK) + .create(SAWMILL_CONTAINER, SAWMILL_BLOCK) .addSlot(0, 44, 32) // Log input slot .addSlot(1, 80, 24) // Plank Output .addSlot(2, 80, 42) // Secondary Output @@ -205,11 +218,22 @@ public class VEContainers { .build(); public static final VEContainerFactory SOLAR_PANEL_FACTORY = new VEContainerFactoryBuilder() - .create(SOLAR_PANEL_CONTAINER,SOLAR_PANEL_BLOCK) + .create(SOLAR_PANEL_CONTAINER, SOLAR_PANEL_BLOCK) .build(); public static final VEContainerFactory STIRLING_GENERATOR_FACTORY = new VEContainerFactoryBuilder() - .create(STIRLING_GENERATOR_CONTAINER,STIRLING_GENERATOR_BLOCK) + .create(STIRLING_GENERATOR_CONTAINER, STIRLING_GENERATOR_BLOCK) .addSlot(0, 80, 35) .build(); + + // TOOLING STATION UNUSED + public static final VEContainerFactory TOOLING_STATION_FACTORY = new VEContainerFactoryBuilder() + .create(TOOLING_STATION_CONTAINER,TOOLING_STATION_BLOCK) + .addSlot(0, 38, 18) // Fluid input slot + .addSlot(1, 38, 49) // Extract fluid from input + .addSlot(2, 86, 32) // Main Tool slot + .addSlot(3, 134, 18) // Bit Slot + .addSlot(4, 134,49) // Base Slot + .addSlot(5,154, -14) // Upgrade Slot + .build(); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java index 5093a2a46..00df94d20 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.BatteryBoxContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.buttons.VEPowerIOManager; @@ -20,14 +20,14 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -public class BatteryBoxScreen extends VEContainerScreen { +public class BatteryBoxScreen extends VEContainerScreen { private final BatteryBoxTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/battery_box_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public BatteryBoxScreen(BatteryBoxContainer screenContainer, Inventory inv, Component titleIn){ + public BatteryBoxScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (BatteryBoxTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java index e442c3325..654f42604 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.BatteryBoxContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.items.batteries.VEEnergyItem; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.buttons.VEPowerIOManager; @@ -16,14 +16,9 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.ItemStackHandler; -import net.minecraftforge.items.wrapper.RangedWrapper; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -298,7 +293,7 @@ public void saveAdditional(@NotNull CompoundTag tag) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new BatteryBoxContainer(i,level,worldPosition,playerInventory,playerEntity); + return VEContainers.BATTERY_BOX_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java index 8741cf29d..37c855e37 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.tools.networking.packets; -import com.veteam.voluminousenergy.blocks.containers.BatteryBoxContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; @@ -47,7 +47,7 @@ public static void handle(BatteryBoxSendOutPowerPacket packet, CustomPayloadEven public static void handlePacket(BatteryBoxSendOutPowerPacket packet, AbstractContainerMenu openContainer, boolean onServer){ if(openContainer != null){ - if(openContainer instanceof BatteryBoxContainer batteryBoxContainer){ + if(openContainer instanceof VEContainer batteryBoxContainer){ if(onServer){ BlockEntity tileEntity = batteryBoxContainer.getTileEntity(); if(tileEntity instanceof BatteryBoxTile batteryBoxTile){ diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java index e0d3b0136..9218eb628 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.tools.networking.packets; -import com.veteam.voluminousenergy.blocks.containers.BatteryBoxContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; @@ -51,7 +51,7 @@ public static void handle(BatteryBoxSlotPairPacket packet, CustomPayloadEvent.Co public static void handlePacket(BatteryBoxSlotPairPacket packet, AbstractContainerMenu openContainer, boolean onServer) { if (openContainer != null) { - if (openContainer instanceof BatteryBoxContainer batteryBoxContainer) { + if (openContainer instanceof VEContainer batteryBoxContainer) { if (onServer) { BlockEntity tileEntity = batteryBoxContainer.getTileEntity(); if (tileEntity instanceof BatteryBoxTile batteryBoxTile) { From e4e274508a57d00de0ad31b471a8e5f3a002e834 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Mon, 12 Feb 2024 00:43:32 -0500 Subject: [PATCH 03/27] Updated BatteryBox container --- .../blocks/blocks/VEBlocks.java | 10 +-- .../containers/BatteryBoxContainer.java | 77 ------------------- .../blocks/containers/VEContainer.java | 8 ++ .../blocks/containers/VEContainers.java | 36 +++++++-- .../blocks/screens/BatteryBoxScreen.java | 6 +- .../blocks/screens/ToolingStationScreen.java | 6 +- .../blocks/tiles/BatteryBoxTile.java | 9 +-- .../packets/BatteryBoxSendOutPowerPacket.java | 4 +- .../packets/BatteryBoxSlotPairPacket.java | 4 +- 9 files changed, 55 insertions(+), 105 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/BatteryBoxContainer.java diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java index 5752e6792..3d5d86ae4 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java @@ -187,13 +187,13 @@ public class VEBlocks { })); // Battery Box - public static RegistryObject BATTERY_BOX_BLOCK = VE_BLOCKS_REGISTRY.register("battery_box", BatteryBoxBlock::new); + public static RegistryObject BATTERY_BOX_BLOCK = VE_BLOCKS_REGISTRY.register("battery_box", BatteryBoxBlock::new); public static RegistryObject> BATTERY_BOX_TILE = VE_TILE_REGISTRY.register("battery_box", () -> BlockEntityType.Builder.of(BatteryBoxTile::new,VEBlocks.BATTERY_BOX_BLOCK.get()).build(null)); - public static RegistryObject> BATTERY_BOX_CONTAINER = VE_CONTAINER_REGISTRY.register("battery_box", () -> + public static RegistryObject> BATTERY_BOX_CONTAINER = VE_CONTAINER_REGISTRY.register("battery_box", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); - return new BatteryBoxContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + return VEContainers.BATTERY_BOX_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); // Primitive Solar Panel @@ -247,10 +247,10 @@ public class VEBlocks { })); // Tooling Station - public static RegistryObject TOOLING_STATION_BLOCK = VE_BLOCKS_REGISTRY.register("tooling_station", ToolingStationBlock::new); + public static RegistryObject TOOLING_STATION_BLOCK = VE_BLOCKS_REGISTRY.register("tooling_station", ToolingStationBlock::new); public static RegistryObject> TOOLING_STATION_TILE = VE_TILE_REGISTRY.register("tooling_station", () -> BlockEntityType.Builder.of(ToolingStationTile::new,VEBlocks.TOOLING_STATION_BLOCK.get()).build(null)); - public static RegistryObject> TOOLING_STATION_CONTAINER = VE_CONTAINER_REGISTRY.register("tooling_station", () -> + public static RegistryObject> TOOLING_STATION_CONTAINER = VE_CONTAINER_REGISTRY.register("tooling_station", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); return new ToolingStationContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/BatteryBoxContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/BatteryBoxContainer.java deleted file mode 100644 index 37d2452a5..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/BatteryBoxContainer.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import com.veteam.voluminousenergy.blocks.screens.BatteryBoxScreen; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; - -public class BatteryBoxContainer extends VEContainer { - - private static final int NUMBER_OF_SLOTS = 12; - - public BatteryBoxContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player){ - super(VEBlocks.BATTERY_BOX_CONTAINER.get(),id,world,pos,inventory,player,VEBlocks.BATTERY_BOX_BLOCK.get()); - } - - @Override - protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEInsertSlot(h, 0, 35,17)); - addSlot(new VEInsertSlot(h, 1,53,17)); - addSlot(new VEInsertSlot(h,2,71, 17)); - addSlot(new VEInsertSlot(h,3,89, 17)); - addSlot(new VEInsertSlot(h,4,107, 17)); - addSlot(new VEInsertSlot(h,5,125, 17)); - - //Bottom Slots - addSlot(new VEInsertSlot(h,6,35, 54)); - addSlot(new VEInsertSlot(h, 7,53,54)); - addSlot(new VEInsertSlot(h,8,71, 54)); - addSlot(new VEInsertSlot(h,9,89, 54)); - addSlot(new VEInsertSlot(h,10,107, 54)); - addSlot(new VEInsertSlot(h,11,125, 54)); - } - - @Nonnull - @Override - public @NotNull ItemStack quickMoveStack(final @NotNull Player player, final int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogic(index, NUMBER_OF_SLOTS, slotStack) != null) return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - - slot.onTake(player, slotStack); - } - return returnStack; - } - - public void updateSendOutPowerButton(boolean status){ - if(this.screen instanceof BatteryBoxScreen batteryBoxScreen) { - batteryBoxScreen.updateSendOutPowerButton(status); - } - } - - -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java index b412dc090..f073e6bfc 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java @@ -1,6 +1,7 @@ package com.veteam.voluminousenergy.blocks.containers; import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.screens.BatteryBoxScreen; import com.veteam.voluminousenergy.blocks.screens.VEContainerScreen; import com.veteam.voluminousenergy.blocks.tiles.IVEPoweredTileEntity; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; @@ -119,6 +120,13 @@ public int powerScreen(int px){ return (((stored*100/max*100)/100)*px)/100; } + // For the battery box. Might remove later + public void updateSendOutPowerButton(boolean status){ + if(this.screen instanceof BatteryBoxScreen batteryBoxScreen) { + batteryBoxScreen.updateSendOutPowerButton(status); + } + } + public ItemStack handleCoreQuickMoveStackLogicWithUpgradeSlot(final int index, final int containerSlots, final int upgradeSlotId, ItemStack slotStack){ if (index < containerSlots) { // Container --> Inventory if (!moveItemStackTo(slotStack, containerSlots, this.slots.size(), true)) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java index f53be9306..9338c21f6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java @@ -1,10 +1,8 @@ package com.veteam.voluminousenergy.blocks.containers; import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory.VEContainerFactoryBuilder; -import com.veteam.voluminousenergy.blocks.inventory.slots.TileEntitySlots.StirlingGeneratorInputSlot; import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraftforge.items.SlotItemHandler; import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.*; @@ -27,7 +25,22 @@ public class VEContainers { .addSlot(5, 130, -14) // Upgrade Slot .build(); - // TODO Decide if battery box can or should be converted. Put it here + public static final VEContainerFactory BATTERY_BOX_FACTORY = new VEContainerFactoryBuilder() + .create(BATTERY_BOX_CONTAINER, BATTERY_BOX_BLOCK) + .addSlot(0, 35, 17) + .addSlot(1, 53, 17) + .addSlot(2, 71, 17) + .addSlot(3, 89, 17) + .addSlot(4, 107, 17) + .addSlot(5, 125, 17) + //Bottom Slots + .addSlot(6, 35, 54) + .addSlot(7, 53, 54) + .addSlot(8, 71, 54) + .addSlot(9, 89, 54) + .addSlot(10, 107, 54) + .addSlot(11, 125, 54) + .build(); public static final VEContainerFactory BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(BLAST_FURNACE_CONTAINER, BLAST_FURNACE_BLOCK) @@ -195,7 +208,7 @@ public class VEContainers { .build(); public static final VEContainerFactory SAWMILL_FACTORY = new VEContainerFactoryBuilder() - .create(SAWMILL_CONTAINER,SAWMILL_BLOCK) + .create(SAWMILL_CONTAINER, SAWMILL_BLOCK) .addSlot(0, 44, 32) // Log input slot .addSlot(1, 80, 24) // Plank Output .addSlot(2, 80, 42) // Secondary Output @@ -205,11 +218,22 @@ public class VEContainers { .build(); public static final VEContainerFactory SOLAR_PANEL_FACTORY = new VEContainerFactoryBuilder() - .create(SOLAR_PANEL_CONTAINER,SOLAR_PANEL_BLOCK) + .create(SOLAR_PANEL_CONTAINER, SOLAR_PANEL_BLOCK) .build(); public static final VEContainerFactory STIRLING_GENERATOR_FACTORY = new VEContainerFactoryBuilder() - .create(STIRLING_GENERATOR_CONTAINER,STIRLING_GENERATOR_BLOCK) + .create(STIRLING_GENERATOR_CONTAINER, STIRLING_GENERATOR_BLOCK) .addSlot(0, 80, 35) .build(); + + // TOOLING STATION UNUSED + public static final VEContainerFactory TOOLING_STATION_FACTORY = new VEContainerFactoryBuilder() + .create(TOOLING_STATION_CONTAINER,TOOLING_STATION_BLOCK) + .addSlot(0, 38, 18) // Fluid input slot + .addSlot(1, 38, 49) // Extract fluid from input + .addSlot(2, 86, 32) // Main Tool slot + .addSlot(3, 134, 18) // Bit Slot + .addSlot(4, 134,49) // Base Slot + .addSlot(5,154, -14) // Upgrade Slot + .build(); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java index 5093a2a46..00df94d20 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.BatteryBoxContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.buttons.VEPowerIOManager; @@ -20,14 +20,14 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -public class BatteryBoxScreen extends VEContainerScreen { +public class BatteryBoxScreen extends VEContainerScreen { private final BatteryBoxTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/battery_box_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public BatteryBoxScreen(BatteryBoxContainer screenContainer, Inventory inv, Component titleIn){ + public BatteryBoxScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (BatteryBoxTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java index b911dff37..44433eef6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java @@ -2,7 +2,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.ToolingStationContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.ToolingStationTile; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; @@ -13,13 +13,13 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; -public class ToolingStationScreen extends VEContainerScreen { +public class ToolingStationScreen extends VEContainerScreen { private ToolingStationTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/tooling_station_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public ToolingStationScreen(ToolingStationContainer screenContainer, Inventory inv, Component titleIn){ + public ToolingStationScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); tileEntity = (ToolingStationTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java index e442c3325..654f42604 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.BatteryBoxContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.items.batteries.VEEnergyItem; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.buttons.VEPowerIOManager; @@ -16,14 +16,9 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.items.IItemHandlerModifiable; import net.minecraftforge.items.ItemStackHandler; -import net.minecraftforge.items.wrapper.RangedWrapper; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -298,7 +293,7 @@ public void saveAdditional(@NotNull CompoundTag tag) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new BatteryBoxContainer(i,level,worldPosition,playerInventory,playerEntity); + return VEContainers.BATTERY_BOX_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java index 8741cf29d..37c855e37 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.tools.networking.packets; -import com.veteam.voluminousenergy.blocks.containers.BatteryBoxContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; @@ -47,7 +47,7 @@ public static void handle(BatteryBoxSendOutPowerPacket packet, CustomPayloadEven public static void handlePacket(BatteryBoxSendOutPowerPacket packet, AbstractContainerMenu openContainer, boolean onServer){ if(openContainer != null){ - if(openContainer instanceof BatteryBoxContainer batteryBoxContainer){ + if(openContainer instanceof VEContainer batteryBoxContainer){ if(onServer){ BlockEntity tileEntity = batteryBoxContainer.getTileEntity(); if(tileEntity instanceof BatteryBoxTile batteryBoxTile){ diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java index e0d3b0136..9218eb628 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.tools.networking.packets; -import com.veteam.voluminousenergy.blocks.containers.BatteryBoxContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; @@ -51,7 +51,7 @@ public static void handle(BatteryBoxSlotPairPacket packet, CustomPayloadEvent.Co public static void handlePacket(BatteryBoxSlotPairPacket packet, AbstractContainerMenu openContainer, boolean onServer) { if (openContainer != null) { - if (openContainer instanceof BatteryBoxContainer batteryBoxContainer) { + if (openContainer instanceof VEContainer batteryBoxContainer) { if (onServer) { BlockEntity tileEntity = batteryBoxContainer.getTileEntity(); if (tileEntity instanceof BatteryBoxTile batteryBoxTile) { From d0622e6900bdff8241b5e0f753c6df5f3bc72bf2 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Wed, 14 Feb 2024 18:43:22 -0500 Subject: [PATCH 04/27] Removed VEFluidTileEntity. Optimized Imports to speed this process up --- .../triggers/VECriteriaTriggers.java | 1 - .../blocks/blocks/VEBlocks.java | 4 +- .../blocks/machines/SolarPanelBlock.java | 8 - .../blocks/ores/red_sand/RedSaltpeterOre.java | 2 - .../blocks/containers/VEContainerFactory.java | 50 ++- .../blocks/containers/VEContainers.java | 2 - .../blocks/screens/AirCompressorScreen.java | 3 +- .../blocks/screens/AqueoulizerScreen.java | 2 +- .../blocks/screens/BatteryBoxScreen.java | 3 +- .../blocks/screens/BlastFurnaceScreen.java | 3 +- .../screens/CentrifugalAgitatorScreen.java | 3 +- .../screens/CentrifugalSeparatorScreen.java | 3 +- .../screens/CombustionGeneratorScreen.java | 3 +- .../blocks/screens/CompressorScreen.java | 3 +- .../blocks/screens/CrusherScreen.java | 3 +- .../screens/DimensionalLaserScreen.java | 3 +- .../screens/DistillationUnitScreen.java | 3 +- .../blocks/screens/ElectricFurnaceScreen.java | 3 +- .../blocks/screens/ElectrolyzerScreen.java | 3 +- .../screens/FluidElectrolyzerScreen.java | 3 +- .../blocks/screens/FluidMixerScreen.java | 3 +- .../blocks/screens/GasFiredFurnaceScreen.java | 3 +- .../screens/HydroponicIncubatorScreen.java | 2 +- .../screens/ImplosionCompressorScreen.java | 3 +- .../screens/PrimitiveBlastFurnaceScreen.java | 3 +- .../screens/PrimitiveSolarPanelScreen.java | 2 +- .../PrimitiveStirlingGeneratorScreen.java | 3 +- .../blocks/screens/PumpScreen.java | 3 +- .../blocks/screens/SawmillScreen.java | 3 +- .../blocks/screens/SolarPanelScreen.java | 2 +- .../screens/StirlingGeneratorScreen.java | 3 +- .../blocks/screens/ToolingStationScreen.java | 3 +- .../blocks/screens/VEContainerScreen.java | 32 +- .../screens/tank/AluminumTankScreen.java | 3 +- .../blocks/screens/tank/EighzoTankScreen.java | 3 +- .../screens/tank/NetheriteTankScreen.java | 3 +- .../screens/tank/NighaliteTankScreen.java | 3 +- .../screens/tank/SolariumTankScreen.java | 3 +- .../blocks/screens/tank/TankScreen.java | 3 +- .../screens/tank/TitaniumTankScreen.java | 3 +- .../blocks/tiles/AirCompressorTile.java | 2 +- .../blocks/tiles/AqueoulizerTile.java | 2 +- .../blocks/tiles/CentrifugalAgitatorTile.java | 2 +- .../blocks/tiles/CombustionGeneratorTile.java | 2 +- .../blocks/tiles/ElectricFurnaceTile.java | 1 - .../blocks/tiles/FluidElectrolyzerTile.java | 2 +- .../blocks/tiles/FluidMixerTile.java | 2 +- .../blocks/tiles/GasFiredFurnaceTile.java | 2 +- .../blocks/tiles/HydroponicIncubatorTile.java | 2 +- .../blocks/tiles/IFluidTileEntity.java | 5 - .../blocks/tiles/PumpTile.java | 2 +- .../blocks/tiles/SawmillTile.java | 4 +- .../blocks/tiles/ToolingStationTile.java | 6 +- .../blocks/tiles/VEFluidTileEntity.java | 376 ------------------ .../blocks/tiles/VEItemStackHandler.java | 88 ++++ .../blocks/tiles/VEMultiBlockTileEntity.java | 2 +- .../blocks/tiles/VESolarTile.java | 1 - .../blocks/tiles/VETileEntity.java | 239 ++++++++--- .../blocks/tiles/VETileFactoryBuilder.java | 42 +- .../blocks/tiles/tank/TankTile.java | 4 +- .../entity/LaserBlockEntityRenderer.java | 1 - .../compat/jei/VoluminousEnergyPlugin.java | 4 +- .../jei/category/ElectrolyzingCategory.java | 1 - .../tools/multitool/CombustionMultitool.java | 5 +- .../persistence/ChunkFluids.java | 1 - .../CombustionGeneratorOxidizerRecipe.java | 1 - .../voluminousenergy/recipe/VERNGRecipe.java | 1 - .../voluminousenergy/recipe/VERecipe.java | 4 +- .../networking/packets/TankBoolPacket.java | 8 +- .../packets/TankDirectionPacket.java | 8 +- .../util/MultiFluidSlotWrapper.java | 6 +- .../voluminousenergy/util/RelationalTank.java | 4 +- .../voluminousenergy/util/WorldUtil.java | 1 - .../util/recipe/FluidIngredient.java | 1 - .../util/recipe/FluidSerializerHelper.java | 2 +- .../util/recipe/RecipeUtil.java | 12 +- .../util/tiles/CapabilityMap.java | 4 +- 77 files changed, 441 insertions(+), 603 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/IFluidTileEntity.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEFluidTileEntity.java create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java diff --git a/src/main/java/com/veteam/voluminousenergy/achievements/triggers/VECriteriaTriggers.java b/src/main/java/com/veteam/voluminousenergy/achievements/triggers/VECriteriaTriggers.java index 9763cce77..878f61691 100644 --- a/src/main/java/com/veteam/voluminousenergy/achievements/triggers/VECriteriaTriggers.java +++ b/src/main/java/com/veteam/voluminousenergy/achievements/triggers/VECriteriaTriggers.java @@ -2,7 +2,6 @@ import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.advancements.CriterionTrigger; -import net.minecraft.advancements.critereon.ConstructBeaconTrigger; public class VECriteriaTriggers { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java index 3d5d86ae4..816048639 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java @@ -12,7 +12,9 @@ import com.veteam.voluminousenergy.blocks.blocks.ores.red_sand.RedSaltpeterOre; import com.veteam.voluminousenergy.blocks.blocks.storage.materials.*; import com.veteam.voluminousenergy.blocks.blocks.storage.raw.*; -import com.veteam.voluminousenergy.blocks.containers.*; +import com.veteam.voluminousenergy.blocks.containers.ToolingStationContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.blocks.containers.tank.*; import com.veteam.voluminousenergy.blocks.tiles.*; import com.veteam.voluminousenergy.blocks.tiles.tank.*; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SolarPanelBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SolarPanelBlock.java index 2752e5da5..ebde53857 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SolarPanelBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SolarPanelBlock.java @@ -1,23 +1,15 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.blocks.util.FaceableBlock; import com.veteam.voluminousenergy.blocks.tiles.SolarPanelTile; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.MenuProvider; -import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.BlockHitResult; import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/red_sand/RedSaltpeterOre.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/red_sand/RedSaltpeterOre.java index ff63cebe5..872406126 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/red_sand/RedSaltpeterOre.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/red_sand/RedSaltpeterOre.java @@ -6,8 +6,6 @@ import net.minecraft.util.Mth; import net.minecraft.util.RandomSource; import net.minecraft.world.level.block.ColoredFallingBlock; -import net.minecraft.world.level.block.Fallable; -import net.minecraft.world.level.block.FallingBlock; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.state.BlockState; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java index f8ea0ebfd..8d31adea1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java @@ -1,21 +1,24 @@ package com.veteam.voluminousenergy.blocks.containers; +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.tiles.IVEPoweredTileEntity; +import com.veteam.voluminousenergy.util.SlotType; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.SlotItemHandler; import net.minecraftforge.registries.RegistryObject; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; public class VEContainerFactory { - - // private int numSlots = 0; // TODO this needs to be pulled from the client later:tm: private RegistryObject> menuTypeRegistryObject; private RegistryObject block; private final List slots = new ArrayList<>(); @@ -28,8 +31,28 @@ public VEContainer create(int id, Level world, BlockPos pos, Inventory inventory return new VEContainer(menuTypeRegistryObject.get(), id, world, pos, inventory, player, block.get()) { @Override protected void addSlotsToGUI(IItemHandler h) { - for (Slot slot : VEContainerFactory.this.slots) { - addSlot(new SlotItemHandler(h, slot.index, slot.x, slot.y)); + List slots = VEContainerFactory.this.slots; + + int energySlotId = -1; + + if( this.tileEntity instanceof IVEPoweredTileEntity poweredTileEntity) { + energySlotId = poweredTileEntity.getUpgradeSlotId(); + } + + for(int i = 0; i < slots.size(); i++) { + if(i == energySlotId) { + Slot slot = slots.get(i); + addSlot(new VESlot(h, slot.index, slot.x, slot.y,true)); + continue; + } + if(i >= this.tileEntity.getSlotManagers().size()) { + VoluminousEnergy.LOGGER.error("Unable to properly create " + menuTypeRegistryObject.getId() + ". The VEContainerFactory tried to process more slots than were available."); + continue; + } + SlotType slotType = this.tileEntity.getSlotManagers().get(i).getSlotType(); + boolean isOutput = slotType == SlotType.FLUID_OUTPUT || slotType == SlotType.OUTPUT; + Slot slot = slots.get(i); + addSlot(new VESlot(h, slot.index, slot.x, slot.y,!isOutput)); } } }; @@ -59,4 +82,23 @@ public VEContainerFactory build() { private record Slot(int index, int x, int y) { } + + public static class VESlot extends SlotItemHandler { + + private final IItemHandler handler; + private final int index; + private final boolean allowInsertion; + + public VESlot(IItemHandler itemHandler, int index, int xPos, int yPos,boolean allowInsertion) { + super(itemHandler, index, xPos, yPos); + this.handler = itemHandler; + this.index = index; + this.allowInsertion = allowInsertion; + } + + public boolean mayPlace(@NotNull ItemStack stack) { + if (stack.isEmpty()) return false; + return allowInsertion; // && handler.isItemValid(index, stack); TODO fix me + } + } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java index 9338c21f6..2e3b48aae 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java @@ -1,8 +1,6 @@ package com.veteam.voluminousenergy.blocks.containers; import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory.VEContainerFactoryBuilder; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.*; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java index 345bd0dbe..1f5d81826 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java @@ -12,6 +12,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; public class AirCompressorScreen extends VEContainerScreen { @@ -41,7 +42,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("air_compressor"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java index 006495f87..7d939e5e7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java @@ -45,7 +45,7 @@ protected void init() { } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("aqueoulizer"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("+"), 82, 34, GREY_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack,this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java index 00df94d20..e63aad144 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java @@ -19,6 +19,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; public class BatteryBoxScreen extends VEContainerScreen { @@ -82,7 +83,7 @@ public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partia } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("battery_box"), 34, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack,this.font, TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java index 444c2d8f3..7404dc388 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java @@ -13,6 +13,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -44,7 +45,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { if (tileEntity.getMultiblockValidity()){ TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("blast_furnace"), 8, 6, WHITE_TEXT_STYLE); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java index 8df0e2be1..c3c543bd2 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java @@ -13,6 +13,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -45,7 +46,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("centrifugal_agitator"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java index f907b577c..2c844f6e8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java @@ -12,6 +12,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -42,7 +43,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("centrifugal_separator"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java index f44cb56dd..25f851ae4 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java @@ -14,6 +14,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -44,7 +45,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("combustion_generator"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderCenteredShadowedText(matrixStack,Minecraft.getInstance().font, Component.nullToEmpty(tileEntity.getEnergyRate() + " FE/t"), 96, 18, WHITE_TEXT_STYLE); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java index 7faaec5a2..a943e21de 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java @@ -12,6 +12,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -44,7 +45,7 @@ public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partia } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("compressor"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java index 8ce23349b..e5cf23568 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java @@ -12,6 +12,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -42,7 +43,7 @@ public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partia } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("crusher"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java index 74581c2d0..889b2f4bb 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java @@ -19,6 +19,7 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.templates.FluidTank; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -89,7 +90,7 @@ protected void init() { } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { if (tileEntity.getMultiblockValidity()) { TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("dimensional_laser"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java index d5a3d5368..e01daaeb1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java @@ -13,6 +13,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -45,7 +46,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { if (tileEntity.getMultiblockValidity()){ TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("distillation_unit"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java index b98ae6467..e0af0a339 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java @@ -15,6 +15,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -68,7 +69,7 @@ public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partia } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("electric_furnace"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java index 81d443716..bde816376 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java @@ -12,6 +12,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -42,7 +43,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("electrolyzer"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java index 310e9910a..4c0ea5a9b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java @@ -13,6 +13,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -44,7 +45,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("fluid_electrolyzer"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java index e400f60b2..1c6171986 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java @@ -14,6 +14,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -45,7 +46,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("fluid_mixer"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("+"), 78, 34, GREY_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java index 3239e7544..fcb0ae585 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java @@ -12,6 +12,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -42,7 +43,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX,int mouseY){ + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY){ TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("gas_fired_furnace"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java index 1f730c5fa..447a30f98 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java @@ -45,7 +45,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("hydroponic_incubator"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java index 1c0ed73a0..d9da05ab6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java @@ -15,6 +15,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -76,7 +77,7 @@ public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partia } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("implosion_compressor"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java index e76dde62f..95f521450 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java @@ -14,6 +14,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -65,7 +66,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("primitiveblastfurnace"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java index e8c604e95..de0f06d3e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java @@ -43,7 +43,7 @@ protected void renderTooltip(@NotNull GuiGraphics matrixStack, int mouseX, int m } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY){ + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY){ TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("primitive_solar_panel"), 8, 6, WHITE_TEXT_STYLE); if (tileEntity.getLevel().isDay()) TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getGeneration() + " FE/t"), 90, 32, WHITE_TEXT_STYLE); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java index 4b150ed61..f93deb61b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java @@ -16,6 +16,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -82,7 +83,7 @@ public List getTooltips() { } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY){ + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY){ TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("primitivestirlinggenerator"), 8, 6, WHITE_TEXT_STYLE); int generationRate; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java index 5af8302db..e6a0a16ac 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java @@ -16,6 +16,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; public class PumpScreen extends VEContainerScreen { @@ -57,7 +58,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("pump"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java index cd44dcef7..b57d7cdfb 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java @@ -13,6 +13,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -43,7 +44,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("sawmill"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java index 02fffae90..f1cd4a071 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java @@ -42,7 +42,7 @@ protected void renderTooltip(@NotNull GuiGraphics matrixStack, int mouseX, int m super.renderTooltip(matrixStack,mouseX, mouseY); } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY){ + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY){ TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("solar_panel"), 8, 6, WHITE_TEXT_STYLE); if (tileEntity.getLevel().isDay()) TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getGeneration() + " FE/t"), 90, 32, WHITE_TEXT_STYLE); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java index 87bdad9de..2f52c6a9c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java @@ -16,6 +16,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; import java.util.Arrays; import java.util.List; @@ -58,7 +59,7 @@ protected void init() { } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("stirling_generator"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergyRate() + " FE/t"), 90, 18, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java index 44433eef6..2035cec47 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java @@ -12,6 +12,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; public class ToolingStationScreen extends VEContainerScreen { private ToolingStationTile tileEntity; @@ -39,7 +40,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("tooling_station"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java index f9dbab7e3..9dedc9f13 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.screens; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.VEFluidTileEntity; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.buttons.VEIOButton; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; @@ -25,6 +25,7 @@ import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.Slot; import net.minecraftforge.network.PacketDistributor; +import org.jetbrains.annotations.NotNull; import java.util.UUID; @@ -46,7 +47,7 @@ public VEContainerScreen(T menu, Inventory inventory, Component component) { } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { this.renderables.stream().filter(Renderable -> Renderable instanceof ioMenuButton).forEach(button -> { if (((ioMenuButton) button).shouldIOBeOpen()) { renderSlotAndTankLabels(matrixStack, mouseX, mouseY); @@ -54,11 +55,7 @@ protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { }); } - public void renderIOMenu(VEFluidTileEntity tileEntity) { - renderIOMenu(tileEntity,64 + (this.width / 2),this.topPos - 18); - } - - public void renderIOMenu(VEFluidTileEntity tileEntity, int menuButtonX, int menuButtonY) { + public void renderIOMenu(VETileEntity tileEntity, int menuButtonX, int menuButtonY) { // Buttons addRenderableWidget(new ioMenuButton(menuButtonX,menuButtonY , buttons -> { @@ -90,27 +87,6 @@ public void renderIOMenu(VEFluidTileEntity tileEntity, int menuButtonX, int menu } } - - public void renderIOMenu(VETileEntity tileEntity, int menuButtonX, int menuButtonY) { - - // Buttons - addRenderableWidget(new ioMenuButton(menuButtonX,menuButtonY , buttons -> { - - })); - - - int increase = 0; - - for (VESlotManager manager : tileEntity.getSlotManagers()) { - addRenderableWidget(new SlotBoolButton(manager, (this.width / 2) - 198, this.topPos + (20 * increase), button -> { - })); - - addRenderableWidget(new SlotDirectionButton(manager, (this.width / 2) - 184, this.topPos + (20 * increase), button -> { - })); - increase++; - } - } - public void renderIOMenu(VETileEntity tileEntity) { // Buttons addRenderableWidget(new ioMenuButton(64 + (this.width / 2), this.topPos - 18, buttons -> { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/AluminumTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/AluminumTankScreen.java index e306f872c..d5f265356 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/AluminumTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/AluminumTankScreen.java @@ -5,6 +5,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; public class AluminumTankScreen extends TankScreen { public AluminumTankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { @@ -12,7 +13,7 @@ public AluminumTankScreen(TankContainer screenContainer, Inventory inv, Componen } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("aluminum_tank"), 8, 6, WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/EighzoTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/EighzoTankScreen.java index edcec1f57..22fb37918 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/EighzoTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/EighzoTankScreen.java @@ -5,6 +5,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; public class EighzoTankScreen extends TankScreen { public EighzoTankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { @@ -12,7 +13,7 @@ public EighzoTankScreen(TankContainer screenContainer, Inventory inv, Component } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("eighzo_tank"), 8, 6, WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NetheriteTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NetheriteTankScreen.java index 5a376b63c..c6eadebcd 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NetheriteTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NetheriteTankScreen.java @@ -5,6 +5,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; public class NetheriteTankScreen extends TankScreen { public NetheriteTankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { @@ -12,7 +13,7 @@ public NetheriteTankScreen(TankContainer screenContainer, Inventory inv, Compone } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("netherite_tank"), 8, 6, WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NighaliteTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NighaliteTankScreen.java index af5ba02b6..51e45c387 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NighaliteTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NighaliteTankScreen.java @@ -5,6 +5,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; public class NighaliteTankScreen extends TankScreen { public NighaliteTankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { @@ -12,7 +13,7 @@ public NighaliteTankScreen(TankContainer screenContainer, Inventory inv, Compone } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("nighalite_tank"), 8, 6, WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/SolariumTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/SolariumTankScreen.java index 3154a65dd..405415ae5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/SolariumTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/SolariumTankScreen.java @@ -5,6 +5,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; public class SolariumTankScreen extends TankScreen { public SolariumTankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { @@ -12,7 +13,7 @@ public SolariumTankScreen(TankContainer screenContainer, Inventory inv, Componen } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("solarium_tank"), 8, 6, WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TankScreen.java index bfcdef909..723fe0586 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TankScreen.java @@ -21,6 +21,7 @@ import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; import net.minecraftforge.network.PacketDistributor; +import org.jetbrains.annotations.NotNull; import java.util.UUID; @@ -51,7 +52,7 @@ protected void init(){ } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TitaniumTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TitaniumTankScreen.java index c7e7e78e3..06b7fca3a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TitaniumTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TitaniumTankScreen.java @@ -5,6 +5,7 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; +import org.jetbrains.annotations.NotNull; public class TitaniumTankScreen extends TankScreen { public TitaniumTankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { @@ -12,7 +13,7 @@ public TitaniumTankScreen(TankContainer screenContainer, Inventory inv, Componen } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("titanium_tank"), 8, 6, WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java index 7b3ea6d14..7f7cd90cd 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java @@ -31,7 +31,7 @@ import java.util.Collections; import java.util.List; -public class AirCompressorTile extends VEFluidTileEntity implements IVEPoweredTileEntity, IVECountable { +public class AirCompressorTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { public VESlotManager[] slotManagers = new VESlotManager[]{ new VESlotManager(0,Direction.UP,true, SlotType.FLUID_INPUT,1,0), diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java index 585fde3d4..013360ab9 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java @@ -21,7 +21,7 @@ import java.util.ArrayList; import java.util.List; -public class AqueoulizerTile extends VEFluidTileEntity implements IVEPoweredTileEntity, IVECountable { +public class AqueoulizerTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { private final ItemStackHandler inventory = createHandler(6); public List fluidManagers = new ArrayList<>() {{ diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java index b98cb64e3..28b673a90 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.List; -public class CentrifugalAgitatorTile extends VEFluidTileEntity implements IVEPoweredTileEntity, IVECountable { +public class CentrifugalAgitatorTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { public List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java index 493cfa42f..0129c38c5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java @@ -41,7 +41,7 @@ import java.util.Collections; import java.util.List; -public class CombustionGeneratorTile extends VEFluidTileEntity implements IVEPoweredTileEntity, IVECountable { +public class CombustionGeneratorTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { List slotManagers = new ArrayList<>() { { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java index 1f79099b3..40cca7c1f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java @@ -28,7 +28,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.concurrent.atomic.AtomicReference; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java index 9bd508ed7..b08a7b257 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java @@ -25,7 +25,7 @@ import java.util.ArrayList; import java.util.List; -public class FluidElectrolyzerTile extends VEFluidTileEntity implements IVEPoweredTileEntity, IVECountable { +public class FluidElectrolyzerTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { public List slotManagers = new ArrayList<>() {{ diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java index d8c5a1bef..19e13a9e5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.List; -public class FluidMixerTile extends VEFluidTileEntity implements IVEPoweredTileEntity, IVECountable { +public class FluidMixerTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java index e8d933d0c..8ac7e04ad 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java @@ -46,7 +46,7 @@ import java.util.Objects; import java.util.concurrent.atomic.AtomicReference; -public class GasFiredFurnaceTile extends VEFluidTileEntity implements IVECountable { +public class GasFiredFurnaceTile extends VETileEntity implements IVECountable { List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java index dd923e4c8..19fa08007 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java @@ -33,7 +33,7 @@ import static net.minecraft.util.Mth.abs; -public class HydroponicIncubatorTile extends VEFluidTileEntity implements IVEPoweredTileEntity, IVECountable { +public class HydroponicIncubatorTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { private final ItemStackHandler inventory = createHandler(8); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/IFluidTileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/IFluidTileEntity.java deleted file mode 100644 index bd3bcf980..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/IFluidTileEntity.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -public interface IFluidTileEntity { - -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java index cf095c633..d3fb9ef3c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java @@ -38,7 +38,7 @@ import java.util.Collections; import java.util.List; -public class PumpTile extends VEFluidTileEntity implements IVEPoweredTileEntity { +public class PumpTile extends VETileEntity implements IVEPoweredTileEntity { private final LazyOptional handler = LazyOptional.of(() -> this.inventory); private final LazyOptional fluid = LazyOptional.of(this::createFluid); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java index aac50edad..06bf5f32d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java @@ -1,6 +1,5 @@ package com.veteam.voluminousenergy.blocks.tiles; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.VEFluidSawmillRecipe; @@ -24,7 +23,6 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.item.crafting.ShapelessRecipe; import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; @@ -39,7 +37,7 @@ import java.util.List; import java.util.Objects; -public class SawmillTile extends VEFluidTileEntity implements IVEPoweredTileEntity,IVECountable { +public class SawmillTile extends VETileEntity implements IVEPoweredTileEntity,IVECountable { List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0,0, Direction.UP, true, SlotType.INPUT)); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java index 608f8ef2d..813211c6b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java @@ -1,6 +1,5 @@ package com.veteam.voluminousenergy.blocks.tiles; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.ToolingStationContainer; import com.veteam.voluminousenergy.items.tools.multitool.Multitool; @@ -24,7 +23,6 @@ import net.minecraft.world.item.BucketItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.material.Fluids; import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.fluids.FluidStack; @@ -32,18 +30,16 @@ import net.minecraftforge.fluids.capability.templates.FluidTank; import net.minecraftforge.items.ItemStackHandler; import org.jetbrains.annotations.NotNull; -import org.stringtemplate.v4.ST; import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collections; -import java.util.HashSet; import java.util.List; import static com.veteam.voluminousenergy.items.tools.multitool.CombustionMultitool.isCombustibleFuel; -public class ToolingStationTile extends VEFluidTileEntity implements IVEPoweredTileEntity { +public class ToolingStationTile extends VETileEntity implements IVEPoweredTileEntity { // Slot Managers List slotManagers = new ArrayList<>() {{ diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEFluidTileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEFluidTileEntity.java deleted file mode 100644 index a56fa5bb4..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEFluidTileEntity.java +++ /dev/null @@ -1,376 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.recipe.RecipeCache; -import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; -import com.veteam.voluminousenergy.sounds.VESounds; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.*; -import net.minecraft.core.BlockPos; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.sounds.SoundSource; -import net.minecraft.world.item.BucketItem; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.Recipe; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Fluid; -import net.minecraft.world.level.material.Fluids; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import static net.minecraft.util.Mth.abs; - -public abstract class VEFluidTileEntity extends VETileEntity implements IFluidTileEntity { - - public static final int TANK_CAPACITY = 4000; - private boolean fluidInputDirty; - - public VEFluidTileEntity(BlockEntityType type, BlockPos pos, BlockState state, RecipeType> recipeType) { - super(type, pos, state, recipeType); - } - - @Override - public ItemStackHandler createHandler(int slots) { - - VEFluidTileEntity tileEntity = this; - int upgradeSlotLocation = -1; - if (tileEntity instanceof IVEPoweredTileEntity poweredTileEntity) { - upgradeSlotLocation = poweredTileEntity.getUpgradeSlotId(); - } - - int finalUpgradeSlotLocation = upgradeSlotLocation; - return new ItemStackHandler(slots) { - - @Override - protected void onContentsChanged(int slot) { - setChanged(); - List managers = getSlotManagers(); - - if(slot == finalUpgradeSlotLocation) tileEntity.markRecipeDirty(); - else if (slot < managers.size()) { - SlotType slotType = getSlotManagers().get(slot).getSlotType(); - if (slotType == SlotType.INPUT) { - tileEntity.markRecipeDirty(); - } else if (slotType.isFluidBucketIORelated()) { - tileEntity.markFluidInputDirty(); - } - } - } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if (slot == finalUpgradeSlotLocation) return TagUtil.isTaggedMachineUpgradeItem(stack); - VESlotManager manager = tileEntity.getSlotManagers().get(slot); - if(manager.getAllowedItems().contains(stack.getItem())) return true; - if (manager.getSlotType() == SlotType.FLUID_INPUT && stack.getItem() instanceof BucketItem bucketItem) { - if (bucketItem.getFluid() == Fluids.EMPTY) return true; - RelationalTank tank = tileEntity.getRelationalTanks().get(manager.getTankId()); - if(tank.getTankType() == TankType.OUTPUT) { - return bucketItem.getFluid().isSame(Fluids.EMPTY); - } - for (Recipe recipe : tileEntity.getPotentialRecipes()) { - VEFluidRecipe veFluidRecipe = (VEFluidRecipe) recipe; - if (veFluidRecipe.getFluidIngredient(tank.getRecipePos()).test(new FluidStack(bucketItem.getFluid(), 1))) { - return true; - } - } - } else if (manager.getSlotType() == SlotType.INPUT) { - for (Recipe recipe : tileEntity.getPotentialRecipes()) { - VEFluidRecipe veFluidRecipe = (VEFluidRecipe) recipe; - if (veFluidRecipe.getIngredient(manager.getRecipePos()).test(stack)) { - return true; - } - } - } else return manager.getSlotType() == SlotType.FLUID_OUTPUT; - return false; - } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if (!isItemValid(slot, stack)) return stack; - return super.insertItem(slot, stack, simulate); - } - }; - } - - //use for inputting a fluid - public void inputFluid(RelationalTank tank, int slot1, int slot2) { - ItemStack input = tank.getInput().copy(); - ItemStack output = tank.getOutput().copy(); - FluidTank inputTank = tank.getTank(); - ItemStackHandler handler = getInventoryHandler(); - if (input.getItem() instanceof BucketItem && input.getItem() != Items.BUCKET) { - if ((output.getItem() == Items.BUCKET && output.getCount() < 16) || checkOutputSlotForEmptyOrBucket(output)) { - Fluid fluid = ((BucketItem) input.getItem()).getFluid(); - if (inputTank.isEmpty() || inputTank.getFluid().isFluidEqual(new FluidStack(fluid, 1000)) && inputTank.getFluidAmount() + 1000 <= inputTank.getTankCapacity(0)) { - inputTank.fill(new FluidStack(fluid, 1000), IFluidHandler.FluidAction.EXECUTE); - handler.extractItem(slot1, 1, false); - handler.insertItem(slot2, new ItemStack(Items.BUCKET, 1), false); - this.markRecipeDirty(); - } - } - } - } - - - //use for when the input and output slot are different - public void outputFluid(RelationalTank tank, int slot1, int slot2) { - ItemStack inputSlot = tank.getInput(); - ItemStack outputSlot = tank.getOutput(); - FluidTank outputTank = tank.getTank(); - ItemStackHandler handler = getInventoryHandler(); - if (inputSlot.getItem() == Items.BUCKET && outputTank.getFluidAmount() >= 1000 && inputSlot.getCount() > 0 && outputSlot.copy() == ItemStack.EMPTY) { - ItemStack bucketStack = new ItemStack(outputTank.getFluid().getRawFluid().getBucket(), 1); - outputTank.drain(1000, IFluidHandler.FluidAction.EXECUTE); - handler.extractItem(slot1, 1, false); - handler.insertItem(slot2, bucketStack, false); - this.markRecipeDirty(); - } - } - - @Override - public void load(CompoundTag tag) { - - for (RelationalTank relationalTank : getRelationalTanks()) { - CompoundTag compoundTag = tag.getCompound(relationalTank.getTankName()); - relationalTank.getTank().readFromNBT(compoundTag); - relationalTank.readGuiProperties(tag); - } - - super.load(tag); - } - - @Override - public void tick() { - processFluidIO(); - super.tick(); - } - - @Override - void processRecipe() { - if (selectedRecipe == null) return; - VEFluidRecipe recipe = (VEFluidRecipe) selectedRecipe; - - if (canConsumeEnergy()) { - - if (counter == 1) { - // Validate output - for (RelationalTank relationalTank : getRelationalTanks()) { - if (relationalTank.getTankType() == TankType.OUTPUT) { - FluidStack recipeFluid = recipe.getOutputFluid(relationalTank.getRecipePos()); - FluidTank tank = relationalTank.getTank(); - FluidStack currentFluid = tank.getFluid(); - if(currentFluid.isEmpty()) continue; - // If the output fluid amount won't fit, then you must acquit - if (!recipeFluid.isFluidEqual(currentFluid) - || tank.getFluidAmount() + recipeFluid.getAmount() > tank.getCapacity()) { - return; - } - } - } - - ItemStackHandler handler = getInventoryHandler(); - - if (handler != null) { - // Validate output - for (VESlotManager slotManager : getSlotManagers()) { - if(slotManager.getSlotType() != SlotType.OUTPUT) continue; - ItemStack recipeStack = recipe.getResult(slotManager.getRecipePos()); - ItemStack currentItem = slotManager.getItem(handler); - if(currentItem.isEmpty()) continue; - // If the output item amount won't fit, then you must acquit - if(!recipeStack.is(currentItem.getItem()) - || recipeStack.getCount() + currentItem.getCount() > currentItem.getMaxStackSize()) { - return; - } - } - - VEFluidRNGRecipe irngRecipe = null; - if(recipe instanceof VEFluidRNGRecipe rec) { - irngRecipe = rec; - } - Random r = new Random(); - - // process recipe - for(VESlotManager slotManager : getSlotManagers()) { - if(slotManager.getSlotType() == SlotType.OUTPUT) { - ItemStack output = recipe.getResult(slotManager.getRecipePos()); - ItemStack currentStack = slotManager.getItem(handler); - // rng calculations - if(irngRecipe != null) { - float randomness = irngRecipe.getOutputChance(slotManager.getRecipePos()); - if(randomness != 1) { - float random = abs(0 + r.nextFloat() * (-1)); - if(random > randomness) continue; - } - - } - if(currentStack.isEmpty()) slotManager.setItem(output,handler); - else currentStack.setCount(currentStack.getCount() + output.getCount()); - } else if(slotManager.getSlotType() == SlotType.INPUT) { - Ingredient ingredient = recipe.getIngredient(slotManager.getRecipePos()); - ItemStack currentStack = slotManager.getItem(handler); - currentStack.setCount(currentStack.getCount() - ingredient.getItems()[0].getCount()); - } - } - } - - // process recipe - for (RelationalTank relationalTank : getRelationalTanks()) { - if (relationalTank.getTankType() == TankType.OUTPUT) { - relationalTank.fillOutput(recipe,relationalTank.getRecipePos()); - } else if(relationalTank.getTankType() == TankType.INPUT) { - relationalTank.drainInput(recipe,relationalTank.getRecipePos()); - } - } - doExtraRecipeProcessing(); - - this.markRecipeDirty(); - this.markFluidInputDirty(); - this.setChanged(); - } else if (counter > 0) { - if (++sound_tick == 19 && Config.PLAY_MACHINE_SOUNDS.get()) { - sound_tick = 0; - level.playSound(null, this.getBlockPos(), VESounds.AQUEOULIZER, SoundSource.BLOCKS, 1.0F, 1.0F); - } - } else { - counter = length; - } - counter--; - consumeEnergy(); - } - } - - @Override - public void saveAdditional(@NotNull CompoundTag tag) { - - //Save tanks - for (RelationalTank relationalTank : getRelationalTanks()) { - CompoundTag compoundTag = new CompoundTag(); - relationalTank.getTank().writeToNBT(compoundTag); - tag.put(relationalTank.getTankName(), compoundTag); - relationalTank.writeGuiProperties(tag); - } - - super.saveAdditional(tag); - } - - public int getTankCapacity() { - return TANK_CAPACITY; - } - - public void updateTankPacketFromGui(boolean status, int id) { - for (RelationalTank tank : getRelationalTanks()) { - if (id == tank.getSlotNum()) tank.setSideStatus(status); - } - } - - public void updateTankPacketFromGui(int direction, int id) { - for (RelationalTank tank : getRelationalTanks()) { - if (id == tank.getSlotNum()) { - this.capabilityMap.moveFluidSlotManagerPos(tank,IntToDirection.IntegerToDirection(direction)); - } - } - } - - public abstract @Nonnull List getRelationalTanks(); - - public static boolean checkOutputSlotForEmptyOrBucket(ItemStack slotStack) { - return slotStack.copy() == ItemStack.EMPTY || ((slotStack.copy().getItem() == Items.BUCKET) && slotStack.copy().getCount() < 16); - } - - public void markFluidInputDirty() { - this.fluidInputDirty = true; - } - - protected void processFluidIO() { - if (!fluidInputDirty) return; - fluidInputDirty = false; - for (VESlotManager manager : this.getSlotManagers()) { - ItemStackHandler inventory = this.getInventoryHandler(); - if (manager.getSlotType() == SlotType.FLUID_INPUT) { - - RelationalTank tank = this.getRelationalTanks().get(manager.getTankId()); - tank.setInput(inventory.getStackInSlot(manager.getSlotNum())); - tank.setOutput(inventory.getStackInSlot(manager.getOutputSlotId())); - if(tank.getTankType() == TankType.INPUT || tank.getTankType() == TankType.BOTH) inputFluid(tank, manager.getSlotNum(), manager.getOutputSlotId()); - outputFluid(tank, manager.getSlotNum(), manager.getOutputSlotId()); - } - } - } - - @Override - public void validateRecipe() { - if (!this.isRecipeDirty) { - return; - } - this.isRecipeDirty = false; - - this.potentialRecipes = RecipeCache.getFluidRecipesFromCache(level, this.getRecipeType(), getSlotManagers(), getRelationalTanks(), this, true); - if (this.potentialRecipes.size() == 1) { - List inputFluids = this.getRelationalTanks().stream() - .filter(tank -> tank.getTankType() == TankType.INPUT) - .map(tank -> tank.getTank().getFluid()).toList(); - - ItemStackHandler handler = this.getInventoryHandler(); - List inputItems = new ArrayList<>(); - if (handler != null) { - inputItems = this.getSlotManagers().stream() - .filter(manager -> manager.getSlotType() == SlotType.INPUT) - .map(manager -> manager.getItem(handler)).toList(); - } - VEFluidRecipe newRecipe = RecipeCache.getFluidRecipeFromCache(level, getRecipeType(), inputFluids, inputItems); - - if (newRecipe == null) { - counter = 0; - length = 0; - this.selectedRecipe = null; - return; - } - - int newLength; - - if (this instanceof IVEPoweredTileEntity poweredTileEntity && handler != null) { - newLength = this.calculateCounter(newRecipe.getProcessTime(), - handler.getStackInSlot(poweredTileEntity.getUpgradeSlotId()).copy()); - } else { - newLength = this.calculateCounter(newRecipe.getProcessTime(), ItemStack.EMPTY); - } - - - double ratio = (double) length / (double) newLength; - length = newLength; - counter = (int) (counter / ratio); - - if (this.selectedRecipe != newRecipe) { - this.selectedRecipe = newRecipe; - counter = newLength; - } - } else { - counter = 0; - length = 0; - this.selectedRecipe = null; - } - } - - public FluidStack getFluidStackFromTank(int num) { - if (num >= getRelationalTanks().size() || num < 0) { - return FluidStack.EMPTY; - } - return getRelationalTanks().get(num).getTank().getFluid(); - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java new file mode 100644 index 000000000..d46c4bbf5 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java @@ -0,0 +1,88 @@ +package com.veteam.voluminousenergy.blocks.tiles; + +import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; +import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.SlotType; +import com.veteam.voluminousenergy.util.TagUtil; +import com.veteam.voluminousenergy.util.TankType; +import net.minecraft.world.item.BucketItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.level.material.Fluids; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.items.ItemStackHandler; + +import javax.annotation.Nonnull; +import java.util.List; + +public class VEItemStackHandler extends ItemStackHandler { + + private final VETileEntity tileEntity; + private final int slots; + private final int upgradeSlotLocation; + + public VEItemStackHandler(VETileEntity tileEntity,int slots) { + this.tileEntity = tileEntity; + this.slots = slots; + upgradeSlotLocation = -1; + } + + public VEItemStackHandler(VETileEntity tileEntity,int slots,int upgradeSlotLocation) { + this.tileEntity = tileEntity; + this.slots = slots; + this.upgradeSlotLocation = upgradeSlotLocation; + } + + @Override + protected void onContentsChanged(int slot) { + tileEntity.setChanged(); + List managers = tileEntity.getSlotManagers(); + + if(slot == upgradeSlotLocation) tileEntity.markRecipeDirty(); + else if (slot < managers.size()) { + SlotType slotType = tileEntity.getSlotManagers().get(slot).getSlotType(); + if (slotType == SlotType.INPUT) { + tileEntity.markRecipeDirty(); + } else if (slotType.isFluidBucketIORelated()) { + tileEntity.markFluidInputDirty(); + } + } + } + + @Override + public boolean isItemValid(int slot, @Nonnull ItemStack stack) { + if (slot == upgradeSlotLocation) return TagUtil.isTaggedMachineUpgradeItem(stack); + VESlotManager manager = tileEntity.getSlotManagers().get(slot); + if(manager.getAllowedItems().contains(stack.getItem())) return true; + if (manager.getSlotType() == SlotType.FLUID_INPUT && stack.getItem() instanceof BucketItem bucketItem) { + if (bucketItem.getFluid() == Fluids.EMPTY) return true; + RelationalTank tank = tileEntity.getRelationalTanks().get(manager.getTankId()); + if(tank.getTankType() == TankType.OUTPUT) { + return bucketItem.getFluid().isSame(Fluids.EMPTY); + } + for (Recipe recipe : tileEntity.getPotentialRecipes()) { + VEFluidRecipe veFluidRecipe = (VEFluidRecipe) recipe; + if (veFluidRecipe.getFluidIngredient(tank.getRecipePos()).test(new FluidStack(bucketItem.getFluid(), 1))) { + return true; + } + } + } else if (manager.getSlotType() == SlotType.INPUT) { + for (Recipe recipe : tileEntity.getPotentialRecipes()) { + VEFluidRecipe veFluidRecipe = (VEFluidRecipe) recipe; + if (veFluidRecipe.getIngredient(manager.getRecipePos()).test(stack)) { + return true; + } + } + } else return manager.getSlotType() == SlotType.FLUID_OUTPUT; + return false; + } + + @Nonnull + @Override + public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { + if (!isItemValid(slot, stack)) return stack; + return super.insertItem(slot, stack, simulate); + } + +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEMultiBlockTileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEMultiBlockTileEntity.java index 507efef98..2708853d7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEMultiBlockTileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEMultiBlockTileEntity.java @@ -10,7 +10,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import org.jetbrains.annotations.NotNull; -public abstract class VEMultiBlockTileEntity extends VEFluidTileEntity { +public abstract class VEMultiBlockTileEntity extends VETileEntity { public VEMultiBlockTileEntity(BlockEntityType type, BlockPos pos, BlockState state, RecipeType> recipeType) { super(type, pos, state, recipeType); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java index 7d5ca8730..a04ae5946 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java @@ -1,6 +1,5 @@ package com.veteam.voluminousenergy.blocks.tiles; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 2792da0b7..c81142cff 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -1,10 +1,10 @@ package com.veteam.voluminousenergy.blocks.tiles; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.items.upgrades.MysteriousMultiplier; import com.veteam.voluminousenergy.recipe.RecipeCache; -import com.veteam.voluminousenergy.recipe.VERNGRecipe; +import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; +import com.veteam.voluminousenergy.recipe.VEFluidRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; @@ -24,7 +24,9 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.BucketItem; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeType; @@ -32,12 +34,15 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.material.Fluid; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.util.INBTSerializable; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.energy.IEnergyStorage; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.IFluidHandler; +import net.minecraftforge.fluids.capability.templates.FluidTank; import net.minecraftforge.items.ItemStackHandler; import org.apache.commons.lang3.NotImplementedException; import org.jetbrains.annotations.NotNull; @@ -47,7 +52,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import java.util.concurrent.atomic.AtomicReference; import static net.minecraft.util.Mth.abs; @@ -72,78 +76,202 @@ public static void serverTick(Level level, BlockPos pos, BlockState state, VETil voluminousTile.tick(); } + // Fluid methods to subclass + + public void inputFluid(RelationalTank tank, int slot1, int slot2) { + ItemStack input = tank.getInput().copy(); + ItemStack output = tank.getOutput().copy(); + FluidTank inputTank = tank.getTank(); + ItemStackHandler handler = getInventoryHandler(); + if (input.getItem() instanceof BucketItem && input.getItem() != Items.BUCKET) { + if ((output.getItem() == Items.BUCKET && output.getCount() < 16) || checkOutputSlotForEmptyOrBucket(output)) { + Fluid fluid = ((BucketItem) input.getItem()).getFluid(); + if (inputTank.isEmpty() || inputTank.getFluid().isFluidEqual(new FluidStack(fluid, 1000)) && inputTank.getFluidAmount() + 1000 <= inputTank.getTankCapacity(0)) { + inputTank.fill(new FluidStack(fluid, 1000), IFluidHandler.FluidAction.EXECUTE); + handler.extractItem(slot1, 1, false); + handler.insertItem(slot2, new ItemStack(Items.BUCKET, 1), false); + this.markRecipeDirty(); + } + } + } + } + + + //use for when the input and output slot are different + public void outputFluid(RelationalTank tank, int slot1, int slot2) { + ItemStack inputSlot = tank.getInput(); + ItemStack outputSlot = tank.getOutput(); + FluidTank outputTank = tank.getTank(); + ItemStackHandler handler = getInventoryHandler(); + if (inputSlot.getItem() == Items.BUCKET && outputTank.getFluidAmount() >= 1000 && inputSlot.getCount() > 0 && outputSlot.copy() == ItemStack.EMPTY) { + ItemStack bucketStack = new ItemStack(outputTank.getFluid().getRawFluid().getBucket(), 1); + outputTank.drain(1000, IFluidHandler.FluidAction.EXECUTE); + handler.extractItem(slot1, 1, false); + handler.insertItem(slot2, bucketStack, false); + this.markRecipeDirty(); + } + } + + + public int getTankCapacity() { + return TANK_CAPACITY; + } + + public void updateTankPacketFromGui(boolean status, int id) { + for (RelationalTank tank : getRelationalTanks()) { + if (id == tank.getSlotNum()) tank.setSideStatus(status); + } + } + + public void updateTankPacketFromGui(int direction, int id) { + for (RelationalTank tank : getRelationalTanks()) { + if (id == tank.getSlotNum()) { + this.capabilityMap.moveFluidSlotManagerPos(tank, IntToDirection.IntegerToDirection(direction)); + } + } + } + + @Deprecated + public static final int TANK_CAPACITY = 4000; + boolean fluidInputDirty; + + public @Nonnull List getRelationalTanks() { + + return new ArrayList<>(); + } + + public static boolean checkOutputSlotForEmptyOrBucket(ItemStack slotStack) { + return slotStack.copy() == ItemStack.EMPTY || ((slotStack.copy().getItem() == Items.BUCKET) && slotStack.copy().getCount() < 16); + } + + public void markFluidInputDirty() { + this.fluidInputDirty = true; + } + + protected void processFluidIO() { + if (!fluidInputDirty) return; + fluidInputDirty = false; + for (VESlotManager manager : this.getSlotManagers()) { + ItemStackHandler inventory = this.getInventoryHandler(); + if (manager.getSlotType() == SlotType.FLUID_INPUT) { + + RelationalTank tank = this.getRelationalTanks().get(manager.getTankId()); + tank.setInput(inventory.getStackInSlot(manager.getSlotNum())); + tank.setOutput(inventory.getStackInSlot(manager.getOutputSlotId())); + if (tank.getTankType() == TankType.INPUT || tank.getTankType() == TankType.BOTH) + inputFluid(tank, manager.getSlotNum(), manager.getOutputSlotId()); + outputFluid(tank, manager.getSlotNum(), manager.getOutputSlotId()); + } + } + } + + public FluidStack getFluidStackFromTank(int num) { + if (num >= getRelationalTanks().size() || num < 0) { + return FluidStack.EMPTY; + } + return getRelationalTanks().get(num).getTank().getFluid(); + } + + // END OF FLUID STUFF + int counter = 0; int length = 0; int sound_tick = 0; boolean isRecipeDirty; + /** * Must include a call to updateClients(); * This message can be removed if updateClients(); is found to be useless */ public void tick() { + processFluidIO(); updateClients(); validateRecipe(); processRecipe(); } + void processRecipe() { if (selectedRecipe == null) return; - VERecipe recipe = (VERecipe) selectedRecipe; + VEFluidRecipe recipe = (VEFluidRecipe) selectedRecipe; if (canConsumeEnergy()) { if (counter == 1) { // Validate output + for (RelationalTank relationalTank : getRelationalTanks()) { + if (relationalTank.getTankType() == TankType.OUTPUT) { + FluidStack recipeFluid = recipe.getOutputFluid(relationalTank.getRecipePos()); + FluidTank tank = relationalTank.getTank(); + FluidStack currentFluid = tank.getFluid(); + if (currentFluid.isEmpty()) continue; + // If the output fluid amount won't fit, then you must acquit + if (!recipeFluid.isFluidEqual(currentFluid) + || tank.getFluidAmount() + recipeFluid.getAmount() > tank.getCapacity()) { + return; + } + } + } + ItemStackHandler handler = getInventoryHandler(); + if (handler != null) { // Validate output for (VESlotManager slotManager : getSlotManagers()) { - if(slotManager.getSlotType() != SlotType.OUTPUT) continue; + if (slotManager.getSlotType() != SlotType.OUTPUT) continue; ItemStack recipeStack = recipe.getResult(slotManager.getRecipePos()); ItemStack currentItem = slotManager.getItem(handler); - if(currentItem.isEmpty()) continue; + if (currentItem.isEmpty()) continue; // If the output item amount won't fit, then you must acquit - if(!recipeStack.is(currentItem.getItem()) + if (!recipeStack.is(currentItem.getItem()) || recipeStack.getCount() + currentItem.getCount() > currentItem.getMaxStackSize()) { return; } } - VERNGRecipe rngRecipe = null; - if(recipe instanceof VERNGRecipe rec) { - rngRecipe = rec; + VEFluidRNGRecipe irngRecipe = null; + if (recipe instanceof VEFluidRNGRecipe rec) { + irngRecipe = rec; } Random r = new Random(); + // process recipe - for(VESlotManager slotManager : getSlotManagers()) { - if(slotManager.getSlotType() == SlotType.OUTPUT) { + for (VESlotManager slotManager : getSlotManagers()) { + if (slotManager.getSlotType() == SlotType.OUTPUT) { ItemStack output = recipe.getResult(slotManager.getRecipePos()); ItemStack currentStack = slotManager.getItem(handler); // rng calculations - if(rngRecipe != null) { - float randomness = rngRecipe.getOutputChance(slotManager.getRecipePos()); - if(randomness != 1) { + if (irngRecipe != null) { + float randomness = irngRecipe.getOutputChance(slotManager.getRecipePos()); + if (randomness != 1) { float random = abs(0 + r.nextFloat() * (-1)); - if(random > randomness) continue; + if (random > randomness) continue; } } - - if(currentStack.isEmpty()) slotManager.setItem(output,handler); + if (currentStack.isEmpty()) slotManager.setItem(output, handler); else currentStack.setCount(currentStack.getCount() + output.getCount()); - } else if(slotManager.getSlotType() == SlotType.INPUT) { + } else if (slotManager.getSlotType() == SlotType.INPUT) { Ingredient ingredient = recipe.getIngredient(slotManager.getRecipePos()); ItemStack currentStack = slotManager.getItem(handler); - // This is to support recipes with empty slots - if(ingredient.isEmpty()) continue; currentStack.setCount(currentStack.getCount() - ingredient.getItems()[0].getCount()); } } - this.doExtraRecipeProcessing(); } + // process recipe + for (RelationalTank relationalTank : getRelationalTanks()) { + if (relationalTank.getTankType() == TankType.OUTPUT) { + relationalTank.fillOutput(recipe, relationalTank.getRecipePos()); + } else if (relationalTank.getTankType() == TankType.INPUT) { + relationalTank.drainInput(recipe, relationalTank.getRecipePos()); + } + } + doExtraRecipeProcessing(); + this.markRecipeDirty(); + this.markFluidInputDirty(); this.setChanged(); } else if (counter > 0) { if (++sound_tick == 19 && Config.PLAY_MACHINE_SOUNDS.get()) { @@ -253,7 +381,7 @@ public void load(CompoundTag tag) { handler.deserializeNBT(inv); } - if (energy != null) energy.ifPresent(h -> h.deserializeNBT(tag)); + energy.ifPresent(h -> h.deserializeNBT(tag)); if (this instanceof IVECountable) { counter = tag.getInt("counter"); @@ -264,6 +392,12 @@ public void load(CompoundTag tag) { manager.read(tag); } + for (RelationalTank relationalTank : getRelationalTanks()) { + CompoundTag compoundTag = tag.getCompound(relationalTank.getTankName()); + relationalTank.getTank().readFromNBT(compoundTag); + relationalTank.readGuiProperties(tag); + } + super.load(tag); } @@ -291,11 +425,20 @@ public void saveAdditional(@NotNull CompoundTag tag) { tag.putInt("counter", counter); tag.putInt("length", length); } + + for (RelationalTank relationalTank : getRelationalTanks()) { + CompoundTag compoundTag = new CompoundTag(); + relationalTank.getTank().writeToNBT(compoundTag); + tag.put(relationalTank.getTankName(), compoundTag); + relationalTank.writeGuiProperties(tag); + } + super.saveAdditional(tag); } /** * A default ItemStackHandler creator. Passing in an int size creates it for us + * * @param slots the size of the inventory * @return a new inventory */ @@ -315,7 +458,7 @@ protected void onContentsChanged(int slot) { setChanged(); List managers = getSlotManagers(); - if(slot == finalUpgradeSlotLocation) tileEntity.markRecipeDirty(); + if (slot == finalUpgradeSlotLocation) tileEntity.markRecipeDirty(); else if (slot < managers.size()) { SlotType slotType = getSlotManagers().get(slot).getSlotType(); if (slotType == SlotType.INPUT) { @@ -375,7 +518,6 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate } /** - * * @param status boolean status of the slot * @param slotId int id of the slot */ @@ -391,7 +533,7 @@ public void updatePacketFromGui(boolean status, int slotId) { public void updatePacketFromGui(int direction, int slotId) { for (VESlotManager slot : getSlotManagers()) { if (slotId == slot.getSlotNum()) { - this.capabilityMap.moveSlotManagerPos(slot,direction); + this.capabilityMap.moveSlotManagerPos(slot, direction); return; } } @@ -400,7 +542,8 @@ public void updatePacketFromGui(int direction, int slotId) { CapabilityMap capabilityMap = null; /** - * This handles items,energy and fluids. Handling fluids could be moved to VEFluidTileEntity + * This handles items,energy and fluids. Handling fluids could be moved to VETileEntity + * * @param cap Base capability * @param side Base Direction * @param T the type of capability @@ -411,14 +554,10 @@ public LazyOptional getCapability(@Nonnull Capability cap, @Nullable D ItemStackHandler inventory = getInventoryHandler(); List itemManagers = getSlotManagers(); - if(capabilityMap == null) { - if(this instanceof VEFluidTileEntity fluidTileEntity) { - capabilityMap = new CapabilityMap(inventory,itemManagers,fluidTileEntity.getRelationalTanks(), energy,fluidTileEntity); - } else { - capabilityMap = new CapabilityMap(inventory,itemManagers,new ArrayList<>(), energy,null); - } + if (capabilityMap == null) { + capabilityMap = new CapabilityMap(inventory, itemManagers, getRelationalTanks(), energy, this); } - return this.capabilityMap.getCapability(cap,side,this); + return this.capabilityMap.getCapability(cap, side, this); } /** @@ -453,18 +592,19 @@ public void consumeEnergy() { } - private LazyOptional capability; + /** * Like consumeEnergy this requires that the object has an inventory + * * @return True if the object has enough energy to be able to continue * Throws an error if missing the power consumeEnergy IMPL */ public boolean canConsumeEnergy() { if (this instanceof IVEPoweredTileEntity ivePoweredTileEntity) { - if(ivePoweredTileEntity.getMaxPower() == 0) return true; // For tiles that do not consume power - if(capability == null) { - capability = this.getCapability(ForgeCapabilities.ENERGY,null); + if (ivePoweredTileEntity.getMaxPower() == 0) return true; // For tiles that do not consume power + if (capability == null) { + capability = this.getCapability(ForgeCapabilities.ENERGY, null); } return capability.map(IEnergyStorage::getEnergyStored).orElse(0) > this.consumptionMultiplier(ivePoweredTileEntity.getPowerUsage(), getInventoryHandler().getStackInSlot(ivePoweredTileEntity.getUpgradeSlotId()).copy()); @@ -525,7 +665,9 @@ public boolean canConsumeEnergy() { */ @Override public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) { - if (energy != null) energy.ifPresent(e -> e.setEnergy(pkt.getTag().getInt("energy"))); + energy.ifPresent(e -> { + if (pkt.getTag() != null && pkt.getTag().contains("energy")) e.setEnergy(pkt.getTag().getInt("energy")); + }); this.load(pkt.getTag()); super.onDataPacket(net, pkt); } @@ -557,16 +699,6 @@ public LazyOptional getEnergy() { return energy; } - public int decrementCounterOnNoPower(int localCounter) { - return localCounter < this.length ? localCounter + Config.DECREMENT_SPEED_ON_NO_POWER.get() : this.length; - } - - public void decrementSuperCounterOnNoPower() { - throw new IllegalStateException("This method is currently disabled!"); -// this.counter = this.counter < this.length ? this.counter + Config.DECREMENT_SPEED_ON_NO_POWER.get() : this.length; -// this.setChanged(); - } - public void markRecipeDirty() { this.isRecipeDirty = true; } @@ -577,8 +709,11 @@ public void validateRecipe() { } this.isRecipeDirty = false; - this.potentialRecipes = RecipeCache.getRecipesFromCache(level, this.getRecipeType(), getSlotManagers(),this,true); + this.potentialRecipes = RecipeCache.getFluidRecipesFromCache(level, this.getRecipeType(), getSlotManagers(), getRelationalTanks(), this, true); if (this.potentialRecipes.size() == 1) { + List inputFluids = this.getRelationalTanks().stream() + .filter(tank -> tank.getTankType() == TankType.INPUT) + .map(tank -> tank.getTank().getFluid()).toList(); ItemStackHandler handler = this.getInventoryHandler(); List inputItems = new ArrayList<>(); @@ -587,7 +722,7 @@ public void validateRecipe() { .filter(manager -> manager.getSlotType() == SlotType.INPUT) .map(manager -> manager.getItem(handler)).toList(); } - VERecipe newRecipe = RecipeCache.getRecipeFromCache(level, getRecipeType(), inputItems); + VEFluidRecipe newRecipe = RecipeCache.getFluidRecipeFromCache(level, getRecipeType(), inputFluids, inputItems); if (newRecipe == null) { counter = 0; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactoryBuilder.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactoryBuilder.java index d4161b7c5..66611fd2b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactoryBuilder.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactoryBuilder.java @@ -1,44 +1,16 @@ package com.veteam.voluminousenergy.blocks.tiles; -import com.veteam.voluminousenergy.util.RegistryLookups; -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.MenuProvider; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import org.apache.commons.lang3.NotImplementedException; -import org.jetbrains.annotations.Nullable; - -import javax.annotation.Nonnull; +import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; +import net.minecraftforge.common.util.LazyOptional; public class VETileFactoryBuilder { + private VETileEntity tileEntity; - - - public static class VETileEntity extends BlockEntity implements MenuProvider { - - public VETileEntity(BlockEntityType entityType, BlockPos blockPos, BlockState blockState) { - super(entityType, blockPos, blockState); - } - - @Override - public @Nonnull Component getDisplayName() { - ResourceLocation name = RegistryLookups.getBlockEntityTypeKey(this); - if (name == null) - throw new NotImplementedException("Missing registry name for class: " + this.getClass().getName()); - return Component.nullToEmpty(name.getPath()); - } - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, Inventory inventory, Player player) { - return null; - } + public VETileFactoryBuilder addEnergyStore(int maxPower,int transferRate) { + VEEnergyStorage storage = new VEEnergyStorage(maxPower, transferRate); + this.tileEntity.energy = LazyOptional.of(() -> storage); + return this; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java index 58e48bdce..87dc1e611 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.blocks.tiles.tank; -import com.veteam.voluminousenergy.blocks.tiles.VEFluidTileEntity; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.MultiFluidSlotWrapper; import com.veteam.voluminousenergy.util.RelationalTank; @@ -30,7 +30,7 @@ import java.util.ArrayList; import java.util.List; -public class TankTile extends VEFluidTileEntity { +public class TankTile extends VETileEntity { private final RelationalTank tank = new RelationalTank(new FluidTank(0), 0, TankType.BOTH, "tank:tank_gui"); List slotManagers = new ArrayList<>() {{ diff --git a/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java b/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java index dbcab3717..291ae29d9 100644 --- a/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java +++ b/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java @@ -27,7 +27,6 @@ import org.joml.Matrix4f; import javax.annotation.Nonnull; -import java.util.Random; @OnlyIn(Dist.CLIENT) public class LaserBlockEntityRenderer implements BlockEntityRenderer { diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java index f55775841..9f26da7ee 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java @@ -2,7 +2,9 @@ import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.*; +import com.veteam.voluminousenergy.blocks.containers.ToolingStationContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.blocks.screens.*; import com.veteam.voluminousenergy.compat.jei.category.*; import com.veteam.voluminousenergy.compat.jei.containerHandler.*; diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ElectrolyzingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ElectrolyzingCategory.java index 3bc6aa1ee..4101db64e 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ElectrolyzingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ElectrolyzingCategory.java @@ -28,7 +28,6 @@ import java.util.ArrayList; import java.util.Arrays; -import java.util.List; public class ElectrolyzingCategory implements IRecipeCategory { diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java index 90fe75e44..05270591a 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java @@ -1,13 +1,12 @@ package com.veteam.voluminousenergy.items.tools.multitool; -import com.veteam.voluminousenergy.blocks.tiles.VEFluidTileEntity; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.items.tools.multitool.bits.MultitoolBit; import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; import com.veteam.voluminousenergy.recipe.VEFluidRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.util.NumberUtil; import com.veteam.voluminousenergy.util.TextUtil; -import com.veteam.voluminousenergy.util.recipe.RecipeUtil; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.chat.Component; import net.minecraft.util.Mth; @@ -33,7 +32,7 @@ public class CombustionMultitool extends Multitool { - public final int TANK_CAPACITY = VEFluidTileEntity.TANK_CAPACITY; + public final int TANK_CAPACITY = VETileEntity.TANK_CAPACITY; public CombustionMultitool(MultitoolBit bit, String registryName, Properties itemProperties) { super(bit, registryName, itemProperties); diff --git a/src/main/java/com/veteam/voluminousenergy/persistence/ChunkFluids.java b/src/main/java/com/veteam/voluminousenergy/persistence/ChunkFluids.java index 17b2b65c3..f631e9bc9 100644 --- a/src/main/java/com/veteam/voluminousenergy/persistence/ChunkFluids.java +++ b/src/main/java/com/veteam/voluminousenergy/persistence/ChunkFluids.java @@ -5,7 +5,6 @@ import net.minecraft.nbt.ListTag; import net.minecraft.server.level.ServerLevel; import net.minecraft.util.datafix.DataFixTypes; -import net.minecraft.world.entity.raid.Raids; import net.minecraft.world.level.ChunkPos; import net.minecraft.world.level.dimension.DimensionType; import net.minecraft.world.level.saveddata.SavedData; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java index 111deba38..50324fce9 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java @@ -5,7 +5,6 @@ import com.veteam.voluminousenergy.recipe.VEFluidRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.VERecipes; -import com.veteam.voluminousenergy.util.recipe.FluidIngredient; import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java index 0219c8f81..856e442f8 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java @@ -1,7 +1,6 @@ package com.veteam.voluminousenergy.recipe; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; -import net.minecraft.world.item.ItemStack; import java.util.List; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java index d9350baf2..c251b9e77 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java @@ -15,7 +15,9 @@ import org.apache.commons.lang3.NotImplementedException; import org.jetbrains.annotations.NotNull; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; public abstract class VERecipe implements Recipe { diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankBoolPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankBoolPacket.java index 99eb32a42..292e54fcb 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankBoolPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankBoolPacket.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.VEFluidTileEntity; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.inventory.AbstractContainerMenu; @@ -57,9 +57,9 @@ public static void handlePacket(TankBoolPacket packet, AbstractContainerMenu ope if(openContainer instanceof VEContainer VEContainer) { if (onServer) { BlockEntity tileEntity = VEContainer.getTileEntity(); - if (tileEntity instanceof VEFluidTileEntity veFluidTileEntity) { - veFluidTileEntity.updateTankPacketFromGui(packet.status, packet.id); - veFluidTileEntity.setChanged(); + if (tileEntity instanceof VETileEntity VETileEntity) { + VETileEntity.updateTankPacketFromGui(packet.status, packet.id); + VETileEntity.setChanged(); } } else { //voluminousContainer.updateStatusTank(packet.status, packet.id); diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankDirectionPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankDirectionPacket.java index 73dc1750e..a4a569fb3 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankDirectionPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankDirectionPacket.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.VEFluidTileEntity; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.inventory.AbstractContainerMenu; @@ -57,9 +57,9 @@ public static void handlePacket(TankDirectionPacket packet, AbstractContainerMen if (openContainer instanceof VEContainer VEContainer) { if (onServer) { BlockEntity tileEntity = VEContainer.getTileEntity(); - if (tileEntity instanceof VEFluidTileEntity veFluidTileEntity) { - veFluidTileEntity.updateTankPacketFromGui(packet.direction, packet.tankId); - veFluidTileEntity.setChanged(); + if (tileEntity instanceof VETileEntity VETileEntity) { + VETileEntity.updateTankPacketFromGui(packet.direction, packet.tankId); + VETileEntity.setChanged(); } } else { //voluminousContainer.updateDirectionTank(packet.direction, packet.tankId); diff --git a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java index ce378d1fc..f743bdafc 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java +++ b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java @@ -1,7 +1,5 @@ package com.veteam.voluminousenergy.util; -import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.tiles.VEFluidTileEntity; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.blocks.tiles.tank.TankTile; import com.veteam.voluminousenergy.recipe.VEFluidRecipe; @@ -18,9 +16,9 @@ public class MultiFluidSlotWrapper implements IFluidHandler { HashMap tankHashMap = new HashMap<>(); List tanks; - VEFluidTileEntity tileEntity; + VETileEntity tileEntity; - public MultiFluidSlotWrapper(List tanks,VEFluidTileEntity tileEntity) { + public MultiFluidSlotWrapper(List tanks,VETileEntity tileEntity) { this.tanks = tanks; this.tileEntity = tileEntity; tanks.forEach(m -> tankHashMap.put(m.getSlotNum(), m)); diff --git a/src/main/java/com/veteam/voluminousenergy/util/RelationalTank.java b/src/main/java/com/veteam/voluminousenergy/util/RelationalTank.java index 785280e4f..16cb25d22 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/RelationalTank.java +++ b/src/main/java/com/veteam/voluminousenergy/util/RelationalTank.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.util; -import com.veteam.voluminousenergy.blocks.tiles.VEFluidTileEntity; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.recipe.VEFluidRecipe; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; @@ -105,7 +105,7 @@ public void fillOutput(VEFluidRecipe recipe, int id) { } } - public void setValidator(VEFluidTileEntity tileEntity,boolean isInput) { + public void setValidator(VETileEntity tileEntity,boolean isInput) { this.tank.setValidator(t -> { for(Recipe recipe : tileEntity.getPotentialRecipes()) { VEFluidRecipe veFluidRecipe = (VEFluidRecipe) recipe; diff --git a/src/main/java/com/veteam/voluminousenergy/util/WorldUtil.java b/src/main/java/com/veteam/voluminousenergy/util/WorldUtil.java index 510787434..2a3827c3d 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/WorldUtil.java +++ b/src/main/java/com/veteam/voluminousenergy/util/WorldUtil.java @@ -3,7 +3,6 @@ import com.veteam.voluminousenergy.persistence.ChunkFluid; import com.veteam.voluminousenergy.persistence.ChunkFluids; import com.veteam.voluminousenergy.recipe.DimensionalLaserRecipe; -import com.veteam.voluminousenergy.recipe.RecipeCache; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.util.climate.FluidClimateSpawn; import net.minecraft.core.BlockPos; diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidIngredient.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidIngredient.java index b45ed2f83..6a6d7b119 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidIngredient.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidIngredient.java @@ -6,7 +6,6 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.DataResult; import com.mojang.serialization.codecs.RecordCodecBuilder; -import com.veteam.voluminousenergy.VoluminousEnergy; import it.unimi.dsi.fastutil.ints.IntArrayList; import it.unimi.dsi.fastutil.ints.IntComparators; import it.unimi.dsi.fastutil.ints.IntList; diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidSerializerHelper.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidSerializerHelper.java index 20f3b06c8..ec97a9e07 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidSerializerHelper.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidSerializerHelper.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.util.recipe; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; +import com.veteam.voluminousenergy.recipe.VEFluidRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import net.minecraft.core.NonNullList; import net.minecraft.network.FriendlyByteBuf; diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeUtil.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeUtil.java index 23f0dbf8d..4adead9f5 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeUtil.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeUtil.java @@ -2,8 +2,10 @@ import com.google.gson.JsonObject; import com.google.gson.JsonSyntaxException; -import com.veteam.voluminousenergy.recipe.*; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; +import com.veteam.voluminousenergy.recipe.CrusherRecipe; +import com.veteam.voluminousenergy.recipe.StirlingGeneratorRecipe; +import com.veteam.voluminousenergy.recipe.ToolingRecipe; +import com.veteam.voluminousenergy.recipe.VEFluidSawmillRecipe; import com.veteam.voluminousenergy.util.RegistryLookups; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; @@ -15,14 +17,16 @@ import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeHolder; import net.minecraft.world.level.Level; -import net.minecraft.world.level.material.Fluid; import net.minecraftforge.common.util.Lazy; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.registries.ForgeRegistries; import oshi.util.tuples.Pair; import javax.annotation.Nullable; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Objects; +import java.util.Optional; import java.util.concurrent.atomic.AtomicReference; public class RecipeUtil { diff --git a/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java b/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java index db493c701..e654caa05 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java +++ b/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java @@ -1,7 +1,5 @@ package com.veteam.voluminousenergy.util.tiles; -import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.tiles.VEFluidTileEntity; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -30,7 +28,7 @@ public class CapabilityMap { private final ItemStackHandler inventory; private final LazyOptional energyStorage; - public CapabilityMap(@Nullable ItemStackHandler inventory, List managerList, List tanks, LazyOptional energy, @Nullable VEFluidTileEntity tileEntity) { + public CapabilityMap(@Nullable ItemStackHandler inventory, List managerList, List tanks, LazyOptional energy, @Nullable VETileEntity tileEntity) { this.inventory = inventory; this.energyStorage = energy; From d8abb4d31d490c7aa57d8a14659ddd7190834667 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Mon, 19 Feb 2024 23:31:04 -0500 Subject: [PATCH 05/27] Completed refactor of VETileEntities --- .../blocks/blocks/VEBlocks.java | 8 +- .../blocks/machines/AqueoulizerBlock.java | 4 +- .../PrimitiveStirlingGeneratorBlock.java | 4 +- .../util/VEItemStackWithFluidHandler.java | 10 +- .../blocks/containers/VEContainer.java | 16 +- .../blocks/containers/VEContainerFactory.java | 38 +- .../blocks/containers/VEContainers.java | 250 +++++----- .../blocks/screens/AirCompressorScreen.java | 4 +- .../blocks/screens/AqueoulizerScreen.java | 22 +- .../blocks/screens/BatteryBoxScreen.java | 4 +- .../blocks/screens/BlastFurnaceScreen.java | 6 +- .../screens/CentrifugalAgitatorScreen.java | 70 +-- .../screens/CentrifugalSeparatorScreen.java | 6 +- .../screens/CombustionGeneratorScreen.java | 80 +-- .../blocks/screens/CompressorScreen.java | 6 +- .../blocks/screens/CrusherScreen.java | 6 +- .../screens/DimensionalLaserScreen.java | 6 +- .../screens/DistillationUnitScreen.java | 6 +- .../blocks/screens/ElectricFurnaceScreen.java | 52 +- .../blocks/screens/ElectrolyzerScreen.java | 6 +- .../screens/FluidElectrolyzerScreen.java | 6 +- .../blocks/screens/FluidMixerScreen.java | 6 +- .../blocks/screens/GasFiredFurnaceScreen.java | 2 +- .../screens/HydroponicIncubatorScreen.java | 6 +- .../screens/ImplosionCompressorScreen.java | 62 ++- .../screens/PrimitiveBlastFurnaceScreen.java | 2 +- .../screens/PrimitiveSolarPanelScreen.java | 4 +- .../PrimitiveStirlingGeneratorScreen.java | 19 +- .../blocks/screens/PumpScreen.java | 4 +- .../blocks/screens/SawmillScreen.java | 6 +- .../blocks/screens/SolarPanelScreen.java | 4 +- .../screens/StirlingGeneratorScreen.java | 10 +- .../blocks/screens/ToolingStationScreen.java | 4 +- .../blocks/screens/VEContainerScreen.java | 5 +- .../blocks/tiles/AirCompressorTile.java | 34 +- .../blocks/tiles/AqueoulizerTile.java | 43 +- .../blocks/tiles/BatteryBoxTile.java | 250 +++++----- .../blocks/tiles/BlastFurnaceTile.java | 33 +- .../blocks/tiles/CentrifugalAgitatorTile.java | 38 +- .../tiles/CentrifugalSeparatorTile.java | 24 +- .../blocks/tiles/CombustionGeneratorTile.java | 81 ++- .../blocks/tiles/CompressorTile.java | 24 +- .../blocks/tiles/CrusherTile.java | 83 +--- .../blocks/tiles/DimensionalLaserTile.java | 38 +- .../blocks/tiles/DistillationUnitTile.java | 43 +- .../blocks/tiles/ElectricFurnaceTile.java | 24 +- .../blocks/tiles/ElectrolyzerTile.java | 26 +- .../blocks/tiles/FluidElectrolyzerTile.java | 37 +- .../blocks/tiles/FluidMixerTile.java | 37 +- .../blocks/tiles/GasFiredFurnaceTile.java | 12 +- .../blocks/tiles/HydroponicIncubatorTile.java | 36 +- .../blocks/tiles/IVECountable.java | 5 - .../blocks/tiles/IVEPowerGenerator.java | 4 - .../blocks/tiles/IVEPoweredTileEntity.java | 39 -- .../blocks/tiles/ImplosionCompressorTile.java | 24 +- .../tiles/PrimitiveBlastFurnaceTile.java | 33 +- .../blocks/tiles/PrimitiveSolarPanelTile.java | 11 - .../tiles/PrimitiveStirlingGeneratorTile.java | 53 +- .../blocks/tiles/PumpTile.java | 50 +- .../blocks/tiles/SawmillTile.java | 38 +- .../blocks/tiles/SolarPanelTile.java | 10 - .../blocks/tiles/StirlingGeneratorTile.java | 87 +--- .../blocks/tiles/ToolingStationTile.java | 33 +- .../blocks/tiles/VEItemStackHandler.java | 9 +- .../blocks/tiles/VESolarTile.java | 42 +- .../blocks/tiles/VETileEntities.java | 41 ++ .../blocks/tiles/VETileEntity.java | 465 +++++++----------- .../blocks/tiles/VETileFactory.java | 196 ++++++++ .../blocks/tiles/VETileFactoryBuilder.java | 16 - .../blocks/tiles/tank/TankTile.java | 10 +- .../compat/jei/VoluminousEnergyPlugin.java | 22 +- .../tools/multitool/CombustionMultitool.java | 2 +- .../voluminousenergy/recipe/RecipeCache.java | 12 +- .../recipe/StirlingGeneratorRecipe.java | 2 +- .../recipe/VEEnergyRecipe.java | 4 +- .../voluminousenergy/recipe/VERecipes.java | 2 +- .../recipe/processor/FluidItemProcessor.java | 121 +++++ .../processor/GeneratorItemProcessor.java | 64 +++ .../recipe/processor/RecipeProcessor.java | 9 + .../recipe/validator/FluidItemValidator.java | 70 +++ .../validator/GeneratorItemValidator.java | 36 ++ .../recipe/validator/RecipeValidator.java | 9 + .../tools/buttons/tanks/TankBoolButton.java | 6 +- .../buttons/tanks/TankDirectionButton.java | 6 +- .../tools/energy/VEEnergyStorage.java | 68 ++- .../util/BucketInputOutputUtil.java | 2 +- .../util/MultiFluidSlotWrapper.java | 22 +- .../voluminousenergy/util/SlotType.java | 1 + ...ationalTank.java => VERelationalTank.java} | 12 +- .../util/tiles/CapabilityMap.java | 44 +- .../assets/voluminousenergy/lang/en_us.json | 1 + 91 files changed, 1511 insertions(+), 1777 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/IVECountable.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/IVEPowerGenerator.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/IVEPoweredTileEntity.java create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactoryBuilder.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/FluidItemProcessor.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorItemProcessor.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/RecipeProcessor.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/validator/FluidItemValidator.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/validator/GeneratorItemValidator.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/validator/RecipeValidator.java rename src/main/java/com/veteam/voluminousenergy/util/{RelationalTank.java => VERelationalTank.java} (93%) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java index 816048639..042f48429 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java @@ -60,8 +60,8 @@ public class VEBlocks { //Primitive Stirling public static RegistryObject PRIMITIVE_STIRLING_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("primitivestirlinggenerator", PrimitiveStirlingGeneratorBlock::new); - public static RegistryObject> PRIMITIVE_STIRLING_GENERATOR_TILE = VE_TILE_REGISTRY.register("primitivestirlinggenerator", - () -> BlockEntityType.Builder.of(PrimitiveStirlingGeneratorTile::new,VEBlocks.PRIMITIVE_STIRLING_GENERATOR_BLOCK.get()).build(null)); + public static RegistryObject> PRIMITIVE_STIRLING_GENERATOR_TILE = VE_TILE_REGISTRY.register("primitivestirlinggenerator", + () -> BlockEntityType.Builder.of(VETileEntities.PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY::create,VEBlocks.PRIMITIVE_STIRLING_GENERATOR_BLOCK.get()).build(null)); public static RegistryObject> PRIMITIVE_STIRLING_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("primitivestirlinggenerator", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -130,8 +130,8 @@ public class VEBlocks { // Aqueoulizer public static RegistryObject AQUEOULIZER_BLOCK = VE_BLOCKS_REGISTRY.register("aqueoulizer", AqueoulizerBlock::new); - public static RegistryObject> AQUEOULIZER_TILE = VE_TILE_REGISTRY.register("aqueoulizer", - () -> BlockEntityType.Builder.of(AqueoulizerTile::new,VEBlocks.AQUEOULIZER_BLOCK.get()).build(null)); + public static RegistryObject> AQUEOULIZER_TILE = VE_TILE_REGISTRY.register("aqueoulizer", + () -> BlockEntityType.Builder.of(VETileEntities.AQUEOULIZER_TILE_FACTORY::create,VEBlocks.AQUEOULIZER_BLOCK.get()).build(null)); public static RegistryObject> AQUEOULIZER_CONTAINER = VE_CONTAINER_REGISTRY.register("aqueoulizer", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AqueoulizerBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AqueoulizerBlock.java index 61388724d..9f58c9069 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AqueoulizerBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AqueoulizerBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.AqueoulizerTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -31,7 +31,7 @@ public AqueoulizerBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new AqueoulizerTile(pos, state); + return VETileEntities.AQUEOULIZER_TILE_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveStirlingGeneratorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveStirlingGeneratorBlock.java index d3daf7091..dd0bdca40 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveStirlingGeneratorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveStirlingGeneratorBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.PrimitiveStirlingGeneratorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -32,7 +32,7 @@ public PrimitiveStirlingGeneratorBlock() { @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new PrimitiveStirlingGeneratorTile(pos, state); + return VETileEntities.PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java index c31dcac98..6af592ac6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.recipe.VEFluidRecipe; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.TagUtil; import net.minecraft.core.NonNullList; import net.minecraft.world.item.ItemStack; @@ -15,17 +15,17 @@ public class VEItemStackWithFluidHandler extends ItemStackHandler { private final VESlotManager[] managers; - private final RelationalTank[] relationalTanks; + private final VERelationalTank[] relationalTanks; private final Class recipeType; private VEFluidRecipe recipe; private final Level level; private final int upgradeSlot; - public VEItemStackWithFluidHandler(int size,int upgradeSlot, Class recipeType, List tankList, Level level, VESlotManager... managers) { + public VEItemStackWithFluidHandler(int size, int upgradeSlot, Class recipeType, List tankList, Level level, VESlotManager... managers) { stacks = NonNullList.withSize(size, ItemStack.EMPTY); this.managers = managers; this.recipeType = recipeType; - this.relationalTanks = tankList.toArray(RelationalTank[]::new); + this.relationalTanks = tankList.toArray(VERelationalTank[]::new); this.level = level; this.upgradeSlot = upgradeSlot; } @@ -49,7 +49,7 @@ public boolean isItemValid(int slot, @NotNull ItemStack stack) { return false; } - public RelationalTank[] getRelationalTanks() { + public VERelationalTank[] getRelationalTanks() { return relationalTanks; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java index f073e6bfc..2e27a0062 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java @@ -3,8 +3,8 @@ import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.screens.BatteryBoxScreen; import com.veteam.voluminousenergy.blocks.screens.VEContainerScreen; -import com.veteam.voluminousenergy.blocks.tiles.IVEPoweredTileEntity; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.RegistryLookups; import com.veteam.voluminousenergy.util.SlotType; @@ -56,13 +56,14 @@ protected VEContainer(@Nullable MenuType menuType, int id, Level world, Block layoutPlayerInventorySlots(); // We assume if it's a powered tile entity that it requires a dataslot for energy - if(this.tileEntity instanceof IVEPoweredTileEntity) { + if(this.tileEntity.getEnergy() != null) { addDataSlot(new DataSlot() { @Override public int get() { return getEnergy(); } + // Setting anything here seems to cause a flickering on the client @Override public void set(int value) { } @@ -181,8 +182,9 @@ public void updateDirectionTank(int direction, int id){ } public int getUpgradeSlotId(){ - if (tileEntity instanceof IVEPoweredTileEntity){ - return ((IVEPoweredTileEntity) tileEntity).getUpgradeSlotId(); + VEEnergyStorage storage = this.tileEntity.getEnergy(); + if (storage != null){ + return storage.getUpgradeSlotId(); } VoluminousEnergy.LOGGER.error("A container called getUpgradeSlotId when tile doesn't support upgrade slots! Offending tile is: " + RegistryLookups.getBlockEntityTypeKey(tileEntity.getType())); return 0; @@ -196,10 +198,10 @@ public ItemStack quickMoveStack(final @NotNull Player player, final int index) { VoluminousEnergy.LOGGER.info("testing!"); - int numberOfSlots = this.tileEntity.getSlotManagers().size() + (this.tileEntity instanceof IVEPoweredTileEntity ? 1 : 0); + int numberOfSlots = this.tileEntity.getSlotManagers().size() + (this.tileEntity.getEnergy() != null ? 1 : 0); // TODO why is this a dangling if? - if(this.tileEntity instanceof IVEPoweredTileEntity){} + if(this.tileEntity.getEnergy() != null){} if (slot.hasItem()) { final ItemStack slotStack = slot.getItem(); @@ -242,7 +244,7 @@ protected boolean moveItemStackTo(@NotNull ItemStack stackToMove, int endPos, in List slotManagers = this.tileEntity.getSlotManagers(); ItemStackHandler handler = this.tileEntity.getInventoryHandler(); int powerId = -1; - if(tileEntity instanceof IVEPoweredTileEntity ivePoweredTileEntity) powerId = ivePoweredTileEntity.getUpgradeSlotId(); + if(tileEntity.getEnergy() != null) powerId = tileEntity.getEnergy().getUpgradeSlotId(); if (stackToMove.isStackable()) { while (!stackToMove.isEmpty()) { if (currentPos >= endPos) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java index 8d31adea1..fc1a09945 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java @@ -1,7 +1,8 @@ package com.veteam.voluminousenergy.blocks.containers; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.tiles.IVEPoweredTileEntity; +import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.TileSlot; +import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.SlotType; import net.minecraft.core.BlockPos; import net.minecraft.world.entity.player.Inventory; @@ -17,16 +18,24 @@ import java.util.ArrayList; import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; public class VEContainerFactory { private RegistryObject> menuTypeRegistryObject; private RegistryObject block; private final List slots = new ArrayList<>(); + private final List tileSlots = new ArrayList<>(); - public int numberOfSlots() { + private int upgradeSlotId = -1; + + public int getNumberOfSlots() { return VEContainerFactory.this.slots.size(); } + public int upgradeSlotId() { + return upgradeSlotId; + } + public VEContainer create(int id, Level world, BlockPos pos, Inventory inventory, Player player) { return new VEContainer(menuTypeRegistryObject.get(), id, world, pos, inventory, player, block.get()) { @Override @@ -35,8 +44,8 @@ protected void addSlotsToGUI(IItemHandler h) { int energySlotId = -1; - if( this.tileEntity instanceof IVEPoweredTileEntity poweredTileEntity) { - energySlotId = poweredTileEntity.getUpgradeSlotId(); + if( this.tileEntity.getEnergy() != null) { + energySlotId = this.tileEntity.getEnergy().getUpgradeSlotId(); } for(int i = 0; i < slots.size(); i++) { @@ -58,6 +67,11 @@ protected void addSlotsToGUI(IItemHandler h) { }; } + public List getTileSlotsAsManagers() { + AtomicInteger i = new AtomicInteger(0); + return tileSlots.stream().map(t -> t.asManager(i.getAndIncrement())).toList(); + } + public static class VEContainerFactoryBuilder { private VEContainerFactory factory; @@ -69,8 +83,22 @@ public VEContainerFactoryBuilder create(RegistryObject> me return this; } - public VEContainerFactoryBuilder addSlot(int index, int x, int y) { + private int index = 0; + + public VEContainerFactoryBuilder addSlot(int x, int y) { + this.factory.slots.add(new Slot(index++, x, y)); + return this; + } + + public VEContainerFactoryBuilder addUpgradeSlot(int x, int y) { this.factory.slots.add(new Slot(index, x, y)); + this.factory.upgradeSlotId = index++; + return this; + } + + public VEContainerFactoryBuilder addSlot(int x, int y,TileSlot slot) { + this.factory.slots.add(new Slot(index++, x, y)); + this.factory.tileSlots.add(slot); return this; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java index 2e3b48aae..d25f6ca1e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java @@ -1,6 +1,8 @@ package com.veteam.voluminousenergy.blocks.containers; import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory.VEContainerFactoryBuilder; +import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.*; +import net.minecraft.core.Direction; import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.*; @@ -8,186 +10,186 @@ public class VEContainers { public static final VEContainerFactory AIR_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() .create(AIR_COMPRESSOR_CONTAINER, AIR_COMPRESSOR_BLOCK) - .addSlot(0, 70, 18) // Air Compressor bucket input slot - .addSlot(1, 70, 49) // Air Compressor bucket output slot - .addSlot(2, 154, -14) // Upgrade Slot + .addSlot(70, 18) // Air Compressor bucket input slot + .addSlot(70, 49) // Air Compressor bucket output slot + .addSlot(154, -14) // Upgrade Slot .build(); public static final VEContainerFactory AQUEOULIZER_FACTORY = new VEContainerFactoryBuilder() .create(AQUEOULIZER_CONTAINER, AQUEOULIZER_BLOCK) - .addSlot(0, 38, 18) // Bucket input; input tank - .addSlot(1, 38, 49) // Bucket output; input tank - .addSlot(2, 137, 18) // Bucket insert; output tank - .addSlot(3, 137, 49) // Bucket output; output tank - .addSlot(4, 96, 32) // Item to be dissolved - .addSlot(5, 130, -14) // Upgrade Slot + .addSlot(38, 18, new BucketInputSlot(Direction.UP, 0)) + .addSlot(38, 49, new BucketOutputSlot(Direction.DOWN)) + .addSlot(137, 18, new BucketInputSlot(Direction.NORTH, 1)) + .addSlot(137, 49, new BucketOutputSlot(Direction.SOUTH)) + .addSlot(96, 32, new ItemInputSlot(Direction.EAST, 0)) + .addUpgradeSlot(130, -14) .build(); public static final VEContainerFactory BATTERY_BOX_FACTORY = new VEContainerFactoryBuilder() .create(BATTERY_BOX_CONTAINER, BATTERY_BOX_BLOCK) - .addSlot(0, 35, 17) - .addSlot(1, 53, 17) - .addSlot(2, 71, 17) - .addSlot(3, 89, 17) - .addSlot(4, 107, 17) - .addSlot(5, 125, 17) + .addSlot(35, 17) + .addSlot(53, 17) + .addSlot(71, 17) + .addSlot(89, 17) + .addSlot(107, 17) + .addSlot(125, 17) //Bottom Slots - .addSlot(6, 35, 54) - .addSlot(7, 53, 54) - .addSlot(8, 71, 54) - .addSlot(9, 89, 54) - .addSlot(10, 107, 54) - .addSlot(11, 125, 54) + .addSlot(35, 54) + .addSlot(53, 54) + .addSlot(71, 54) + .addSlot(89, 54) + .addSlot(107, 54) + .addSlot(125, 54) .build(); public static final VEContainerFactory BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(BLAST_FURNACE_CONTAINER, BLAST_FURNACE_BLOCK) - .addSlot(0, 38, 18) // Fluid input slot - .addSlot(1, 38, 49) // Extract fluid from heat tank - .addSlot(2, 80, 25) // First input slot - .addSlot(3, 80, 43) // Second input slot - .addSlot(4, 134, 34) // Third input slot - .addSlot(5, 130, -14) // Upgrade slot. + .addSlot(38, 18) // Fluid input slot + .addSlot(38, 49) // Extract fluid from heat tank + .addSlot(80, 25) // First input slot + .addSlot(80, 43) // Second input slot + .addSlot(134, 34) // Third input slot + .addSlot(130, -14) // Upgrade slot. .build(); public static final VEContainerFactory CENTRIFUGAL_AGITATOR_FACTORY = new VEContainerFactoryBuilder() .create(CENTRIFUGAL_AGITATOR_CONTAINER, CENTRIFUGAL_AGITATOR_BLOCK) - .addSlot(0, 38, 18) // Bucket insert; input tank - .addSlot(1, 38, 49) // Bucket extract; input tank - .addSlot(2, 96, 18) // Bucket insert; first output tank - .addSlot(3, 96, 49) // Bucket extract; first output tank - .addSlot(4, 137, 18) // Bucket insert; second output tank - .addSlot(5, 137, 49) // Bucket extract; second output tank - .addSlot(6, 130, -14) // Upgrade slot + .addSlot(38, 18) // Bucket insert; input tank + .addSlot(38, 49) // Bucket extract; input tank + .addSlot(96, 18) // Bucket insert; first output tank + .addSlot(96, 49) // Bucket extract; first output tank + .addSlot(137, 18) // Bucket insert; second output tank + .addSlot(137, 49) // Bucket extract; second output tank + .addSlot(130, -14) // Upgrade slot .build(); public static final VEContainerFactory CENTRIFUGAL_SEPARATOR_FACTORY = new VEContainerFactoryBuilder() .create(CENTRIFUGAL_SEPARATOR_CONTAINER, CENTRIFUGAL_SEPARATOR_BLOCK) - .addSlot(0, 53, 24) // Primary input slot - .addSlot(1, 53, 42) // Empty Bucket slot - .addSlot(2, 99, 33) //Main Output - .addSlot(3, 117, 15) //RNG #1 Slot - .addSlot(4, 135, 33) //RNG #2 Slot - .addSlot(5, 117, 51) //RNG #3 Slot - .addSlot(6, 155, -14) // Upgrade Slot + .addSlot(53, 24) // Primary input slot + .addSlot(53, 42) // Empty Bucket slot + .addSlot(99, 33) //Main Output + .addSlot(117, 15) //RNG #1 Slot + .addSlot(135, 33) //RNG #2 Slot + .addSlot(117, 51) //RNG #3 Slot + .addSlot(155, -14) // Upgrade Slot .build(); public static final VEContainerFactory COMBUSTION_GENERATOR_FACTORY = new VEContainerFactoryBuilder() .create(COMBUSTION_GENERATOR_CONTAINER, COMBUSTION_GENERATOR_BLOCK) - .addSlot(0, 38, 18) // Oxidizer input slot - .addSlot(1, 38, 49) // Extract fluid from oxidizer slot - .addSlot(2, 138, 18) // Fuel input slot - .addSlot(3, 138, 49) // Extract fluid from fuel output + .addSlot(38, 18) // Oxidizer input slot + .addSlot(38, 49) // Extract fluid from oxidizer slot + .addSlot(138, 18) // Fuel input slot + .addSlot(138, 49) // Extract fluid from fuel output .build(); public static final VEContainerFactory COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() .create(COMPRESSOR_CONTAINER, COMPRESSOR_BLOCK) - .addSlot(0, 80, 13) - .addSlot(1, 80, 58) //Main Output - .addSlot(2, 154, -14) //Upgrade slot + .addSlot(80, 13) + .addSlot(80, 58) //Main Output + .addSlot(154, -14) //Upgrade slot .build(); public static final VEContainerFactory CRUSHER_FACTORY = new VEContainerFactoryBuilder() .create(CRUSHER_CONTAINER, CRUSHER_BLOCK) - .addSlot(0, 80, 13) - .addSlot(1, 80, 58) //Main Output - .addSlot(2, 154, -14) //Upgrade slot + .addSlot(80, 13) + .addSlot(80, 58) //Main Output + .addSlot(154, -14) //Upgrade slot .build(); public static final VEContainerFactory DIMENSIONAL_LASER_FACTORY = new VEContainerFactoryBuilder() .create(DIMENSIONAL_LASER_CONTAINER, DIMENSIONAL_LASER_BLOCK) - .addSlot(0, 138, 18) // Bucket top slot - .addSlot(1, 138, 49) // Bucket bottom slot - .addSlot(2, 38, 33) // RFID chip slot - .addSlot(3, 130, -14) // Upgrade slot + .addSlot(138, 18) // Bucket top slot + .addSlot(138, 49) // Bucket bottom slot + .addSlot(38, 33) // RFID chip slot + .addSlot(130, -14) // Upgrade slot .build(); public static final VEContainerFactory DISTILLATION_UNIT_FACTORY = new VEContainerFactoryBuilder() .create(DISTILLATION_UNIT_CONTAINER, DISTILLATION_UNIT_BLOCK) - .addSlot(0, 38, 18) // Fluid input slot - .addSlot(1, 38, 49) // Extract fluid from input - .addSlot(2, 96, 11) // Top slot for first output - .addSlot(3, 96, 42) // Bottom slot for first output - .addSlot(4, 137, 11) // Top slot for from second output - .addSlot(5, 137, 42) // Bottom slot for second output - .addSlot(6, 122, 64) // Item Output Slot - .addSlot(7, 130, -14) // Upgrade slot + .addSlot(38, 18) // Fluid input slot + .addSlot(38, 49) // Extract fluid from input + .addSlot(96, 11) // Top slot for first output + .addSlot(96, 42) // Bottom slot for first output + .addSlot(137, 11) // Top slot for from second output + .addSlot(137, 42) // Bottom slot for second output + .addSlot(122, 64) // Item Output Slot + .addSlot(130, -14) // Upgrade slot .build(); public static final VEContainerFactory ELECTRIC_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(ELECTRIC_FURNACE_CONTAINER, ELECTRIC_FURNACE_BLOCK) - .addSlot(0, 53, 33) // Furnace Input Slot - .addSlot(1, 116, 33) // Furnace Output Slot - .addSlot(2, 154, -14)// Upgrade Slot + .addSlot(53, 33) // Furnace Input Slot + .addSlot(116, 33) // Furnace Output Slot + .addSlot(154, -14)// Upgrade Slot .build(); public static final VEContainerFactory ELECTROLYZER_FACTORY = new VEContainerFactoryBuilder() .create(ELECTROLYZER_CONTAINER, ELECTROLYZER_BLOCK) - .addSlot(0, 71, 13) - .addSlot(1, 89, 13) // Empty Bucket slot - .addSlot(2, 53, 57) //Main Output - .addSlot(3, 71, 57) //RNG #1 Slot - .addSlot(4, 89, 57) //RNG #2 Slot - .addSlot(5, 107, 57) //RNG #3 Slot - .addSlot(6, 154, -14) // Upgrade Slot + .addSlot(71, 13) + .addSlot(89, 13) // Empty Bucket slot + .addSlot(53, 57) //Main Output + .addSlot(71, 57) //RNG #1 Slot + .addSlot(89, 57) //RNG #2 Slot + .addSlot(107, 57) //RNG #3 Slot + .addSlot(154, -14) // Upgrade Slot .build(); public static final VEContainerFactory FLUID_ELECTROLYZER_FACTORY = new VEContainerFactoryBuilder() .create(FLUID_ELECTROLYZER_CONTAINER, FLUID_ELECTROLYZER_BLOCK) - .addSlot(0, 38, 18) // Top input bucket - .addSlot(1, 38, 49) // Bottom input bucket - .addSlot(2, 96, 18) // Top output0 bucket - .addSlot(3, 96, 49) // Bottom output0 bucket - .addSlot(4, 137, 18) // Top output1 bucket - .addSlot(5, 137, 49) // Bottom output1 bucket - .addSlot(6, 130, -14) // Upgrade slot + .addSlot(38, 18) // Top input bucket + .addSlot(38, 49) // Bottom input bucket + .addSlot(96, 18) // Top output0 bucket + .addSlot(96, 49) // Bottom output0 bucket + .addSlot(137, 18) // Top output1 bucket + .addSlot(137, 49) // Bottom output1 bucket + .addSlot(130, -14) // Upgrade slot .build(); public static final VEContainerFactory FLUID_MIXER_FACTORY = new VEContainerFactoryBuilder() .create(FLUID_MIXER_CONTAINER, FLUID_MIXER_BLOCK) - .addSlot(0, 38, 18) // Top input0 bucket - .addSlot(1, 38, 49) // Bottom input0 bucket - .addSlot(2, 86, 18) // Top input1 bucket - .addSlot(3, 86, 49) // Bottom input1 bucket - .addSlot(4, 136, 18) // Top output0 bucket - .addSlot(5, 136, 49) // Bottom output0 bucket - .addSlot(6, 130, -14) // Upgrade slot + .addSlot(38, 18) // Top input0 bucket + .addSlot(38, 49) // Bottom input0 bucket + .addSlot(86, 18) // Top input1 bucket + .addSlot(86, 49) // Bottom input1 bucket + .addSlot(136, 18) // Top output0 bucket + .addSlot(136, 49) // Bottom output0 bucket + .addSlot(130, -14) // Upgrade slot .build(); public static final VEContainerFactory GAS_FIRED_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(GAS_FIRED_FURNACE_CONTAINER, GAS_FIRED_FURNACE_BLOCK) - .addSlot(0, 8, 18) // Fluid input slot - .addSlot(1, 8, 49) // Extract fluid from input - .addSlot(2, 53, 33) // Item input slot - .addSlot(3, 116, 33) // Item output slot - .addSlot(4, 154, -14) // Upgrade slot + .addSlot(8, 18) // Fluid input slot + .addSlot(8, 49) // Extract fluid from input + .addSlot(53, 33) // Item input slot + .addSlot(116, 33) // Item output slot + .addSlot(154, -14) // Upgrade slot .build(); public static final VEContainerFactory HYDROPONIC_INCUBATOR_FACTORY = new VEContainerFactoryBuilder() .create(HYDROPONIC_INCUBATOR_CONTAINER, HYDROPONIC_INCUBATOR_BLOCK) - .addSlot(0, 38, 18) // Bucket top slot - .addSlot(1, 38, 49) // Bucket bottom slot - .addSlot(2, 83, 34) // Primary input - .addSlot(3, 123, 8) // Primary output - .addSlot(4, 123, 26) // RNG0 output - .addSlot(5, 123, 44) // RNG1 output - .addSlot(6, 123, 62) // RNG2 output - .addSlot(7, 154, -14) // Upgrade slot + .addSlot(38, 18) // Bucket top slot + .addSlot(38, 49) // Bucket bottom slot + .addSlot(83, 34) // Primary input + .addSlot(123, 8) // Primary output + .addSlot(123, 26) // RNG0 output + .addSlot(123, 44) // RNG1 output + .addSlot(123, 62) // RNG2 output + .addSlot(154, -14) // Upgrade slot .build(); public static final VEContainerFactory IMPLOSION_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() .create(IMPLOSION_COMPRESSOR_CONTAINER, IMPLOSION_COMPRESSOR_BLOCK) - .addSlot(0, 53, 23) // Main input - .addSlot(1, 53, 41) // Gunpowder slot - .addSlot(2, 116, 33) //Main Output - .addSlot(3, 154, -14) //Upgrade slot + .addSlot(53, 23) // Main input + .addSlot(53, 41) // Gunpowder slot + .addSlot(116, 33) //Main Output + .addSlot(154, -14) //Upgrade slot .build(); public static final VEContainerFactory PRIMITIVE_BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(PRIMITIVE_BLAST_FURNACE_CONTAINER, PRIMITIVE_BLAST_FURNACE_BLOCK) - .addSlot(0, 53, 33) - .addSlot(1, 116, 33) - .addSlot(2, 154, -14) + .addSlot(53, 33) + .addSlot(116, 33) + .addSlot(154, -14) .build(); public static final VEContainerFactory PRIMITIVE_SOLAR_PANEL_FACTORY = new VEContainerFactoryBuilder() @@ -196,23 +198,23 @@ public class VEContainers { public static final VEContainerFactory PRIMITIVE_STIRLING_GENERATOR_FACTORY = new VEContainerFactoryBuilder() .create(PRIMITIVE_STIRLING_GENERATOR_CONTAINER, PRIMITIVE_STIRLING_GENERATOR_BLOCK) - .addSlot(0, 80, 35) + .addSlot(80, 35, new ItemInputSlot(Direction.UP, 0)) .build(); public static final VEContainerFactory PUMP_FACTORY = new VEContainerFactoryBuilder() .create(PUMP_CONTAINER, PUMP_BLOCK) - .addSlot(0, 70, 18) // Pump bucket input slot - .addSlot(1, 70, 49) // Pump bucket output slot + .addSlot(70, 18) // Pump bucket input slot + .addSlot(70, 49) // Pump bucket output slot .build(); public static final VEContainerFactory SAWMILL_FACTORY = new VEContainerFactoryBuilder() .create(SAWMILL_CONTAINER, SAWMILL_BLOCK) - .addSlot(0, 44, 32) // Log input slot - .addSlot(1, 80, 24) // Plank Output - .addSlot(2, 80, 42) // Secondary Output - .addSlot(3, 115, 18) // Bucket Input - .addSlot(4, 115, 49) // Bucket Output - .addSlot(5, 154, -14) // Upgrade Slot + .addSlot(44, 32) // Log input slot + .addSlot(80, 24) // Plank Output + .addSlot(80, 42) // Secondary Output + .addSlot(115, 18) // Bucket Input + .addSlot(115, 49) // Bucket Output + .addSlot(154, -14) // Upgrade Slot .build(); public static final VEContainerFactory SOLAR_PANEL_FACTORY = new VEContainerFactoryBuilder() @@ -221,17 +223,17 @@ public class VEContainers { public static final VEContainerFactory STIRLING_GENERATOR_FACTORY = new VEContainerFactoryBuilder() .create(STIRLING_GENERATOR_CONTAINER, STIRLING_GENERATOR_BLOCK) - .addSlot(0, 80, 35) + .addSlot(80, 35) .build(); // TOOLING STATION UNUSED public static final VEContainerFactory TOOLING_STATION_FACTORY = new VEContainerFactoryBuilder() - .create(TOOLING_STATION_CONTAINER,TOOLING_STATION_BLOCK) - .addSlot(0, 38, 18) // Fluid input slot - .addSlot(1, 38, 49) // Extract fluid from input - .addSlot(2, 86, 32) // Main Tool slot - .addSlot(3, 134, 18) // Bit Slot - .addSlot(4, 134,49) // Base Slot - .addSlot(5,154, -14) // Upgrade Slot + .create(TOOLING_STATION_CONTAINER, TOOLING_STATION_BLOCK) + .addSlot(38, 18) // Fluid input slot + .addSlot(38, 49) // Extract fluid from input + .addSlot(86, 32) // Main Tool slot + .addSlot(134, 18) // Bit Slot + .addSlot(134, 49) // Base Slot + .addSlot(154, -14) // Upgrade Slot .build(); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java index 1f5d81826..108443dfa 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java @@ -62,9 +62,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack,int mouseX, int m @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.AIR_COMPRESSOR_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.AIR_COMPRESSOR_MAX_POWER.get()), mouseX, mouseY); } if (isHovering(93, 18, 12, 50, mouseX, mouseY)){ // Oxidizer Tank diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java index 7d939e5e7..14f4982ea 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.AqueoulizerTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; @@ -20,14 +20,14 @@ import java.util.List; public class AqueoulizerScreen extends VEContainerScreen { - private final AqueoulizerTile tileEntity; + private final VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/aqueoulizer_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public AqueoulizerScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (AqueoulizerTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -46,17 +46,17 @@ protected void init() { @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("aqueoulizer"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("+"), 82, 34, GREY_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack,this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("aqueoulizer"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("+"), 82, 34, GREY_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Tanks - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("1")), 157, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("1")), 157, 18, WHITE_TEXT_STYLE); // Slots handled by super super.renderSlotAndTankLabels(matrixStack, mouseX, mouseY); @@ -65,9 +65,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.AQUEOULIZER_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.AQUEOULIZER_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -106,7 +104,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(this.GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); if (tileEntity != null) { - int progress = tileEntity.progressCounterPX(9); + int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java index e63aad144..98cd43cd3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java @@ -112,9 +112,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.BATTERY_BOX_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.BATTERY_BOX_MAX_POWER.get()), mouseX, mouseY); } if (isHovering(10,4,15,10, mouseX, mouseY)){ diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java index 7404dc388..5e653a1b5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java @@ -76,9 +76,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.BLAST_FURNACE_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.BLAST_FURNACE_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -111,7 +109,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(this.GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); if(tileEntity != null && tileEntity.getMultiblockValidity()){ - int progress = tileEntity.progressCounterPX(9); + int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java index c3c543bd2..5064bd0d1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java @@ -22,23 +22,23 @@ public class CentrifugalAgitatorScreen extends VEContainerScreen { private final CentrifugalAgitatorTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/centrifugal_agitator_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public CentrifugalAgitatorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public CentrifugalAgitatorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = (CentrifugalAgitatorTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); // Buttons renderIOMenu(tileEntity); @@ -47,8 +47,8 @@ protected void init(){ @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("centrifugal_agitator"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("centrifugal_agitator"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @@ -64,34 +64,34 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { - if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.CENTRIFUGAL_AGITATOR_MAX_POWER.get()), mouseX, mouseY); - })); + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { + if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { + + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.CENTRIFUGAL_AGITATOR_MAX_POWER.get()), mouseX, mouseY); + } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - if (isHovering(61, 18, 12, 50, mouseX, mouseY)){ // Input Tank + if (isHovering(61, 18, 12, 50, mouseX, mouseY)) { // Input Tank int amount = tileEntity.getFluidStackFromTank(0).getAmount(); String name = tileEntity.getFluidStackFromTank(0).getTranslationKey(); - matrixStack.renderTooltip(this.font,TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - if (isHovering(119, 18, 12, 50, mouseX, mouseY)){ // First Output Tank + if (isHovering(119, 18, 12, 50, mouseX, mouseY)) { // First Output Tank int amount = tileEntity.getFluidStackFromTank(1).getAmount(); String name = tileEntity.getFluidStackFromTank(1).getTranslationKey(); - matrixStack.renderTooltip(this.font,TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - if (isHovering(157, 18, 12, 50, mouseX, mouseY)){ // Second Output Tank + if (isHovering(157, 18, 12, 50, mouseX, mouseY)) { // Second Output Tank int amount = tileEntity.getFluidStackFromTank(2).getAmount(); String name = tileEntity.getFluidStackFromTank(2).getTranslationKey(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -105,15 +105,15 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(this.GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(9); + matrixStack.blit(this.GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { + int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); /*Note for this.blit below: @@ -124,22 +124,24 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(this.GUI,i+81, j+31, 176, 0, progress, 17); - matrixStack.blit(this.GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(this.GUI, i + 81, j + 31, 176, 0, progress, 17); + matrixStack.blit(this.GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(1),tileEntity.getTankCapacity(), i + 119, j + 18, 0, 12, 50); - } catch (Exception e){ } + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(1), tileEntity.getTankCapacity(), i + 119, j + 18, 0, 12, 50); + } catch (Exception e) { + } - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(2),tileEntity.getTankCapacity(), i + 157, j + 18, 0, 12, 50); - } catch (Exception e){ } + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(2), tileEntity.getTankCapacity(), i + 157, j + 18, 0, 12, 50); + } catch (Exception e) { + } drawIOSideHelper(); // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+129, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java index 2c844f6e8..a679f51f1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java @@ -63,9 +63,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.CENTRIFUGAL_SEPARATOR_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.CENTRIFUGAL_SEPARATOR_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -91,7 +89,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(this.GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(9); + int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); /*Note for this.blit below: p_blit_1_ = starting x for blit on screen diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java index 25f851ae4..bc9dcc6f5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java @@ -23,71 +23,69 @@ public class CombustionGeneratorScreen extends VEContainerScreen { private CombustionGeneratorTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/combustion_generator_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public CombustionGeneratorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public CombustionGeneratorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = (CombustionGeneratorTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); - renderIOMenu(this.tileEntity,64 + (this.width/2), this.topPos -18); + renderIOMenu(this.tileEntity, 64 + (this.width / 2), this.topPos - 18); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("combustion_generator"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("combustion_generator"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderCenteredShadowedText(matrixStack,Minecraft.getInstance().font, Component.nullToEmpty(tileEntity.getEnergyRate() + " FE/t"), 96, 18, WHITE_TEXT_STYLE); + TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(tileEntity.getEnergyRate() + " FE/t"), 96, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 38, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 38, 49, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 138, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 138, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 38, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 38, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 138, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 138, 49, WHITE_TEXT_STYLE); // Tanks - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("1")), 119, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("1")), 119, 18, WHITE_TEXT_STYLE); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { - if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.COMBUSTION_GENERATOR_MAX_POWER.get()), mouseX, mouseY); - })); + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { + if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.COMBUSTION_GENERATOR_MAX_POWER.get()), mouseX, mouseY); } - if (isHovering(61, 18, 12, 50, mouseX, mouseY)){ // Oxidizer Tank + if (isHovering(61, 18, 12, 50, mouseX, mouseY)) { // Oxidizer Tank String name = tileEntity.getFluidStackFromTank(0).getTranslationKey(); int amount = tileEntity.getFluidStackFromTank(0).getAmount(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - if (isHovering(119, 18, 12, 50, mouseX, mouseY)){ // Fuel Tank + if (isHovering(119, 18, 12, 50, mouseX, mouseY)) { // Fuel Tank String name = tileEntity.getFluidStackFromTank(1).getTranslationKey(); int amount = tileEntity.getFluidStackFromTank(1).getAmount(); - matrixStack.renderTooltip(this.font,TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)){ // Flame blit + if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { // Flame blit matrixStack.renderComponentTooltip(this.font, getTooltips(), mouseX, mouseY); } @@ -106,15 +104,15 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(14); + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { + int progress = tileEntity.progressProcessingCounterPX(14); int power = menu.powerScreen(49); /*Note for this.blit below: @@ -125,16 +123,18 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i + 89, j + (36 + (14-progress)), 176, (14-progress), 14, progress); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); - - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); - } catch (Exception e){ } - - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(1),tileEntity.getTankCapacity(), i + 119, j + 18, 0, 12, 50); - } catch (Exception e){ } + matrixStack.blit(GUI, i + 89, j + (36 + (14 - progress)), 176, (14 - progress), 14, progress); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); + + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); + } catch (Exception e) { + } + + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(1), tileEntity.getTankCapacity(), i + 119, j + 18, 0, 12, 50); + } catch (Exception e) { + } RenderSystem.setShaderTexture(0, GUI_TOOLS); drawIOSideHelper(); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java index a943e21de..dd45d3af2 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java @@ -61,9 +61,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.COMPRESSOR_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.COMPRESSOR_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -89,7 +87,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(24); + int progress = tileEntity.progressProcessingCounterPX(24); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java index e5cf23568..6cba3f4c4 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java @@ -60,9 +60,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.CRUSHER_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.CRUSHER_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); @@ -90,7 +88,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(24); + int progress = tileEntity.progressProcessingCounterPX(24); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java index 889b2f4bb..6d94f94dd 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java @@ -112,9 +112,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, tileEntity.getMaxPower()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), tileEntity.getEnergy().getMaxEnergyStored()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -147,7 +145,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); if (tileEntity != null && tileEntity.getMultiblockValidity()) { - int progress = tileEntity.progressCounterPX(17); // 17 vertical, 15 horz for Dimensional Laser + int progress = tileEntity.progressProcessingCounterPX(17); // 17 vertical, 15 horz for Dimensional Laser int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java index e01daaeb1..647af6c34 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java @@ -74,9 +74,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.DISTILLATION_UNIT_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.DISTILLATION_UNIT_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -121,7 +119,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); if(tileEntity != null && tileEntity.getMultiblockValidity()){ - int progress = tileEntity.progressCounterPX(9); + int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java index e0af0a339..16296b4d9 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java @@ -25,74 +25,72 @@ public class ElectricFurnaceScreen extends VEContainerScreen { private ElectricFurnaceTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/electric_furnace_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public ElectricFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public ElectricFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = (ElectricFurnaceTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - protected void init(){ + protected void init() { super.init(); // Buttons - addRenderableWidget(new ioMenuButton(64 + (this.width/2), this.topPos +4, buttons ->{ + addRenderableWidget(new ioMenuButton(64 + (this.width / 2), this.topPos + 4, buttons -> { })); // Input insert - addRenderableWidget(new SlotBoolButton(tileEntity.inputSlotManager, (this.width/2)-198, this.topPos, button->{ + addRenderableWidget(new SlotBoolButton(tileEntity.inputSlotManager, (this.width / 2) - 198, this.topPos, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.inputSlotManager, (this.width/2)-184, this.topPos, button ->{ + addRenderableWidget(new SlotDirectionButton(tileEntity.inputSlotManager, (this.width / 2) - 184, this.topPos, button -> { // Do nothing })); // Input Extract - addRenderableWidget(new SlotBoolButton(tileEntity.outputSlotManager, (this.width/2)-198, this.topPos+20, button ->{ + addRenderableWidget(new SlotBoolButton(tileEntity.outputSlotManager, (this.width / 2) - 198, this.topPos + 20, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.outputSlotManager, (this.width/2)-184, this.topPos+20, button ->{ + addRenderableWidget(new SlotDirectionButton(tileEntity.outputSlotManager, (this.width / 2) - 184, this.topPos + 20, button -> { // Do nothing })); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("electric_furnace"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("electric_furnace"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 53, 33, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 116, 33, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 53, 33, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 116, 33, WHITE_TEXT_STYLE); } @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.ELECTRIC_FURNACE_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.ELECTRIC_FURNACE_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -106,15 +104,15 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(9); + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { + int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); /*Note for this.blit below: @@ -125,12 +123,12 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i+81,j+31,176,0,progress,17); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(GUI, i + 81, j + 31, 176, 0, progress, 17); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); } // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java index bde816376..194af2417 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java @@ -64,9 +64,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.ELECTROLYZER_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.ELECTROLYZER_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -92,7 +90,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(24); + int progress = tileEntity.progressProcessingCounterPX(24); int power = menu.powerScreen(49); /*Note for this.blit below: p_blit_1_ = starting x for blit on screen diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java index 4c0ea5a9b..3965bfa9c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java @@ -71,9 +71,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.FLUID_ELECTROLYZER_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.FLUID_ELECTROLYZER_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -118,7 +116,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(9); + int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java index 1c6171986..2780e6188 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java @@ -73,9 +73,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.FLUID_MIXER_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.FLUID_MIXER_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -120,7 +118,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(9); + int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java index fcb0ae585..698028418 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java @@ -105,7 +105,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks,int mouseX,in matrixStack.blit(GUI,i,j,0,0,this.imageWidth,this.imageHeight); final int flameHeight = 14; if(tileEntity!=null){ - int progress = tileEntity.progressCounterPX(9); + int progress = tileEntity.progressProcessingCounterPX(9); int fuelProgress = tileEntity.progressFuelCounterPX(flameHeight); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java index 447a30f98..5b592977e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java @@ -69,9 +69,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.HYDROPONIC_INCUBATOR_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.HYDROPONIC_INCUBATOR_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -104,7 +102,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(9); + int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java index d9da05ab6..2fea40069 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java @@ -20,87 +20,85 @@ import java.util.Arrays; import java.util.List; -public class ImplosionCompressorScreen extends VEContainerScreen { +public class ImplosionCompressorScreen extends VEContainerScreen { private ImplosionCompressorTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/implosion_compressor_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public ImplosionCompressorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public ImplosionCompressorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = (ImplosionCompressorTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - protected void init(){ + protected void init() { super.init(); // Buttons - addRenderableWidget(new ioMenuButton(64 + (this.width/2), this.topPos +4, buttons ->{ + addRenderableWidget(new ioMenuButton(64 + (this.width / 2), this.topPos + 4, buttons -> { })); // Input insert - addRenderableWidget(new SlotBoolButton(tileEntity.inputSlotManager, (this.width/2)-198, this.topPos, button->{ + addRenderableWidget(new SlotBoolButton(tileEntity.inputSlotManager, (this.width / 2) - 198, this.topPos, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.inputSlotManager, (this.width/2)-184, this.topPos, button ->{ + addRenderableWidget(new SlotDirectionButton(tileEntity.inputSlotManager, (this.width / 2) - 184, this.topPos, button -> { // Do nothing })); // Input Gunpowder - addRenderableWidget(new SlotBoolButton(tileEntity.gunpowderSlotManager, (this.width/2)-198, this.topPos+20, button ->{ + addRenderableWidget(new SlotBoolButton(tileEntity.gunpowderSlotManager, (this.width / 2) - 198, this.topPos + 20, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.gunpowderSlotManager, (this.width/2)-184, this.topPos+20, button ->{ + addRenderableWidget(new SlotDirectionButton(tileEntity.gunpowderSlotManager, (this.width / 2) - 184, this.topPos + 20, button -> { // Do nothing })); // Output - addRenderableWidget(new SlotBoolButton(tileEntity.outputSlotManager, (this.width/2)-198, this.topPos+40, button ->{ + addRenderableWidget(new SlotBoolButton(tileEntity.outputSlotManager, (this.width / 2) - 198, this.topPos + 40, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.outputSlotManager, (this.width/2)-184, this.topPos+40, button ->{ + addRenderableWidget(new SlotDirectionButton(tileEntity.outputSlotManager, (this.width / 2) - 184, this.topPos + 40, button -> { // Do nothing })); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("implosion_compressor"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("implosion_compressor"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 53, 23, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 53, 41, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 116, 33, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 53, 23, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 53, 41, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 116, 33, WHITE_TEXT_STYLE); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.IMPLOSION_COMPRESSOR_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.IMPLOSION_COMPRESSOR_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -114,15 +112,15 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(24); + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { + int progress = tileEntity.progressProcessingCounterPX(24); int power = menu.powerScreen(49); /*Note for this.blit below: @@ -133,12 +131,12 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i+78,j+31,176,0,progress,17); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(GUI, i + 78, j + 31, 176, 0, progress, 17); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); } // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); drawIOSideHelper(); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java index 95f521450..7521e2ab8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java @@ -111,7 +111,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(24); + int progress = tileEntity.progressProcessingCounterPX(24); /*Note for this.blit below: x = starting x for blit on screen y = starting y for blit on screen diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java index de0f06d3e..98214deb2 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java @@ -35,9 +35,7 @@ public void render(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY, flo @Override protected void renderTooltip(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.PRIMITIVE_SOLAR_PANEL_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.PRIMITIVE_SOLAR_PANEL_MAX_POWER.get()), mouseX, mouseY); } super.renderTooltip(matrixStack,mouseX, mouseY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java index f93deb61b..88351f959 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java @@ -3,8 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.PrimitiveStirlingGeneratorTile; -import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotBoolButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotDirectionButton; @@ -25,12 +24,12 @@ public class PrimitiveStirlingGeneratorScreen extends VEContainerScreen { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.PRIMITIVE_STIRLING_GENERATOR_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), tileEntity.getEnergy().getMaxEnergyStored()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)){ matrixStack.renderComponentTooltip(this.font, getTooltips(), mouseX, mouseY); } @@ -79,16 +76,14 @@ public List getTooltips() { return Arrays.asList( Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.percent_burned").getString() + ": " + tileEntity.progressCounterPercent() + "%"), Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.ticksLeft()), - Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergyRate() + " FE/t")); + Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergy().getProduction() + " FE/t")); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY){ TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("primitivestirlinggenerator"), 8, 6, WHITE_TEXT_STYLE); - int generationRate; - if (tileEntity.ticksLeft() > 0) generationRate = Config.PRIMITIVE_STIRLING_GENERATOR_GENERATE.get(); - else generationRate = 0; + int generationRate = tileEntity.getEnergy().getProduction(); TextUtil.renderCenteredShadowedText(matrixStack,Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + generationRate + " FE/t"), 90, 18, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); @@ -111,7 +106,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); // Actual Gui if (tileEntity != null) { int power = menu.powerScreen(49); - int progress = tileEntity.progressCounterPX(14); + int progress = tileEntity.progressBurnCounterPX(14); matrixStack.blit(GUI,i + 81, j + (55 + (14-progress)), 176, (14-progress), 14, progress); // 55 = full, 55+14 = end matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 14 + (49-power), 12, power); RenderSystem.setShaderTexture(0, GUI_TOOLS); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java index e6a0a16ac..55dff14c7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java @@ -76,9 +76,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.PUMP_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.PUMP_MAX_POWER.get()), mouseX, mouseY); } if (isHovering(93, 18, 12, 50, mouseX, mouseY)){ // Oxidizer Tank diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java index b57d7cdfb..9d16dedc4 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java @@ -67,9 +67,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.SAWMILL_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.SAWMILL_MAX_POWER.get()), mouseX, mouseY); } if (isHovering(138, 18, 12, 50, mouseX, mouseY)){ // Output Tank @@ -104,7 +102,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); if(tileEntity != null){ - int progress = tileEntity.progressCounterPX(9); + int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java index f1cd4a071..ea4d0002a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java @@ -35,9 +35,7 @@ public void render(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY, flo @Override protected void renderTooltip(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, /*temp modified*/Config.SOLAR_PANEL_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), /*temp modified*/Config.SOLAR_PANEL_MAX_POWER.get()), mouseX, mouseY); } super.renderTooltip(matrixStack,mouseX, mouseY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java index 2f52c6a9c..cd25da30b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java @@ -61,7 +61,7 @@ protected void init() { @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("stirling_generator"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergyRate() + " FE/t"), 90, 18, WHITE_TEXT_STYLE); + TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergy().getProduction() + " FE/t"), 90, 18, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @@ -75,9 +75,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.STIRLING_GENERATOR_MAX_POWER.get()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.STIRLING_GENERATOR_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -92,7 +90,7 @@ public List getTooltips() { return Arrays.asList( Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.percent_burned").getString() + ": " + tileEntity.progressCounterPercent() + "%"), Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.ticksLeft()), - Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergyRate() + " FE/t")); + Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergy().getProduction() + " FE/t")); } @Override @@ -104,7 +102,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); if (tileEntity != null) { - int progress = tileEntity.progressCounterPX(14); + int progress = tileEntity.progressProcessingCounterPX(14); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java index 2035cec47..e50d81446 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java @@ -62,9 +62,7 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, tileEntity.getMaxPower()), mouseX, mouseY); - })); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), tileEntity.getEnergy().getMaxEnergyStored()), mouseX, mouseY); } if (isHovering(61, 18, 12, 50, mouseX, mouseY)){ // Input Tank diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java index 9dedc9f13..e0271954c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java @@ -2,7 +2,6 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.buttons.VEIOButton; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotBoolButton; @@ -12,7 +11,7 @@ import com.veteam.voluminousenergy.tools.networking.VENetwork; import com.veteam.voluminousenergy.tools.networking.packets.UuidPacket; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; @@ -74,7 +73,7 @@ public void renderIOMenu(VETileEntity tileEntity, int menuButtonX, int menuButto increase++; } - for (RelationalTank tank : tileEntity.getRelationalTanks()) { + for (VERelationalTank tank : tileEntity.getRelationalTanks()) { // Input Tank addRenderableWidget(new TankBoolButton(tank, (this.width / 2) - 198, this.topPos + (20 * increase), button -> { // Do nothing diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java index 7f7cd90cd..698594fec 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java @@ -6,7 +6,7 @@ import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TagUtil; import com.veteam.voluminousenergy.util.TankType; @@ -31,7 +31,7 @@ import java.util.Collections; import java.util.List; -public class AirCompressorTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { +public class AirCompressorTile extends VETileEntity { public VESlotManager[] slotManagers = new VESlotManager[]{ new VESlotManager(0,Direction.UP,true, SlotType.FLUID_INPUT,1,0), @@ -40,7 +40,7 @@ public class AirCompressorTile extends VETileEntity implements IVEPoweredTileEnt private final ItemStackHandler inventory = createHandler(3, this); - private final RelationalTank airTank = new RelationalTank(new FluidTank(TANK_CAPACITY), 0, TankType.OUTPUT, "air_tank:air_tank_properties"); + private final VERelationalTank airTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, TankType.OUTPUT, "air_tank:air_tank_properties"); public AirCompressorTile(BlockPos pos, BlockState state) { super(VEBlocks.AIR_COMPRESSOR_TILE.get(), pos, state, null); @@ -82,7 +82,7 @@ public void tick() { level.playSound(null, this.getBlockPos(), VESounds.AIR_COMPRESSOR, SoundSource.BLOCKS, 1.0F, 1.0F); } } - counter = (byte) this.calculateCounter(20, this.inventory.getStackInSlot(this.getUpgradeSlotId())); + counter = (byte) this.calculateCounter(20, this.inventory.getStackInSlot(this.energy.getUpgradeSlotId())); } } else { counter--; @@ -99,7 +99,7 @@ protected void onContentsChanged(int slot) { @Override public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if (tileEntity.getUpgradeSlotId() == slot) { + if (tileEntity.energy.getUpgradeSlotId() == slot) { return TagUtil.isTaggedMachineUpgradeItem(stack); } if(slot == 0 && stack.getItem() instanceof BucketItem bucketItem) { @@ -137,11 +137,11 @@ public FluidStack getAirTankFluid() { } @Override - public @Nonnull List getRelationalTanks() { + public @Nonnull List getRelationalTanks() { return Collections.singletonList(airTank); } - public RelationalTank getAirTank() { + public VERelationalTank getAirTank() { return this.airTank; } @@ -154,24 +154,4 @@ public RelationalTank getAirTank() { public @Nonnull List getSlotManagers() { return List.of(slotManagers); } - - @Override - public int getMaxPower() { - return Config.AIR_COMPRESSOR_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.AIR_COMPRESSOR_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.AIR_COMPRESSOR_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 2; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java index 013360ab9..2b2cc23b5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java @@ -3,9 +3,8 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.AqueoulizerRecipe; -import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import net.minecraft.core.BlockPos; @@ -21,12 +20,12 @@ import java.util.ArrayList; import java.util.List; -public class AqueoulizerTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { - private final ItemStackHandler inventory = createHandler(6); +public class AqueoulizerTile extends VETileEntity { + private final ItemStackHandler inventory = new VEItemStackHandler(this,6); - public List fluidManagers = new ArrayList<>() {{ - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank:input_tank_gui")); - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 1, 0, TankType.OUTPUT, "outputTank:output_tank_gui")); + public List fluidManagers = new ArrayList<>() {{ + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank:input_tank_gui")); + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 1, 0, TankType.OUTPUT, "outputTank:output_tank_gui")); }}; public List slotManagers = new ArrayList<>(){{ @@ -44,14 +43,6 @@ public class AqueoulizerTile extends VETileEntity implements IVEPoweredTileEntit public AqueoulizerTile(BlockPos pos, BlockState state) { super(VEBlocks.AQUEOULIZER_TILE.get(), pos, state, AqueoulizerRecipe.RECIPE_TYPE); - fluidManagers.get(0).setValidator(this, true); - fluidManagers.get(1).setValidator(this, false); - } - - @Override - public void tick() { - updateClients(); - super.tick(); } @Nonnull @@ -61,7 +52,7 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor } @Override - public @Nonnull List getRelationalTanks() { + public @Nonnull List getRelationalTanks() { return fluidManagers; } @@ -69,24 +60,4 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor public @Nonnull List getSlotManagers() { return slotManagers; } - - @Override - public int getMaxPower() { - return Config.AQUEOULIZER_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.AQUEOULIZER_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.AQUEOULIZER_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 5; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java index 654f42604..682696556 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.List; -public class BatteryBoxTile extends VETileEntity implements IVEPoweredTileEntity { +public class BatteryBoxTile extends VETileEntity { private final int POWER_MAX_TX = Config.BATTERY_BOX_TRANSFER.get(); private final int MAX_POWER = Config.BATTERY_BOX_MAX_POWER.get(); @@ -39,23 +39,23 @@ public class BatteryBoxTile extends VETileEntity implements IVEPoweredTileEntity add(new VESlotManager(3, Direction.UP, true, SlotType.INPUT)); add(new VESlotManager(4, Direction.UP, true, SlotType.INPUT)); add(new VESlotManager(5, Direction.UP, true, SlotType.INPUT)); - add(new VESlotManager(6,Direction.DOWN, true,SlotType.OUTPUT)); - add(new VESlotManager(7,Direction.DOWN, true,SlotType.OUTPUT)); - add(new VESlotManager(8,Direction.DOWN, true,SlotType.OUTPUT)); - add(new VESlotManager(9,Direction.DOWN, true,SlotType.OUTPUT)); - add(new VESlotManager(10,Direction.DOWN, true,SlotType.OUTPUT)); - add(new VESlotManager(11,Direction.DOWN, true,SlotType.OUTPUT)); + add(new VESlotManager(6, Direction.DOWN, true, SlotType.OUTPUT)); + add(new VESlotManager(7, Direction.DOWN, true, SlotType.OUTPUT)); + add(new VESlotManager(8, Direction.DOWN, true, SlotType.OUTPUT)); + add(new VESlotManager(9, Direction.DOWN, true, SlotType.OUTPUT)); + add(new VESlotManager(10, Direction.DOWN, true, SlotType.OUTPUT)); + add(new VESlotManager(11, Direction.DOWN, true, SlotType.OUTPUT)); } }; @Override public void updatePacketFromGui(boolean status, int slotId) { - if(slotId < 6) { - for(int i = 0; i < 6;i++) { + if (slotId < 6) { + for (int i = 0; i < 6; i++) { slotManagers.get(i).setStatus(status); } - } else if(slotId < 12) { - for(int i = 6; i < 12; i++) { + } else if (slotId < 12) { + for (int i = 6; i < 12; i++) { slotManagers.get(i).setStatus(status); } } @@ -63,25 +63,25 @@ public void updatePacketFromGui(boolean status, int slotId) { @Override public void updatePacketFromGui(int direction, int slotId) { - if(slotId < 6) { - for(int i = 0; i < 6;i++) { - this.capabilityMap.moveSlotManagerPos(slotManagers.get(i),direction); + if (slotId < 6) { + for (int i = 0; i < 6; i++) { + this.capabilityMap.moveSlotManagerPos(slotManagers.get(i), direction); } - } else if(slotId < 12) { - for(int i = 6; i < 12; i++) { - this.capabilityMap.moveSlotManagerPos(slotManagers.get(i),direction); + } else if (slotId < 12) { + for (int i = 6; i < 12; i++) { + this.capabilityMap.moveSlotManagerPos(slotManagers.get(i), direction); } } } // Modes and meta stuff for the battery box private final VEBatterySwitchManager[] switchManagers = { - new VEBatterySwitchManager(0,true), - new VEBatterySwitchManager(1,true), - new VEBatterySwitchManager(2,true), - new VEBatterySwitchManager(3,true), - new VEBatterySwitchManager(4,true), - new VEBatterySwitchManager(5,true), + new VEBatterySwitchManager(0, true), + new VEBatterySwitchManager(1, true), + new VEBatterySwitchManager(2, true), + new VEBatterySwitchManager(3, true), + new VEBatterySwitchManager(4, true), + new VEBatterySwitchManager(5, true), }; @@ -90,7 +90,7 @@ public void updatePacketFromGui(int direction, int slotId) { private final VEPowerIOManager powerIOManager = new VEPowerIOManager(true); public BatteryBoxTile(BlockPos pos, BlockState state) { - super(VEBlocks.BATTERY_BOX_TILE.get(), pos, state,null); + super(VEBlocks.BATTERY_BOX_TILE.get(), pos, state, null); } public ItemStackHandler inventory = new ItemStackHandler(12) { @@ -101,15 +101,16 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { //IS ITEM VALID @Nonnull @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate){ //ALSO DO THIS PER SLOT BASIS TO SAVE DEBUG HOURS!!! - if(stack.getCapability(ForgeCapabilities.ENERGY).isPresent()) return super.insertItem(slot, stack, simulate); + public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { //ALSO DO THIS PER SLOT BASIS TO SAVE DEBUG HOURS!!! + if (stack.getCapability(ForgeCapabilities.ENERGY).isPresent()) + return super.insertItem(slot, stack, simulate); return stack; } @Override @Nonnull - public ItemStack extractItem(int slot, int amount, boolean simulate){ - return super.extractItem(slot,amount,simulate); + public ItemStack extractItem(int slot, int amount, boolean simulate) { + return super.extractItem(slot, amount, simulate); } @Override @@ -120,14 +121,14 @@ protected void onContentsChanged(final int slot) { }; @Override - public void tick(){ + public void tick() { updateClients(); - for(int i = 0; i < 12; i++){ - if(!inventory.getStackInSlot(i).isEmpty()){ - if(inventory.getStackInSlot(i).getCapability(ForgeCapabilities.ENERGY).isPresent()){ - if(i >= 6){ - int j = i-6; - if(switchManagers[j].isFlipped()){ + for (int i = 0; i < 12; i++) { + if (!inventory.getStackInSlot(i).isEmpty()) { + if (inventory.getStackInSlot(i).getCapability(ForgeCapabilities.ENERGY).isPresent()) { + if (i >= 6) { + int j = i - 6; + if (switchManagers[j].isFlipped()) { //VoluminousEnergy.LOGGER.debug("Discharging: " + i); dischargeItem(inventory.getStackInSlot(j)); } else { @@ -135,7 +136,7 @@ public void tick(){ chargeItem(inventory.getStackInSlot(j)); } } else { - if(switchManagers[i].isFlipped()){ + if (switchManagers[i].isFlipped()) { //VoluminousEnergy.LOGGER.debug("Discharging: " + i); dischargeItem(inventory.getStackInSlot(i)); } else { @@ -147,116 +148,111 @@ public void tick(){ } } } - if(powerIOManager.isFlipped()){ + if (powerIOManager.isFlipped()) { sendOutPower(); } } private void dischargeItem(ItemStack itemStack) { - energy.ifPresent(teEnergy -> { - if(teEnergy.getEnergyStored() < teEnergy.getMaxEnergyStored()){ - itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energyItem ->{ - if(energyItem.canExtract()){ - int toExtract; - if(itemStack.getItem() instanceof VEEnergyItem) { - int maxExtractItem = ((VEEnergyItem) itemStack.getItem()).getMaxTransfer(); - toExtract = Math.min(energyItem.getEnergyStored(), maxExtractItem); - toExtract = Math.min(toExtract, POWER_MAX_TX); - } else toExtract = Math.min(energyItem.getEnergyStored(), POWER_MAX_TX); - - if(energyItem.getEnergyStored() > 0){ - if(toExtract + teEnergy.getEnergyStored() <= MAX_POWER){ - energyItem.extractEnergy(toExtract,false); - teEnergy.receiveEnergy(toExtract,false); - } else if (teEnergy.getEnergyStored() != MAX_POWER){ - energyItem.extractEnergy(MAX_POWER - teEnergy.getEnergyStored(), false); - teEnergy.receiveEnergy(MAX_POWER - teEnergy.getEnergyStored(), false); - } + if (energy.getEnergyStored() < energy.getMaxEnergyStored()) { + itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energyItem -> { + if (energyItem.canExtract()) { + int toExtract; + if (itemStack.getItem() instanceof VEEnergyItem) { + int maxExtractItem = ((VEEnergyItem) itemStack.getItem()).getMaxTransfer(); + toExtract = Math.min(energyItem.getEnergyStored(), maxExtractItem); + toExtract = Math.min(toExtract, POWER_MAX_TX); + } else toExtract = Math.min(energyItem.getEnergyStored(), POWER_MAX_TX); + + if (energyItem.getEnergyStored() > 0) { + if (toExtract + energy.getEnergyStored() <= MAX_POWER) { + energyItem.extractEnergy(toExtract, false); + energy.receiveEnergy(toExtract, false); + } else if (energy.getEnergyStored() != MAX_POWER) { + energyItem.extractEnergy(MAX_POWER - energy.getEnergyStored(), false); + energy.receiveEnergy(MAX_POWER - energy.getEnergyStored(), false); } } - }); - } - }); + } + }); + } } - private void chargeItem(ItemStack itemStack){ - energy.ifPresent(teEnergy -> { - if(teEnergy.getEnergyStored() > 0){ - itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energyItem -> { - if(energyItem.canReceive()){ - int toReceive; - if(itemStack.getItem() instanceof VEEnergyItem){ - int maxReceiveItem = ((VEEnergyItem) itemStack.getItem()).getMaxTransfer(); - toReceive = Math.min( - (energyItem.getMaxEnergyStored() - energyItem.getEnergyStored()), - maxReceiveItem); - toReceive = Math.min(toReceive, POWER_MAX_TX); - toReceive = Math.min(toReceive, teEnergy.getEnergyStored()); - } else toReceive = Math.min((energyItem.getMaxEnergyStored() - energyItem.getEnergyStored()), POWER_MAX_TX); - - if(toReceive + teEnergy.getEnergyStored() <= energyItem.getMaxEnergyStored()){ - teEnergy.extractEnergy(toReceive, false); - energyItem.receiveEnergy(toReceive, false); - } else if(energyItem.getEnergyStored() != energyItem.getMaxEnergyStored()){ // Actually, this might not be needed - teEnergy.extractEnergy(energyItem.getMaxEnergyStored() - energyItem.getEnergyStored(), false); - energyItem.receiveEnergy(energyItem.getMaxEnergyStored() - energyItem.getEnergyStored(), false); - } + private void chargeItem(ItemStack itemStack) { + if (energy.getEnergyStored() > 0) { + itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energyItem -> { + if (energyItem.canReceive()) { + int toReceive; + if (itemStack.getItem() instanceof VEEnergyItem) { + int maxReceiveItem = ((VEEnergyItem) itemStack.getItem()).getMaxTransfer(); + toReceive = Math.min( + (energyItem.getMaxEnergyStored() - energyItem.getEnergyStored()), + maxReceiveItem); + toReceive = Math.min(toReceive, POWER_MAX_TX); + toReceive = Math.min(toReceive, energy.getEnergyStored()); + } else + toReceive = Math.min((energyItem.getMaxEnergyStored() - energyItem.getEnergyStored()), POWER_MAX_TX); + + if (toReceive + energy.getEnergyStored() <= energyItem.getMaxEnergyStored()) { + energy.extractEnergy(toReceive, false); + energyItem.receiveEnergy(toReceive, false); + } else if (energyItem.getEnergyStored() != energyItem.getMaxEnergyStored()) { // Actually, this might not be needed + energy.extractEnergy(energyItem.getMaxEnergyStored() - energyItem.getEnergyStored(), false); + energyItem.receiveEnergy(energyItem.getMaxEnergyStored() - energyItem.getEnergyStored(), false); } - }); - } - }); + } + }); + } } - private void moveItem(int i){ - if(i <6){ + private void moveItem(int i) { + if (i < 6) { //VoluminousEnergy.LOGGER.debug("Move Item Called"); ItemStack itemStack = inventory.getStackInSlot(i).copy(); - if(inventory.getStackInSlot(i+6).isEmpty()){ + if (inventory.getStackInSlot(i + 6).isEmpty()) { //VoluminousEnergy.LOGGER.debug("Empty check passed"); // Remove item in the ith, slot and move it to i+6th slot indicating it's discharged itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energy -> { //VoluminousEnergy.LOGGER.debug("Item has Energy Capability"); - if((!switchManagers[i].isFlipped() && energy.getEnergyStored() == energy.getMaxEnergyStored()) - || (switchManagers[i].isFlipped() && energy.getEnergyStored() == 0)){ + if ((!switchManagers[i].isFlipped() && energy.getEnergyStored() == energy.getMaxEnergyStored()) + || (switchManagers[i].isFlipped() && energy.getEnergyStored() == 0)) { //VoluminousEnergy.LOGGER.debug("Energy stored is Max energy, or item is drained"); - inventory.extractItem(i,1,false); - inventory.insertItem(i+6,itemStack.copy(),false); + inventory.extractItem(i, 1, false); + inventory.insertItem(i + 6, itemStack.copy(), false); } }); } - } else if (inventory.getStackInSlot(i-6).isEmpty()) { + } else if (inventory.getStackInSlot(i - 6).isEmpty()) { ItemStack itemStack = inventory.getStackInSlot(i).copy(); itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energy -> { - if((switchManagers[i-6].isFlipped() && energy.getEnergyStored() == energy.getMaxEnergyStored()) - || (!switchManagers[i-6].isFlipped() && energy.getEnergyStored() == 0)){ - inventory.extractItem(i,1,false); - inventory.insertItem(i-6, itemStack.copy(),false); + if ((switchManagers[i - 6].isFlipped() && energy.getEnergyStored() == energy.getMaxEnergyStored()) + || (!switchManagers[i - 6].isFlipped() && energy.getEnergyStored() == 0)) { + inventory.extractItem(i, 1, false); + inventory.insertItem(i - 6, itemStack.copy(), false); } }); } } - public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxReceive){ + public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxReceive) { return tileEntity.getCapability(ForgeCapabilities.ENERGY, from).map(handler -> handler.receiveEnergy(maxReceive, false)).orElse(0); } - private void sendOutPower() { - energy.ifPresent(energy -> { - for (Direction dir : Direction.values()){ - BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); - Direction opposite = dir.getOpposite(); - if(tileEntity != null){ - // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount - int smallest = Math.min(getTransferRate(), energy.getEnergyStored()); - int received = receiveEnergy(tileEntity, opposite, smallest); - energy.consumeEnergy(received); - if (energy.getEnergyStored() <=0){ - break; - } + void sendOutPower() { + for (Direction dir : Direction.values()) { + BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); + Direction opposite = dir.getOpposite(); + if (tileEntity != null) { + // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount + int smallest = Math.min(this.energy.getMaxTransfer(), energy.getEnergyStored()); + int received = receiveEnergy(tileEntity, opposite, smallest); + energy.consumeEnergy(received); + if (energy.getEnergyStored() <= 0) { + break; } } - }); + } } /* @@ -264,7 +260,7 @@ private void sendOutPower() { */ @Override - public void load(CompoundTag tag){ + public void load(CompoundTag tag) { switchManagers[0].setFlipped(tag.getBoolean("slot_pair_mode_0")); switchManagers[1].setFlipped(tag.getBoolean("slot_pair_mode_1")); switchManagers[2].setFlipped(tag.getBoolean("slot_pair_mode_2")); @@ -306,16 +302,16 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor return slotManagers; } - public void updateSlotPair(boolean mode, int pairId){ + public void updateSlotPair(boolean mode, int pairId) { switchManagers[pairId].setFlipped(mode); } - public void updateSendOutPower(boolean sendOutPower){ + public void updateSendOutPower(boolean sendOutPower) { this.powerIOManager.setFlipped(sendOutPower); - if(sendOutPower) { - this.energy.ifPresent(e -> e.setMaxReceive(0)); + if (sendOutPower) { + energy.setMaxReceive(0); } else { - this.energy.ifPresent(e -> e.setMaxReceive(getTransferRate())); + energy.setMaxReceive(this.energy.getMaxTransfer()); } } @@ -326,24 +322,4 @@ public VEBatterySwitchManager[] getSwitchManagers() { public VEPowerIOManager getPowerIOManager() { return powerIOManager; } - - @Override - public int getMaxPower() { - return Config.BATTERY_BOX_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return 0; - } - - @Override - public int getTransferRate() { - return Config.BATTERY_BOX_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return -1; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java index 6d247bd33..d6d7754f9 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java @@ -3,9 +3,8 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.IndustrialBlastingRecipe; -import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import net.minecraft.core.BlockPos; @@ -24,7 +23,7 @@ import java.util.ArrayList; import java.util.List; -public class BlastFurnaceTile extends VEMultiBlockTileEntity implements IVEPoweredTileEntity, IVECountable { +public class BlastFurnaceTile extends VEMultiBlockTileEntity { List slotManagers = new ArrayList<>() { { @@ -36,13 +35,13 @@ public class BlastFurnaceTile extends VEMultiBlockTileEntity implements IVEPower } }; - RelationalTank[] fluidManagers = new RelationalTank[]{ - new RelationalTank(new FluidTank(TANK_CAPACITY), 0,0, TankType.INPUT, "heatTank:heat_tank_gui") + VERelationalTank[] fluidManagers = new VERelationalTank[]{ + new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0,0, TankType.INPUT, "heatTank:heat_tank_gui") }; private byte tick = 19; - public ItemStackHandler inventory = createHandler(6); + public ItemStackHandler inventory = new VEItemStackHandler(this,6); @Override public @Nonnull ItemStackHandler getInventoryHandler() { @@ -104,27 +103,7 @@ public int getTemperatureFahrenheit() { } @Override - public @NotNull List getRelationalTanks() { + public @NotNull List getRelationalTanks() { return List.of(fluidManagers); } - - @Override - public int getMaxPower() { - return Config.BLAST_FURNACE_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.BLAST_FURNACE_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.BLAST_FURNACE_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 5; - } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java index 28b673a90..e17badc6d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java @@ -3,9 +3,8 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.CentrifugalAgitatorRecipe; -import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import net.minecraft.core.BlockPos; @@ -23,7 +22,7 @@ import java.util.ArrayList; import java.util.List; -public class CentrifugalAgitatorTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { +public class CentrifugalAgitatorTile extends VETileEntity { public List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); @@ -34,16 +33,17 @@ public class CentrifugalAgitatorTile extends VETileEntity implements IVEPoweredT add(new VESlotManager(5, Direction.WEST, true, SlotType.FLUID_OUTPUT)); }}; - public List fluidManagers = new ArrayList<>() {{ - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank:input_tank_gui")); - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 1, 0, TankType.OUTPUT, "outputTank0:output_tank_0_gui")); - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 2, 1, TankType.OUTPUT, "outputTank1:output_tank_1_gui")); + public List fluidManagers = new ArrayList<>() {{ + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank:input_tank_gui")); + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 1, 0, TankType.OUTPUT, "outputTank0:output_tank_0_gui")); + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 2, 1, TankType.OUTPUT, "outputTank1:output_tank_1_gui")); }}; + public CentrifugalAgitatorTile(BlockPos pos, BlockState state) { super(VEBlocks.CENTRIFUGAL_AGITATOR_TILE.get(), pos, state, CentrifugalAgitatorRecipe.RECIPE_TYPE); } - public ItemStackHandler inventory = createHandler(7); + public ItemStackHandler inventory = new VEItemStackHandler(this, 7); @Override public @Nonnull ItemStackHandler getInventoryHandler() { @@ -55,11 +55,6 @@ public void tick() { super.tick(); } - @Override - public int getUpgradeSlotId() { - return 6; - } - @Nonnull @Override public List getSlotManagers() { @@ -73,22 +68,7 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor } @Override - public @NotNull List getRelationalTanks() { + public @NotNull List getRelationalTanks() { return fluidManagers; } - - @Override - public int getMaxPower() { - return Config.CENTRIFUGAL_AGITATOR_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.CENTRIFUGAL_AGITATOR_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.CENTRIFUGAL_AGITATOR_TRANSFER.get(); - } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java index 9f4f6685e..70d990f70 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java @@ -20,8 +20,8 @@ import java.util.ArrayList; import java.util.List; -public class CentrifugalSeparatorTile extends VETileEntity implements IVEPoweredTileEntity,IVECountable { - private final ItemStackHandler handler = createHandler(7); +public class CentrifugalSeparatorTile extends VETileEntity { + private final ItemStackHandler handler = new VEItemStackHandler(this,7); public List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0,0, Direction.UP,true, SlotType.INPUT)); @@ -52,24 +52,4 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor public List getSlotManagers() { return slotManagers; } - - @Override - public int getMaxPower() { - return Config.CENTRIFUGAL_SEPARATOR_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.CENTRIFUGAL_SEPARATOR_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.CENTRIFUGAL_SEPARATOR_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 6; - } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java index 0129c38c5..7a0a5f7df 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java @@ -10,7 +10,7 @@ import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import net.minecraft.core.BlockPos; @@ -41,7 +41,7 @@ import java.util.Collections; import java.util.List; -public class CombustionGeneratorTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { +public class CombustionGeneratorTile extends VETileEntity { List slotManagers = new ArrayList<>() { { @@ -55,10 +55,10 @@ public class CombustionGeneratorTile extends VETileEntity implements IVEPoweredT private final int tankCapacity = 4000; public static final int COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT = 250; - List fluidManagers = new ArrayList<>() { + List fluidManagers = new ArrayList<>() { { - add(new RelationalTank(new FluidTank(tankCapacity), 0, 0, TankType.INPUT, "oxidizerTank:oxidizer_tank_gui")); - add(new RelationalTank(new FluidTank(tankCapacity), 1, 0, TankType.INPUT, "fuelTank:fuel_tank_gui")); + add(new VERelationalTank(new FluidTank(tankCapacity), 0, 0, TankType.INPUT, "oxidizerTank:oxidizer_tank_gui")); + add(new VERelationalTank(new FluidTank(tankCapacity), 1, 0, TankType.INPUT, "fuelTank:fuel_tank_gui")); } }; private int energyRate; @@ -69,11 +69,11 @@ public CombustionGeneratorTile(BlockPos pos, BlockState state) { super(VEBlocks.COMBUSTION_GENERATOR_TILE.get(), pos, state, null); fluidManagers.get(0).getTank().setValidator(fluid -> { List recipes = CombustionGeneratorFuelRecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE); - return recipes.stream().anyMatch(r -> ((VEFluidRecipe)r).getFluidIngredient(0).test(fluid)); + return recipes.stream().anyMatch(r -> ((VEFluidRecipe) r).getFluidIngredient(0).test(fluid)); }); fluidManagers.get(1).getTank().setValidator(fluid -> { List recipes = CombustionGeneratorOxidizerRecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE); - return recipes.stream().anyMatch(r -> ((VEFluidRecipe)r).getFluidIngredient(0).test(fluid)); + return recipes.stream().anyMatch(r -> ((VEFluidRecipe) r).getFluidIngredient(0).test(fluid)); }); } @@ -95,7 +95,7 @@ public void tick() { } if (energyCapability.map(IEnergyStorage::getEnergyStored).orElse(0) + energyRate <= Config.COMBUSTION_GENERATOR_MAX_POWER.get()) { counter--; - energy.ifPresent(e -> e.addEnergy(energyRate)); //Amount of energy to add per tick + energy.addEnergy(energyRate); //Amount of energy to add per tick if (++sound_tick == 19) { sound_tick = 0; if (Config.PLAY_MACHINE_SOUNDS.get()) { @@ -161,22 +161,20 @@ public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxR handler.receiveEnergy(maxReceive, false)).orElse(0); } - private void sendOutPower() { - energy.ifPresent(energy -> { - for (Direction dir : Direction.values()) { - BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); - Direction opposite = dir.getOpposite(); - if (tileEntity != null) { - // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount - int smallest = Math.min(Config.COMBUSTION_GENERATOR_SEND.get(), energy.getEnergyStored()); - int received = receiveEnergy(tileEntity, opposite, smallest); - energy.consumeEnergy(received); - if (energy.getEnergyStored() <= 0) { - break; - } + void sendOutPower() { + for (Direction dir : Direction.values()) { + BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); + Direction opposite = dir.getOpposite(); + if (tileEntity != null) { + // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount + int smallest = Math.min(Config.COMBUSTION_GENERATOR_SEND.get(), energy.getEnergyStored()); + int received = receiveEnergy(tileEntity, opposite, smallest); + energy.consumeEnergy(received); + if (energy.getEnergyStored() <= 0) { + break; } } - }); + } } private ItemStackHandler createHandler() { @@ -190,16 +188,16 @@ protected void onContentsChanged(int slot) { @Override public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if(stack.getItem() instanceof BucketItem bucketItem) { + if (stack.getItem() instanceof BucketItem bucketItem) { Fluid fluid = bucketItem.getFluid(); - if(fluid.isSame(Fluids.EMPTY)) return true; - FluidStack testFluid = new FluidStack(fluid,COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT); - if(slot == 0) { + if (fluid.isSame(Fluids.EMPTY)) return true; + FluidStack testFluid = new FluidStack(fluid, COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT); + if (slot == 0) { List recipes = VERecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE); - return recipes.stream().anyMatch(r -> ((VEFluidRecipe)r).getFluidIngredient(0).test(testFluid)); - } else if(slot == 2) { + return recipes.stream().anyMatch(r -> ((VEFluidRecipe) r).getFluidIngredient(0).test(testFluid)); + } else if (slot == 2) { List recipes = VERecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE); - return recipes.stream().anyMatch(r -> ((VEFluidRecipe)r).getFluidIngredient(0).test(testFluid)); + return recipes.stream().anyMatch(r -> ((VEFluidRecipe) r).getFluidIngredient(0).test(testFluid)); } return true; } @@ -224,7 +222,8 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor public List getSlotManagers() { return slotManagers; } - public int progressCounterPX(int px) { + + public int progressBurnCounterPX(int px) { if (counter == 0) { return 0; } else { @@ -246,31 +245,11 @@ public int getTankCapacity() { } @Override - public @NotNull List getRelationalTanks() { + public @NotNull List getRelationalTanks() { return fluidManagers; } public int getEnergyRate() { return energyRate; } - - @Override - public int getMaxPower() { - return Config.COMBUSTION_GENERATOR_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return -1; - } - - @Override - public int getTransferRate() { - return Config.COMBUSTION_GENERATOR_SEND.get(); - } - - @Override - public int getUpgradeSlotId() { - return -1; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java index af23d7245..daff60fbb 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.List; -public class CompressorTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { +public class CompressorTile extends VETileEntity { public List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0,0, Direction.UP, true, SlotType.INPUT)); @@ -39,7 +39,7 @@ public CompressorTile(BlockEntityType type, BlockPos pos, BlockState state) { super(VEBlocks.COMPRESSOR_TILE.get(), pos, state, null); } - private final ItemStackHandler inventory = createHandler(3); + private final ItemStackHandler inventory = new VEItemStackHandler(this,3); @Nullable @Override @@ -58,26 +58,6 @@ public List getSlotManagers() { return slotManagers; } - @Override - public int getMaxPower() { - return Config.COMPRESSOR_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.COMPRESSOR_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.COMPRESSOR_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 2; - } - @Override public RecipeType> getRecipeType() { return CompressorRecipe.RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java index dafdaaecd..7c0413fed 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java @@ -29,7 +29,7 @@ import java.util.Optional; import java.util.Random; -public class CrusherTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { +public class CrusherTile extends VETileEntity { public List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0,0, Direction.UP, true, SlotType.INPUT)); @@ -41,66 +41,7 @@ public CrusherTile(BlockPos pos, BlockState state) { super(VEBlocks.CRUSHER_TILE.get(), pos, state, CrusherRecipe.RECIPE_TYPE); } - @Override - public ItemStackHandler createHandler(int slots) { - CrusherTile tileEntity = this; - return new ItemStackHandler(4) { - - - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if (slot == tileEntity.getUpgradeSlotId()) return TagUtil.isTaggedMachineUpgradeItem(stack); - - VESlotManager manager = slotManagers.get(slot); - if (manager.getSlotType() == SlotType.OUTPUT) return true; - return VERecipe.getCachedRecipes(CrusherRecipe.RECIPE_TYPE) - .stream().anyMatch(r -> r.getIngredient(0).test(stack)); - } - - @Override - @Nonnull - public ItemStack extractItem(int slot, int amount, boolean simulate) { - - if (level != null && slot > 0 && !simulate) { - JavaRandomSource rand = new JavaRandomSource(new Random().nextLong()); - - Optional crusherRecipe = RecipeUtil - .getCrusherRecipeFromAnyOutputAndTryInput( - inventory.getStackInSlot(slot).copy().getItem(), - inventory.getStackInSlot(0).getItem(), level); - - if (crusherRecipe.isPresent()) { - if (!(crusherRecipe.get().minExp == 0)) { - level.addFreshEntity(new ExperienceOrb( - level, - worldPosition.getX(), - worldPosition.getY(), - worldPosition.getZ(), - amount * Mth.nextInt( - rand, - crusherRecipe.get().minExp, - crusherRecipe.get().maxExp - ) - )); - - } - } - } - - return super.extractItem(slot, amount, simulate); - } - - @Override - protected void onContentsChanged(final int slot) { - super.onContentsChanged(slot); - CrusherTile.this.setChanged(); - tileEntity.markRecipeDirty(); - } - }; - } - - public ItemStackHandler inventory = createHandler(4); + public ItemStackHandler inventory = new VEItemStackHandler(this,4); @Nullable @Override @@ -118,24 +59,4 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor public List getSlotManagers() { return slotManagers; } - - @Override - public int getMaxPower() { - return Config.CRUSHER_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.CRUSHER_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.CRUSHER_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 3; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java index 61310ef9e..0cefd18c7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java @@ -10,7 +10,7 @@ import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import com.veteam.voluminousenergy.util.WorldUtil; @@ -42,7 +42,7 @@ import java.util.List; import java.util.Random; -public class DimensionalLaserTile extends VEMultiBlockTileEntity implements IVEPoweredTileEntity, IVECountable { +public class DimensionalLaserTile extends VEMultiBlockTileEntity { public VESlotManager bucketTopSm = new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT,1,0); public VESlotManager bucketBottomSm = new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT); @@ -54,9 +54,9 @@ public class DimensionalLaserTile extends VEMultiBlockTileEntity implements IVEP add(RFIDsm); }}; - RelationalTank outputTank = new RelationalTank(new FluidTank(TANK_CAPACITY), 0,0, TankType.OUTPUT, "outputTank:output_tank_gui"); + VERelationalTank outputTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0,0, TankType.OUTPUT, "outputTank:output_tank_gui"); - List fluidManagers = new ArrayList<>() {{ + List fluidManagers = new ArrayList<>() {{ add(outputTank); }}; @@ -75,7 +75,7 @@ public DimensionalLaserTile(BlockPos pos, BlockState state) { this.RFIDsm.addAllowedItem(VEItems.RFID_CHIP.get()); } - public ItemStackHandler inventory = createHandler(4); + public ItemStackHandler inventory = new VEItemStackHandler(this,4); @Override public void tick() { @@ -153,11 +153,11 @@ public void tick() { SingleChunkFluid fluid = fluidFromPos.getFluids().get(0); - if (super.canConsumeEnergy() && outputTank.getTank().getFluidAmount() < TANK_CAPACITY) { + if (super.canConsumeEnergy() && outputTank.getTank().getFluidAmount() < DEFAULT_TANK_CAPACITY) { if (counter == 1) { if (outputTank.isFluidValid(fluid.getFluid())) { - int fillSize = Math.min(fluid.getAmount(), TANK_CAPACITY - outputTank.getTank().getFluidAmount()); + int fillSize = Math.min(fluid.getAmount(), DEFAULT_TANK_CAPACITY - outputTank.getTank().getFluidAmount()); fillSize = Math.min(fillSize, fluid.getAmount()); outputTank.getTank().fill(new FluidStack(fluid.getFluid(), fillSize), IFluidHandler.FluidAction.EXECUTE); } @@ -168,7 +168,7 @@ public void tick() { counter--; consumeEnergy(); } else { - int counterTemp = this.calculateCounter(Config.DIMENSIONAL_LASER_PROCESS_TIME.get(), inventory.getStackInSlot(this.getUpgradeSlotId()).copy()); + int counterTemp = this.calculateCounter(Config.DIMENSIONAL_LASER_PROCESS_TIME.get(), inventory.getStackInSlot(this.energy.getUpgradeSlotId()).copy()); counter = counterTemp != 0 ? counterTemp : 1; length = counter; } @@ -219,7 +219,7 @@ public boolean isComplete() { @Nonnull @Override - public List getRelationalTanks() { + public List getRelationalTanks() { return this.fluidManagers; } @@ -257,26 +257,6 @@ public void resetTickTimer() { this.tickTimer = 0; } - @Override - public int getMaxPower() { - return Config.DIMENSIONAL_LASER_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.DIMENSIONAL_LASER_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.DIMENSIONAL_LASER_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 3; - } - @Override public boolean isMultiBlockValid(Block block) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java index afbe74e7f..e09e6041f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java @@ -3,9 +3,8 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.DistillationRecipe; -import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import net.minecraft.core.BlockPos; @@ -16,6 +15,7 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraftforge.fluids.capability.templates.FluidTank; import net.minecraftforge.items.ItemStackHandler; +import org.apache.commons.lang3.NotImplementedException; import org.jetbrains.annotations.NotNull; import javax.annotation.Nonnull; @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.List; -public class DistillationUnitTile extends VEMultiBlockTileEntity implements IVEPoweredTileEntity, IVECountable { +public class DistillationUnitTile extends VEMultiBlockTileEntity { public List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0, Direction.UP, false, SlotType.FLUID_INPUT,1,0)); add(new VESlotManager(1, Direction.DOWN, false, SlotType.FLUID_OUTPUT)); @@ -34,16 +34,14 @@ public class DistillationUnitTile extends VEMultiBlockTileEntity implements IVEP add(new VESlotManager(6, 0, Direction.DOWN, false, SlotType.OUTPUT)); }}; - public List fluidManagers = new ArrayList<>() {{ - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank:input_tank_gui")); - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 1, 0, TankType.OUTPUT, "outputTank0:output_tank_0_gui")); - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 2, 1, TankType.OUTPUT, "outputTank1:output_tank_1_gui")); + public List fluidManagers = new ArrayList<>() {{ + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank:input_tank_gui")); + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 1, 0, TankType.OUTPUT, "outputTank0:output_tank_0_gui")); + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 2, 1, TankType.OUTPUT, "outputTank1:output_tank_1_gui")); }}; private byte tick = 19; - public ItemStackHandler inventory = createHandler(8); - public DistillationUnitTile(BlockPos pos, BlockState state) { super(VEBlocks.DISTILLATION_UNIT_TILE.get(), pos, state, DistillationRecipe.RECIPE_TYPE); } @@ -74,37 +72,18 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor return VEContainers.DISTILLATION_UNIT_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } + @Nullable @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; + public ItemStackHandler getInventoryHandler() { + throw new NotImplementedException("Missing impl for Distillation tile inventory handler!"); } @Override - public @NotNull List getRelationalTanks() { + public @NotNull List getRelationalTanks() { return fluidManagers; } public boolean getMultiblockValidity() { return validity; } - - @Override - public int getMaxPower() { - return Config.DISTILLATION_UNIT_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.DISTILLATION_UNIT_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.DISTILLATION_UNIT_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 7; - } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java index 40cca7c1f..20833ec4d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java @@ -32,7 +32,7 @@ import java.util.Objects; import java.util.concurrent.atomic.AtomicReference; -public class ElectricFurnaceTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { +public class ElectricFurnaceTile extends VETileEntity { public VESlotManager inputSlotManager = new VESlotManager(0, Direction.UP, true, SlotType.INPUT); public VESlotManager outputSlotManager = new VESlotManager(1, Direction.DOWN, true, SlotType.OUTPUT); @@ -108,7 +108,7 @@ public void tick() { } } } else { - counter = this.calculateCounter(200, inventory.getStackInSlot(this.getUpgradeSlotId())); + counter = this.calculateCounter(200, inventory.getStackInSlot(this.energy.getUpgradeSlotId())); length = counter; this.referenceStack.set(furnaceInput.copy()); } @@ -259,24 +259,4 @@ public boolean itemChecker(SmeltingRecipe furnaceRecipe, BlastingRecipe blasting public int getCounter() { return counter; } - - @Override - public int getMaxPower() { - return Config.ELECTRIC_FURNACE_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.ELECTRIC_FURNACE_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.ELECTRIC_FURNACE_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 2; - } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.java index 9becfae56..e5a0cc98b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.java @@ -3,7 +3,6 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.ElectrolyzerRecipe; -import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.SlotType; import net.minecraft.core.BlockPos; @@ -20,7 +19,7 @@ import java.util.ArrayList; import java.util.List; -public class ElectrolyzerTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { +public class ElectrolyzerTile extends VETileEntity { List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0,0, Direction.UP, true, SlotType.INPUT)); @@ -35,7 +34,7 @@ public ElectrolyzerTile(BlockPos pos, BlockState state) { super(VEBlocks.ELECTROLYZER_TILE.get(), pos, state, ElectrolyzerRecipe.RECIPE_TYPE); } - public ItemStackHandler inventory = createHandler(7); + public ItemStackHandler inventory = new VEItemStackHandler(this,7); @Nullable @Override @@ -53,25 +52,4 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor public List getSlotManagers() { return slotManagers; } - - - @Override - public int getMaxPower() { - return Config.ELECTROLYZER_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.ELECTROLYZER_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.ELECTROLYZER_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 6; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java index b08a7b257..4838cd2e8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java @@ -3,9 +3,8 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.FluidElectrolyzerRecipe; -import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import net.minecraft.core.BlockPos; @@ -25,7 +24,7 @@ import java.util.ArrayList; import java.util.List; -public class FluidElectrolyzerTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { +public class FluidElectrolyzerTile extends VETileEntity { public List slotManagers = new ArrayList<>() {{ @@ -37,28 +36,23 @@ public class FluidElectrolyzerTile extends VETileEntity implements IVEPoweredTil add(new VESlotManager(5, Direction.SOUTH, true, SlotType.FLUID_OUTPUT)); }}; - public List fluidManagers = new ArrayList<>() {{ - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank:input_tank_gui")); - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 1, 0, TankType.OUTPUT, "outputTank0:output_tank_0_gui")); - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 2, 1, TankType.OUTPUT, "outputTank1:output_tank_1_gui")); + public List fluidManagers = new ArrayList<>() {{ + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank:input_tank_gui")); + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 1, 0, TankType.OUTPUT, "outputTank0:output_tank_0_gui")); + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 2, 1, TankType.OUTPUT, "outputTank1:output_tank_1_gui")); }}; public FluidElectrolyzerTile(BlockPos pos, BlockState state) { super(VEBlocks.FLUID_ELECTROLYZER_TILE.get(), pos, state, FluidElectrolyzerRecipe.RECIPE_TYPE); } - public ItemStackHandler inventory = createHandler(7); + public ItemStackHandler inventory = new VEItemStackHandler(this,7); @Override public @Nonnull ItemStackHandler getInventoryHandler() { return inventory; } - @Override - public int getUpgradeSlotId() { - return 6; - } - @Nonnull @Override public List getSlotManagers() { @@ -72,25 +66,10 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor } @Override - public @NotNull List getRelationalTanks() { + public @NotNull List getRelationalTanks() { return fluidManagers; } - @Override - public int getMaxPower() { - return Config.FLUID_ELECTROLYZER_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.FLUID_ELECTROLYZER_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.FLUID_ELECTROLYZER_TRANSFER.get(); - } - @Override public RecipeType> getRecipeType() { return FluidElectrolyzerRecipe.RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java index 19e13a9e5..ada6da6cd 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java @@ -3,9 +3,8 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.FluidMixerRecipe; -import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import net.minecraft.core.BlockPos; @@ -23,7 +22,7 @@ import java.util.ArrayList; import java.util.List; -public class FluidMixerTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { +public class FluidMixerTile extends VETileEntity { List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); @@ -33,28 +32,23 @@ public class FluidMixerTile extends VETileEntity implements IVEPoweredTileEntity add(new VESlotManager(5, Direction.SOUTH, true, SlotType.FLUID_OUTPUT)); }}; - List fluidManagers = new ArrayList<>() {{ - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank0:input_tank_0_gui")); - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 1, 1, TankType.INPUT, "inputTank1:input_tank_1_gui")); - add(new RelationalTank(new FluidTank(TANK_CAPACITY), 2, 0, TankType.OUTPUT, "outputTank0:output_tank_0_gui")); + List fluidManagers = new ArrayList<>() {{ + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank0:input_tank_0_gui")); + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 1, 1, TankType.INPUT, "inputTank1:input_tank_1_gui")); + add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 2, 0, TankType.OUTPUT, "outputTank0:output_tank_0_gui")); }}; public FluidMixerTile(BlockPos pos, BlockState state) { super(VEBlocks.FLUID_MIXER_TILE.get(), pos, state, FluidMixerRecipe.RECIPE_TYPE); } - public ItemStackHandler inventory = createHandler(7); + public ItemStackHandler inventory = new VEItemStackHandler(this, 7); @Override public @Nonnull ItemStackHandler getInventoryHandler() { return inventory; } - @Override - public int getUpgradeSlotId() { - return 6; - } - @Nonnull @Override public List getSlotManagers() { @@ -68,22 +62,7 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor } @Override - public @NotNull List getRelationalTanks() { + public @NotNull List getRelationalTanks() { return fluidManagers; } - - @Override - public int getMaxPower() { - return Config.FLUID_MIXER_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.FLUID_MIXER_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.FLUID_MIXER_TRANSFER.get(); - } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java index 8ac7e04ad..48b71eaef 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java @@ -8,7 +8,7 @@ import com.veteam.voluminousenergy.recipe.VEFluidRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TagUtil; import com.veteam.voluminousenergy.util.TankType; @@ -46,7 +46,7 @@ import java.util.Objects; import java.util.concurrent.atomic.AtomicReference; -public class GasFiredFurnaceTile extends VETileEntity implements IVECountable { +public class GasFiredFurnaceTile extends VETileEntity { List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); @@ -55,9 +55,9 @@ public class GasFiredFurnaceTile extends VETileEntity implements IVECountable { add(new VESlotManager(3, Direction.WEST, true, SlotType.OUTPUT)); }}; - RelationalTank fuelTank = new RelationalTank(new FluidTank(TANK_CAPACITY), 0,0, TankType.INPUT, "fuel_tank:fuel_tank_gui"); + VERelationalTank fuelTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0,0, TankType.INPUT, "fuel_tank:fuel_tank_gui"); - List fluidManagers = new ArrayList<>() {{ + List fluidManagers = new ArrayList<>() {{ add(fuelTank); }}; @@ -305,7 +305,7 @@ public FluidStack getFluidFromTank() { } @Override - public @NotNull List getRelationalTanks() { + public @NotNull List getRelationalTanks() { return fluidManagers; } @@ -346,7 +346,7 @@ public boolean itemChecker(SmeltingRecipe furnaceRecipe, BlastingRecipe blasting return false; } - public RelationalTank getFuelTank() { + public VERelationalTank getFuelTank() { return fuelTank; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java index 19fa08007..1051a1cd2 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java @@ -8,7 +8,7 @@ import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import net.minecraft.core.BlockPos; @@ -33,9 +33,9 @@ import static net.minecraft.util.Mth.abs; -public class HydroponicIncubatorTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { +public class HydroponicIncubatorTile extends VETileEntity { - private final ItemStackHandler inventory = createHandler(8); + private final ItemStackHandler inventory = new VEItemStackHandler(this, 8); List slotManagers = new ArrayList<>() { { @@ -49,9 +49,9 @@ public class HydroponicIncubatorTile extends VETileEntity implements IVEPoweredT } }; - RelationalTank inputTank = new RelationalTank(new FluidTank(TANK_CAPACITY), 0,0, TankType.INPUT, "inputTank:input_tank_gui"); + VERelationalTank inputTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0,0, TankType.INPUT, "inputTank:input_tank_gui"); - List fluidManagers = new ArrayList<>() { + List fluidManagers = new ArrayList<>() { { add(inputTank); } @@ -102,7 +102,7 @@ void processRecipe() { if (counter == 1) { // Validate output - for (RelationalTank relationalTank : getRelationalTanks()) { + for (VERelationalTank relationalTank : getRelationalTanks()) { if (relationalTank.getTankType() == TankType.OUTPUT) { FluidStack recipeFluid = recipe.getOutputFluid(relationalTank.getRecipePos()); FluidTank tank = relationalTank.getTank(); @@ -159,7 +159,7 @@ void processRecipe() { } // process recipe - for (RelationalTank relationalTank : getRelationalTanks()) { + for (VERelationalTank relationalTank : getRelationalTanks()) { if (relationalTank.getTankType() == TankType.OUTPUT) { relationalTank.fillOutput(recipe,relationalTank.getRecipePos()); } else if(relationalTank.getTankType() == TankType.INPUT) { @@ -185,27 +185,7 @@ void processRecipe() { } @Override - public @NotNull List getRelationalTanks() { + public @NotNull List getRelationalTanks() { return this.fluidManagers; } - - @Override - public int getMaxPower() { - return Config.HYDROPONIC_INCUBATOR_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.HYDROPONIC_INCUBATOR_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.HYDROPONIC_INCUBATOR_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 7; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/IVECountable.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/IVECountable.java deleted file mode 100644 index 909d91cc5..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/IVECountable.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -public interface IVECountable { - -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/IVEPowerGenerator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/IVEPowerGenerator.java deleted file mode 100644 index 2c926f038..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/IVEPowerGenerator.java +++ /dev/null @@ -1,4 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -public interface IVEPowerGenerator extends IVEPoweredTileEntity { -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/IVEPoweredTileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/IVEPoweredTileEntity.java deleted file mode 100644 index bc8358ff6..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/IVEPoweredTileEntity.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -/** - * Any value that is unused (for example getPowerUsage() in a generator tile) - * should be set to 0 - * Note: These values should all be pulled from - * @see com.veteam.voluminousenergy.tools.Config - * Except for - * @see #getUpgradeSlotId() - */ -public interface IVEPoweredTileEntity { - - /** - * @return The max power the tile entity can store at one time - */ - int getMaxPower(); - - /** - * - * @return the power usage the entity uses per tick - * Should be 0 if representing a tile that only produces power - */ - int getPowerUsage(); - - /** - * The IO rate of energy from this tile - * for tiles that generate power this value should be set to Config..._SEND - * @return The maximum allowed throughput of a tile entity. - */ - int getTransferRate(); - - /** - * Used in conjunction with createHandler - * @see VETileEntity#createHandler(int,IVEPoweredTileEntity) ; - * Otherwise this method does nothing - * @return The slot id of the upgrade slot - */ - int getUpgradeSlotId(); -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java index 2419bf6b4..58d7abc3f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java @@ -22,7 +22,7 @@ import java.util.ArrayList; import java.util.List; -public class ImplosionCompressorTile extends VETileEntity implements IVEPoweredTileEntity,IVECountable { +public class ImplosionCompressorTile extends VETileEntity { public VESlotManager inputSlotManager = new VESlotManager(0,0,Direction.UP,true, SlotType.INPUT); public VESlotManager gunpowderSlotManager = new VESlotManager(1,1, Direction.EAST, true,SlotType.INPUT); @@ -38,7 +38,7 @@ public ImplosionCompressorTile(BlockPos pos, BlockState state) { super(VEBlocks.IMPLOSION_COMPRESSOR_TILE.get(), pos, state,ImplosionCompressorRecipe.RECIPE_TYPE); } - private final ItemStackHandler inventory = createHandler(4); + private final ItemStackHandler inventory = new VEItemStackHandler(this,4); @Nullable @Override @@ -57,26 +57,6 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor public List getSlotManagers() { return slotManagers; } - - @Override - public int getMaxPower() { - return Config.IMPLOSION_COMPRESSOR_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.IMPLOSION_COMPRESSOR_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.IMPLOSION_COMPRESSOR_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 3; - } @Override public RecipeType> getRecipeType() { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java index f2085b38b..635770141 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java @@ -3,7 +3,6 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.PrimitiveBlastFurnaceRecipe; -import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.SlotType; import net.minecraft.core.BlockPos; @@ -16,7 +15,6 @@ import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.items.ItemStackHandler; import org.jetbrains.annotations.NotNull; @@ -26,7 +24,7 @@ import java.util.List; -public class PrimitiveBlastFurnaceTile extends VETileEntity implements IVECountable,IVEPoweredTileEntity { +public class PrimitiveBlastFurnaceTile extends VETileEntity { public VESlotManager inputSm = new VESlotManager(0,0,Direction.UP,true, SlotType.INPUT); public VESlotManager outputSm = new VESlotManager(1,0, Direction.DOWN,true,SlotType.OUTPUT); @@ -40,7 +38,7 @@ public PrimitiveBlastFurnaceTile(BlockPos pos, BlockState state) { super(VEBlocks.PRIMITIVE_BLAST_FURNACE_TILE.get(), pos, state,PrimitiveBlastFurnaceRecipe.RECIPE_TYPE); } - private final ItemStackHandler inventory = createHandler(3); + private final ItemStackHandler inventory = new VEItemStackHandler(this,3); @Override @@ -66,37 +64,10 @@ public List getSlotManagers() { return slotManagers; } - @Nullable - @Override - public LazyOptional getEnergy() { - return null; - } - public int getCounter(){ return counter; } @Override public RecipeType> getRecipeType() { return PrimitiveBlastFurnaceRecipe.RECIPE_TYPE; } - - - @Override - public int getMaxPower() { - return 0; - } - - @Override - public int getPowerUsage() { - return 0; - } - - @Override - public int getTransferRate() { - return 0; - } - - @Override - public int getUpgradeSlotId() { - return 2; - } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java index cf207007d..e258b786c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java @@ -28,15 +28,4 @@ public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventor public int getGeneration(){ return (int)(Config.PRIMITIVE_SOLAR_PANEL_GENERATE.get()*this.solarIntensity()); } - - @Override - public int getMaxPower() { - return Config.PRIMITIVE_SOLAR_PANEL_MAX_POWER.get(); - } - - - @Override - public int getTransferRate() { - return Config.PRIMITIVE_SOLAR_PANEL_SEND.get(); - } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java index 0188a2076..b400992b9 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java @@ -29,7 +29,7 @@ import java.util.ArrayList; import java.util.List; -public class PrimitiveStirlingGeneratorTile extends VETileEntity implements IVEPowerGenerator, IVECountable { +public class PrimitiveStirlingGeneratorTile extends VETileEntity { List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0, Direction.UP, true, SlotType.INPUT)); @@ -55,7 +55,7 @@ public void tick() { if (counter > 0) { counter--; if (energyCap.map(IEnergyStorage::getEnergyStored).orElse(0) < maxPower) { - energy.ifPresent(e -> e.addEnergy(generateAmount)); //Amount of energy to add per tick + energy.addEnergy(generateAmount); //Amount of energy to add per tick } if (++sound_tick == 19) { sound_tick = 0; @@ -78,29 +78,6 @@ public void tick() { sendOutPower(); } - public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxReceive) { - return tileEntity.getCapability(ForgeCapabilities.ENERGY, from).map(handler -> - handler.receiveEnergy(maxReceive, false)).orElse(0); - } - - private void sendOutPower() { - energy.ifPresent(energy -> { - for (Direction dir : Direction.values()) { - BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); - Direction opposite = dir.getOpposite(); - if (tileEntity != null) { - // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount - int smallest = Math.min(Config.PRIMITIVE_STIRLING_GENERATOR_SEND.get(), energy.getEnergyStored()); - int received = receiveEnergy(tileEntity, opposite, smallest); - energy.consumeEnergy(received); - if (energy.getEnergyStored() <= 0) { - break; - } - } - } - }); - } - private ItemStackHandler createHandler() { return new ItemStackHandler(1) { @Override @@ -118,8 +95,8 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { @Nonnull @Override public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if(!isItemValid(slot,stack)) return stack; - return super.insertItem(slot,stack,simulate); + if (!isItemValid(slot, stack)) return stack; + return super.insertItem(slot, stack, simulate); } }; } @@ -144,7 +121,7 @@ public List getSlotManagers() { // TODO check if these methods are identical to super. If they are remove them - public int progressCounterPX(int px) { + public int progressBurnCounterPX(int px) { if (counter == 0) { return 0; } else { @@ -160,24 +137,4 @@ public int progressCounterPercent() { public int getEnergyRate() { return 40; } - - @Override - public int getMaxPower() { - return Config.PRIMITIVE_STIRLING_GENERATOR_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return 0; - } - - @Override - public int getTransferRate() { - return Config.PRIMITIVE_STIRLING_GENERATOR_SEND.get(); - } - - @Override - public int getUpgradeSlotId() { - return 0; - } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java index d3fb9ef3c..033716c9b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java @@ -6,7 +6,7 @@ import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.IntToDirection; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import net.minecraft.core.BlockPos; @@ -21,7 +21,6 @@ import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.material.Fluids; -import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.energy.IEnergyStorage; @@ -38,7 +37,7 @@ import java.util.Collections; import java.util.List; -public class PumpTile extends VETileEntity implements IVEPoweredTileEntity { +public class PumpTile extends VETileEntity { private final LazyOptional handler = LazyOptional.of(() -> this.inventory); private final LazyOptional fluid = LazyOptional.of(this::createFluid); @@ -55,7 +54,7 @@ public class PumpTile extends VETileEntity implements IVEPoweredTileEntity { private int lY = 0; private int lZ = 0; - private final RelationalTank fluidTank = new RelationalTank(new FluidTank(tankCapacity), 0, TankType.OUTPUT,"tank:tank_gui"); + private final VERelationalTank fluidTank = new VERelationalTank(new FluidTank(tankCapacity), 0, TankType.OUTPUT,"tank:tank_gui"); private Fluid pumpingFluid = Fluids.EMPTY; private final ItemStackHandler inventory = this.createHandler(); @@ -87,7 +86,7 @@ public void tick(){ public void addFluidToTank() { if ((fluidTank.getTank().getFluidAmount() + 1000) <= tankCapacity) { - energy.ifPresent(e -> e.consumeEnergy(Config.PUMP_POWER_USAGE.get())); + energy.consumeEnergy(Config.PUMP_POWER_USAGE.get()); fluidTank.getTank().fill(new FluidStack(this.pumpingFluid, 1000), IFluidHandler.FluidAction.EXECUTE); } } @@ -121,7 +120,7 @@ public void updatePacketFromGui(int direction, int slotId) { } public void updateTankPacketFromGui(int direction, int id) { - for (RelationalTank tank : getRelationalTanks()) { + for (VERelationalTank tank : getRelationalTanks()) { if (id == tank.getSlotNum()) { tank.setSideDirection(IntToDirection.IntegerToDirection(direction)); } @@ -202,21 +201,6 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate }; } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ITEM_HANDLER) { - return handler.cast(); - } - if (cap == ForgeCapabilities.ENERGY) { - return energy.cast(); - } - if (cap == ForgeCapabilities.FLUID_HANDLER){ - return fluid.cast(); - } - return super.getCapability(cap, side); - } - @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { @@ -243,7 +227,7 @@ public int getTankCapacity(){ } @Override - public @NotNull List getRelationalTanks() { + public @NotNull List getRelationalTanks() { return Collections.singletonList(fluidTank); } @@ -295,27 +279,7 @@ public boolean fluidPumpMethod() { return false; } - public RelationalTank getTank(){ + public VERelationalTank getTank(){ return this.fluidTank; } - - @Override - public int getMaxPower() { - return Config.PUMP_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.PUMP_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.PUMP_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 0; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java index 06bf5f32d..ea2c4bad7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java @@ -6,7 +6,7 @@ import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TagUtil; import com.veteam.voluminousenergy.util.TankType; @@ -37,7 +37,7 @@ import java.util.List; import java.util.Objects; -public class SawmillTile extends VETileEntity implements IVEPoweredTileEntity,IVECountable { +public class SawmillTile extends VETileEntity { List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0,0, Direction.UP, true, SlotType.INPUT)); @@ -46,10 +46,10 @@ public class SawmillTile extends VETileEntity implements IVEPoweredTileEntity,IV add(new VESlotManager(3, Direction.SOUTH,true,SlotType.FLUID_INPUT,4,0)); add(new VESlotManager(4, Direction.EAST,true,SlotType.FLUID_OUTPUT)); }}; - RelationalTank outputTank = new RelationalTank(new FluidTank(TANK_CAPACITY),0,0, TankType.OUTPUT, "outputTank:output_tank_gui"); + VERelationalTank outputTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY),0,0, TankType.OUTPUT, "outputTank:output_tank_gui"); private final FluidStack configuredFluidForNoRecipe = new FluidStack(Objects.requireNonNull(ForgeRegistries.FLUIDS.getValue(new ResourceLocation(Config.SAWMILL_FLUID_LOCATION.get()))), Config.SAWMILL_FLUID_AMOUNT.get()); - List fluidManagers = new ArrayList<>() {{ + List fluidManagers = new ArrayList<>() {{ add(outputTank); }}; @@ -95,7 +95,7 @@ public void tick() { if (plankOutputStack != null){ // Valid Item! if (this.configuredFluidForNoRecipe != null - && (outputTank.getTank().getFluidAmount() + Config.SAWMILL_FLUID_AMOUNT.get()) <= TANK_CAPACITY + && (outputTank.getTank().getFluidAmount() + Config.SAWMILL_FLUID_AMOUNT.get()) <= DEFAULT_TANK_CAPACITY && (inventory.getStackInSlot(1).isEmpty() || inventory.getStackInSlot(1).getItem() == plankOutputStack.getItem()) && (inventory.getStackInSlot(2).isEmpty() || inventory.getStackInSlot(2).getItem() == secondOutputStack.getItem()) && (inventory.getStackInSlot(1).getCount() + Config.SAWMILL_PRIMARY_OUTPUT_COUNT.get()) <= 64 @@ -124,7 +124,7 @@ public void tick() { secondOutputStack = recipe.getResult(1).copy(); FluidStack outputFluid = recipe.getOutputFluid(0).copy(); - if ((outputTank.getTank().getFluidAmount() + outputFluid.getAmount()) <= TANK_CAPACITY + if ((outputTank.getTank().getFluidAmount() + outputFluid.getAmount()) <= DEFAULT_TANK_CAPACITY && (inventory.getStackInSlot(1).isEmpty() || inventory.getStackInSlot(1).getItem() == plankOutputStack.getItem()) && (inventory.getStackInSlot(2).isEmpty() || inventory.getStackInSlot(2).getItem() == secondOutputStack.getItem()) && (inventory.getStackInSlot(1).getCount() + recipe.getResult(0).getCount()) <= 64 @@ -238,8 +238,8 @@ private void coreTickProcessing(@Nullable VEFluidSawmillRecipe VEFluidSawmillRec } } else { counter = VEFluidSawmillRecipe != null - ? this.calculateCounter(VEFluidSawmillRecipe.getProcessTime(), inventory.getStackInSlot(this.getUpgradeSlotId()).copy()) // Sawmill recipe not null - : this.calculateCounter(Config.SAWMILL_PROCESSING_TIME.get(), inventory.getStackInSlot(this.getUpgradeSlotId()).copy());// Use default values when null + ? this.calculateCounter(VEFluidSawmillRecipe.getProcessTime(), inventory.getStackInSlot(this.energy.getUpgradeSlotId()).copy()) // Sawmill recipe not null + : this.calculateCounter(Config.SAWMILL_PROCESSING_TIME.get(), inventory.getStackInSlot(this.energy.getUpgradeSlotId()).copy());// Use default values when null length = counter; } } @@ -259,30 +259,10 @@ public FluidStack getFluidStackFromTank(int num){ } @Override - public @NotNull List getRelationalTanks() { + public @NotNull List getRelationalTanks() { return fluidManagers; } - @Override - public int getMaxPower() { - return Config.SAWMILL_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return Config.SAWMILL_POWER_USAGE.get(); - } - - @Override - public int getTransferRate() { - return Config.SAWMILL_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 5; - } - @Override public RecipeType> getRecipeType() { return VEFluidSawmillRecipe.RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java index 5393dbdef..a56cbcb87 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java @@ -28,14 +28,4 @@ public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventor public int getGeneration(){ return (int)(Config.SOLAR_PANEL_GENERATE.get()*this.solarIntensity()); } - - @Override - public int getMaxPower() { - return Config.SOLAR_PANEL_MAX_POWER.get(); - } - - @Override - public int getTransferRate() { - return Config.SOLAR_PANEL_SEND.get(); - } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java index 24046a939..a6773b80b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java @@ -4,7 +4,6 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.StirlingGeneratorRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.SlotType; @@ -14,7 +13,6 @@ import net.minecraft.nbt.CompoundTag; import net.minecraft.network.Connection; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; -import net.minecraft.sounds.SoundSource; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; @@ -32,7 +30,7 @@ import java.util.ArrayList; import java.util.List; -public class StirlingGeneratorTile extends VETileEntity implements IVEPowerGenerator, IVECountable { +public class StirlingGeneratorTile extends VETileEntity { List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0, Direction.UP, true, SlotType.INPUT)); }}; @@ -51,35 +49,11 @@ public StirlingGeneratorTile(BlockPos pos, BlockState state) { @NotNull LazyOptional energyCap; private final int maxPower; + @Override public void tick() { updateClients(); validateRecipe(); - - if (counter > 0) { - if (energyCap.map(IEnergyStorage::getEnergyStored).orElse(0) + energyRate <= maxPower) { - counter--; - energy.ifPresent(e -> e.addEnergy(energyRate)); //Amount of energy to add per tick - } - if (++sound_tick == 19) { - sound_tick = 0; - if (Config.PLAY_MACHINE_SOUNDS.get()) { - level.playSound(null, this.getBlockPos(), VESounds.GENERAL_MACHINE_NOISE, SoundSource.BLOCKS, 1.0F, 1.0F); - } - } - setChanged(); - } else if (recipe != null) { - if ((recipe.getEnergyPerTick() * recipe.getProcessTime()) + getEnergy().map(IEnergyStorage::getEnergyStored).orElse(0) <= maxPower) { - inventory.extractItem(0, recipe.getIngredientCount(0), false); - this.counter = recipe.getProcessTime(); - this.energyRate = recipe.getEnergyPerTick(); - this.length = this.counter; - setChanged(); - } - } - if (counter == 0) { - energyRate = 0; - } sendOutPower(); } @@ -97,22 +71,20 @@ public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxR handler.receiveEnergy(maxReceive, false)).orElse(0); } - private void sendOutPower() { - energy.ifPresent(energy -> { - for (Direction dir : Direction.values()) { - BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); - Direction opposite = dir.getOpposite(); - if (tileEntity != null) { - // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount - int smallest = Math.min(Config.STIRLING_GENERATOR_SEND.get(), energy.getEnergyStored()); - int received = receiveEnergy(tileEntity, opposite, smallest); - energy.consumeEnergy(received); - if (energy.getEnergyStored() <= 0) { - break; - } + void sendOutPower() { + for (Direction dir : Direction.values()) { + BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); + Direction opposite = dir.getOpposite(); + if (tileEntity != null) { + // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount + int smallest = Math.min(Config.STIRLING_GENERATOR_SEND.get(), energy.getEnergyStored()); + int received = receiveEnergy(tileEntity, opposite, smallest); + energy.consumeEnergy(received); + if (energy.getEnergyStored() <= 0) { + break; } } - }); + } } @Override @@ -152,8 +124,8 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { @Nonnull @Override public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if(!isItemValid(slot,stack)) return stack; - return super.insertItem(slot,stack,simulate); + if (!isItemValid(slot, stack)) return stack; + return super.insertItem(slot, stack, simulate); } }; } @@ -175,35 +147,12 @@ public ItemStackHandler getInventoryHandler() { public List getSlotManagers() { return slotManagers; } - public int progressCounterPX(int px) { + + public int progressBurnCounterPX(int px) { if (counter == 0) { return 0; } else { return (px * (((counter * 100) / length))) / 100; } } - - public int getEnergyRate() { - return energyRate; - } - - @Override - public int getMaxPower() { - return Config.STIRLING_GENERATOR_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { - return 0; - } - - @Override - public int getTransferRate() { - return Config.STIRLING_GENERATOR_SEND.get(); - } - - @Override - public int getUpgradeSlotId() { - return 0; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java index 813211c6b..4130e4510 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java @@ -9,9 +9,8 @@ import com.veteam.voluminousenergy.recipe.RecipeCache; import com.veteam.voluminousenergy.recipe.ToolingRecipe; import com.veteam.voluminousenergy.recipe.VEFluidRecipe; -import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import com.veteam.voluminousenergy.util.recipe.RecipeUtil; @@ -39,7 +38,7 @@ import static com.veteam.voluminousenergy.items.tools.multitool.CombustionMultitool.isCombustibleFuel; -public class ToolingStationTile extends VETileEntity implements IVEPoweredTileEntity { +public class ToolingStationTile extends VETileEntity { // Slot Managers List slotManagers = new ArrayList<>() {{ @@ -50,9 +49,9 @@ public class ToolingStationTile extends VETileEntity implements IVEPoweredTileEn add(new VESlotManager(4, Direction.EAST, true, SlotType.INPUT)); }}; - RelationalTank fuelTank = new RelationalTank(new FluidTank(TANK_CAPACITY), 0, null, null, TankType.INPUT, "fuel_tank:fuel_tank_gui"); + VERelationalTank fuelTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, null, null, TankType.INPUT, "fuel_tank:fuel_tank_gui"); - List fluidManagers = new ArrayList<>() {{ + List fluidManagers = new ArrayList<>() {{ add(fuelTank); }}; @@ -229,32 +228,12 @@ public FluidStack getFluidStackFromTank(int num) { return FluidStack.EMPTY; } - public RelationalTank getInputTank() { + public VERelationalTank getInputTank() { return this.fuelTank; } @Override - public @NotNull List getRelationalTanks() { + public @NotNull List getRelationalTanks() { return fluidManagers; } - - @Override - public int getMaxPower() { - return Config.TOOLING_STATION_MAX_POWER.get(); - } - - @Override - public int getPowerUsage() { // Tooling Station atm doesn't use power. Transfer to recharge electric tools (if support added) should be capped by this#getTransferRate(); - return 0; - } - - @Override - public int getTransferRate() { - return Config.TOOLING_STATION_TRANSFER.get(); - } - - @Override - public int getUpgradeSlotId() { - return 0; - } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java index d46c4bbf5..6ff25f462 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.recipe.VEFluidRecipe; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TagUtil; import com.veteam.voluminousenergy.util.TankType; @@ -19,18 +19,17 @@ public class VEItemStackHandler extends ItemStackHandler { private final VETileEntity tileEntity; - private final int slots; private final int upgradeSlotLocation; public VEItemStackHandler(VETileEntity tileEntity,int slots) { + super(slots); this.tileEntity = tileEntity; - this.slots = slots; upgradeSlotLocation = -1; } public VEItemStackHandler(VETileEntity tileEntity,int slots,int upgradeSlotLocation) { + super(slots); this.tileEntity = tileEntity; - this.slots = slots; this.upgradeSlotLocation = upgradeSlotLocation; } @@ -57,7 +56,7 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { if(manager.getAllowedItems().contains(stack.getItem())) return true; if (manager.getSlotType() == SlotType.FLUID_INPUT && stack.getItem() instanceof BucketItem bucketItem) { if (bucketItem.getFluid() == Fluids.EMPTY) return true; - RelationalTank tank = tileEntity.getRelationalTanks().get(manager.getTankId()); + VERelationalTank tank = tileEntity.getRelationalTanks().get(manager.getTankId()); if(tank.getTankType() == TankType.OUTPUT) { return bucketItem.getFluid().isSame(Fluids.EMPTY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java index a04ae5946..fb61a0cb6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java @@ -8,19 +8,15 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; import net.minecraftforge.items.ItemStackHandler; import org.jetbrains.annotations.NotNull; -import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.ArrayList; import java.util.List; -public abstract class VESolarTile extends VETileEntity implements IVEPowerGenerator { +public abstract class VESolarTile extends VETileEntity { int generation; int currentEnergy; @@ -42,9 +38,7 @@ public void tick() { } void generateEnergy(int fe){ - if (this.getCapability(ForgeCapabilities.ENERGY).map(IEnergyStorage::getEnergyStored).orElse(0) < getMaxPower()){ - energy.ifPresent(e -> e.addEnergy(fe)); //Amount of energy to add per tick - } + energy.addEnergy(fe); } public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxReceive){ @@ -52,20 +46,13 @@ public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxR handler.receiveEnergy(maxReceive, false)).orElse(0); } - - @Override - public int getPowerUsage() { - return 0; - } - - private void sendOutPower() { - energy.ifPresent(energy -> { + void sendOutPower() { for (Direction dir : Direction.values()){ BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); Direction opposite = dir.getOpposite(); if(tileEntity != null){ // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount - int smallest = Math.min(getTransferRate(), energy.getEnergyStored()); + int smallest = Math.min(energy.getMaxTransfer(), energy.getEnergyStored()); int received = receiveEnergy(tileEntity, opposite, smallest); energy.consumeEnergy(received); if (energy.getEnergyStored() <=0){ @@ -73,7 +60,6 @@ private void sendOutPower() { } } } - }); } /** @@ -112,7 +98,7 @@ protected boolean isClear(){ public void load(CompoundTag tag) { tag.putInt("generation_rate", this.generation); super.load(tag); - this.currentEnergy = this.energy.resolve().get().getEnergyStored(); + this.currentEnergy = this.getEnergyStored(); } @@ -122,22 +108,8 @@ public void saveAdditional(@NotNull CompoundTag tag) { super.saveAdditional(tag); } - @Nonnull - @Override - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if (cap == ForgeCapabilities.ENERGY){ - return energy.cast(); - } - return super.getCapability(cap, side); - } - public abstract int getGeneration(); - @Override - public int getUpgradeSlotId() { - return 0; - } - @Nullable @Override public ItemStackHandler getInventoryHandler() { @@ -149,8 +121,4 @@ public ItemStackHandler getInventoryHandler() { public List getSlotManagers() { return new ArrayList<>(); } - - public int getCurrentEnergy() { - return currentEnergy; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java new file mode 100644 index 000000000..7ced329a2 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -0,0 +1,41 @@ +package com.veteam.voluminousenergy.blocks.tiles; + +import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.blocks.containers.VEContainers; +import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.FluidInputTank; +import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.FluidOutputTank; +import com.veteam.voluminousenergy.recipe.VERecipes; +import com.veteam.voluminousenergy.recipe.processor.FluidItemProcessor; +import com.veteam.voluminousenergy.recipe.processor.GeneratorItemProcessor; +import com.veteam.voluminousenergy.recipe.validator.FluidItemValidator; +import com.veteam.voluminousenergy.recipe.validator.GeneratorItemValidator; +import com.veteam.voluminousenergy.tools.Config; + +public class VETileEntities { + + static final int DEFAULT_TANK_CAPACITY = 4000; + + public static final VETileFactory AQUEOULIZER_TILE_FACTORY = + new VETileFactory(VEBlocks.AQUEOULIZER_TILE, VEContainers.AQUEOULIZER_FACTORY) + .addEnergyStorageWithConsumption( + Config.AQUEOULIZER_MAX_POWER.get(), + Config.AQUEOULIZER_TRANSFER.get(), + Config.AQUEOULIZER_POWER_USAGE.get()) + .withTanks(new FluidInputTank(0, DEFAULT_TANK_CAPACITY), + new FluidOutputTank(0, DEFAULT_TANK_CAPACITY)) + .countable() + .makesSound() + .withRecipe(VERecipes.VERecipeTypes.AQUEOULIZING) + .withRecipeProcessing(new FluidItemProcessor(),new FluidItemValidator()); + + public static final VETileFactory PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY = + new VETileFactory(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_TILE,VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY) + .addEnergyStorage( + Config.PRIMITIVE_STIRLING_GENERATOR_MAX_POWER.get(), + Config.PRIMITIVE_STIRLING_GENERATOR_SEND.get()) + .countable() + .makesSound() + .sendsOutPower() + .withRecipe(VERecipes.VERecipeTypes.STIRLING) + .withRecipeProcessing(new GeneratorItemProcessor(true,4),new GeneratorItemValidator()); +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index c81142cff..499c1216d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -2,11 +2,9 @@ import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.items.upgrades.MysteriousMultiplier; -import com.veteam.voluminousenergy.recipe.RecipeCache; -import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; import com.veteam.voluminousenergy.recipe.VEFluidRecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.sounds.VESounds; +import com.veteam.voluminousenergy.recipe.processor.RecipeProcessor; +import com.veteam.voluminousenergy.recipe.validator.RecipeValidator; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -19,7 +17,6 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; import net.minecraft.resources.ResourceLocation; -import net.minecraft.sounds.SoundSource; import net.minecraft.world.MenuProvider; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; @@ -27,7 +24,6 @@ import net.minecraft.world.item.BucketItem; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; @@ -50,35 +46,43 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; -import java.util.Random; - -import static net.minecraft.util.Mth.abs; public abstract class VETileEntity extends BlockEntity implements MenuProvider { + + VEItemStackHandler inventory; private final RecipeType> recipeType; - Recipe selectedRecipe = null; - List> potentialRecipes = new ArrayList<>(); + VEFluidRecipe selectedRecipe = null; + List potentialRecipes = new ArrayList<>(); + + final List tanks = new ArrayList<>(); + final List managers = new ArrayList<>(); + final HashMap dataMap = new HashMap<>(); + RecipeProcessor recipeProcessor; + RecipeValidator recipeValidator; + boolean sendsOutPower; public VETileEntity(BlockEntityType type, BlockPos pos, BlockState state, RecipeType> recipeType) { super(type, pos, state); this.recipeType = recipeType; - this.isRecipeDirty = true; } /** - * Lazy Optional of getEnergy which cannot be null but can contain a null VEEnergyStorage - * for the ifpresent to fail + * Nullable VEEnergyStorage. */ - LazyOptional energy = createEnergy(); + VEEnergyStorage energy; public static void serverTick(Level level, BlockPos pos, BlockState state, VETileEntity voluminousTile) { voluminousTile.tick(); } - // Fluid methods to subclass + // Fluid methods to subclass? - public void inputFluid(RelationalTank tank, int slot1, int slot2) { + public static final int DEFAULT_TANK_CAPACITY = 4000; + boolean fluidInputDirty = true; + + public void inputFluid(VERelationalTank tank, int slot1, int slot2) { ItemStack input = tank.getInput().copy(); ItemStack output = tank.getOutput().copy(); FluidTank inputTank = tank.getTank(); @@ -98,7 +102,7 @@ public void inputFluid(RelationalTank tank, int slot1, int slot2) { //use for when the input and output slot are different - public void outputFluid(RelationalTank tank, int slot1, int slot2) { + public void outputFluid(VERelationalTank tank, int slot1, int slot2) { ItemStack inputSlot = tank.getInput(); ItemStack outputSlot = tank.getOutput(); FluidTank outputTank = tank.getTank(); @@ -114,30 +118,25 @@ public void outputFluid(RelationalTank tank, int slot1, int slot2) { public int getTankCapacity() { - return TANK_CAPACITY; + return DEFAULT_TANK_CAPACITY; } public void updateTankPacketFromGui(boolean status, int id) { - for (RelationalTank tank : getRelationalTanks()) { + for (VERelationalTank tank : getRelationalTanks()) { if (id == tank.getSlotNum()) tank.setSideStatus(status); } } public void updateTankPacketFromGui(int direction, int id) { - for (RelationalTank tank : getRelationalTanks()) { + for (VERelationalTank tank : getRelationalTanks()) { if (id == tank.getSlotNum()) { this.capabilityMap.moveFluidSlotManagerPos(tank, IntToDirection.IntegerToDirection(direction)); } } } - @Deprecated - public static final int TANK_CAPACITY = 4000; - boolean fluidInputDirty; - - public @Nonnull List getRelationalTanks() { - - return new ArrayList<>(); + public @Nonnull List getRelationalTanks() { + return tanks; } public static boolean checkOutputSlotForEmptyOrBucket(ItemStack slotStack) { @@ -155,7 +154,7 @@ protected void processFluidIO() { ItemStackHandler inventory = this.getInventoryHandler(); if (manager.getSlotType() == SlotType.FLUID_INPUT) { - RelationalTank tank = this.getRelationalTanks().get(manager.getTankId()); + VERelationalTank tank = this.getRelationalTanks().get(manager.getTankId()); tank.setInput(inventory.getStackInSlot(manager.getSlotNum())); tank.setOutput(inventory.getStackInSlot(manager.getOutputSlotId())); if (tank.getTankType() == TankType.INPUT || tank.getTankType() == TankType.BOTH) @@ -177,7 +176,7 @@ public FluidStack getFluidStackFromTank(int num) { int counter = 0; int length = 0; int sound_tick = 0; - boolean isRecipeDirty; + boolean isRecipeDirty = true; /** @@ -187,103 +186,9 @@ public FluidStack getFluidStackFromTank(int num) { public void tick() { processFluidIO(); updateClients(); - validateRecipe(); - processRecipe(); - } - - - void processRecipe() { - if (selectedRecipe == null) return; - VEFluidRecipe recipe = (VEFluidRecipe) selectedRecipe; - - if (canConsumeEnergy()) { - - if (counter == 1) { - // Validate output - for (RelationalTank relationalTank : getRelationalTanks()) { - if (relationalTank.getTankType() == TankType.OUTPUT) { - FluidStack recipeFluid = recipe.getOutputFluid(relationalTank.getRecipePos()); - FluidTank tank = relationalTank.getTank(); - FluidStack currentFluid = tank.getFluid(); - if (currentFluid.isEmpty()) continue; - // If the output fluid amount won't fit, then you must acquit - if (!recipeFluid.isFluidEqual(currentFluid) - || tank.getFluidAmount() + recipeFluid.getAmount() > tank.getCapacity()) { - return; - } - } - } - - ItemStackHandler handler = getInventoryHandler(); - - if (handler != null) { - // Validate output - for (VESlotManager slotManager : getSlotManagers()) { - if (slotManager.getSlotType() != SlotType.OUTPUT) continue; - ItemStack recipeStack = recipe.getResult(slotManager.getRecipePos()); - ItemStack currentItem = slotManager.getItem(handler); - if (currentItem.isEmpty()) continue; - // If the output item amount won't fit, then you must acquit - if (!recipeStack.is(currentItem.getItem()) - || recipeStack.getCount() + currentItem.getCount() > currentItem.getMaxStackSize()) { - return; - } - } - - VEFluidRNGRecipe irngRecipe = null; - if (recipe instanceof VEFluidRNGRecipe rec) { - irngRecipe = rec; - } - Random r = new Random(); - - // process recipe - for (VESlotManager slotManager : getSlotManagers()) { - if (slotManager.getSlotType() == SlotType.OUTPUT) { - ItemStack output = recipe.getResult(slotManager.getRecipePos()); - ItemStack currentStack = slotManager.getItem(handler); - // rng calculations - if (irngRecipe != null) { - float randomness = irngRecipe.getOutputChance(slotManager.getRecipePos()); - if (randomness != 1) { - float random = abs(0 + r.nextFloat() * (-1)); - if (random > randomness) continue; - } - - } - if (currentStack.isEmpty()) slotManager.setItem(output, handler); - else currentStack.setCount(currentStack.getCount() + output.getCount()); - } else if (slotManager.getSlotType() == SlotType.INPUT) { - Ingredient ingredient = recipe.getIngredient(slotManager.getRecipePos()); - ItemStack currentStack = slotManager.getItem(handler); - currentStack.setCount(currentStack.getCount() - ingredient.getItems()[0].getCount()); - } - } - } - - // process recipe - for (RelationalTank relationalTank : getRelationalTanks()) { - if (relationalTank.getTankType() == TankType.OUTPUT) { - relationalTank.fillOutput(recipe, relationalTank.getRecipePos()); - } else if (relationalTank.getTankType() == TankType.INPUT) { - relationalTank.drainInput(recipe, relationalTank.getRecipePos()); - } - } - doExtraRecipeProcessing(); - - this.markRecipeDirty(); - this.markFluidInputDirty(); - this.setChanged(); - } else if (counter > 0) { - if (++sound_tick == 19 && Config.PLAY_MACHINE_SOUNDS.get()) { - sound_tick = 0; - level.playSound(null, this.getBlockPos(), VESounds.AQUEOULIZER, SoundSource.BLOCKS, 1.0F, 1.0F); - } - } else { - counter = length; - } - counter--; - consumeEnergy(); - } + if(this.recipeValidator != null) recipeValidator.validateRecipe(this); + if(this.recipeProcessor != null) recipeProcessor.processRecipe(this); + if(this.sendsOutPower) sendOutPower(); } /** @@ -297,7 +202,7 @@ public void updateClients() { level.sendBlockUpdated(this.worldPosition, this.getBlockState(), this.getBlockState(), 1); } - protected int calculateCounter(int processTime, ItemStack upgradeStack) { + public int calculateCounter(int processTime, ItemStack upgradeStack) { if (upgradeStack.getItem() == VEItems.QUARTZ_MULTIPLIER.get()) { int count = upgradeStack.getCount(); if (count == 4) { @@ -312,7 +217,8 @@ protected int calculateCounter(int processTime, ItemStack upgradeStack) { return processTime; } - protected int consumptionMultiplier(int consumption, ItemStack upgradeStack) { + protected int consumptionMultiplier(int consumption, int slot) { + ItemStack upgradeStack = slot == -1 ? ItemStack.EMPTY : getInventory().getStackInSlot(slot); if (upgradeStack.getItem() == VEItems.QUARTZ_MULTIPLIER.get()) { int count = upgradeStack.getCount(); if (count == 4) { @@ -380,19 +286,17 @@ public void load(CompoundTag tag) { if (handler != null) { handler.deserializeNBT(inv); } + if(energy != null) energy.deserializeNBT(tag); - energy.ifPresent(h -> h.deserializeNBT(tag)); - - if (this instanceof IVECountable) { - counter = tag.getInt("counter"); - length = tag.getInt("length"); + for(var entry : dataMap.entrySet()) { + dataMap.put(entry.getKey(),tag.getInt(entry.getKey())); } for (VESlotManager manager : getSlotManagers()) { manager.read(tag); } - for (RelationalTank relationalTank : getRelationalTanks()) { + for (VERelationalTank relationalTank : getRelationalTanks()) { CompoundTag compoundTag = tag.getCompound(relationalTank.getTankName()); relationalTank.getTank().readFromNBT(compoundTag); relationalTank.readGuiProperties(tag); @@ -415,18 +319,17 @@ public void saveAdditional(@NotNull CompoundTag tag) { tag.put("inv", compound); } - if (energy != null) energy.ifPresent(h -> h.serializeNBT(tag)); + if (energy != null) energy.serializeNBT(tag); for (VESlotManager manager : getSlotManagers()) { manager.write(tag); } - if (this instanceof IVECountable) { - tag.putInt("counter", counter); - tag.putInt("length", length); + for(var entry : dataMap.entrySet()) { + tag.putInt(entry.getKey(),entry.getValue()); } - for (RelationalTank relationalTank : getRelationalTanks()) { + for (VERelationalTank relationalTank : getRelationalTanks()) { CompoundTag compoundTag = new CompoundTag(); relationalTank.getTank().writeToNBT(compoundTag); tag.put(relationalTank.getTankName(), compoundTag); @@ -436,62 +339,13 @@ public void saveAdditional(@NotNull CompoundTag tag) { super.saveAdditional(tag); } - /** - * A default ItemStackHandler creator. Passing in an int size creates it for us - * - * @param slots the size of the inventory - * @return a new inventory - */ - public ItemStackHandler createHandler(int slots) { - - VETileEntity tileEntity = this; - int upgradeSlotLocation = -1; - if (tileEntity instanceof IVEPoweredTileEntity poweredTileEntity) { - upgradeSlotLocation = poweredTileEntity.getUpgradeSlotId(); - } - - int finalUpgradeSlotLocation = upgradeSlotLocation; - return new ItemStackHandler(slots) { - - @Override - protected void onContentsChanged(int slot) { - setChanged(); - List managers = getSlotManagers(); - - if (slot == finalUpgradeSlotLocation) tileEntity.markRecipeDirty(); - else if (slot < managers.size()) { - SlotType slotType = getSlotManagers().get(slot).getSlotType(); - if (slotType == SlotType.INPUT) { - tileEntity.markRecipeDirty(); - } - } - } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if (slot == finalUpgradeSlotLocation) return TagUtil.isTaggedMachineUpgradeItem(stack); - VESlotManager manager = tileEntity.getSlotManagers().get(slot); - if (manager.getSlotType() == SlotType.INPUT) { - for (Recipe recipe : tileEntity.getPotentialRecipes()) { - VERecipe veRecipe = (VERecipe) recipe; - if (veRecipe.getIngredient(manager.getRecipePos()).test(stack)) { - return true; - } - } - } - return false; - } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if (!isItemValid(slot, stack)) return stack; - return super.insertItem(slot, stack, simulate); - } - }; + @Override + public void setChanged() { + updateClients(); + super.setChanged(); } - public ItemStackHandler createHandler(int size, IVEPoweredTileEntity tileEntity) { + public ItemStackHandler createHandler(int size, VETileEntity tileEntity) { return new ItemStackHandler(size) { @Override protected void onContentsChanged(int slot) { @@ -500,7 +354,7 @@ protected void onContentsChanged(int slot) { @Override public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if (tileEntity.getUpgradeSlotId() == slot) { + if (tileEntity.energy.getUpgradeSlotId() == slot) { return TagUtil.isTaggedMachineUpgradeItem(stack); } return true; @@ -509,7 +363,7 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { @Nonnull @Override public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if (slot == tileEntity.getUpgradeSlotId()) { + if (slot == tileEntity.energy.getUpgradeSlotId()) { return TagUtil.isTaggedMachineUpgradeItem(stack) ? super.insertItem(slot, stack, simulate) : stack; } return super.insertItem(slot, stack, simulate); @@ -517,6 +371,27 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate }; } + public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxReceive) { + return tileEntity.getCapability(ForgeCapabilities.ENERGY, from).map(handler -> + handler.receiveEnergy(maxReceive, false)).orElse(0); + } + + void sendOutPower() { + for (Direction dir : Direction.values()) { + BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); + Direction opposite = dir.getOpposite(); + if (tileEntity != null) { + // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount + int smallest = Math.min(Config.PRIMITIVE_STIRLING_GENERATOR_SEND.get(), energy.getEnergyStored()); + int received = receiveEnergy(tileEntity, opposite, smallest); + energy.consumeEnergy(received); + if (energy.getEnergyStored() <= 0) { + break; + } + } + } + } + /** * @param status boolean status of the slot * @param slotId int id of the slot @@ -560,20 +435,6 @@ public LazyOptional getCapability(@Nonnull Capability cap, @Nullable D return this.capabilityMap.getCapability(cap, side, this); } - /** - * @return a VEEnergyStorage object or null if this tile is not an instance of poweredTileEntity - */ - public LazyOptional createEnergy() { - if (this instanceof IVEPoweredTileEntity IVEPoweredTileEntity) { - VEEnergyStorage storage = new VEEnergyStorage(IVEPoweredTileEntity.getMaxPower(), IVEPoweredTileEntity.getTransferRate()); - if (this instanceof IVEPowerGenerator) { - storage.setMaxReceive(0); - } - return LazyOptional.of(() -> storage); - } - return LazyOptional.empty(); - } - /** * Call this to consume energy * Note that tiles now require an upgrade slot and thus an inventory to properly function here @@ -581,36 +442,20 @@ public LazyOptional createEnergy() { * Throws an error if missing the power consumeEnergy IMPL */ public void consumeEnergy() { - if (this instanceof IVEPoweredTileEntity IVEPoweredTileEntity) { - energy.ifPresent(e -> e - .consumeEnergy( - this.consumptionMultiplier(IVEPoweredTileEntity.getPowerUsage(), - getInventoryHandler().getStackInSlot(IVEPoweredTileEntity.getUpgradeSlotId()).copy()))); - } else { - throw new NotImplementedException("Missing implementation of IVEPoweredTileEntity in class: " + this.getClass().getName()); - } + if(this.energy == null) return; + energy.consumeEnergy(this.consumptionMultiplier(energy.getConsumption(),energy.getUpgradeSlotId())); } - - private LazyOptional capability; - /** - * Like consumeEnergy this requires that the object has an inventory - * - * @return True if the object has enough energy to be able to continue - * Throws an error if missing the power consumeEnergy IMPL + * @return True if the object has enough energy to be able to continue. Or the entity doesn't run on energy */ public boolean canConsumeEnergy() { - if (this instanceof IVEPoweredTileEntity ivePoweredTileEntity) { - if (ivePoweredTileEntity.getMaxPower() == 0) return true; // For tiles that do not consume power - if (capability == null) { - capability = this.getCapability(ForgeCapabilities.ENERGY, null); - } - return capability.map(IEnergyStorage::getEnergyStored).orElse(0) - > this.consumptionMultiplier(ivePoweredTileEntity.getPowerUsage(), getInventoryHandler().getStackInSlot(ivePoweredTileEntity.getUpgradeSlotId()).copy()); - } else { - throw new NotImplementedException("Missing implementation of IVEPoweredTileEntity in class: " + this.getClass().getName()); + if (energy != null) { + if (energy.getMaxEnergyStored() == 0) return true; // For tiles that do not consume power + return energy.getEnergyStored() + > this.consumptionMultiplier(energy.getConsumption(), energy.getUpgradeSlotId()); } + return true; } /** @@ -644,18 +489,19 @@ public boolean canConsumeEnergy() { * USE EITHER A NEWLY CREATED ONE OR ONE OF THE createHandler's defined here * * @return a ItemStackHandler or null if the object lacks an inventory - * @see #createHandler(int) - * @see #createHandler(int, IVEPoweredTileEntity) */ - public abstract @Nullable - ItemStackHandler getInventoryHandler(); + public @Nullable ItemStackHandler getInventoryHandler() { + return this.inventory; + } /** * Important note. If the entity has no slot managers return a new ArrayList otherwise this will crash * * @return A not null List list */ - public abstract @Nonnull List getSlotManagers(); + public @Nonnull List getSlotManagers() { + return this.managers; + } /** * When a data packet is received load it. @@ -665,19 +511,29 @@ public boolean canConsumeEnergy() { */ @Override public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) { - energy.ifPresent(e -> { - if (pkt.getTag() != null && pkt.getTag().contains("energy")) e.setEnergy(pkt.getTag().getInt("energy")); - }); + if (energy != null && pkt.getTag() != null && pkt.getTag().contains("energy")) + energy.setEnergy(pkt.getTag().getInt("energy")); this.load(pkt.getTag()); super.onDataPacket(net, pkt); } - public int progressCounterPX(int px) { + public int progressBurnCounterPX(int px) { + int counter = dataMap.get("counter"); + int length = dataMap.get("length"); + if (counter != 0 && length != 0) return (px * (((counter * 100) / length))) / 100;; + return 0; + } + + public int progressProcessingCounterPX(int px) { + int counter = dataMap.get("counter"); + int length = dataMap.get("length"); if (counter != 0 && length != 0) return (px * (100 - ((counter * 100) / length))) / 100; return 0; } public int progressCounterPercent() { + int counter = dataMap.get("counter"); + int length = dataMap.get("length"); if (length != 0) { return (int) (100 - (((float) counter / (float) length) * 100)); } else { @@ -686,7 +542,7 @@ public int progressCounterPercent() { } public int ticksLeft() { - return counter; + return dataMap.get("counter"); } @Nullable @@ -695,7 +551,8 @@ public ClientboundBlockEntityDataPacket getUpdatePacket() { return ClientboundBlockEntityDataPacket.create(this); } - public LazyOptional getEnergy() { + @Nullable + public VEEnergyStorage getEnergy() { return energy; } @@ -703,68 +560,86 @@ public void markRecipeDirty() { this.isRecipeDirty = true; } - public void validateRecipe() { - if (!this.isRecipeDirty) { - return; - } - this.isRecipeDirty = false; - - this.potentialRecipes = RecipeCache.getFluidRecipesFromCache(level, this.getRecipeType(), getSlotManagers(), getRelationalTanks(), this, true); - if (this.potentialRecipes.size() == 1) { - List inputFluids = this.getRelationalTanks().stream() - .filter(tank -> tank.getTankType() == TankType.INPUT) - .map(tank -> tank.getTank().getFluid()).toList(); - - ItemStackHandler handler = this.getInventoryHandler(); - List inputItems = new ArrayList<>(); - if (handler != null) { - inputItems = this.getSlotManagers().stream() - .filter(manager -> manager.getSlotType() == SlotType.INPUT) - .map(manager -> manager.getItem(handler)).toList(); - } - VEFluidRecipe newRecipe = RecipeCache.getFluidRecipeFromCache(level, getRecipeType(), inputFluids, inputItems); + public RecipeType> getRecipeType() { + return this.recipeType; + } - if (newRecipe == null) { - counter = 0; - length = 0; - this.selectedRecipe = null; - return; - } + public List getPotentialRecipes() { + return potentialRecipes; + } - int newLength; + void addTanks(List tanks) { + this.tanks.addAll(tanks); + } - if (this instanceof IVEPoweredTileEntity poweredTileEntity && handler != null) { - newLength = this.calculateCounter(newRecipe.getProcessTime(), - handler.getStackInSlot(poweredTileEntity.getUpgradeSlotId()).copy()); - } else { - newLength = this.calculateCounter(newRecipe.getProcessTime(), ItemStack.EMPTY); - } + void addSlots(List managers) { + this.managers.addAll(managers); + } + public VEItemStackHandler getInventory() { + return inventory; + } - double ratio = (double) length / (double) newLength; - length = newLength; - counter = (int) (counter / ratio); + @Nullable + public VEFluidRecipe getSelectedRecipe() { + return selectedRecipe; + } - if (this.selectedRecipe != newRecipe) { - this.selectedRecipe = newRecipe; - counter = newLength; - } - } else { - counter = 0; - length = 0; - this.selectedRecipe = null; - } + public List getTanks() { + return tanks; } - public void doExtraRecipeProcessing() { + public List getManagers() { + return managers; + } + public boolean isFluidInputDirty() { + return fluidInputDirty; } - public RecipeType> getRecipeType() { - return this.recipeType; + public boolean isRecipeDirty() { + return isRecipeDirty; } - public List> getPotentialRecipes() { - return potentialRecipes; + public int getData(String key) { + return this.dataMap.getOrDefault(key,-1); + } + + public void setData(String key, int value) { + this.dataMap.put(key,value); + } + + public void setRecipeDirty(boolean dirty) { + this.isRecipeDirty = dirty; + } + + public void setPotentialRecipes(List recipes) { + this.potentialRecipes = recipes; + } + + @Deprecated + void processRecipe() { + + } + + @Deprecated + void doExtraRecipeProcessing() { + + } + + @Deprecated + public void validateRecipe() { + } + + public boolean sendsOutPower() { + return sendsOutPower; + } + + public void setSendsOutPower(boolean sendsOutPower) { + this.sendsOutPower = sendsOutPower; + } + + public void setSelectedRecipe(VEFluidRecipe recipe) { + this.selectedRecipe = recipe; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java new file mode 100644 index 000000000..230782b07 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java @@ -0,0 +1,196 @@ +package com.veteam.voluminousenergy.blocks.tiles; + +import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory; +import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.processor.RecipeProcessor; +import com.veteam.voluminousenergy.recipe.validator.RecipeValidator; +import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; +import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; +import com.veteam.voluminousenergy.util.SlotType; +import com.veteam.voluminousenergy.util.TankType; +import com.veteam.voluminousenergy.util.VERelationalTank; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.entity.player.Inventory; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraftforge.fluids.capability.templates.FluidTank; +import net.minecraftforge.registries.RegistryObject; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + +public class VETileFactory { + private List tanks = new ArrayList<>(); + private RegistryObject> recipeType; + private final RegistryObject> tileRegistry; + private final VEContainerFactory containerFactory; + private VEEnergyStorage storage; + + private final HashMap dataMap = new HashMap<>(); + private RecipeProcessor processor; + private RecipeValidator validator; + private boolean sendsOutPower = false; + + public VETileFactory(RegistryObject> tileRegistry, VEContainerFactory containerFactory) { + this.tileRegistry = tileRegistry; + this.containerFactory = containerFactory; + } + + public VETileEntity create(BlockPos pos, BlockState state) { + + VETileEntity newTile = new VETileEntity(tileRegistry.get(), pos, state, recipeType.get()) { + + @Nullable + @Override + public AbstractContainerMenu createMenu(int id, @NotNull Inventory playerInventory, @NotNull Player player) { + return containerFactory.create(id, level, worldPosition, playerInventory, player); + } + }; + // Add our tanks and slots + AtomicInteger index = new AtomicInteger(); + newTile.addSlots(containerFactory.getTileSlotsAsManagers()); + index.set(0); + newTile.addTanks(tanks.stream().map(t -> t.asTank(index.getAndIncrement())).toList()); + // Populate the data map + newTile.dataMap.putAll(dataMap); + + // Set energy before the slot count otherwise we'll run into issues with the data slot + newTile.energy = storage.copy(); + + //set processor + newTile.recipeProcessor = processor; + newTile.recipeValidator = validator; + + // send out power + newTile.sendsOutPower = sendsOutPower; + + // build out the inventory + int inventorySize = containerFactory.getNumberOfSlots(); + storage.setUpgradeSlotId(containerFactory.upgradeSlotId()); + newTile.inventory = new VEItemStackHandler(newTile,inventorySize,storage.getUpgradeSlotId()); + + return newTile; + } + + public VETileFactory withRecipe(RegistryObject> recipe) { + this.recipeType = recipe; + return this; + } + + public VETileFactory addEnergyStorageWithConsumption(int maxPower, int transferRate, int consumption) { + VEEnergyStorage storage = new VEEnergyStorage(maxPower, transferRate); + storage.setConsumption(consumption); + this.storage = storage; + return this; + } + + public VETileFactory addEnergyStorage(int maxPower, int transferRate) { + this.storage = new VEEnergyStorage(maxPower, transferRate); + return this; + } + + public VETileFactory addUpgradeSlot(int upgradeSlotId) { + + if (storage == null) + throw new IllegalStateException("Attempted to add upgrade slot without first adding energy storage!"); + + storage.setUpgradeSlotId(upgradeSlotId); + return this; + } + + public VETileFactory countable() { + this.dataMap.put("counter",0); + this.dataMap.put("length",0); + return this; + } + + public VETileFactory withDataFlag(String flag) { + this.dataMap.put(flag,0); + return this; + } + + public VETileFactory includeSoundTick() { + this.dataMap.put("sound_tick",0); + return this; + } + + public VETileFactory withTanks(TileTank... tanks) { + this.tanks = List.of(tanks); + return this; + } + + public VETileFactory makesSound() { + this.dataMap.put("sound_tick",0); + return this; + } + + public VETileFactory withRecipeProcessing(RecipeProcessor processor, RecipeValidator recipeValidator) { + this.processor = processor; + this.validator = recipeValidator; + return this; + } + + public VETileFactory sendsOutPower() { + this.sendsOutPower = true; + return this; + } + + public record ItemInputSlot(Direction direction,int recipePos) implements TileSlot { + @Override + public VESlotManager asManager(int id) { + return new VESlotManager(id, recipePos, direction, true, SlotType.INPUT); + } + } + + public record ItemOutputSlot(Direction direction,int recipePos) implements TileSlot { + @Override + public VESlotManager asManager(int id) { + return new VESlotManager(id, recipePos, direction, true, SlotType.OUTPUT); + } + } + + public record BucketInputSlot(Direction direction, int tankId) implements TileSlot { + @Override + public VESlotManager asManager(int id) { + return new VESlotManager(id, direction, true, SlotType.FLUID_INPUT, id + 1, tankId); + } + } + + public record BucketOutputSlot(Direction direction) implements TileSlot { + @Override + public VESlotManager asManager(int id) { + return new VESlotManager(id, direction, true, SlotType.FLUID_OUTPUT); + } + } + + public record FluidInputTank(int recipePos, int capacity) implements TileTank { + @Override + public VERelationalTank asTank(int id) { + return new VERelationalTank(new FluidTank(capacity), id, recipePos, TankType.INPUT, "input_tank_" + id + ":input_tank_gui"); + } + } + + public record FluidOutputTank(int recipePos, int capacity) implements TileTank { + @Override + public VERelationalTank asTank(int id) { + return new VERelationalTank(new FluidTank(capacity), id, recipePos, TankType.OUTPUT, "input_tank_" + id + ":output_tank_gui"); + } + } + + public interface TileSlot { + VESlotManager asManager(int id); + } + + public interface TileTank { + + VERelationalTank asTank(int id); + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactoryBuilder.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactoryBuilder.java deleted file mode 100644 index 66611fd2b..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactoryBuilder.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; -import net.minecraftforge.common.util.LazyOptional; - -public class VETileFactoryBuilder { - - private VETileEntity tileEntity; - - public VETileFactoryBuilder addEnergyStore(int maxPower,int transferRate) { - VEEnergyStorage storage = new VEEnergyStorage(maxPower, transferRate); - this.tileEntity.energy = LazyOptional.of(() -> storage); - return this; - } - -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java index 87dc1e611..f603ce316 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java @@ -3,7 +3,7 @@ import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.MultiFluidSlotWrapper; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import net.minecraft.core.BlockPos; @@ -31,14 +31,14 @@ import java.util.List; public class TankTile extends VETileEntity { - private final RelationalTank tank = new RelationalTank(new FluidTank(0), 0, TankType.BOTH, "tank:tank_gui"); + private final VERelationalTank tank = new VERelationalTank(new FluidTank(0), 0, TankType.BOTH, "tank:tank_gui"); List slotManagers = new ArrayList<>() {{ add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); }}; - List fluidManagers = new ArrayList<>() {{ + List fluidManagers = new ArrayList<>() {{ add(tank); }}; @@ -126,7 +126,7 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate }; } - public RelationalTank getTank() { + public VERelationalTank getTank() { return this.tank; } @@ -170,7 +170,7 @@ public LazyOptional getCapability(@NotNull Capability cap, @Nullable D } @Override - public @NotNull List getRelationalTanks() { + public @NotNull List getRelationalTanks() { return fluidManagers; } diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java index 9f26da7ee..ef2fdc418 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java @@ -184,18 +184,18 @@ public void registerGuiHandlers(IGuiHandlerRegistration registration) { @Override public void registerRecipeTransferHandlers(IRecipeTransferRegistration registration) { - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.CRUSHER_CONTAINER.get(), CrushingCategory.RECIPE_TYPE, 0, 1, VEContainers.CRUSHER_FACTORY.numberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.ELECTROLYZER_CONTAINER.get(), ElectrolyzingCategory.RECIPE_TYPE, 0, 2, VEContainers.ELECTROLYZER_FACTORY.numberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.COMPRESSOR_CONTAINER.get(), CompressingCategory.RECIPE_TYPE, 0, 1, VEContainers.COMPRESSOR_FACTORY.numberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.PRIMITIVE_STIRLING_GENERATOR_CONTAINER.get(), StirlingCategory.RECIPE_TYPE, 0, 1, VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY.numberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.STIRLING_GENERATOR_CONTAINER.get(), StirlingCategory.RECIPE_TYPE, 0, 1, VEContainers.STIRLING_GENERATOR_FACTORY.numberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.AQUEOULIZER_CONTAINER.get(), AqueoulizingCategory.RECIPE_TYPE, 3, 2, VEContainers.AQUEOULIZER_FACTORY.numberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.CENTRIFUGAL_SEPARATOR_CONTAINER.get(), CentrifugalSeparationCategory.RECIPE_TYPE, 0, 2, VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY.numberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.IMPLOSION_COMPRESSOR_CONTAINER.get(), ImplosionCompressionCategory.RECIPE_TYPE, 0, 2, VEContainers.IMPLOSION_COMPRESSOR_FACTORY.numberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.BLAST_FURNACE_CONTAINER.get(), IndustrialBlastingCategory.RECIPE_TYPE, 2, 3, VEContainers.BLAST_FURNACE_FACTORY.numberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.CRUSHER_CONTAINER.get(), CrushingCategory.RECIPE_TYPE, 0, 1, VEContainers.CRUSHER_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.ELECTROLYZER_CONTAINER.get(), ElectrolyzingCategory.RECIPE_TYPE, 0, 2, VEContainers.ELECTROLYZER_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.COMPRESSOR_CONTAINER.get(), CompressingCategory.RECIPE_TYPE, 0, 1, VEContainers.COMPRESSOR_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.PRIMITIVE_STIRLING_GENERATOR_CONTAINER.get(), StirlingCategory.RECIPE_TYPE, 0, 1, VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.STIRLING_GENERATOR_CONTAINER.get(), StirlingCategory.RECIPE_TYPE, 0, 1, VEContainers.STIRLING_GENERATOR_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.AQUEOULIZER_CONTAINER.get(), AqueoulizingCategory.RECIPE_TYPE, 3, 2, VEContainers.AQUEOULIZER_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.CENTRIFUGAL_SEPARATOR_CONTAINER.get(), CentrifugalSeparationCategory.RECIPE_TYPE, 0, 2, VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.IMPLOSION_COMPRESSOR_CONTAINER.get(), ImplosionCompressionCategory.RECIPE_TYPE, 0, 2, VEContainers.IMPLOSION_COMPRESSOR_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.BLAST_FURNACE_CONTAINER.get(), IndustrialBlastingCategory.RECIPE_TYPE, 2, 3, VEContainers.BLAST_FURNACE_FACTORY.getNumberOfSlots(), 36); registration.addRecipeTransferHandler(ToolingStationContainer.class, VEBlocks.TOOLING_STATION_CONTAINER.get(), ToolingCategory.RECIPE_TYPE, 3, 2, ToolingStationContainer.NUMBER_OF_SLOTS, 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.SAWMILL_CONTAINER.get(), SawmillCategory.RECIPE_TYPE, 0, 3, VEContainers.SAWMILL_FACTORY.numberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.PRIMITIVE_BLAST_FURNACE_CONTAINER.get(), PrimitiveBlastingCategory.RECIPE_TYPE, 0, 2, VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY.numberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.SAWMILL_CONTAINER.get(), SawmillCategory.RECIPE_TYPE, 0, 3, VEContainers.SAWMILL_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.PRIMITIVE_BLAST_FURNACE_CONTAINER.get(), PrimitiveBlastingCategory.RECIPE_TYPE, 0, 2, VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY.getNumberOfSlots(), 36); // TODO: Transfer helper for the Fluid Electrolyzer // TODO: Fluid Mixer // TODO: Hydroponic Incubator diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java index 05270591a..c5f63ba61 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java @@ -32,7 +32,7 @@ public class CombustionMultitool extends Multitool { - public final int TANK_CAPACITY = VETileEntity.TANK_CAPACITY; + public final int TANK_CAPACITY = VETileEntity.DEFAULT_TANK_CAPACITY; public CombustionMultitool(MultitoolBit bit, String registryName, Properties itemProperties) { super(bit, registryName, itemProperties); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java index 4e36d1b7b..d5a7e599b 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; import net.minecraft.world.item.ItemStack; @@ -95,16 +95,16 @@ public static VEFluidRecipe getFluidRecipeFromCache(Level level, RecipeType getFluidRecipesFromCache(Level level, RecipeType> type, List slots, List tanks, VETileEntity entity, boolean ignoreEmpty) { + public static @NotNull List getFluidRecipesFromCache(VETileEntity tile, boolean ignoreEmpty) { - var recipes = VERecipe.getCachedRecipes(type); + var recipes = VERecipe.getCachedRecipes(tile.getRecipeType()); List recipeList = new ArrayList<>(); for (VERecipe recipe : recipes) { boolean isValid = true; - for (RelationalTank tank : tanks) { + for (VERelationalTank tank : tile.getTanks()) { if (ignoreEmpty && tank.getTank().isEmpty()) continue; if (tank.getTankType() != TankType.INPUT) continue; FluidStack currentFluid = tank.getTank().getFluid(); @@ -114,9 +114,9 @@ public static VEFluidRecipe getFluidRecipeFromCache(Level level, RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.STIRLING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.STIRLING.get(); public StirlingGeneratorRecipe() { } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VEEnergyRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VEEnergyRecipe.java index a068b6c69..6235e37df 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEEnergyRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VEEnergyRecipe.java @@ -5,7 +5,7 @@ import java.util.ArrayList; import java.util.List; -public abstract class VEEnergyRecipe extends VERecipe { +public abstract class VEEnergyRecipe extends VEFluidRecipe { private int energyPerTick; @@ -14,7 +14,7 @@ public VEEnergyRecipe() { } public VEEnergyRecipe(List ingredients, int processTime, int energy_per_tick) { - super(ingredients,new ArrayList<>(),processTime); + super(ingredients,new ArrayList<>(),new ArrayList<>(),new ArrayList<>(),processTime); this.energyPerTick = energy_per_tick; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java index ec4b3674a..741afcb3f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java @@ -32,7 +32,7 @@ public static final class VERecipeTypes{ public static final RegistryObject> COMPRESSING = VE_RECIPE_TYPES_REGISTRY.register("compressing", () -> new VERecipeType<>(RecipeConstants.COMPRESSING)); - public static final RegistryObject> STIRLING = + public static final RegistryObject> STIRLING = VE_RECIPE_TYPES_REGISTRY.register("stirling", () -> new VERecipeType<>(RecipeConstants.STIRLING)); public static final RegistryObject> OXIDIZING = diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/FluidItemProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/FluidItemProcessor.java new file mode 100644 index 000000000..041f31d7b --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/FluidItemProcessor.java @@ -0,0 +1,121 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; +import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.sounds.VESounds; +import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; +import com.veteam.voluminousenergy.util.SlotType; +import com.veteam.voluminousenergy.util.TankType; +import com.veteam.voluminousenergy.util.VERelationalTank; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.templates.FluidTank; +import net.minecraftforge.items.ItemStackHandler; + +import java.util.Random; + +import static net.minecraft.util.Mth.abs; + +public class FluidItemProcessor implements RecipeProcessor { + + @Override + public void processRecipe(VETileEntity tile) { + if (tile.getSelectedRecipe() == null) return; + if (!tile.canConsumeEnergy()) return; + VEFluidRecipe recipe = tile.getSelectedRecipe(); + + int counter = tile.getData("counter"); + + if (counter == 1) { + // Validate output + for (VERelationalTank relationalTank : tile.getRelationalTanks()) { + if (relationalTank.getTankType() == TankType.OUTPUT) { + FluidStack recipeFluid = recipe.getOutputFluid(relationalTank.getRecipePos()); + FluidTank tank = relationalTank.getTank(); + FluidStack currentFluid = tank.getFluid(); + if (currentFluid.isEmpty()) continue; + // If the output fluid amount won't fit, then you must acquit + if (!recipeFluid.isFluidEqual(currentFluid) + || tank.getFluidAmount() + recipeFluid.getAmount() > tank.getCapacity()) { + return; + } + } + } + + ItemStackHandler handler = tile.getInventoryHandler(); + + if (handler != null) { + // Validate output + for (VESlotManager slotManager : tile.getSlotManagers()) { + if (slotManager.getSlotType() != SlotType.OUTPUT) continue; + ItemStack recipeStack = recipe.getResult(slotManager.getRecipePos()); + ItemStack currentItem = slotManager.getItem(handler); + if (currentItem.isEmpty()) continue; + // If the output item amount won't fit, then you must acquit + if (!recipeStack.is(currentItem.getItem()) + || recipeStack.getCount() + currentItem.getCount() > currentItem.getMaxStackSize()) { + return; + } + } + + VEFluidRNGRecipe irngRecipe = null; + if (recipe instanceof VEFluidRNGRecipe rec) { + irngRecipe = rec; + } + Random r = new Random(); + + // process recipe + for (VESlotManager slotManager : tile.getSlotManagers()) { + if (slotManager.getSlotType() == SlotType.OUTPUT) { + ItemStack output = recipe.getResult(slotManager.getRecipePos()); + ItemStack currentStack = slotManager.getItem(handler); + // rng calculations + if (irngRecipe != null) { + float randomness = irngRecipe.getOutputChance(slotManager.getRecipePos()); + if (randomness != 1) { + float random = abs(0 + r.nextFloat() * (-1)); + if (random > randomness) continue; + } + + } + if (currentStack.isEmpty()) slotManager.setItem(output, handler); + else currentStack.setCount(currentStack.getCount() + output.getCount()); + } else if (slotManager.getSlotType() == SlotType.INPUT) { + Ingredient ingredient = recipe.getIngredient(slotManager.getRecipePos()); + ItemStack currentStack = slotManager.getItem(handler); + currentStack.setCount(currentStack.getCount() - ingredient.getItems()[0].getCount()); + } + } + } + + // process recipe + for (VERelationalTank relationalTank : tile.getRelationalTanks()) { + if (relationalTank.getTankType() == TankType.OUTPUT) { + relationalTank.fillOutput(recipe, relationalTank.getRecipePos()); + } else if (relationalTank.getTankType() == TankType.INPUT) { + relationalTank.drainInput(recipe, relationalTank.getRecipePos()); + } + } + + tile.markRecipeDirty(); + tile.markFluidInputDirty(); + tile.setChanged(); + } else if (counter > 0) { + int soundTick = tile.getData("sound_tick"); + if (++soundTick == 19 && Config.PLAY_MACHINE_SOUNDS.get()) { + soundTick = 0; + tile.getLevel().playSound(null, tile.getBlockPos(), VESounds.AQUEOULIZER, SoundSource.BLOCKS, 1.0F, 1.0F); + } + tile.setData("sound_tick", soundTick); + } else { + tile.setData("counter", tile.getData("length")); + } + tile.setData("counter", tile.getData("counter") - 1); + tile.consumeEnergy(); + } + +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorItemProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorItemProcessor.java new file mode 100644 index 000000000..4593edcf0 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorItemProcessor.java @@ -0,0 +1,64 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.VEEnergyRecipe; +import com.veteam.voluminousenergy.sounds.VESounds; +import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; +import net.minecraft.sounds.SoundSource; +import org.apache.commons.lang3.NotImplementedException; + +public class GeneratorItemProcessor implements RecipeProcessor { + + private int divisor = 1; + private boolean allowOverflow = false; + + public GeneratorItemProcessor(boolean allowOverflow,int divisor) { + this.allowOverflow = allowOverflow; + this.divisor = divisor; + } + + public GeneratorItemProcessor() { + } + + @Override + public void processRecipe(VETileEntity tile) { + VEEnergyStorage energy = tile.getEnergy(); + + if (energy == null) throw new NotImplementedException("Missing energy impl for " + tile.getDisplayName()); + int counter = tile.getData("counter"); + + if (counter > 0) { + if (energy.getEnergyStored() + energy.getProduction() <= energy.getCapacity() || allowOverflow) { + tile.setData("counter", --counter); + energy.addEnergy(energy.getProduction()); + } + + if (Config.PLAY_MACHINE_SOUNDS.get()) { + int sound_tick = tile.getData("sound_tick"); + if (++sound_tick == 19) { + sound_tick = 0; + tile.getLevel().playSound(null, + tile.getBlockPos(), + VESounds.GENERAL_MACHINE_NOISE, + SoundSource.BLOCKS, 1.0F, 1.0F); + tile.setData("sound_tick", sound_tick); + } + } + tile.setChanged(); + } else if (counter == 0) { + if (tile.getSelectedRecipe() instanceof VEEnergyRecipe recipe) { + tile.getInventory().extractItem(0, recipe.getIngredientCount(0), false); + tile.setData("counter", recipe.getProcessTime()); + tile.getEnergy().setProduction(recipe.getEnergyPerTick() / divisor); + tile.setData("length", recipe.getProcessTime()); + tile.setSelectedRecipe(null); + tile.setChanged(); + } else { + tile.getEnergy().setProduction(0); + } + } + } + +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/RecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/RecipeProcessor.java new file mode 100644 index 000000000..7b9180c4c --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/RecipeProcessor.java @@ -0,0 +1,9 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; + +public interface RecipeProcessor { + + void processRecipe(VETileEntity tile); + +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/validator/FluidItemValidator.java b/src/main/java/com/veteam/voluminousenergy/recipe/validator/FluidItemValidator.java new file mode 100644 index 000000000..1edd8eef5 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/validator/FluidItemValidator.java @@ -0,0 +1,70 @@ +package com.veteam.voluminousenergy.recipe.validator; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.RecipeCache; +import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.util.SlotType; +import com.veteam.voluminousenergy.util.TankType; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.items.ItemStackHandler; + +import java.util.ArrayList; +import java.util.List; + +public class FluidItemValidator implements RecipeValidator { + + @Override + public void validateRecipe(VETileEntity tile) { + if (!tile.isRecipeDirty()) { + return; + } + tile.setRecipeDirty(false); + + tile.setPotentialRecipes(RecipeCache.getFluidRecipesFromCache(tile, true)); + if (tile.getPotentialRecipes().size() == 1) { + List inputFluids = tile.getRelationalTanks().stream() + .filter(tank -> tank.getTankType() == TankType.INPUT) + .map(tank -> tank.getTank().getFluid()).toList(); + + ItemStackHandler handler = tile.getInventoryHandler(); + List inputItems = new ArrayList<>(); + if (handler != null) { + inputItems = tile.getSlotManagers().stream() + .filter(manager -> manager.getSlotType() == SlotType.INPUT) + .map(manager -> manager.getItem(handler)).toList(); + } + VEFluidRecipe newRecipe = RecipeCache.getFluidRecipeFromCache(null, tile.getRecipeType(), inputFluids, inputItems); + + if (newRecipe == null) { + tile.setData("counter",0); + tile.setData("length",0); + tile.setSelectedRecipe(null); + return; + } + + int newLength; + + if (tile.getEnergy() != null && handler != null) { + newLength = tile.calculateCounter(newRecipe.getProcessTime(), + handler.getStackInSlot(tile.getEnergy().getUpgradeSlotId()).copy()); + } else { + newLength = tile.calculateCounter(newRecipe.getProcessTime(), ItemStack.EMPTY); + } + + + double ratio = (double) tile.getData("length") / (double) newLength; + tile.setData("length",newLength); + tile.setData("counter", (int) (tile.getData("counter") / ratio)); + + if (tile.getSelectedRecipe() != newRecipe) { + tile.setSelectedRecipe(newRecipe); + tile.setData("counter",newLength); + } + } else { + tile.setData("counter",0); + tile.setData("length",0); + tile.setSelectedRecipe(null); + } + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/validator/GeneratorItemValidator.java b/src/main/java/com/veteam/voluminousenergy/recipe/validator/GeneratorItemValidator.java new file mode 100644 index 000000000..96a7fa57f --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/validator/GeneratorItemValidator.java @@ -0,0 +1,36 @@ +package com.veteam.voluminousenergy.recipe.validator; + +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.RecipeCache; +import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.util.SlotType; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.items.ItemStackHandler; + +import java.util.ArrayList; +import java.util.List; + +public class GeneratorItemValidator implements RecipeValidator { + + @Override + public void validateRecipe(VETileEntity tile) { + if (!tile.isRecipeDirty()) { + return; + } + tile.setRecipeDirty(false); + tile.setPotentialRecipes(RecipeCache.getFluidRecipesFromCache(tile, true)); + if (tile.getPotentialRecipes().size() == 1) { + ItemStackHandler handler = tile.getInventoryHandler(); + List inputItems = new ArrayList<>(); + if (handler != null) { + inputItems = tile.getSlotManagers().stream() + .filter(manager -> manager.getSlotType() == SlotType.INPUT) + .map(manager -> manager.getItem(handler)).toList(); + } + VEFluidRecipe newRecipe = RecipeCache.getFluidRecipeFromCache(null, tile.getRecipeType(), new ArrayList<>(), inputItems); + tile.setSelectedRecipe(newRecipe); + } + } + +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/validator/RecipeValidator.java b/src/main/java/com/veteam/voluminousenergy/recipe/validator/RecipeValidator.java new file mode 100644 index 000000000..01200d867 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/validator/RecipeValidator.java @@ -0,0 +1,9 @@ +package com.veteam.voluminousenergy.recipe.validator; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; + +public interface RecipeValidator { + + void validateRecipe(VETileEntity tile); + +} diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankBoolButton.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankBoolButton.java index eeea945ad..112706aec 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankBoolButton.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankBoolButton.java @@ -5,7 +5,7 @@ import com.veteam.voluminousenergy.tools.buttons.VEIOButton; import com.veteam.voluminousenergy.tools.networking.VENetwork; import com.veteam.voluminousenergy.tools.networking.packets.TankBoolPacket; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; import net.minecraft.network.chat.Component; @@ -14,10 +14,10 @@ public class TankBoolButton extends VEIOButton { private boolean enable = false; - private RelationalTank tank; + private VERelationalTank tank; private final ResourceLocation texture = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/crushergui.png"); - public TankBoolButton(RelationalTank tank, int x, int y, Button.OnPress onPress) { + public TankBoolButton(VERelationalTank tank, int x, int y, Button.OnPress onPress) { super(x, y, 16, 15, Component.nullToEmpty(""), button -> { ((TankBoolButton) button).cycle(); onPress.onPress(button); diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankDirectionButton.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankDirectionButton.java index 17af2d0d2..941d3bd0d 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankDirectionButton.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankDirectionButton.java @@ -6,7 +6,7 @@ import com.veteam.voluminousenergy.tools.networking.VENetwork; import com.veteam.voluminousenergy.tools.networking.packets.TankDirectionPacket; import com.veteam.voluminousenergy.util.IntToDirection; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; @@ -16,11 +16,11 @@ import net.minecraftforge.network.PacketDistributor; public class TankDirectionButton extends VEIOButton { - private RelationalTank tank; + private VERelationalTank tank; private Direction direction; private final ResourceLocation texture = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/crushergui.png"); - public TankDirectionButton(RelationalTank tank, int x, int y, OnPress onPress) { + public TankDirectionButton(VERelationalTank tank, int x, int y, OnPress onPress) { super(x, y, 96, 20, Component.nullToEmpty(""), button -> { ((TankDirectionButton) button).cycle(); onPress.onPress(button); diff --git a/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java b/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java index 9c8e43fd6..daa4c4e6e 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java @@ -1,5 +1,7 @@ package com.veteam.voluminousenergy.tools.energy; +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.IntTag; import net.minecraft.nbt.Tag; @@ -9,18 +11,29 @@ public class VEEnergyStorage extends EnergyStorage implements INBTSerializable { + private int production; + private int consumption; + private int upgradeSlotId = -1; + public VEEnergyStorage(int capacity, int maxTransfer) { super(capacity, maxTransfer); } + public VEEnergyStorage(int capacity, int maxTransfer, int production, int consumption, int upgradeSlotId) { + super(capacity, maxTransfer); + this.production = production; + this.consumption = consumption; + this.upgradeSlotId = upgradeSlotId; + } + public void setEnergy(int energy){ this.energy = energy; } - public void addEnergy(int energy){ + public void addEnergy(int energy) { this.energy += energy; - if (this.energy > getMaxEnergyStored()){ - this.energy = getEnergyStored(); + if (this.energy > capacity){ + this.energy = capacity; } } @@ -40,20 +53,69 @@ public CompoundTag serializeNBT(){ public void serializeNBT(CompoundTag tag) { tag.putInt("energy", getEnergyStored()); + tag.putInt("energy_production",production); + tag.putInt("energy_consumption",consumption); + tag.putInt("upgrade_slot",upgradeSlotId); } public void deserializeNBT(CompoundTag tag) { setEnergy(tag.getInt("energy")); + this.production = tag.getInt("energy_production"); + this.consumption = tag.getInt("energy_consumption"); + this.upgradeSlotId = tag.getInt("upgrade_slot"); + } + + public VEEnergyStorage copy() { + return new VEEnergyStorage(capacity,maxReceive,production,consumption,upgradeSlotId); } public void setMaxReceive(int amount) { this.maxReceive = amount; } + public void setConsumption(int consumption) { + this.consumption = consumption; + } + + public void setProduction(int production) { + this.production = production; + } + @Override public void deserializeNBT(Tag nbt) { if (!(nbt instanceof IntTag intNbt)) throw new IllegalArgumentException("VEEnergyStorage: Cannot deserialize to an instance that isn't the default implementation!"); setEnergy(intNbt.getAsInt()); } + + public void setUpgradeSlotId(int upgradeSlotId) { + this.upgradeSlotId = upgradeSlotId; + } + + public int getProduction() { + return production; + } + + public int getConsumption() { + return consumption; + } + + public int getMaxTransfer() { + return maxReceive; + } + + public int getUpgradeSlotId() { + return this.upgradeSlotId; + } + + /** + * How much energy can be stored + * @return the int value of the capacity + */ + public int getCapacity() + { + return capacity; + } + + } diff --git a/src/main/java/com/veteam/voluminousenergy/util/BucketInputOutputUtil.java b/src/main/java/com/veteam/voluminousenergy/util/BucketInputOutputUtil.java index 1dd007d5b..0d2af6d0a 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/BucketInputOutputUtil.java +++ b/src/main/java/com/veteam/voluminousenergy/util/BucketInputOutputUtil.java @@ -12,7 +12,7 @@ public class BucketInputOutputUtil { - public static void processBucketInput(ItemStack oxidizerInput, ItemStack oxidizerOutput, RelationalTank oxidizerTank, List rawFluidInputList, int tankCapacity, IItemHandler inventory) { + public static void processBucketInput(ItemStack oxidizerInput, ItemStack oxidizerOutput, VERelationalTank oxidizerTank, List rawFluidInputList, int tankCapacity, IItemHandler inventory) { // Input fluid into the oxidizer tank if (oxidizerInput.copy() != ItemStack.EMPTY && oxidizerOutput.copy() == ItemStack.EMPTY) { if (oxidizerInput.copy().getItem() instanceof BucketItem && oxidizerInput.getCount() == 1) { diff --git a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java index f743bdafc..e781c2734 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java +++ b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java @@ -14,11 +14,11 @@ public class MultiFluidSlotWrapper implements IFluidHandler { - HashMap tankHashMap = new HashMap<>(); - List tanks; + HashMap tankHashMap = new HashMap<>(); + List tanks; VETileEntity tileEntity; - public MultiFluidSlotWrapper(List tanks,VETileEntity tileEntity) { + public MultiFluidSlotWrapper(List tanks, VETileEntity tileEntity) { this.tanks = tanks; this.tileEntity = tileEntity; tanks.forEach(m -> tankHashMap.put(m.getSlotNum(), m)); @@ -33,7 +33,7 @@ public int getTanks() { @Override public FluidStack getFluidInTank(int tank) { if (tankHashMap.containsKey(tank)) { - RelationalTank fluidTank = tankHashMap.get(tank); + VERelationalTank fluidTank = tankHashMap.get(tank); return fluidTank.getTank() == null ? FluidStack.EMPTY : fluidTank.getTank().getFluid(); } return FluidStack.EMPTY; @@ -42,7 +42,7 @@ public FluidStack getFluidInTank(int tank) { @Override public int getTankCapacity(int tank) { if (tankHashMap.containsKey(tank)) { - RelationalTank fluidTank = tankHashMap.get(tank); + VERelationalTank fluidTank = tankHashMap.get(tank); return fluidTank.getTank() == null ? 0 : fluidTank.getTank().getCapacity(); } return 0; @@ -50,7 +50,7 @@ public int getTankCapacity(int tank) { @Override public boolean isFluidValid(int tank, @Nonnull FluidStack stack) { - RelationalTank relationalTank = tankHashMap.get(tank); + VERelationalTank relationalTank = tankHashMap.get(tank); if(relationalTank.isAllowAny()) return true; for (Recipe recipe : tileEntity.getPotentialRecipes()) { VEFluidRecipe veFluidRecipe = (VEFluidRecipe) recipe; @@ -64,7 +64,7 @@ public boolean isFluidValid(int tank, @Nonnull FluidStack stack) { @Override public int fill(FluidStack resource, FluidAction action) { - for(RelationalTank tank : tanks) { + for(VERelationalTank tank : tanks) { if(tank.getTankType() == TankType.OUTPUT) continue; if (isFluidValid(tank.getSlotNum(), resource) && (tank.getTank().isEmpty() || resource.isFluidEqual(tank.getTank().getFluid()))) { if(!tank.getSideStatus() && !(tileEntity instanceof TankTile)) return 0; @@ -81,7 +81,7 @@ public FluidStack drain(FluidStack resource, FluidAction action) { if (resource.isEmpty()) { return FluidStack.EMPTY; } - for(RelationalTank tank : tanks) { + for(VERelationalTank tank : tanks) { if(!tank.getSideStatus() && !tank.isIgnoreDirection()) continue; if(!Config.ALLOW_EXTRACTION_FROM_INPUT_TANKS.get()) { if(tank.getTankType() != TankType.OUTPUT && tank.getTankType() != TankType.BOTH) continue; @@ -97,7 +97,7 @@ public FluidStack drain(FluidStack resource, FluidAction action) { @Nonnull @Override public FluidStack drain(int maxDrain, FluidAction action) { - for(RelationalTank tank : tanks) { + for(VERelationalTank tank : tanks) { if(!tank.getSideStatus() && !(tileEntity instanceof TankTile)) continue; if(!Config.ALLOW_EXTRACTION_FROM_INPUT_TANKS.get()) { if(tank.getTankType() != TankType.OUTPUT && tank.getTankType() != TankType.BOTH) continue; @@ -110,11 +110,11 @@ public FluidStack drain(int maxDrain, FluidAction action) { return FluidStack.EMPTY; } - public void addRelationalTank(RelationalTank tank) { + public void addRelationalTank(VERelationalTank tank) { tankHashMap.put(tank.getSlotNum(),tank); tanks.add(tank); } - public void removeRelationalTank(RelationalTank tank) { + public void removeRelationalTank(VERelationalTank tank) { tankHashMap.remove(tank.getSlotNum()); tanks.remove(tank); } diff --git a/src/main/java/com/veteam/voluminousenergy/util/SlotType.java b/src/main/java/com/veteam/voluminousenergy/util/SlotType.java index 2d732d799..d75722863 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/SlotType.java +++ b/src/main/java/com/veteam/voluminousenergy/util/SlotType.java @@ -3,6 +3,7 @@ public enum SlotType { INPUT("slot.voluminousenergy.input_slot"), OUTPUT("slot.voluminousenergy.output_slot"), + UPGRADE("slot.voluminousenergy.upgrade_slot"), FLUID_INPUT("slot.voluminousenergy.input_slot",true), FLUID_OUTPUT("slot.voluminousenergy.output_slot",true); private final String translationKey; diff --git a/src/main/java/com/veteam/voluminousenergy/util/RelationalTank.java b/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java similarity index 93% rename from src/main/java/com/veteam/voluminousenergy/util/RelationalTank.java rename to src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java index 16cb25d22..f91514fd7 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/RelationalTank.java +++ b/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java @@ -15,7 +15,7 @@ import java.util.ArrayList; import java.util.List; -public class RelationalTank { +public class VERelationalTank { FluidTank tank; int slotNum; @@ -34,12 +34,12 @@ public class RelationalTank { */ private String nbt; - public RelationalTank() { + public VERelationalTank() { } @Deprecated - public RelationalTank(FluidTank tank, int slotNum, ItemStack input, ItemStack output, TankType tankType, String nbt) { + public VERelationalTank(FluidTank tank, int slotNum, ItemStack input, ItemStack output, TankType tankType, String nbt) { this.tank = tank; this.slotNum = slotNum; this.input = input; @@ -49,7 +49,7 @@ public RelationalTank(FluidTank tank, int slotNum, ItemStack input, ItemStack ou } @Deprecated - public RelationalTank(FluidTank tank, int slotNum, ItemStack input, ItemStack output, TankType tankType, int id, String nbt) { + public VERelationalTank(FluidTank tank, int slotNum, ItemStack input, ItemStack output, TankType tankType, int id, String nbt) { this.tank = tank; this.slotNum = slotNum; this.input = input; @@ -59,7 +59,7 @@ public RelationalTank(FluidTank tank, int slotNum, ItemStack input, ItemStack ou this.nbt = nbt; } - public RelationalTank(FluidTank tank, int slotNum,int recipePos, TankType tankType, String nbt) { + public VERelationalTank(FluidTank tank, int slotNum, int recipePos, TankType tankType, String nbt) { this.tank = tank; this.slotNum = slotNum; this.tankType = tankType; @@ -67,7 +67,7 @@ public RelationalTank(FluidTank tank, int slotNum,int recipePos, TankType tankTy this.nbt = nbt; } - public RelationalTank(FluidTank tank, int slotNum, TankType tankType, String nbt) { + public VERelationalTank(FluidTank tank, int slotNum, TankType tankType, String nbt) { this.tank = tank; this.slotNum = slotNum; this.tankType = tankType; diff --git a/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java b/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java index e654caa05..fd1d9c538 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java +++ b/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java @@ -1,12 +1,13 @@ package com.veteam.voluminousenergy.util.tiles; +import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.IntToDirection; import com.veteam.voluminousenergy.util.MultiFluidSlotWrapper; import com.veteam.voluminousenergy.util.MultiSlotWrapper; -import com.veteam.voluminousenergy.util.RelationalTank; +import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.core.Direction; import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraftforge.common.capabilities.Capability; @@ -22,42 +23,41 @@ public class CapabilityMap { - private final HashMap itemMap = new HashMap<>(); - private final HashMap fluidMap = new HashMap<>(); + private final HashMap itemMap = new HashMap<>(); + private final HashMap fluidMap = new HashMap<>(); @Nullable private final ItemStackHandler inventory; private final LazyOptional energyStorage; - public CapabilityMap(@Nullable ItemStackHandler inventory, List managerList, List tanks, LazyOptional energy, @Nullable VETileEntity tileEntity) { + public CapabilityMap(@Nullable ItemStackHandler inventory, List managerList, List tanks, VEEnergyStorage energy, @Nullable VETileEntity tileEntity) { this.inventory = inventory; - this.energyStorage = energy; - - for(Direction direction : Direction.values()) { - if(inventory != null) itemMap.put(direction,new MultiSlotWrapper(inventory,new ArrayList<>())); - if(tileEntity != null) fluidMap.put(direction,new MultiFluidSlotWrapper(new ArrayList<>(),tileEntity)); + this.energyStorage = energy == null ? LazyOptional.empty() : LazyOptional.of(() -> energy); + for (Direction direction : Direction.values()) { + if (inventory != null) itemMap.put(direction, new MultiSlotWrapper(inventory, new ArrayList<>())); + if (tileEntity != null) fluidMap.put(direction, new MultiFluidSlotWrapper(new ArrayList<>(), tileEntity)); } - for(VESlotManager manager : managerList) { + for (VESlotManager manager : managerList) { MultiSlotWrapper wrapper = itemMap.get(manager.getDirection()); wrapper.addSlotManager(manager); } - for(RelationalTank tank : tanks) { + for (VERelationalTank tank : tanks) { MultiFluidSlotWrapper wrapper = fluidMap.get(tank.getSideDirection()); wrapper.addRelationalTank(tank); } } - public void moveSlotManagerPos(VESlotManager manager,int direction) { + public void moveSlotManagerPos(VESlotManager manager, int direction) { Direction oldDir = manager.getDirection(); itemMap.get(oldDir).removeSlotManager(manager); - Direction newDir = IntToDirection.IntegerToDirection(direction); + Direction newDir = IntToDirection.IntegerToDirection(direction); manager.setDirection(newDir); itemMap.get(manager.getDirection()).addSlotManager(manager); } - public void moveFluidSlotManagerPos(RelationalTank tank,Direction direction) { + public void moveFluidSlotManagerPos(VERelationalTank tank, Direction direction) { Direction oldDirection = tank.getSideDirection(); fluidMap.get(oldDirection).removeRelationalTank(tank); tank.setSideDirection(direction); @@ -65,26 +65,26 @@ public void moveFluidSlotManagerPos(RelationalTank tank,Direction direction) { } - public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side,VETileEntity tileEntity) { - if(cap == ForgeCapabilities.ENERGY) { + public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side, VETileEntity tileEntity) { + if (cap == ForgeCapabilities.ENERGY) { return this.energyStorage.cast(); } - if(side == null) { - if(cap == ForgeCapabilities.ITEM_HANDLER) { + if (side == null) { + if (cap == ForgeCapabilities.ITEM_HANDLER) { return this.inventory == null ? LazyOptional.empty() : LazyOptional.of(() -> this.inventory).cast(); } } else { - Direction normalizedSide = CapabilityMap.normalizeDirection(side,tileEntity); - if(cap == ForgeCapabilities.ITEM_HANDLER) { + Direction normalizedSide = CapabilityMap.normalizeDirection(side, tileEntity); + if (cap == ForgeCapabilities.ITEM_HANDLER) { return inventory == null ? LazyOptional.empty() : LazyOptional.of(() -> this.itemMap.get(normalizedSide)).cast(); - } else if(cap == ForgeCapabilities.FLUID_HANDLER) { + } else if (cap == ForgeCapabilities.FLUID_HANDLER) { return LazyOptional.of(() -> this.fluidMap.get(normalizedSide)).cast(); } } return LazyOptional.empty(); } - public static Direction normalizeDirection(Direction direction,VETileEntity tileEntity) { + public static Direction normalizeDirection(Direction direction, VETileEntity tileEntity) { Direction currentDirection = tileEntity.getBlockState().getValue(BlockStateProperties.FACING); int directionInt = direction.get3DDataValue(); if (directionInt == 0 || directionInt == 1) return direction; diff --git a/src/main/resources/assets/voluminousenergy/lang/en_us.json b/src/main/resources/assets/voluminousenergy/lang/en_us.json index 4f50e31ad..ce233ace7 100644 --- a/src/main/resources/assets/voluminousenergy/lang/en_us.json +++ b/src/main/resources/assets/voluminousenergy/lang/en_us.json @@ -54,6 +54,7 @@ "slot.voluminousenergy.rng_slot": "RNG Slot", "slot.voluminousenergy.input_slot": "Slot", "slot.voluminousenergy.output_slot": "Slot", + "slot.voluminousenergy.upgrade_slot": "Slot", "slot.voluminousenergy.bucket_slot": "Bucket Slot", "_comment": "Tank Names", From 2ea2704a8d4d521fde054505c97890227711a447 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Sun, 25 Feb 2024 04:35:35 -0500 Subject: [PATCH 06/27] Work on refactoring recipes. Merged VEFluidRecipe into VERecipe --- .../util/VEItemStackWithFluidHandler.java | 4 +- .../containers/ToolingStationContainer.java | 8 +- .../blocks/containers/VEContainer.java | 2 - .../blocks/containers/VEContainers.java | 112 ++++++------- .../blocks/containers/tank/TankContainer.java | 4 +- .../blocks/inventory/slots/VEOutputSlot.java | 4 +- .../blocks/screens/AirCompressorScreen.java | 2 +- .../blocks/screens/AqueoulizerScreen.java | 2 +- .../blocks/screens/BlastFurnaceScreen.java | 2 +- .../screens/CentrifugalAgitatorScreen.java | 2 +- .../screens/CentrifugalSeparatorScreen.java | 2 +- .../blocks/screens/CompressorScreen.java | 2 +- .../blocks/screens/CrusherScreen.java | 2 +- .../screens/DimensionalLaserScreen.java | 4 +- .../screens/DistillationUnitScreen.java | 2 +- .../blocks/screens/ElectricFurnaceScreen.java | 2 +- .../blocks/screens/ElectrolyzerScreen.java | 2 +- .../screens/FluidElectrolyzerScreen.java | 2 +- .../blocks/screens/FluidMixerScreen.java | 2 +- .../screens/HydroponicIncubatorScreen.java | 2 +- .../screens/ImplosionCompressorScreen.java | 2 +- .../screens/PrimitiveBlastFurnaceScreen.java | 2 +- .../PrimitiveStirlingGeneratorScreen.java | 2 +- .../blocks/screens/SawmillScreen.java | 2 +- .../blocks/tiles/BatteryBoxTile.java | 2 +- .../blocks/tiles/CombustionGeneratorTile.java | 14 +- .../blocks/tiles/ElectricFurnaceTile.java | 2 +- .../blocks/tiles/GasFiredFurnaceTile.java | 4 +- .../blocks/tiles/HydroponicIncubatorTile.java | 4 +- .../blocks/tiles/SawmillTile.java | 6 +- .../blocks/tiles/ToolingStationTile.java | 4 +- .../blocks/tiles/VEItemStackHandler.java | 16 +- .../blocks/tiles/VETileEntities.java | 12 +- .../blocks/tiles/VETileEntity.java | 67 +++++--- .../blocks/tiles/VETileFactory.java | 28 ++-- .../jei/category/CombustionCategory.java | 8 +- .../tools/multitool/CombustionMultitool.java | 8 +- .../recipe/AqueoulizerRecipe.java | 32 +++- .../recipe/CentrifugalAgitatorRecipe.java | 20 +-- .../recipe/CentrifugalSeparatorRecipe.java | 9 +- .../CombustionGeneratorFuelRecipe.java | 10 +- .../CombustionGeneratorOxidizerRecipe.java | 10 +- .../recipe/CompressorRecipe.java | 5 +- .../recipe/CrusherRecipe.java | 4 +- .../recipe/DimensionalLaserRecipe.java | 8 +- .../recipe/DistillationRecipe.java | 8 +- .../recipe/ElectrolyzerRecipe.java | 9 +- .../recipe/FluidElectrolyzerRecipe.java | 8 +- .../recipe/FluidMixerRecipe.java | 8 +- .../recipe/HydroponicIncubatorRecipe.java | 6 +- .../recipe/ImplosionCompressorRecipe.java | 5 +- .../recipe/IndustrialBlastingRecipe.java | 4 +- .../recipe/PrimitiveBlastFurnaceRecipe.java | 5 +- .../voluminousenergy/recipe/RecipeCache.java | 13 +- .../recipe/StirlingGeneratorRecipe.java | 15 +- .../recipe/ToolingRecipe.java | 4 +- .../recipe/VEEnergyRecipe.java | 2 +- .../recipe/VEFluidRNGRecipe.java | 2 +- .../recipe/VEFluidRecipe.java | 63 -------- .../recipe/VEFluidSawmillRecipe.java | 4 +- .../recipe/VERNGExperienceRecipe.java | 5 +- .../voluminousenergy/recipe/VERNGRecipe.java | 46 ------ .../voluminousenergy/recipe/VERecipe.java | 75 ++++++++- .../voluminousenergy/recipe/VERecipes.java | 20 +-- .../recipe/parser/RecipeParser.java | 150 ++++++++++++++++++ .../recipe/processor/DefaultProcessor.java | 81 ++++++++++ .../recipe/processor/FluidItemProcessor.java | 121 -------------- ...Processor.java => GeneratorProcessor.java} | 44 ++++- .../recipe/processor/RecipeProcessor.java | 2 + .../serializer}/FluidSerializerHelper.java | 7 +- .../IngredientSerializerHelper.java | 8 +- .../recipe/validator/FluidItemValidator.java | 70 -------- .../validator/GeneratorItemValidator.java | 36 ----- .../recipe/validator/RecipeValidator.java | 9 -- .../tools/energy/VEEnergyStorage.java | 3 + .../tools/sidemanager/VESlotManager.java | 12 +- .../util/MultiFluidSlotWrapper.java | 7 +- .../voluminousenergy/util/SlotType.java | 10 +- .../voluminousenergy/util/TextUtil.java | 8 +- .../util/VERelationalTank.java | 22 +-- .../util/recipe/FluidIngredient.java | 2 +- .../tags/fluids/combustable.json | 15 ++ .../tags/fluids/oxidizer.json | 8 + 83 files changed, 709 insertions(+), 653 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRecipe.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/FluidItemProcessor.java rename src/main/java/com/veteam/voluminousenergy/recipe/processor/{GeneratorItemProcessor.java => GeneratorProcessor.java} (56%) rename src/main/java/com/veteam/voluminousenergy/{util/recipe => recipe/serializer}/FluidSerializerHelper.java (93%) rename src/main/java/com/veteam/voluminousenergy/{util/recipe => recipe/serializer}/IngredientSerializerHelper.java (91%) delete mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/validator/FluidItemValidator.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/validator/GeneratorItemValidator.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/validator/RecipeValidator.java create mode 100644 src/main/resources/data/voluminousenergy/tags/fluids/combustable.json create mode 100644 src/main/resources/data/voluminousenergy/tags/fluids/oxidizer.json diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java index 6af592ac6..e3f3eb01b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.blocks.blocks.util; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.TagUtil; @@ -17,7 +17,7 @@ public class VEItemStackWithFluidHandler extends ItemStackHandler { private final VESlotManager[] managers; private final VERelationalTank[] relationalTanks; private final Class recipeType; - private VEFluidRecipe recipe; + private VERecipe recipe; private final Level level; private final int upgradeSlot; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java index b39d61bff..0cbefe895 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java @@ -62,9 +62,9 @@ public ToolingStationContainer(int id, Level world, BlockPos pos, Inventory inve @Override protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEBucketSlot(h, 0, 38, 18)); // Fluid input slot + addSlot(new VEBucketSlot(h, 0, 38, 18)); // Fluid input tilePos addSlot(new VEBucketSlot(h, 1, 38, 49)); // Extract fluid from input - addSlot(new VEInsertSlot(h, 2, 86, 32)); // Main Tool slot + addSlot(new VEInsertSlot(h, 2, 86, 32)); // Main Tool tilePos addSlot(new VEInsertSlot(h, 3, 134, 18)); // Bit Slot addSlot(new VEInsertSlot(h, 4, 134,49)); // Base Slot addSlot(new VEInsertSlot(h, 5,154, -14)); // Upgrade Slot @@ -86,8 +86,8 @@ public ItemStack handleCoreQuickMoveStackLogic(final int index, final int contai } } else if (!this.slots.get(3).hasItem() && !this.slots.get(4).hasItem() - && !moveItemStackTo(slotStack, 2, 3, false)) { // Multitool slot id is 2 - // Place the main machine in the main result slot + && !moveItemStackTo(slotStack, 2, 3, false)) { // Multitool tilePos id is 2 + // Place the main machine in the main result tilePos return ItemStack.EMPTY; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java index 2e27a0062..9aebcee62 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java @@ -196,8 +196,6 @@ public ItemStack quickMoveStack(final @NotNull Player player, final int index) { ItemStack returnStack = ItemStack.EMPTY; final Slot slot = this.slots.get(index); - VoluminousEnergy.LOGGER.info("testing!"); - int numberOfSlots = this.tileEntity.getSlotManagers().size() + (this.tileEntity.getEnergy() != null ? 1 : 0); // TODO why is this a dangling if? diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java index d25f6ca1e..aeb747f33 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java @@ -10,16 +10,16 @@ public class VEContainers { public static final VEContainerFactory AIR_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() .create(AIR_COMPRESSOR_CONTAINER, AIR_COMPRESSOR_BLOCK) - .addSlot(70, 18) // Air Compressor bucket input slot - .addSlot(70, 49) // Air Compressor bucket output slot + .addSlot(70, 18,new BucketInputSlot(Direction.UP,0)) // Air Compressor bucket input tilePos + .addSlot(70, 49,new BucketOutputSlot(Direction.DOWN)) // Air Compressor bucket output tilePos .addSlot(154, -14) // Upgrade Slot .build(); public static final VEContainerFactory AQUEOULIZER_FACTORY = new VEContainerFactoryBuilder() .create(AQUEOULIZER_CONTAINER, AQUEOULIZER_BLOCK) - .addSlot(38, 18, new BucketInputSlot(Direction.UP, 0)) + .addSlot(38, 18, new BucketInputSlot(Direction.UP,0)) .addSlot(38, 49, new BucketOutputSlot(Direction.DOWN)) - .addSlot(137, 18, new BucketInputSlot(Direction.NORTH, 1)) + .addSlot(137, 18, new BucketInputSlot(Direction.NORTH,1)) .addSlot(137, 49, new BucketOutputSlot(Direction.SOUTH)) .addSlot(96, 32, new ItemInputSlot(Direction.EAST, 0)) .addUpgradeSlot(130, -14) @@ -27,29 +27,29 @@ public class VEContainers { public static final VEContainerFactory BATTERY_BOX_FACTORY = new VEContainerFactoryBuilder() .create(BATTERY_BOX_CONTAINER, BATTERY_BOX_BLOCK) - .addSlot(35, 17) - .addSlot(53, 17) - .addSlot(71, 17) - .addSlot(89, 17) - .addSlot(107, 17) - .addSlot(125, 17) + .addSlot(35, 17,new InputSlot(Direction.UP)) + .addSlot(53, 17,new InputSlot(Direction.UP)) + .addSlot(71, 17,new InputSlot(Direction.UP)) + .addSlot(89, 17,new InputSlot(Direction.UP)) + .addSlot(107, 17,new InputSlot(Direction.UP)) + .addSlot(125, 17,new InputSlot(Direction.UP)) //Bottom Slots - .addSlot(35, 54) - .addSlot(53, 54) - .addSlot(71, 54) - .addSlot(89, 54) - .addSlot(107, 54) - .addSlot(125, 54) + .addSlot(35, 54,new InputSlot(Direction.DOWN)) + .addSlot(53, 54,new InputSlot(Direction.DOWN)) + .addSlot(71, 54,new InputSlot(Direction.DOWN)) + .addSlot(89, 54,new InputSlot(Direction.DOWN)) + .addSlot(107, 54,new InputSlot(Direction.DOWN)) + .addSlot(125, 54,new InputSlot(Direction.DOWN)) .build(); public static final VEContainerFactory BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(BLAST_FURNACE_CONTAINER, BLAST_FURNACE_BLOCK) - .addSlot(38, 18) // Fluid input slot + .addSlot(38, 18) // Fluid input tilePos .addSlot(38, 49) // Extract fluid from heat tank - .addSlot(80, 25) // First input slot - .addSlot(80, 43) // Second input slot - .addSlot(134, 34) // Third input slot - .addSlot(130, -14) // Upgrade slot. + .addSlot(80, 25) // First input tilePos + .addSlot(80, 43) // Second input tilePos + .addSlot(134, 34) // Third input tilePos + .addSlot(130, -14) // Upgrade tilePos. .build(); public static final VEContainerFactory CENTRIFUGAL_AGITATOR_FACTORY = new VEContainerFactoryBuilder() @@ -60,13 +60,13 @@ public class VEContainers { .addSlot(96, 49) // Bucket extract; first output tank .addSlot(137, 18) // Bucket insert; second output tank .addSlot(137, 49) // Bucket extract; second output tank - .addSlot(130, -14) // Upgrade slot + .addSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory CENTRIFUGAL_SEPARATOR_FACTORY = new VEContainerFactoryBuilder() .create(CENTRIFUGAL_SEPARATOR_CONTAINER, CENTRIFUGAL_SEPARATOR_BLOCK) - .addSlot(53, 24) // Primary input slot - .addSlot(53, 42) // Empty Bucket slot + .addSlot(53, 24) // Primary input tilePos + .addSlot(53, 42) // Empty Bucket tilePos .addSlot(99, 33) //Main Output .addSlot(117, 15) //RNG #1 Slot .addSlot(135, 33) //RNG #2 Slot @@ -76,9 +76,9 @@ public class VEContainers { public static final VEContainerFactory COMBUSTION_GENERATOR_FACTORY = new VEContainerFactoryBuilder() .create(COMBUSTION_GENERATOR_CONTAINER, COMBUSTION_GENERATOR_BLOCK) - .addSlot(38, 18) // Oxidizer input slot - .addSlot(38, 49) // Extract fluid from oxidizer slot - .addSlot(138, 18) // Fuel input slot + .addSlot(38, 18) // Oxidizer input tilePos + .addSlot(38, 49) // Extract fluid from oxidizer tilePos + .addSlot(138, 18) // Fuel input tilePos .addSlot(138, 49) // Extract fluid from fuel output .build(); @@ -86,34 +86,34 @@ public class VEContainers { .create(COMPRESSOR_CONTAINER, COMPRESSOR_BLOCK) .addSlot(80, 13) .addSlot(80, 58) //Main Output - .addSlot(154, -14) //Upgrade slot + .addSlot(154, -14) //Upgrade tilePos .build(); public static final VEContainerFactory CRUSHER_FACTORY = new VEContainerFactoryBuilder() .create(CRUSHER_CONTAINER, CRUSHER_BLOCK) .addSlot(80, 13) .addSlot(80, 58) //Main Output - .addSlot(154, -14) //Upgrade slot + .addSlot(154, -14) //Upgrade tilePos .build(); public static final VEContainerFactory DIMENSIONAL_LASER_FACTORY = new VEContainerFactoryBuilder() .create(DIMENSIONAL_LASER_CONTAINER, DIMENSIONAL_LASER_BLOCK) - .addSlot(138, 18) // Bucket top slot - .addSlot(138, 49) // Bucket bottom slot - .addSlot(38, 33) // RFID chip slot - .addSlot(130, -14) // Upgrade slot + .addSlot(138, 18) // Bucket top tilePos + .addSlot(138, 49) // Bucket bottom tilePos + .addSlot(38, 33) // RFID chip tilePos + .addSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory DISTILLATION_UNIT_FACTORY = new VEContainerFactoryBuilder() .create(DISTILLATION_UNIT_CONTAINER, DISTILLATION_UNIT_BLOCK) - .addSlot(38, 18) // Fluid input slot + .addSlot(38, 18) // Fluid input tilePos .addSlot(38, 49) // Extract fluid from input - .addSlot(96, 11) // Top slot for first output - .addSlot(96, 42) // Bottom slot for first output - .addSlot(137, 11) // Top slot for from second output - .addSlot(137, 42) // Bottom slot for second output + .addSlot(96, 11) // Top tilePos for first output + .addSlot(96, 42) // Bottom tilePos for first output + .addSlot(137, 11) // Top tilePos for from second output + .addSlot(137, 42) // Bottom tilePos for second output .addSlot(122, 64) // Item Output Slot - .addSlot(130, -14) // Upgrade slot + .addSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory ELECTRIC_FURNACE_FACTORY = new VEContainerFactoryBuilder() @@ -126,7 +126,7 @@ public class VEContainers { public static final VEContainerFactory ELECTROLYZER_FACTORY = new VEContainerFactoryBuilder() .create(ELECTROLYZER_CONTAINER, ELECTROLYZER_BLOCK) .addSlot(71, 13) - .addSlot(89, 13) // Empty Bucket slot + .addSlot(89, 13) // Empty Bucket tilePos .addSlot(53, 57) //Main Output .addSlot(71, 57) //RNG #1 Slot .addSlot(89, 57) //RNG #2 Slot @@ -142,7 +142,7 @@ public class VEContainers { .addSlot(96, 49) // Bottom output0 bucket .addSlot(137, 18) // Top output1 bucket .addSlot(137, 49) // Bottom output1 bucket - .addSlot(130, -14) // Upgrade slot + .addSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory FLUID_MIXER_FACTORY = new VEContainerFactoryBuilder() @@ -153,36 +153,36 @@ public class VEContainers { .addSlot(86, 49) // Bottom input1 bucket .addSlot(136, 18) // Top output0 bucket .addSlot(136, 49) // Bottom output0 bucket - .addSlot(130, -14) // Upgrade slot + .addSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory GAS_FIRED_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(GAS_FIRED_FURNACE_CONTAINER, GAS_FIRED_FURNACE_BLOCK) - .addSlot(8, 18) // Fluid input slot + .addSlot(8, 18) // Fluid input tilePos .addSlot(8, 49) // Extract fluid from input - .addSlot(53, 33) // Item input slot - .addSlot(116, 33) // Item output slot - .addSlot(154, -14) // Upgrade slot + .addSlot(53, 33) // Item input tilePos + .addSlot(116, 33) // Item output tilePos + .addSlot(154, -14) // Upgrade tilePos .build(); public static final VEContainerFactory HYDROPONIC_INCUBATOR_FACTORY = new VEContainerFactoryBuilder() .create(HYDROPONIC_INCUBATOR_CONTAINER, HYDROPONIC_INCUBATOR_BLOCK) - .addSlot(38, 18) // Bucket top slot - .addSlot(38, 49) // Bucket bottom slot + .addSlot(38, 18) // Bucket top tilePos + .addSlot(38, 49) // Bucket bottom tilePos .addSlot(83, 34) // Primary input .addSlot(123, 8) // Primary output .addSlot(123, 26) // RNG0 output .addSlot(123, 44) // RNG1 output .addSlot(123, 62) // RNG2 output - .addSlot(154, -14) // Upgrade slot + .addSlot(154, -14) // Upgrade tilePos .build(); public static final VEContainerFactory IMPLOSION_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() .create(IMPLOSION_COMPRESSOR_CONTAINER, IMPLOSION_COMPRESSOR_BLOCK) .addSlot(53, 23) // Main input - .addSlot(53, 41) // Gunpowder slot + .addSlot(53, 41) // Gunpowder tilePos .addSlot(116, 33) //Main Output - .addSlot(154, -14) //Upgrade slot + .addSlot(154, -14) //Upgrade tilePos .build(); public static final VEContainerFactory PRIMITIVE_BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() @@ -203,13 +203,13 @@ public class VEContainers { public static final VEContainerFactory PUMP_FACTORY = new VEContainerFactoryBuilder() .create(PUMP_CONTAINER, PUMP_BLOCK) - .addSlot(70, 18) // Pump bucket input slot - .addSlot(70, 49) // Pump bucket output slot + .addSlot(70, 18) // Pump bucket input tilePos + .addSlot(70, 49) // Pump bucket output tilePos .build(); public static final VEContainerFactory SAWMILL_FACTORY = new VEContainerFactoryBuilder() .create(SAWMILL_CONTAINER, SAWMILL_BLOCK) - .addSlot(44, 32) // Log input slot + .addSlot(44, 32) // Log input tilePos .addSlot(80, 24) // Plank Output .addSlot(80, 42) // Secondary Output .addSlot(115, 18) // Bucket Input @@ -229,9 +229,9 @@ public class VEContainers { // TOOLING STATION UNUSED public static final VEContainerFactory TOOLING_STATION_FACTORY = new VEContainerFactoryBuilder() .create(TOOLING_STATION_CONTAINER, TOOLING_STATION_BLOCK) - .addSlot(38, 18) // Fluid input slot + .addSlot(38, 18) // Fluid input tilePos .addSlot(38, 49) // Extract fluid from input - .addSlot(86, 32) // Main Tool slot + .addSlot(86, 32) // Main Tool tilePos .addSlot(134, 18) // Bit Slot .addSlot(134, 49) // Base Slot .addSlot(154, -14) // Upgrade Slot diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java index da6064760..e24a063f7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java @@ -26,8 +26,8 @@ public TankContainer(int id, Level world, BlockPos pos, Inventory inventory, Pla @Override public void addSlotsToGUI(IItemHandler h) { - addSlot(new VEInsertSlot(h, 0, 70, 19)); // Bucket top slot - addSlot(new VEInsertSlot(h, 1, 70, 50)); // Bucket bottom slot + addSlot(new VEInsertSlot(h, 0, 70, 19)); // Bucket top tilePos + addSlot(new VEInsertSlot(h, 1, 70, 50)); // Bucket bottom tilePos } @Nonnull diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEOutputSlot.java b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEOutputSlot.java index b2b7a00a1..c16b03b5e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEOutputSlot.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEOutputSlot.java @@ -14,8 +14,8 @@ public VEOutputSlot(IItemHandler itemHandler, int index, int xPos, int yPos) { /* We override this and return false since no item can - be valid in an output slot. This is to prevent - users from putting anything in the output slot + be valid in an output tilePos. This is to prevent + users from putting anything in the output tilePos */ @Override // mayPlace, as in, you may place it if it's valid. (MCP: isItemValid) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java index 108443dfa..be6ec8053 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java @@ -99,7 +99,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, try{ VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getAirTankFluid(),tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); } catch (Exception e){ } - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java index 14f4982ea..b9e3c7bed 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java @@ -125,7 +125,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, } catch (Exception e) { } drawIOSideHelper(); - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java index 5e653a1b5..2c75e5756 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java @@ -126,7 +126,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); drawIOSideHelper(); - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS,i+129, j-16,0,0,18,18); } else { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java index 5064bd0d1..f6004cb05 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java @@ -139,7 +139,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, } catch (Exception e) { } drawIOSideHelper(); - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java index a679f51f1..65b264978 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java @@ -103,7 +103,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, matrixStack.blit(this.GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); drawIOSideHelper(); } - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java index dd45d3af2..e43bffa9a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java @@ -102,7 +102,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); drawIOSideHelper(); } - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java index 6cba3f4c4..e5bf029bf 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java @@ -103,7 +103,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); drawIOSideHelper(); } - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java index 6d94f94dd..281eae554 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java @@ -70,7 +70,7 @@ protected void init() { // Do nothing })); - // RFID slot + // RFID tilePos addRenderableWidget(new SlotBoolButton(tileEntity.RFIDsm, (this.width / 2) - 198, this.topPos + 40, button -> { // Do nothing })); @@ -162,7 +162,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), this.getFluidStackFromTank(), tileEntity.getTankCapacity(), i + 119, j + 18, 0, 12, 50); drawIOSideHelper(); - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } else { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java index 647af6c34..59dc2b3c4 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java @@ -143,7 +143,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(2),tileEntity.getTankCapacity(), i + 157, j + 11, 0, 12, 50); } catch (Exception e){ } drawIOSideHelper(); - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS,i+129, j-16,0,0,18,18); } else { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java index 16296b4d9..2e84d9687 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java @@ -127,7 +127,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); } - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java index 194af2417..a4cbc70d7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java @@ -104,7 +104,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); drawIOSideHelper(); } - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java index 3965bfa9c..4285316f3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java @@ -140,7 +140,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(2),tileEntity.getTankCapacity(), i + 157, j + 18, 0, 12, 50); } catch (Exception e){ } drawIOSideHelper(); - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS,i+129, j-16,0,0,18,18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java index 2780e6188..32a50545e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java @@ -142,7 +142,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(2),tileEntity.getTankCapacity(), i + 159, j + 18, 0, 12, 50); } catch (Exception e){ } drawIOSideHelper(); - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS,i+129, j-16,0,0,18,18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java index 5b592977e..8758ecd57 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java @@ -122,7 +122,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(1),tileEntity.getTankCapacity(), i + 157, j + 18, 0, 12, 50); } catch (Exception e){ } drawIOSideHelper(); - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java index 2fea40069..fb44e74ab 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java @@ -134,7 +134,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(GUI, i + 78, j + 31, 176, 0, progress, 17); matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); } - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); drawIOSideHelper(); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java index 7521e2ab8..103e0096c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java @@ -124,7 +124,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, //this.blit(i,j,180,1,progress,15); drawIOSideHelper(); } - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java index 88351f959..db516c029 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java @@ -48,7 +48,7 @@ protected void init(){ })); - // Input slot + // Input tilePos addRenderableWidget(new SlotBoolButton(tileEntity.getSlotManagers().get(0), (this.width/2)-198, this.topPos, button->{ // Do nothing })); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java index 9d16dedc4..0717285f6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java @@ -119,7 +119,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 138, j + 18, 0, 12, 50); drawIOSideHelper(); - // Upgrade slot + // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java index 682696556..3e360f52c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java @@ -211,7 +211,7 @@ private void moveItem(int i) { ItemStack itemStack = inventory.getStackInSlot(i).copy(); if (inventory.getStackInSlot(i + 6).isEmpty()) { //VoluminousEnergy.LOGGER.debug("Empty check passed"); - // Remove item in the ith, slot and move it to i+6th slot indicating it's discharged + // Remove item in the ith, tilePos and move it to i+6th tilePos indicating it's discharged itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energy -> { //VoluminousEnergy.LOGGER.debug("Item has Energy Capability"); if ((!switchManagers[i].isFlipped() && energy.getEnergyStored() == energy.getMaxEnergyStored()) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java index 7a0a5f7df..bfa7c28b9 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java @@ -5,7 +5,7 @@ import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorOxidizerRecipe; import com.veteam.voluminousenergy.recipe.RecipeCache; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; @@ -69,18 +69,18 @@ public CombustionGeneratorTile(BlockPos pos, BlockState state) { super(VEBlocks.COMBUSTION_GENERATOR_TILE.get(), pos, state, null); fluidManagers.get(0).getTank().setValidator(fluid -> { List recipes = CombustionGeneratorFuelRecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE); - return recipes.stream().anyMatch(r -> ((VEFluidRecipe) r).getFluidIngredient(0).test(fluid)); + return recipes.stream().anyMatch(r -> r.getFluidIngredient(0).test(fluid)); }); fluidManagers.get(1).getTank().setValidator(fluid -> { List recipes = CombustionGeneratorOxidizerRecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE); - return recipes.stream().anyMatch(r -> ((VEFluidRecipe) r).getFluidIngredient(0).test(fluid)); + return recipes.stream().anyMatch(r -> r.getFluidIngredient(0).test(fluid)); }); } private LazyOptional energyCapability = null; - VEFluidRecipe oxidizerRecipe; - VEFluidRecipe fuelRecipe; + VERecipe oxidizerRecipe; + VERecipe fuelRecipe; @Override public void tick() { @@ -194,10 +194,10 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { FluidStack testFluid = new FluidStack(fluid, COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT); if (slot == 0) { List recipes = VERecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE); - return recipes.stream().anyMatch(r -> ((VEFluidRecipe) r).getFluidIngredient(0).test(testFluid)); + return recipes.stream().anyMatch(r -> r.getFluidIngredient(0).test(testFluid)); } else if (slot == 2) { List recipes = VERecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE); - return recipes.stream().anyMatch(r -> ((VEFluidRecipe) r).getFluidIngredient(0).test(testFluid)); + return recipes.stream().anyMatch(r -> r.getFluidIngredient(0).test(testFluid)); } return true; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java index 20833ec4d..dda676319 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java @@ -88,7 +88,7 @@ public void tick() { //LOGGER.debug("About to insert in pt1: " + newOutputStack); inventory.insertItem(1, newOutputStack.copy(), false); // CRASH the game if this is not empty! - } else { // Assuming the recipe output item is already in the output slot + } else { // Assuming the recipe output item is already in the output tilePos // Simply change the item to equal the output amount furnaceOutput.setCount(Objects.requireNonNullElse(furnaceRecipe, blastingRecipe).getResultItem(level.registryAccess()).getCount()); //LOGGER.debug("About to insert in pt2: " + furnaceOutput); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java index 48b71eaef..40547f64a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java @@ -5,7 +5,7 @@ import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; import com.veteam.voluminousenergy.recipe.RecipeCache; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.VERelationalTank; @@ -214,7 +214,7 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { if (fluid.isSame(Fluids.EMPTY)) return true; FluidStack fluidStack = new FluidStack(bucketItem.getFluid(), 1000); return VERecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE) - .stream().anyMatch(r -> ((VEFluidRecipe)r).getFluidIngredient(0).test(fluidStack)); + .stream().anyMatch(r -> r.getFluidIngredient(0).test(fluidStack)); } else if (slot == 2) { return level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(stack), level).orElse(null) != null || level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(stack), level).orElse(null) != null; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java index 1051a1cd2..ce3992604 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java @@ -4,7 +4,7 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.HydroponicIncubatorRecipe; import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -96,7 +96,7 @@ public FluidStack getFluidStackFromTank(int num) { @Override void processRecipe() { if (selectedRecipe == null) return; - VEFluidRecipe recipe = (VEFluidRecipe) selectedRecipe; + VERecipe recipe = selectedRecipe; if (canConsumeEnergy()) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java index ea2c4bad7..0b93ebe34 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java @@ -168,7 +168,7 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { } else if (slot == 3 || slot == 4) { return stack.getItem() instanceof BucketItem; } else if (slot == 5){ - return TagUtil.isTaggedMachineUpgradeItem(stack); // this is the upgrade slot + return TagUtil.isTaggedMachineUpgradeItem(stack); // this is the upgrade tilePos } return true; } @@ -200,7 +200,7 @@ private void coreTickProcessing(@Nullable VEFluidSawmillRecipe VEFluidSawmillRec currentPlankStack.setCount(1); } inventory.insertItem(1, resolvedPlankOutput.copy(), false); - } else { // Assuming the recipe output item is already in the output slot + } else { // Assuming the recipe output item is already in the output tilePos // currentPlankStack.setCount(.getCount()); // Simply change the item to equal the output amount inventory.insertItem(1, resolvedPlankOutput.copy(),false); // Place the new output item on top of the old one } @@ -212,7 +212,7 @@ private void coreTickProcessing(@Nullable VEFluidSawmillRecipe VEFluidSawmillRec currentSecondOutput.setCount(1); } inventory.insertItem(2, secondItemOutput.copy(), false); - } else { // Assuming the recipe output item is already in the output slot + } else { // Assuming the recipe output item is already in the output tilePos //currentSecondOutput.setCount(secondItemOutput.getCount()); // Simply change the item to equal the output amount inventory.insertItem(2, secondItemOutput.copy(),false); // Place the new output item on top of the old one } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java index 4130e4510..bb4719a44 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java @@ -8,7 +8,7 @@ import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; import com.veteam.voluminousenergy.recipe.RecipeCache; import com.veteam.voluminousenergy.recipe.ToolingRecipe; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; @@ -72,7 +72,7 @@ public ToolingStationTile(BlockPos pos, BlockState state) { super(VEBlocks.TOOLING_STATION_TILE.get(), pos, state, null); } - VEFluidRecipe fuelRecipe; + VERecipe fuelRecipe; @Override public void tick() { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java index 6ff25f462..b80a4e982 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java @@ -1,6 +1,9 @@ package com.veteam.voluminousenergy.blocks.tiles; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.recipe.VERecipes; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; @@ -53,23 +56,20 @@ else if (slot < managers.size()) { public boolean isItemValid(int slot, @Nonnull ItemStack stack) { if (slot == upgradeSlotLocation) return TagUtil.isTaggedMachineUpgradeItem(stack); VESlotManager manager = tileEntity.getSlotManagers().get(slot); - if(manager.getAllowedItems().contains(stack.getItem())) return true; if (manager.getSlotType() == SlotType.FLUID_INPUT && stack.getItem() instanceof BucketItem bucketItem) { if (bucketItem.getFluid() == Fluids.EMPTY) return true; VERelationalTank tank = tileEntity.getRelationalTanks().get(manager.getTankId()); if(tank.getTankType() == TankType.OUTPUT) { return bucketItem.getFluid().isSame(Fluids.EMPTY); } - for (Recipe recipe : tileEntity.getPotentialRecipes()) { - VEFluidRecipe veFluidRecipe = (VEFluidRecipe) recipe; - if (veFluidRecipe.getFluidIngredient(tank.getRecipePos()).test(new FluidStack(bucketItem.getFluid(), 1))) { + for (VERecipe recipe : tileEntity.getPotentialRecipes()) { + if (recipe.getFluidIngredient(tank.getRecipePos()).test(new FluidStack(bucketItem.getFluid(), 1))) { return true; } } } else if (manager.getSlotType() == SlotType.INPUT) { - for (Recipe recipe : tileEntity.getPotentialRecipes()) { - VEFluidRecipe veFluidRecipe = (VEFluidRecipe) recipe; - if (veFluidRecipe.getIngredient(manager.getRecipePos()).test(stack)) { + for (VERecipe recipe : tileEntity.getPotentialRecipes()) { + if(recipe.getParser().canInsertItem(slot,stack)) { return true; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index 7ced329a2..2d30625ad 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -4,11 +4,11 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.FluidInputTank; import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.FluidOutputTank; +import com.veteam.voluminousenergy.recipe.AqueoulizerRecipe; +import com.veteam.voluminousenergy.recipe.StirlingGeneratorRecipe; import com.veteam.voluminousenergy.recipe.VERecipes; -import com.veteam.voluminousenergy.recipe.processor.FluidItemProcessor; -import com.veteam.voluminousenergy.recipe.processor.GeneratorItemProcessor; -import com.veteam.voluminousenergy.recipe.validator.FluidItemValidator; -import com.veteam.voluminousenergy.recipe.validator.GeneratorItemValidator; +import com.veteam.voluminousenergy.recipe.processor.DefaultProcessor; +import com.veteam.voluminousenergy.recipe.processor.GeneratorProcessor; import com.veteam.voluminousenergy.tools.Config; public class VETileEntities { @@ -26,7 +26,7 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(VERecipes.VERecipeTypes.AQUEOULIZING) - .withRecipeProcessing(new FluidItemProcessor(),new FluidItemValidator()); + .withRecipeProcessing(new DefaultProcessor()); public static final VETileFactory PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY = new VETileFactory(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_TILE,VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY) @@ -37,5 +37,5 @@ public class VETileEntities { .makesSound() .sendsOutPower() .withRecipe(VERecipes.VERecipeTypes.STIRLING) - .withRecipeProcessing(new GeneratorItemProcessor(true,4),new GeneratorItemValidator()); + .withRecipeProcessing(new GeneratorProcessor(true,4)); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 499c1216d..361a66704 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -1,10 +1,11 @@ package com.veteam.voluminousenergy.blocks.tiles; +import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.items.upgrades.MysteriousMultiplier; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.processor.RecipeProcessor; -import com.veteam.voluminousenergy.recipe.validator.RecipeValidator; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -53,14 +54,13 @@ public abstract class VETileEntity extends BlockEntity implements MenuProvider { VEItemStackHandler inventory; private final RecipeType> recipeType; - VEFluidRecipe selectedRecipe = null; - List potentialRecipes = new ArrayList<>(); + VERecipe selectedRecipe = null; + List potentialRecipes = new ArrayList<>(); final List tanks = new ArrayList<>(); final List managers = new ArrayList<>(); final HashMap dataMap = new HashMap<>(); RecipeProcessor recipeProcessor; - RecipeValidator recipeValidator; boolean sendsOutPower; public VETileEntity(BlockEntityType type, BlockPos pos, BlockState state, RecipeType> recipeType) { @@ -101,7 +101,7 @@ public void inputFluid(VERelationalTank tank, int slot1, int slot2) { } - //use for when the input and output slot are different + //use for when the input and output tilePos are different public void outputFluid(VERelationalTank tank, int slot1, int slot2) { ItemStack inputSlot = tank.getInput(); ItemStack outputSlot = tank.getOutput(); @@ -186,8 +186,14 @@ public FluidStack getFluidStackFromTank(int num) { public void tick() { processFluidIO(); updateClients(); - if(this.recipeValidator != null) recipeValidator.validateRecipe(this); - if(this.recipeProcessor != null) recipeProcessor.processRecipe(this); + + if(this.recipeProcessor != null) { + if(this.isRecipeDirty) { + recipeProcessor.validateRecipe(this); + this.isRecipeDirty = false; + } + recipeProcessor.processRecipe(this); + } if(this.sendsOutPower) sendOutPower(); } @@ -273,7 +279,7 @@ public CompoundTag getUpdateTag() { } /** - * Loads inventory, energy, slot managers, counter, and length. + * Loads inventory, energy, tilePos managers, counter, and length. * * @param tag CompoundTag */ @@ -306,7 +312,7 @@ public void load(CompoundTag tag) { } /** - * Saves inventory, energy, slot managers, counter, and length. + * Saves inventory, energy, tilePos managers, counter, and length. * To save the tile call setChanged(); * * @param tag CompoundTag @@ -345,6 +351,7 @@ public void setChanged() { super.setChanged(); } + @Deprecated public ItemStackHandler createHandler(int size, VETileEntity tileEntity) { return new ItemStackHandler(size) { @Override @@ -354,7 +361,7 @@ protected void onContentsChanged(int slot) { @Override public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if (tileEntity.energy.getUpgradeSlotId() == slot) { + if (tileEntity.energy != null && tileEntity.energy.getUpgradeSlotId() == slot) { return TagUtil.isTaggedMachineUpgradeItem(stack); } return true; @@ -363,7 +370,7 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { @Nonnull @Override public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if (slot == tileEntity.energy.getUpgradeSlotId()) { + if (tileEntity.energy != null && slot == tileEntity.energy.getUpgradeSlotId()) { return TagUtil.isTaggedMachineUpgradeItem(stack) ? super.insertItem(slot, stack, simulate) : stack; } return super.insertItem(slot, stack, simulate); @@ -372,8 +379,10 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate } public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxReceive) { - return tileEntity.getCapability(ForgeCapabilities.ENERGY, from).map(handler -> - handler.receiveEnergy(maxReceive, false)).orElse(0); + if(tileEntity instanceof VETileEntity tile && tile.energy != null) { + return tile.energy.receiveEnergy(maxReceive,false); + } + return 0; } void sendOutPower() { @@ -393,8 +402,8 @@ void sendOutPower() { } /** - * @param status boolean status of the slot - * @param slotId int id of the slot + * @param status boolean status of the tilePos + * @param slotId int id of the tilePos */ public void updatePacketFromGui(boolean status, int slotId) { for (VESlotManager slot : getSlotManagers()) { @@ -437,8 +446,8 @@ public LazyOptional getCapability(@Nonnull Capability cap, @Nullable D /** * Call this to consume energy - * Note that tiles now require an upgrade slot and thus an inventory to properly function here - * If you need to consume energy WITHOUT an upgrade slot make a new method that does not have this. + * Note that tiles now require an upgrade tilePos and thus an inventory to properly function here + * If you need to consume energy WITHOUT an upgrade tilePos make a new method that does not have this. * Throws an error if missing the power consumeEnergy IMPL */ public void consumeEnergy() { @@ -495,7 +504,7 @@ public boolean canConsumeEnergy() { } /** - * Important note. If the entity has no slot managers return a new ArrayList otherwise this will crash + * Important note. If the entity has no tilePos managers return a new ArrayList otherwise this will crash * * @return A not null List list */ @@ -503,6 +512,10 @@ public boolean canConsumeEnergy() { return this.managers; } + public @Nonnull ItemStack getStackInSlot(int slot) { + return this.getSlotManagers().get(slot).getItem(this.inventory); + } + /** * When a data packet is received load it. * @@ -564,7 +577,7 @@ public RecipeType> getRecipeType() { return this.recipeType; } - public List getPotentialRecipes() { + public List getPotentialRecipes() { return potentialRecipes; } @@ -581,7 +594,7 @@ public VEItemStackHandler getInventory() { } @Nullable - public VEFluidRecipe getSelectedRecipe() { + public VERecipe getSelectedRecipe() { return selectedRecipe; } @@ -589,6 +602,14 @@ public List getTanks() { return tanks; } + public VERelationalTank getTank(int id) { + return tanks.get(id); + } + + public int getTankCapacity(int id) { + return this.tanks.get(id).getTank().getCapacity(); + } + public List getManagers() { return managers; } @@ -613,7 +634,7 @@ public void setRecipeDirty(boolean dirty) { this.isRecipeDirty = dirty; } - public void setPotentialRecipes(List recipes) { + public void setPotentialRecipes(List recipes) { this.potentialRecipes = recipes; } @@ -639,7 +660,7 @@ public void setSendsOutPower(boolean sendsOutPower) { this.sendsOutPower = sendsOutPower; } - public void setSelectedRecipe(VEFluidRecipe recipe) { + public void setSelectedRecipe(VERecipe recipe) { this.selectedRecipe = recipe; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java index 230782b07..99c325d3b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java @@ -1,9 +1,8 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.processor.RecipeProcessor; -import com.veteam.voluminousenergy.recipe.validator.RecipeValidator; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.SlotType; @@ -29,14 +28,13 @@ public class VETileFactory { private List tanks = new ArrayList<>(); - private RegistryObject> recipeType; + private RegistryObject> recipeType; private final RegistryObject> tileRegistry; private final VEContainerFactory containerFactory; private VEEnergyStorage storage; private final HashMap dataMap = new HashMap<>(); private RecipeProcessor processor; - private RecipeValidator validator; private boolean sendsOutPower = false; public VETileFactory(RegistryObject> tileRegistry, VEContainerFactory containerFactory) { @@ -51,6 +49,9 @@ public VETileEntity create(BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int id, @NotNull Inventory playerInventory, @NotNull Player player) { + // This fixes a race condition issue where the client doesn't have the recipe cache built yet + this.markFluidInputDirty(); + this.markRecipeDirty(); return containerFactory.create(id, level, worldPosition, playerInventory, player); } }; @@ -62,12 +63,11 @@ public AbstractContainerMenu createMenu(int id, @NotNull Inventory playerInvento // Populate the data map newTile.dataMap.putAll(dataMap); - // Set energy before the slot count otherwise we'll run into issues with the data slot + // Set energy before the tilePos count otherwise we'll run into issues with the data tilePos newTile.energy = storage.copy(); //set processor newTile.recipeProcessor = processor; - newTile.recipeValidator = validator; // send out power newTile.sendsOutPower = sendsOutPower; @@ -80,7 +80,7 @@ public AbstractContainerMenu createMenu(int id, @NotNull Inventory playerInvento return newTile; } - public VETileFactory withRecipe(RegistryObject> recipe) { + public VETileFactory withRecipe(RegistryObject> recipe) { this.recipeType = recipe; return this; } @@ -100,7 +100,7 @@ public VETileFactory addEnergyStorage(int maxPower, int transferRate) { public VETileFactory addUpgradeSlot(int upgradeSlotId) { if (storage == null) - throw new IllegalStateException("Attempted to add upgrade slot without first adding energy storage!"); + throw new IllegalStateException("Attempted to add upgrade tilePos without first adding energy storage!"); storage.setUpgradeSlotId(upgradeSlotId); return this; @@ -132,9 +132,8 @@ public VETileFactory makesSound() { return this; } - public VETileFactory withRecipeProcessing(RecipeProcessor processor, RecipeValidator recipeValidator) { + public VETileFactory withRecipeProcessing(RecipeProcessor processor) { this.processor = processor; - this.validator = recipeValidator; return this; } @@ -150,6 +149,13 @@ public VESlotManager asManager(int id) { } } + public record InputSlot(Direction direction) implements TileSlot { + @Override + public VESlotManager asManager(int id) { + return new VESlotManager(id, direction, true, SlotType.INPUT); + } + } + public record ItemOutputSlot(Direction direction,int recipePos) implements TileSlot { @Override public VESlotManager asManager(int id) { @@ -157,7 +163,7 @@ public VESlotManager asManager(int id) { } } - public record BucketInputSlot(Direction direction, int tankId) implements TileSlot { + public record BucketInputSlot(Direction direction,int tankId) implements TileSlot { @Override public VESlotManager asManager(int id) { return new VESlotManager(id, direction, true, SlotType.FLUID_INPUT, id + 1, tankId); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java index 03238c66c..b059bab30 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java @@ -6,7 +6,7 @@ import com.veteam.voluminousenergy.compat.jei.VoluminousEnergyPlugin; import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorOxidizerRecipe; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.util.NumberUtil; import com.veteam.voluminousenergy.util.TextUtil; @@ -104,8 +104,8 @@ public void draw(CombustionGeneratorFuelRecipe recipe, IRecipeSlotsView slotsVie CombustionGeneratorOxidizerRecipe oxidizerRecipe = null; - for(VERecipe veFluidRecipe : recipes) { - if(veFluidRecipe instanceof CombustionGeneratorOxidizerRecipe cor) { + for(VERecipe VERecipe : recipes) { + if(VERecipe instanceof CombustionGeneratorOxidizerRecipe cor) { if(cor.getFluidIngredient(0).test(oxiStack.get())) { oxidizerRecipe = cor; } @@ -160,7 +160,7 @@ public void ingredientHandler(CombustionGeneratorFuelRecipe recipe, ArrayList oxiStacks = new ArrayList<>(); for (VERecipe oxidizerRecipe : VERecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE)) { - oxiStacks.addAll(Arrays.asList(((VEFluidRecipe)oxidizerRecipe).getFluidIngredient(0).getFluids())); + oxiStacks.addAll(Arrays.asList(oxidizerRecipe.getFluidIngredient(0).getFluids())); } oxidizerAcceptor.addIngredients(ForgeTypes.FLUID_STACK, oxiStacks); diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java index c5f63ba61..f9fa2bc2e 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java @@ -3,7 +3,7 @@ import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.items.tools.multitool.bits.MultitoolBit; import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.util.NumberUtil; import com.veteam.voluminousenergy.util.TextUtil; @@ -213,16 +213,14 @@ public float getDestroySpeed(ItemStack itemStack, BlockState blockStateToMine) { private static int getVolumetricEnergyFromFluid(Fluid fluid) { - for(VERecipe r : VERecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE)) { - VEFluidRecipe recipe = (VEFluidRecipe) r; + for(VERecipe recipe : VERecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE)) { if(recipe.getFluidIngredient(0).test(fluid)) return recipe.getFluidIngredientAmount(0); } return 0; } public static boolean isCombustibleFuel(Fluid fluid) { - for(VERecipe r : VERecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE)) { - VEFluidRecipe recipe = (VEFluidRecipe) r; + for(VERecipe recipe : VERecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE)) { if(recipe.getFluidIngredient(0).test(fluid)) return true; } return false; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java index c3d530809..8028649f5 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java @@ -3,7 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -15,15 +16,25 @@ import javax.annotation.Nullable; import java.util.List; -public class AqueoulizerRecipe extends VEFluidRecipe { +public class AqueoulizerRecipe extends VERecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.AQUEOULIZING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.AQUEOULIZING.get(); + + private final RecipeParser parser; public AqueoulizerRecipe() { + parser = RecipeParser.forRecipe(this) + .addIngredient(new RecipeParser.SlotAndRecipePos(4, 0)) + .addFluidIngredient(new RecipeParser.SlotAndRecipePos(0, 0)) + .addFluidResult(new RecipeParser.SlotAndRecipePos(1, 0)); } public AqueoulizerRecipe(List i, List fi, List of, int processTime) { super(i, fi, of, List.of(), processTime); + parser = RecipeParser.forRecipe(this) + .addIngredient(new RecipeParser.SlotAndRecipePos(4, 0)) + .addFluidIngredient(new RecipeParser.SlotAndRecipePos(0, 0)) + .addFluidResult(new RecipeParser.SlotAndRecipePos(1, 0)); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { @@ -35,12 +46,12 @@ public AqueoulizerRecipe(List i, List getter.processTime) ).apply(instance, AqueoulizerRecipe::new)); - private static final FluidSerializerHelper helper = new FluidSerializerHelper<>(); + private static final FluidSerializerHelper helper = new FluidSerializerHelper(); @Nullable @Override public AqueoulizerRecipe fromNetwork(@NotNull FriendlyByteBuf buffer) { - return helper.fromNetwork(new AqueoulizerRecipe(), buffer); + return (AqueoulizerRecipe) helper.fromNetwork(new AqueoulizerRecipe(), buffer); } @Override @@ -56,10 +67,12 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull AqueoulizerRecip @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } @Override - public @NotNull RecipeType getType() { + public @NotNull RecipeType getType() { return RECIPE_TYPE; } @@ -67,6 +80,11 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull AqueoulizerRecip public @NotNull ItemStack getToastSymbol() { return new ItemStack(VEBlocks.AQUEOULIZER_BLOCK.get()); } + + @Override + public RecipeParser getParser() { + return parser; + } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java index 1400cff0a..c68796218 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -15,8 +15,8 @@ import java.util.List; -public class CentrifugalAgitatorRecipe extends VEFluidRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_AGITATING.get(); +public class CentrifugalAgitatorRecipe extends VERecipe { + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_AGITATING.get(); public CentrifugalAgitatorRecipe() { } @@ -25,36 +25,36 @@ public CentrifugalAgitatorRecipe(List fi super(List.of(), fi, of, List.of(), processTime); } - public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { + public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { - public static final Codec VE_RECIPE_CODEC = RecordCodecBuilder.create((instance) -> instance.group( + public static final Codec VE_RECIPE_CODEC = RecordCodecBuilder.create((instance) -> instance.group( VERecipeCodecs.VE_FLUID_INGREDIENT_CODEC.listOf().fieldOf("fluid_ingredients").forGetter((getter) -> getter.registryFluidIngredients), VERecipeCodecs.VE_OUTPUT_FLUID_CODEC.listOf().fieldOf("fluid_results").forGetter((getter) -> getter.fluidOutputList), Codec.INT.fieldOf("process_time").forGetter((getter) -> getter.processTime) ).apply(instance, CentrifugalAgitatorRecipe::new)); - private static final FluidSerializerHelper helper = new FluidSerializerHelper<>(); + private static final FluidSerializerHelper helper = new FluidSerializerHelper<>(); @Nullable @Override - public CentrifugalAgitatorRecipe fromNetwork(@NotNull FriendlyByteBuf buffer) { + public VERecipe fromNetwork(@NotNull FriendlyByteBuf buffer) { return helper.fromNetwork(new CentrifugalAgitatorRecipe(), buffer); } @Override - public @NotNull Codec codec() { + public @NotNull Codec codec() { return VE_RECIPE_CODEC; } @Override - public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CentrifugalAgitatorRecipe recipe) { + public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull VERecipe recipe) { helper.toNetwork(buffer, recipe); } }; @Override public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} @Override - public @NotNull RecipeType getType() { + public @NotNull RecipeType getType() { return RECIPE_TYPE; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java index efb572f79..494a61d19 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.util.recipe.IngredientSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -12,9 +12,10 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; -public class CentrifugalSeparatorRecipe extends VERNGRecipe { +public class CentrifugalSeparatorRecipe extends VEFluidRNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_SEPARATION.get(); @@ -22,14 +23,14 @@ public CentrifugalSeparatorRecipe() { } public CentrifugalSeparatorRecipe(List ingredients, List results, int processTime) { - super(ingredients, results, processTime); + super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { public static final Codec VE_RECIPE_CODEC = RecordCodecBuilder.create((instance) -> instance.group( VERecipeCodecs.VE_LAZY_INGREDIENT_CODEC.listOf().fieldOf("ingredients").forGetter((getter) -> getter.registryIngredients), - VERecipeCodecs.VE_CHANCED_OUTPUT_ITEM_CODEC.listOf().fieldOf("item_results").forGetter((getter) -> getter.resultsWithChance), + VERecipeCodecs.VE_CHANCED_OUTPUT_ITEM_CODEC.listOf().fieldOf("item_results").forGetter((getter) -> getter.itemResultsWithChance), Codec.INT.fieldOf("process_time").forGetter((getter) -> getter.processTime) ).apply(instance, CentrifugalSeparatorRecipe::new)); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorFuelRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorFuelRecipe.java index 85b9b9cb1..7f2b28f07 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorFuelRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorFuelRecipe.java @@ -2,10 +2,10 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.VERecipes; -import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.crafting.RecipeSerializer; @@ -16,8 +16,8 @@ import java.util.ArrayList; import java.util.List; -public class CombustionGeneratorFuelRecipe extends VEFluidRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FUEL_COMBUSTION.get(); +public class CombustionGeneratorFuelRecipe extends VERecipe { + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FUEL_COMBUSTION.get(); private int volumetricEnergy; public CombustionGeneratorFuelRecipe() { @@ -61,7 +61,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CombustionGenera public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} @Override - public @NotNull RecipeType getType(){return RECIPE_TYPE;} + public @NotNull RecipeType getType(){return RECIPE_TYPE;} public int getVolumetricEnergy() {return volumetricEnergy;} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java index 50324fce9..5ecf90f7e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java @@ -2,10 +2,10 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.VERecipes; -import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.crafting.RecipeSerializer; @@ -16,8 +16,8 @@ import java.util.ArrayList; import java.util.List; -public class CombustionGeneratorOxidizerRecipe extends VEFluidRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.OXIDIZING.get(); +public class CombustionGeneratorOxidizerRecipe extends VERecipe { + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.OXIDIZING.get(); public CombustionGeneratorOxidizerRecipe() { @@ -58,7 +58,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CombustionGenera } @Override - public @NotNull RecipeType getType() { + public @NotNull RecipeType getType() { return RECIPE_TYPE; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java index 3427ee8a8..ef094cb9b 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.util.recipe.IngredientSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -12,6 +12,7 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; public class CompressorRecipe extends VERecipe { @@ -21,7 +22,7 @@ public CompressorRecipe() { } public CompressorRecipe(List ingredients, List results, int processTime) { - super(ingredients, results, processTime); + super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java index 85c43c58a..0fd94104d 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.util.recipe.IngredientSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -29,7 +29,7 @@ public CrusherRecipe(List ingredients, List VE_RECIPE_CODEC = RecordCodecBuilder.create((instance) -> instance.group( VERecipeCodecs.VE_LAZY_INGREDIENT_CODEC.listOf().fieldOf("ingredients").forGetter((getter) -> getter.registryIngredients), - VERecipeCodecs.VE_CHANCED_OUTPUT_ITEM_CODEC.listOf().fieldOf("item_results").forGetter((getter) -> getter.resultsWithChance), + VERecipeCodecs.VE_CHANCED_OUTPUT_ITEM_CODEC.listOf().fieldOf("item_results").forGetter((getter) -> getter.itemResultsWithChance), Codec.INT.fieldOf("process_time").forGetter((getter) -> getter.processTime), VERecipeCodecs.VE_EXPERIENCE_RANGE_CODEC.fieldOf("experience").forGetter((getter) -> getter.experience) ).apply(instance, CrusherRecipe::new)); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java index 148c6ab12..91465160f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java @@ -5,7 +5,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.util.ServerSideOnly; import com.veteam.voluminousenergy.util.climate.FluidClimateSpawn; -import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.RecipeSerializer; @@ -21,9 +21,9 @@ import static com.veteam.voluminousenergy.util.recipe.VERecipeCodecs.*; -public class DimensionalLaserRecipe extends VEFluidRecipe { +public class DimensionalLaserRecipe extends VERecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.DIMENSIONAL_LASING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.DIMENSIONAL_LASING.get(); @ServerSideOnly private ClimateData climateData; @@ -145,7 +145,7 @@ public FluidClimateSpawn getFluidClimateSpawn() { } @Override - public @NotNull RecipeType getType() { + public @NotNull RecipeType getType() { return RECIPE_TYPE; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java index 353c34fc8..6700e87ed 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -16,7 +16,7 @@ import java.util.List; public class DistillationRecipe extends VEFluidRNGRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.DISTILLING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.DISTILLING.get(); public DistillationRecipe() { } @@ -55,12 +55,12 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull DistillationReci @Override public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} - + @Override public @NotNull ItemStack getToastSymbol(){ return new ItemStack(VEBlocks.DISTILLATION_UNIT_BLOCK.get()); } @Override - public @NotNull RecipeType getType(){return RECIPE_TYPE;} + public @NotNull RecipeType getType(){return RECIPE_TYPE;} } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java index e23695581..fb4d5996e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.util.recipe.IngredientSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -12,9 +12,10 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; -public class ElectrolyzerRecipe extends VERNGRecipe { +public class ElectrolyzerRecipe extends VEFluidRNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.ELECTROLYZING.get(); @@ -22,14 +23,14 @@ public ElectrolyzerRecipe() { } public ElectrolyzerRecipe(List ingredients, List results, int processTime) { - super(ingredients, results, processTime); + super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { public static final Codec VE_RECIPE_CODEC = RecordCodecBuilder.create((instance) -> instance.group( VERecipeCodecs.VE_LAZY_INGREDIENT_CODEC.listOf().fieldOf("ingredients").forGetter((getter) -> getter.registryIngredients), - VERecipeCodecs.VE_CHANCED_OUTPUT_ITEM_CODEC.listOf().fieldOf("item_results").forGetter((getter) -> getter.resultsWithChance), + VERecipeCodecs.VE_CHANCED_OUTPUT_ITEM_CODEC.listOf().fieldOf("item_results").forGetter((getter) -> getter.itemResultsWithChance), Codec.INT.fieldOf("process_time").forGetter((getter) -> getter.processTime) ).apply(instance, ElectrolyzerRecipe::new)); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java index 90bf08bde..99e8f1611 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -15,8 +15,8 @@ import java.util.List; -public class FluidElectrolyzerRecipe extends VEFluidRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FLUID_ELECTROLYZING.get(); +public class FluidElectrolyzerRecipe extends VERecipe { + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FLUID_ELECTROLYZING.get(); public FluidElectrolyzerRecipe() { } @@ -58,7 +58,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull FluidElectrolyze } @Override - public @NotNull RecipeType getType() { + public @NotNull RecipeType getType() { return RECIPE_TYPE; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java index 5dc9b6a37..0b278f974 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -15,8 +15,8 @@ import java.util.List; -public class FluidMixerRecipe extends VEFluidRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FLUID_MIXING.get(); +public class FluidMixerRecipe extends VERecipe { + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FLUID_MIXING.get(); public FluidMixerRecipe() { } @@ -56,7 +56,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull FluidMixerRecipe public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} @Override - public @NotNull RecipeType getType() { + public @NotNull RecipeType getType() { return RECIPE_TYPE; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java index 4d0dd53a6..03ded8cc2 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -15,7 +15,7 @@ import java.util.List; public class HydroponicIncubatorRecipe extends VEFluidRNGRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.HYDROPONIC_INCUBATING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.HYDROPONIC_INCUBATING.get(); public HydroponicIncubatorRecipe() { } @@ -55,7 +55,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull HydroponicIncuba @Override public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} @Override - public @NotNull RecipeType getType() { + public @NotNull RecipeType getType() { return RECIPE_TYPE; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java index 0b6cea231..27657b85f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.util.recipe.IngredientSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -12,6 +12,7 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; public class ImplosionCompressorRecipe extends VERecipe { @@ -21,7 +22,7 @@ public ImplosionCompressorRecipe() { } public ImplosionCompressorRecipe(List ingredients, List results, int processTime) { - super(ingredients, results, processTime); + super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java index 641dd226a..010e17302 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java @@ -5,7 +5,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.recipe.FluidIngredient; -import com.veteam.voluminousenergy.util.recipe.IngredientSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -22,7 +22,7 @@ import java.util.HashSet; import java.util.List; -public class IndustrialBlastingRecipe extends VEFluidRecipe { +public class IndustrialBlastingRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.INDUSTRIAL_BLASTING.get(); private static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java index eda07a3a9..9519d419c 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.util.recipe.IngredientSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -13,6 +13,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; import java.util.List; public class PrimitiveBlastFurnaceRecipe extends VERecipe { @@ -23,7 +24,7 @@ public PrimitiveBlastFurnaceRecipe() { } public PrimitiveBlastFurnaceRecipe(List ingredients, List results, int processTime) { - super(ingredients, results, processTime); + super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java index d5a7e599b..fbc8fc3dd 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java @@ -40,11 +40,10 @@ public static VERecipe getRecipeFromCache(Level level, RecipeType> type, List fluids, List items) { + public static VERecipe getFluidRecipeFromCache(Level level, RecipeType> type, List fluids, List items) { var recipes = VERecipe.getCachedRecipes(type); - for (VERecipe r : recipes) { - VEFluidRecipe recipe = (VEFluidRecipe) r; + for (VERecipe recipe : recipes) { boolean isValid = true; for (int i = 0; i < fluids.size(); i++) { @@ -95,11 +94,11 @@ public static VEFluidRecipe getFluidRecipeFromCache(Level level, RecipeType getFluidRecipesFromCache(VETileEntity tile, boolean ignoreEmpty) { + public static @NotNull List getFluidRecipesFromCache(VETileEntity tile, boolean ignoreEmpty) { var recipes = VERecipe.getCachedRecipes(tile.getRecipeType()); - List recipeList = new ArrayList<>(); + List recipeList = new ArrayList<>(); for (VERecipe recipe : recipes) { boolean isValid = true; @@ -108,7 +107,7 @@ public static VEFluidRecipe getFluidRecipeFromCache(Level level, RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.STIRLING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.STIRLING.get(); + + private final RecipeParser parser; public StirlingGeneratorRecipe() { + parser = RecipeParser.forRecipe(this) + .addIngredient(new RecipeParser.SlotAndRecipePos(0,0)); } public StirlingGeneratorRecipe(List ingredients, int processTime, int energy_per_tick) { super(ingredients, processTime, energy_per_tick); + parser = RecipeParser.forRecipe(this) + .addIngredient(new RecipeParser.SlotAndRecipePos(0,0)); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { @@ -68,4 +75,8 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull StirlingGenerato return new ItemStack(VEBlocks.STIRLING_GENERATOR_BLOCK.get()); } + @Override + public RecipeParser getParser() { + return parser; + } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java index 1cdd0ef5e..19d4ff52b 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java @@ -5,7 +5,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.items.tools.multitool.Multitool; import com.veteam.voluminousenergy.items.tools.multitool.bits.BitItem; -import com.veteam.voluminousenergy.util.recipe.IngredientSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.Item; @@ -29,7 +29,7 @@ public ToolingRecipe() { } public ToolingRecipe(List i, List oi) { - super(i, oi, 0); + super(i,new ArrayList<>(),new ArrayList<>(), oi, 0); this.bits = Lazy.of(() -> { ArrayList foundBits = new ArrayList<>(); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VEEnergyRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VEEnergyRecipe.java index 6235e37df..861970598 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEEnergyRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VEEnergyRecipe.java @@ -5,7 +5,7 @@ import java.util.ArrayList; import java.util.List; -public abstract class VEEnergyRecipe extends VEFluidRecipe { +public abstract class VEEnergyRecipe extends VERecipe { private int energyPerTick; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRNGRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRNGRecipe.java index bb1d8aad6..9e0a6c52e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRNGRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRNGRecipe.java @@ -5,7 +5,7 @@ import java.util.List; -public abstract class VEFluidRNGRecipe extends VEFluidRecipe { +public abstract class VEFluidRNGRecipe extends VERecipe { public List rngValues; public List itemResultsWithChance; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRecipe.java deleted file mode 100644 index 71f4d9843..000000000 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRecipe.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.veteam.voluminousenergy.recipe; - -import com.veteam.voluminousenergy.util.recipe.FluidIngredient; -import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; -import net.minecraft.world.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -import java.util.ArrayList; -import java.util.List; - -public abstract class VEFluidRecipe extends VERecipe { - - private List fluidIngredientList = null; - public List registryFluidIngredients; - public List fluidOutputList; - - public VEFluidRecipe() { - - } - - public VEFluidRecipe(List i, List fi, List of, List oi, int processTime) { - super(i,oi,processTime); - registryFluidIngredients = fi; - fluidOutputList = of; - this.processTime = processTime; - } - - public List getOutputFluids() { - return this.fluidOutputList; - } - - public FluidStack getOutputFluid(int slot) { - return this.fluidOutputList.get(slot).copy(); - } - - - public List getFluidIngredients() { - if(fluidIngredientList == null) { - List fluidIngredients = new ArrayList<>(); - for(VERecipeCodecs.RegistryFluidIngredient ingredient : registryFluidIngredients) { - fluidIngredients.add(ingredient.getIngredient()); - } - this.fluidIngredientList = fluidIngredients; - } - return fluidIngredientList; - } - - public FluidIngredient getFluidIngredient(int slot) { - return getFluidIngredients().get(slot); - } - - public int getFluidIngredientAmount(int slot) { - return getFluidIngredients().get(slot).getFluids()[0].getAmount(); - } - - public void setFluidOutputList(List fluidOutputList) { - this.fluidOutputList = fluidOutputList; - } - - public void setFluidIngredientList(List fluidIngredientList) { - this.fluidIngredientList = fluidIngredientList; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java index e283f0222..47df4309f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java @@ -4,7 +4,7 @@ import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; @@ -20,7 +20,7 @@ import javax.annotation.Nullable; import java.util.List; -public class VEFluidSawmillRecipe extends VEFluidRecipe { +public class VEFluidSawmillRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.SAWMILLING.get(); private boolean isLogRecipe; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java index c7a13834a..cc5cc0682 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java @@ -2,9 +2,10 @@ import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; +import java.util.ArrayList; import java.util.List; -public abstract class VERNGExperienceRecipe extends VERNGRecipe { +public abstract class VERNGExperienceRecipe extends VEFluidRNGRecipe { @Deprecated public int minExp; @@ -18,7 +19,7 @@ public VERNGExperienceRecipe() { } public VERNGExperienceRecipe(List ingredients, List results, int processTime, VERecipeCodecs.VERecipeExperience experience) { - super(ingredients, results, processTime); + super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); this.experience = experience; this.minExp = experience.minimum(); this.maxExp = experience.maximum(); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java deleted file mode 100644 index 856e442f8..000000000 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.veteam.voluminousenergy.recipe; - -import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; - -import java.util.List; - -public abstract class VERNGRecipe extends VERecipe { - - public List rngValues; - public List resultsWithChance; - - public VERNGRecipe() { - - } - - public VERNGRecipe(List ingredients, List results, int processTime) { - super( - ingredients, - results.stream().map(VERecipeCodecs.VEChancedItemWithCount::getAsItemStack).toList(), - processTime - ); - this.rngValues = results.stream().map(VERecipeCodecs.VEChancedItemWithCount::chance).toList(); - - } - - /** - * A variable list of rng floats of variable length that can change depending on the recipe requirements - * Should only be used in serialization - * @return the raw rng values - */ - public List getRNGOutputs() { - return rngValues; - } - - public float getOutputChance(int i) { - if (i >= rngValues.size()) { - return 1; - } - return rngValues.get(i); - } - - public void setRNGOutputs(List rngOutputs) { - this.rngValues = rngOutputs; - } - -} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java index c251b9e77..f3d56c5d9 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java @@ -2,6 +2,8 @@ import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.util.recipe.FluidIngredient; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.core.NonNullList; import net.minecraft.core.RegistryAccess; @@ -10,10 +12,13 @@ import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; +import net.minecraftforge.fluids.FluidStack; import org.apache.commons.lang3.NotImplementedException; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.HashMap; @@ -21,7 +26,10 @@ public abstract class VERecipe implements Recipe { - public List registryIngredients; + List registryIngredients; + private List fluidIngredientList = null; + public List registryFluidIngredients; + public List fluidOutputList; private static final HashMap,List> recipeCache = new HashMap<>(); private static final HashMap,List> newCache = new HashMap<>(); @@ -31,10 +39,13 @@ public abstract class VERecipe implements Recipe { public List results = new ArrayList<>(); public VERecipe() { + } - public VERecipe(List ingredients, List results, int processTime) { + public VERecipe(List ingredients,List fluidIngredients,List fluidResults, List results, int processTime) { this.results = results; + registryFluidIngredients = fluidIngredients; + fluidOutputList = fluidResults; this.processTime = processTime; this.registryIngredients = NonNullList.create(); this.registryIngredients.addAll(ingredients); @@ -107,6 +118,11 @@ public List getResults() { throw new NotImplementedException("Class" + this.getClass().getName() + " missing getToastSymbol impl!"); } + @Override + public @NotNull RecipeSerializer getSerializer() { + throw new NotImplementedException("Missing serializer impl for " + this.getClass().getName()); + } + public boolean matches(@NotNull VETileEntity veTileEntity) { throw new NotImplementedException("Matches is not impl'd for: " + this.getClass().getName()); } @@ -138,6 +154,41 @@ public void setResults(List results) { this.results = results; } + public List getOutputFluids() { + return this.fluidOutputList; + } + + public FluidStack getOutputFluid(int slot) { + return this.fluidOutputList.get(slot).copy(); + } + + public List getFluidIngredients() { + if(fluidIngredientList == null) { + List fluidIngredients = new ArrayList<>(); + for(VERecipeCodecs.RegistryFluidIngredient ingredient : registryFluidIngredients) { + fluidIngredients.add(ingredient.getIngredient()); + } + this.fluidIngredientList = fluidIngredients; + } + return fluidIngredientList; + } + + public FluidIngredient getFluidIngredient(int slot) { + return getFluidIngredients().get(slot); + } + + public int getFluidIngredientAmount(int slot) { + return getFluidIngredients().get(slot).getFluids()[0].getAmount(); + } + + public void setFluidOutputList(List fluidOutputList) { + this.fluidOutputList = fluidOutputList; + } + + public void setFluidIngredientList(List fluidIngredientList) { + this.fluidIngredientList = fluidIngredientList; + } + @Override public @NotNull NonNullList getIngredients() { @@ -177,4 +228,24 @@ public static void addRecipeToCacheClient(VERecipe recipe) { }}); } } + + public static List getPotentialRecipes(VETileEntity tile) { + List recipes = new ArrayList<>(); + for(VERecipe recipe : getCachedRecipes(tile.getRecipeType())) { + if(recipe.getParser().isPartialRecipe(tile)) recipes.add(recipe); + } + return recipes; + } + + @Nullable + public static VERecipe getCompleteRecipe(VETileEntity tile) { + for(VERecipe recipe : getCachedRecipes(tile.getRecipeType())) { + if(recipe.getParser().isCompleteRecipe(tile)) return recipe; + } + return null; + } + + public RecipeParser getParser() { + throw new NotImplementedException("Unable to get parser for recipe: " + this.getClass().getName()); + } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java index 741afcb3f..702180e1d 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java @@ -26,25 +26,25 @@ public static final class VERecipeTypes{ public static final RegistryObject> ELECTROLYZING = VE_RECIPE_TYPES_REGISTRY.register("electrolyzing", () -> new VERecipeType<>(RecipeConstants.ELECTROLYZING)); - public static final RegistryObject> CENTRIFUGAL_AGITATING = + public static final RegistryObject> CENTRIFUGAL_AGITATING = VE_RECIPE_TYPES_REGISTRY.register("centrifugal_agitating", () -> new VERecipeType<>(RecipeConstants.CENTRIFUGAL_AGITATING)); public static final RegistryObject> COMPRESSING = VE_RECIPE_TYPES_REGISTRY.register("compressing", () -> new VERecipeType<>(RecipeConstants.COMPRESSING)); - public static final RegistryObject> STIRLING = + public static final RegistryObject> STIRLING = VE_RECIPE_TYPES_REGISTRY.register("stirling", () -> new VERecipeType<>(RecipeConstants.STIRLING)); - public static final RegistryObject> OXIDIZING = + public static final RegistryObject> OXIDIZING = VE_RECIPE_TYPES_REGISTRY.register("oxidizer_combustion", () -> new VERecipeType<>(RecipeConstants.OXIDIZING)); - public static final RegistryObject> FUEL_COMBUSTION = + public static final RegistryObject> FUEL_COMBUSTION = VE_RECIPE_TYPES_REGISTRY.register("fuel_combustion", () -> new VERecipeType<>(RecipeConstants.FUEL_COMBUSTION)); - public static final RegistryObject> AQUEOULIZING = + public static final RegistryObject> AQUEOULIZING = VE_RECIPE_TYPES_REGISTRY.register("aqueoulizing", () -> new VERecipeType<>(RecipeConstants.AQUEOULIZING)); - public static final RegistryObject> DISTILLING = + public static final RegistryObject> DISTILLING = VE_RECIPE_TYPES_REGISTRY.register("distilling", () -> new VERecipeType<>(RecipeConstants.DISTILLING)); public static final RegistryObject> CENTRIFUGAL_SEPARATION = @@ -62,16 +62,16 @@ public static final class VERecipeTypes{ public static final RegistryObject> SAWMILLING = VE_RECIPE_TYPES_REGISTRY.register("sawmilling", () -> new VERecipeType<>(RecipeConstants.SAWMILLING)); - public static final RegistryObject> DIMENSIONAL_LASING = + public static final RegistryObject> DIMENSIONAL_LASING = VE_RECIPE_TYPES_REGISTRY.register("dimensional_lasing", () -> new VERecipeType<>(RecipeConstants.DIMENSIONAL_LASING)); - public static final RegistryObject> FLUID_ELECTROLYZING = + public static final RegistryObject> FLUID_ELECTROLYZING = VE_RECIPE_TYPES_REGISTRY.register("fluid_electrolyzing", () -> new VERecipeType<>(RecipeConstants.FLUID_ELECTROLYZING)); - public static final RegistryObject> FLUID_MIXING = + public static final RegistryObject> FLUID_MIXING = VE_RECIPE_TYPES_REGISTRY.register("fluid_mixing", () -> new VERecipeType<>(RecipeConstants.FLUID_MIXING)); - public static final RegistryObject> HYDROPONIC_INCUBATING = + public static final RegistryObject> HYDROPONIC_INCUBATING = VE_RECIPE_TYPES_REGISTRY.register("hydroponic_incubating", () -> new VERecipeType<>(RecipeConstants.HYDROPONIC_INCUBATING)); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java new file mode 100644 index 000000000..a11a98701 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java @@ -0,0 +1,150 @@ +package com.veteam.voluminousenergy.recipe.parser; + +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.tiles.VEItemStackHandler; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.util.recipe.FluidIngredient; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraftforge.fluids.FluidStack; + +import java.util.ArrayList; +import java.util.List; + +public class RecipeParser { + + List ingredientPositions = new ArrayList<>(); + List itemResultPositions = new ArrayList<>(); + List fluidIngredientPositions = new ArrayList<>(); + List fluidResultPositions = new ArrayList<>(); + + private final VERecipe recipe; + + public RecipeParser(VERecipe recipe) { + this.recipe = recipe; + } + + public static RecipeParser forRecipe(VERecipe recipe) { + return new RecipeParser(recipe); + } + + public RecipeParser addIngredient(SlotAndRecipePos pos) { + this.ingredientPositions.add(pos); + return this; + } + + public RecipeParser addFluidIngredient(SlotAndRecipePos pos) { + this.fluidIngredientPositions.add(pos); + return this; + } + + public RecipeParser addItemResult(SlotAndRecipePos pos) { + this.itemResultPositions.add(pos); + return this; + } + + public RecipeParser addFluidResult(SlotAndRecipePos pos) { + this.fluidResultPositions.add(pos); + return this; + } + + public boolean isPartialRecipe(VETileEntity tile) { + for (SlotAndRecipePos pos : ingredientPositions) { + ItemStack stackInSlot = tile.getStackInSlot(pos.tilePos); + Ingredient ingredient = recipe.getIngredient(pos.recipePos); + if (stackInSlot.isEmpty()) continue; + if (ingredient.test(stackInSlot)) continue; + return false; + } + + for (SlotAndRecipePos pos : fluidIngredientPositions) { + FluidStack stack = tile.getFluidStackFromTank(pos.tilePos); + FluidIngredient fluidIngredient = recipe.getFluidIngredient(pos.recipePos); + if (stack.isEmpty()) continue; + if (fluidIngredient.test(stack)) continue; + return false; + } + return true; + } + + public boolean isCompleteRecipe(VETileEntity tile) { + for (SlotAndRecipePos pos : ingredientPositions) { + ItemStack stackInSlot = tile.getStackInSlot(pos.tilePos); + Ingredient ingredient = recipe.getIngredient(pos.recipePos); + int amountNeeded = recipe.getIngredientCount(pos.recipePos); + if (!ingredient.test(stackInSlot) || stackInSlot.getCount() < amountNeeded) + return false; + } + + for (SlotAndRecipePos pos : fluidIngredientPositions) { + FluidStack stack = tile.getFluidStackFromTank(pos.tilePos); + FluidIngredient fluidIngredient = recipe.getFluidIngredient(pos.recipePos); + int amountNeeded = fluidIngredient.getAmountNeeded(); + if (!fluidIngredient.test(stack) || stack.getAmount() < amountNeeded) + return false; + } + return true; + } + + public boolean canCompleteRecipe(VETileEntity tile) { + + for (SlotAndRecipePos pos : itemResultPositions) { + ItemStack stack = tile.getStackInSlot(pos.tilePos); + ItemStack result = recipe.getResult(pos.recipePos); + if (!stack.is(result.getItem()) || result.getCount() + stack.getCount() > result.getMaxStackSize()) + return false; + } + for (SlotAndRecipePos pos : fluidResultPositions) { + FluidStack stack = tile.getFluidStackFromTank(pos.tilePos); + FluidStack result = recipe.getOutputFluid(pos.recipePos); + if (!stack.isFluidEqual(result) || result.getAmount() + stack.getAmount() > tile.getTankCapacity(pos.tilePos)) + return false; + } + return true; + } + + public void completeRecipe(VETileEntity tile) { + + VEItemStackHandler handler = tile.getInventory(); + + // Subtract the amounts + for (SlotAndRecipePos pos : ingredientPositions) { + handler.extractItem(pos.tilePos, recipe.getIngredientCount(pos.recipePos), false); + } + + for (SlotAndRecipePos pos : fluidIngredientPositions) { + FluidStack fluidStack = tile.getFluidStackFromTank(pos.tilePos); + fluidStack.setAmount(fluidStack.getAmount() - recipe.getFluidIngredientAmount(pos.recipePos)); + } + + // Insert the results + for (SlotAndRecipePos pos : itemResultPositions) { + ItemStack result = recipe.getResult(pos.recipePos); + handler.insertItem(pos.tilePos, result.copy(), false); + } + + for (SlotAndRecipePos pos : fluidResultPositions) { + FluidStack result = recipe.getOutputFluid(pos.recipePos); + FluidStack tileFluid = tile.getFluidStackFromTank(pos.tilePos); + tileFluid.setAmount(tileFluid.getAmount() + result.getAmount()); + } + + // mark fluid IO as dirty + tile.markFluidInputDirty(); + } + + public boolean canInsertItem(int slot, ItemStack stack) { + for (SlotAndRecipePos pos : ingredientPositions) { + if (pos.tilePos == slot) { + Ingredient recipeIngredient = recipe.getIngredient(pos.recipePos); + return recipeIngredient.test(stack); + } + } + return false; + } + + public record SlotAndRecipePos(int tilePos, int recipePos) { + + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java new file mode 100644 index 000000000..0d6a6823f --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java @@ -0,0 +1,81 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.sounds.VESounds; +import com.veteam.voluminousenergy.tools.Config; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.items.ItemStackHandler; + +public class DefaultProcessor implements RecipeProcessor { + + @Override + public void validateRecipe(VETileEntity tile) { + tile.setPotentialRecipes(VERecipe.getPotentialRecipes(tile)); + + if (tile.getPotentialRecipes().size() == 1) { + VERecipe newRecipe = VERecipe.getCompleteRecipe(tile); + if (newRecipe == null) { + tile.setData("counter",0); + tile.setData("length",0); + tile.setSelectedRecipe(null); + return; + } + + int newLength; + ItemStackHandler handler = tile.getInventoryHandler(); + if (tile.getEnergy() != null && handler != null) { + newLength = tile.calculateCounter(newRecipe.getProcessTime(), + handler.getStackInSlot(tile.getEnergy().getUpgradeSlotId()).copy()); + } else { + newLength = tile.calculateCounter(newRecipe.getProcessTime(), ItemStack.EMPTY); + } + + double ratio = (double) tile.getData("length") / (double) newLength; + tile.setData("length",newLength); + tile.setData("counter", (int) (tile.getData("counter") / ratio)); + + if (tile.getSelectedRecipe() != newRecipe) { + tile.setSelectedRecipe(newRecipe); + tile.setData("counter",newLength); + } + } else { + tile.setData("counter",0); + tile.setData("length",0); + tile.setSelectedRecipe(null); + } + } + + @Override + public void processRecipe(VETileEntity tile) { + if (tile.getSelectedRecipe() == null) return; + if (!tile.canConsumeEnergy()) return; + VERecipe recipe = tile.getSelectedRecipe(); + + int counter = tile.getData("counter"); + + if (counter == 1) { + + RecipeParser parser = recipe.getParser(); + if(!parser.canCompleteRecipe(tile)) return; + parser.completeRecipe(tile); + tile.markRecipeDirty(); + tile.markFluidInputDirty(); + tile.setChanged(); + } else if (counter > 0) { + int soundTick = tile.getData("sound_tick"); + if (++soundTick == 19 && Config.PLAY_MACHINE_SOUNDS.get()) { + soundTick = 0; + tile.getLevel().playSound(null, tile.getBlockPos(), VESounds.AQUEOULIZER, SoundSource.BLOCKS, 1.0F, 1.0F); + } + tile.setData("sound_tick", soundTick); + } else { + tile.setData("counter", tile.getData("length")); + } + tile.setData("counter", tile.getData("counter") - 1); + tile.consumeEnergy(); + } + +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/FluidItemProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/FluidItemProcessor.java deleted file mode 100644 index 041f31d7b..000000000 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/FluidItemProcessor.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.veteam.voluminousenergy.recipe.processor; - -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; -import com.veteam.voluminousenergy.sounds.VESounds; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import com.veteam.voluminousenergy.util.VERelationalTank; -import net.minecraft.sounds.SoundSource; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; - -import java.util.Random; - -import static net.minecraft.util.Mth.abs; - -public class FluidItemProcessor implements RecipeProcessor { - - @Override - public void processRecipe(VETileEntity tile) { - if (tile.getSelectedRecipe() == null) return; - if (!tile.canConsumeEnergy()) return; - VEFluidRecipe recipe = tile.getSelectedRecipe(); - - int counter = tile.getData("counter"); - - if (counter == 1) { - // Validate output - for (VERelationalTank relationalTank : tile.getRelationalTanks()) { - if (relationalTank.getTankType() == TankType.OUTPUT) { - FluidStack recipeFluid = recipe.getOutputFluid(relationalTank.getRecipePos()); - FluidTank tank = relationalTank.getTank(); - FluidStack currentFluid = tank.getFluid(); - if (currentFluid.isEmpty()) continue; - // If the output fluid amount won't fit, then you must acquit - if (!recipeFluid.isFluidEqual(currentFluid) - || tank.getFluidAmount() + recipeFluid.getAmount() > tank.getCapacity()) { - return; - } - } - } - - ItemStackHandler handler = tile.getInventoryHandler(); - - if (handler != null) { - // Validate output - for (VESlotManager slotManager : tile.getSlotManagers()) { - if (slotManager.getSlotType() != SlotType.OUTPUT) continue; - ItemStack recipeStack = recipe.getResult(slotManager.getRecipePos()); - ItemStack currentItem = slotManager.getItem(handler); - if (currentItem.isEmpty()) continue; - // If the output item amount won't fit, then you must acquit - if (!recipeStack.is(currentItem.getItem()) - || recipeStack.getCount() + currentItem.getCount() > currentItem.getMaxStackSize()) { - return; - } - } - - VEFluidRNGRecipe irngRecipe = null; - if (recipe instanceof VEFluidRNGRecipe rec) { - irngRecipe = rec; - } - Random r = new Random(); - - // process recipe - for (VESlotManager slotManager : tile.getSlotManagers()) { - if (slotManager.getSlotType() == SlotType.OUTPUT) { - ItemStack output = recipe.getResult(slotManager.getRecipePos()); - ItemStack currentStack = slotManager.getItem(handler); - // rng calculations - if (irngRecipe != null) { - float randomness = irngRecipe.getOutputChance(slotManager.getRecipePos()); - if (randomness != 1) { - float random = abs(0 + r.nextFloat() * (-1)); - if (random > randomness) continue; - } - - } - if (currentStack.isEmpty()) slotManager.setItem(output, handler); - else currentStack.setCount(currentStack.getCount() + output.getCount()); - } else if (slotManager.getSlotType() == SlotType.INPUT) { - Ingredient ingredient = recipe.getIngredient(slotManager.getRecipePos()); - ItemStack currentStack = slotManager.getItem(handler); - currentStack.setCount(currentStack.getCount() - ingredient.getItems()[0].getCount()); - } - } - } - - // process recipe - for (VERelationalTank relationalTank : tile.getRelationalTanks()) { - if (relationalTank.getTankType() == TankType.OUTPUT) { - relationalTank.fillOutput(recipe, relationalTank.getRecipePos()); - } else if (relationalTank.getTankType() == TankType.INPUT) { - relationalTank.drainInput(recipe, relationalTank.getRecipePos()); - } - } - - tile.markRecipeDirty(); - tile.markFluidInputDirty(); - tile.setChanged(); - } else if (counter > 0) { - int soundTick = tile.getData("sound_tick"); - if (++soundTick == 19 && Config.PLAY_MACHINE_SOUNDS.get()) { - soundTick = 0; - tile.getLevel().playSound(null, tile.getBlockPos(), VESounds.AQUEOULIZER, SoundSource.BLOCKS, 1.0F, 1.0F); - } - tile.setData("sound_tick", soundTick); - } else { - tile.setData("counter", tile.getData("length")); - } - tile.setData("counter", tile.getData("counter") - 1); - tile.consumeEnergy(); - } - -} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorItemProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java similarity index 56% rename from src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorItemProcessor.java rename to src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java index 4593edcf0..3adcd72a1 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorItemProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java @@ -3,23 +3,42 @@ import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.recipe.VEEnergyRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; import net.minecraft.sounds.SoundSource; import org.apache.commons.lang3.NotImplementedException; -public class GeneratorItemProcessor implements RecipeProcessor { +import java.util.ArrayList; +import java.util.List; + +public class GeneratorProcessor implements RecipeProcessor { private int divisor = 1; private boolean allowOverflow = false; - public GeneratorItemProcessor(boolean allowOverflow,int divisor) { + public GeneratorProcessor(boolean allowOverflow, int divisor) { this.allowOverflow = allowOverflow; this.divisor = divisor; } - public GeneratorItemProcessor() { + public GeneratorProcessor(int divisor) { + this.divisor = divisor; + } + + @Override + public void validateRecipe(VETileEntity tile) { + if (!tile.isRecipeDirty()) { + return; + } + tile.setRecipeDirty(false); + List potentialRecipes = VERecipe.getPotentialRecipes(tile); + tile.setPotentialRecipes(potentialRecipes); + if (tile.getPotentialRecipes().size() == 1) { + tile.setSelectedRecipe(VERecipe.getCompleteRecipe(tile)); + } } @Override @@ -48,11 +67,20 @@ public void processRecipe(VETileEntity tile) { } tile.setChanged(); } else if (counter == 0) { - if (tile.getSelectedRecipe() instanceof VEEnergyRecipe recipe) { - tile.getInventory().extractItem(0, recipe.getIngredientCount(0), false); - tile.setData("counter", recipe.getProcessTime()); - tile.getEnergy().setProduction(recipe.getEnergyPerTick() / divisor); - tile.setData("length", recipe.getProcessTime()); + if (tile.getSelectedRecipe() instanceof VEEnergyRecipe veEnergyRecipe) { + RecipeParser parser = veEnergyRecipe.getParser(); + if(!parser.canCompleteRecipe(tile)) return; + // Check to see if the energy produced will overflow the tile + if(tile.getEnergy().isFullyCharged()) return; + + VoluminousEnergy.LOGGER.info("recipe completed!"); + + // Since we're a generator we want to subtract the amounts at the start rather than at the end + veEnergyRecipe.getParser().completeRecipe(tile); + + tile.setData("counter", veEnergyRecipe.getProcessTime()); + tile.getEnergy().setProduction(veEnergyRecipe.getEnergyPerTick() / divisor); + tile.setData("length", veEnergyRecipe.getProcessTime()); tile.setSelectedRecipe(null); tile.setChanged(); } else { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/RecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/RecipeProcessor.java index 7b9180c4c..efaada432 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/RecipeProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/RecipeProcessor.java @@ -6,4 +6,6 @@ public interface RecipeProcessor { void processRecipe(VETileEntity tile); + void validateRecipe(VETileEntity tile); + } diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidSerializerHelper.java b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/FluidSerializerHelper.java similarity index 93% rename from src/main/java/com/veteam/voluminousenergy/util/recipe/FluidSerializerHelper.java rename to src/main/java/com/veteam/voluminousenergy/recipe/serializer/FluidSerializerHelper.java index ec97a9e07..c0a889ede 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidSerializerHelper.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/FluidSerializerHelper.java @@ -1,8 +1,9 @@ -package com.veteam.voluminousenergy.util.recipe; +package com.veteam.voluminousenergy.recipe.serializer; import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.util.recipe.FluidIngredient; import net.minecraft.core.NonNullList; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -13,7 +14,7 @@ import java.util.ArrayList; import java.util.List; -public class FluidSerializerHelper { +public class FluidSerializerHelper { @Nullable public T fromNetwork(T recipe, FriendlyByteBuf buffer) { diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/IngredientSerializerHelper.java b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java similarity index 91% rename from src/main/java/com/veteam/voluminousenergy/util/recipe/IngredientSerializerHelper.java rename to src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java index 683883c6c..55187d230 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/IngredientSerializerHelper.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java @@ -1,7 +1,7 @@ -package com.veteam.voluminousenergy.util.recipe; +package com.veteam.voluminousenergy.recipe.serializer; +import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; import com.veteam.voluminousenergy.recipe.VERNGExperienceRecipe; -import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import net.minecraft.core.NonNullList; import net.minecraft.network.FriendlyByteBuf; @@ -35,7 +35,7 @@ public T fromNetwork(T recipe, FriendlyByteBuf buffer) { recipe.setProcessTime(buffer.readInt()); - if (recipe instanceof VERNGRecipe irngRecipe) { + if (recipe instanceof VEFluidRNGRecipe irngRecipe) { int totalRandom = buffer.readInt(); List values = new ArrayList<>(); for (int i = 0; i < totalRandom; i++) { @@ -66,7 +66,7 @@ public void toNetwork(FriendlyByteBuf buffer, T recipe) { buffer.writeInt(recipe.getProcessTime()); - if (recipe instanceof VERNGRecipe irngRecipe) { + if (recipe instanceof VEFluidRNGRecipe irngRecipe) { buffer.writeInt(irngRecipe.getRNGOutputs().size()); for(float f : irngRecipe.getRNGOutputs()) { buffer.writeFloat(f); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/validator/FluidItemValidator.java b/src/main/java/com/veteam/voluminousenergy/recipe/validator/FluidItemValidator.java deleted file mode 100644 index 1edd8eef5..000000000 --- a/src/main/java/com/veteam/voluminousenergy/recipe/validator/FluidItemValidator.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.veteam.voluminousenergy.recipe.validator; - -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.recipe.RecipeCache; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import net.minecraft.world.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.items.ItemStackHandler; - -import java.util.ArrayList; -import java.util.List; - -public class FluidItemValidator implements RecipeValidator { - - @Override - public void validateRecipe(VETileEntity tile) { - if (!tile.isRecipeDirty()) { - return; - } - tile.setRecipeDirty(false); - - tile.setPotentialRecipes(RecipeCache.getFluidRecipesFromCache(tile, true)); - if (tile.getPotentialRecipes().size() == 1) { - List inputFluids = tile.getRelationalTanks().stream() - .filter(tank -> tank.getTankType() == TankType.INPUT) - .map(tank -> tank.getTank().getFluid()).toList(); - - ItemStackHandler handler = tile.getInventoryHandler(); - List inputItems = new ArrayList<>(); - if (handler != null) { - inputItems = tile.getSlotManagers().stream() - .filter(manager -> manager.getSlotType() == SlotType.INPUT) - .map(manager -> manager.getItem(handler)).toList(); - } - VEFluidRecipe newRecipe = RecipeCache.getFluidRecipeFromCache(null, tile.getRecipeType(), inputFluids, inputItems); - - if (newRecipe == null) { - tile.setData("counter",0); - tile.setData("length",0); - tile.setSelectedRecipe(null); - return; - } - - int newLength; - - if (tile.getEnergy() != null && handler != null) { - newLength = tile.calculateCounter(newRecipe.getProcessTime(), - handler.getStackInSlot(tile.getEnergy().getUpgradeSlotId()).copy()); - } else { - newLength = tile.calculateCounter(newRecipe.getProcessTime(), ItemStack.EMPTY); - } - - - double ratio = (double) tile.getData("length") / (double) newLength; - tile.setData("length",newLength); - tile.setData("counter", (int) (tile.getData("counter") / ratio)); - - if (tile.getSelectedRecipe() != newRecipe) { - tile.setSelectedRecipe(newRecipe); - tile.setData("counter",newLength); - } - } else { - tile.setData("counter",0); - tile.setData("length",0); - tile.setSelectedRecipe(null); - } - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/validator/GeneratorItemValidator.java b/src/main/java/com/veteam/voluminousenergy/recipe/validator/GeneratorItemValidator.java deleted file mode 100644 index 96a7fa57f..000000000 --- a/src/main/java/com/veteam/voluminousenergy/recipe/validator/GeneratorItemValidator.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.veteam.voluminousenergy.recipe.validator; - -import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.recipe.RecipeCache; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; -import com.veteam.voluminousenergy.util.SlotType; -import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.ItemStackHandler; - -import java.util.ArrayList; -import java.util.List; - -public class GeneratorItemValidator implements RecipeValidator { - - @Override - public void validateRecipe(VETileEntity tile) { - if (!tile.isRecipeDirty()) { - return; - } - tile.setRecipeDirty(false); - tile.setPotentialRecipes(RecipeCache.getFluidRecipesFromCache(tile, true)); - if (tile.getPotentialRecipes().size() == 1) { - ItemStackHandler handler = tile.getInventoryHandler(); - List inputItems = new ArrayList<>(); - if (handler != null) { - inputItems = tile.getSlotManagers().stream() - .filter(manager -> manager.getSlotType() == SlotType.INPUT) - .map(manager -> manager.getItem(handler)).toList(); - } - VEFluidRecipe newRecipe = RecipeCache.getFluidRecipeFromCache(null, tile.getRecipeType(), new ArrayList<>(), inputItems); - tile.setSelectedRecipe(newRecipe); - } - } - -} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/validator/RecipeValidator.java b/src/main/java/com/veteam/voluminousenergy/recipe/validator/RecipeValidator.java deleted file mode 100644 index 01200d867..000000000 --- a/src/main/java/com/veteam/voluminousenergy/recipe/validator/RecipeValidator.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.veteam.voluminousenergy.recipe.validator; - -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; - -public interface RecipeValidator { - - void validateRecipe(VETileEntity tile); - -} diff --git a/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java b/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java index daa4c4e6e..2d2ac0864 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java @@ -117,5 +117,8 @@ public int getCapacity() return capacity; } + public boolean isFullyCharged() { + return this.capacity == this.energy; + } } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java b/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java index d4aa0b5fa..2ee5b52c2 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java @@ -34,11 +34,11 @@ public VESlotManager(int slotNum, Direction direction, boolean status, SlotType } /** - * Use this for when you have an input slot type - * @param slotNum The slot number is the index in the array of the slotManagers + * Use this for when you have an input tilePos type + * @param slotNum The tilePos number is the index in the array of the slotManagers * @param direction The direction it will be facing by default * @param status The status of the IO - * @param slotType The type of slot + * @param slotType The type of tilePos * @param outputSlot The slotNum of the tank to which a bucket will be placed when this has processed a bucket * @param tankId The index of the tank in the fluidManagers */ @@ -53,11 +53,11 @@ public VESlotManager(int slotNum, Direction direction, boolean status, SlotType } /** - * Use this for an input slot or others - * @param slotNum The slot number is the index in the array of the slotManagers + * Use this for an input tilePos or others + * @param slotNum The tilePos number is the index in the array of the slotManagers * @param direction The direction it will be facing by default * @param status The status of the IO - * @param slotType The type of slot + * @param slotType The type of tilePos */ public VESlotManager(int slotNum, int recipePos, Direction direction, boolean status, SlotType slotType) { this.side.set(direction); diff --git a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java index e781c2734..58c3b87c2 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java +++ b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.blocks.tiles.tank.TankTile; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.Config; import net.minecraft.world.item.crafting.Recipe; import net.minecraftforge.fluids.FluidStack; @@ -52,9 +52,8 @@ public int getTankCapacity(int tank) { public boolean isFluidValid(int tank, @Nonnull FluidStack stack) { VERelationalTank relationalTank = tankHashMap.get(tank); if(relationalTank.isAllowAny()) return true; - for (Recipe recipe : tileEntity.getPotentialRecipes()) { - VEFluidRecipe veFluidRecipe = (VEFluidRecipe) recipe; - if (veFluidRecipe.getFluidIngredient(relationalTank.getRecipePos()).test(stack)) { + for (VERecipe recipe : tileEntity.getPotentialRecipes()) { + if (recipe.getFluidIngredient(relationalTank.getRecipePos()).test(stack)) { return true; } } diff --git a/src/main/java/com/veteam/voluminousenergy/util/SlotType.java b/src/main/java/com/veteam/voluminousenergy/util/SlotType.java index d75722863..0a6ac2cb1 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/SlotType.java +++ b/src/main/java/com/veteam/voluminousenergy/util/SlotType.java @@ -1,11 +1,11 @@ package com.veteam.voluminousenergy.util; public enum SlotType { - INPUT("slot.voluminousenergy.input_slot"), - OUTPUT("slot.voluminousenergy.output_slot"), - UPGRADE("slot.voluminousenergy.upgrade_slot"), - FLUID_INPUT("slot.voluminousenergy.input_slot",true), - FLUID_OUTPUT("slot.voluminousenergy.output_slot",true); + INPUT("tilePos.voluminousenergy.input_slot"), + OUTPUT("tilePos.voluminousenergy.output_slot"), + UPGRADE("tilePos.voluminousenergy.upgrade_slot"), + FLUID_INPUT("tilePos.voluminousenergy.input_slot",true), + FLUID_OUTPUT("tilePos.voluminousenergy.output_slot",true); private final String translationKey; private boolean isFluidBucketIORelated = false; private diff --git a/src/main/java/com/veteam/voluminousenergy/util/TextUtil.java b/src/main/java/com/veteam/voluminousenergy/util/TextUtil.java index de2f195e4..2c3631f94 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/TextUtil.java +++ b/src/main/java/com/veteam/voluminousenergy/util/TextUtil.java @@ -17,10 +17,10 @@ public class TextUtil { // Slots - public static Component TRANSLATED_INPUT_SLOT = TextUtil.translateString("slot.voluminousenergy.input_slot"); - public static Component TRANSLATED_OUTPUT_SLOT = TextUtil.translateString("slot.voluminousenergy.output_slot"); - public static Component TRANSLATED_RNG_SLOT = TextUtil.translateString("slot.voluminousenergy.rng_slot"); - public static Component TRANSLATED_BUCKET_SLOT = TextUtil.translateString("slot.voluminousenergy.bucket_slot"); + public static Component TRANSLATED_INPUT_SLOT = TextUtil.translateString("tilePos.voluminousenergy.input_slot"); + public static Component TRANSLATED_OUTPUT_SLOT = TextUtil.translateString("tilePos.voluminousenergy.output_slot"); + public static Component TRANSLATED_RNG_SLOT = TextUtil.translateString("tilePos.voluminousenergy.rng_slot"); + public static Component TRANSLATED_BUCKET_SLOT = TextUtil.translateString("tilePos.voluminousenergy.bucket_slot"); // Tanks public static Component TRANSLATED_INPUT_TANK = TextUtil.translateString("tank.voluminousenergy.input_tank"); diff --git a/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java b/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java index f91514fd7..6667b40f1 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java +++ b/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.util; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; @@ -84,7 +84,7 @@ public void setIOItemstack(ItemStack input, ItemStack output) { * @param id The ID which is mapped to the output fluid id in the arraylist for the recipes outputfluids * @return true if the fluid can be inserted into the tank */ - public boolean canInsertOutputFluid(VEFluidRecipe recipe, int id) { + public boolean canInsertOutputFluid(VERecipe recipe, int id) { return (this.getTank().isEmpty() || this.tank.getFluid().equals(recipe.getOutputFluids().get(id))) && this.getTank().getFluidAmount() + recipe.getOutputFluids().get(id).getAmount() <= this.tank.getCapacity(); } @@ -94,7 +94,7 @@ public boolean canInsertOutputFluid(VEFluidRecipe recipe, int id) { * @param id The recipe ingredient ID to fill. Should be first checked with canInsertFluid separately * especially if there are multiple outputs */ - public void fillOutput(VEFluidRecipe recipe, int id) { + public void fillOutput(VERecipe recipe, int id) { FluidStack stack = recipe.getOutputFluid(id); @@ -105,20 +105,6 @@ public void fillOutput(VEFluidRecipe recipe, int id) { } } - public void setValidator(VETileEntity tileEntity,boolean isInput) { - this.tank.setValidator(t -> { - for(Recipe recipe : tileEntity.getPotentialRecipes()) { - VEFluidRecipe veFluidRecipe = (VEFluidRecipe) recipe; - if(isInput && veFluidRecipe.getFluidIngredient(this.getRecipePos()).test(t)) { - return true; - } else if(veFluidRecipe.getOutputFluid(this.getRecipePos()).isFluidEqual(t)) { - return true; - } - } - return false; - }); - } - /** * The id will be located in the Recipe file itself. * To find the id the easiest way is to go to the fromJson in a recipe's serializer. @@ -128,7 +114,7 @@ public void setValidator(VETileEntity tileEntity,boolean isInput) { * @param recipe The recipe to pull the input from * @param id The id of the input fluid */ - public void drainInput(VEFluidRecipe recipe, int id) { + public void drainInput(VERecipe recipe, int id) { this.tank.drain(recipe.getFluidIngredients().get(id).getFluids()[0].getAmount(), IFluidHandler.FluidAction.EXECUTE); } diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidIngredient.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidIngredient.java index 6a6d7b119..edbe48356 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidIngredient.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidIngredient.java @@ -78,7 +78,7 @@ public FluidStack[] getFluids() { return this.fluidStacks; } - public int getCount() { + public int getAmountNeeded() { return getFluids()[0].getAmount(); } diff --git a/src/main/resources/data/voluminousenergy/tags/fluids/combustable.json b/src/main/resources/data/voluminousenergy/tags/fluids/combustable.json new file mode 100644 index 000000000..edd3ac5b6 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/tags/fluids/combustable.json @@ -0,0 +1,15 @@ +{ + "replace": false, + "values": [ + "voluminousenergy:crude_oil", + "voluminousenergy:liquefied_coke", + "voluminousenergy:liquefied_coal", + "voluminousenergy:nitroglycerin", + "voluminousenergy:biofuel", + "voluminousenergy:treethanol", + "voluminousenergy:naphtha", + "voluminousenergy:gasoline", + "voluminousenergy:light_fuel", + "voluminousenergy:diesel" + ] +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/tags/fluids/oxidizer.json b/src/main/resources/data/voluminousenergy/tags/fluids/oxidizer.json new file mode 100644 index 000000000..9908d7d4b --- /dev/null +++ b/src/main/resources/data/voluminousenergy/tags/fluids/oxidizer.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "voluminousenergy:compressed_air", + "voluminousenergy:oxygen", + "voluminousenergy:dinitrogen_tetroxide" + ] +} \ No newline at end of file From 948be38ee0b3de9071f169844f7d061944d13f86 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Sat, 9 Mar 2024 18:46:20 -0500 Subject: [PATCH 07/27] Recipe and tile rework parts --- .../blocks/blocks/DimensionalLaserBlock.java | 5 +- .../blocks/blocks/VEBlocks.java | 96 +++--- .../blocks/machines/AirCompressorBlock.java | 4 +- .../blocks/blocks/machines/CrusherBlock.java | 3 +- .../blocks/blocks/machines/SawmillBlock.java | 5 +- .../machines/StirlingGeneratorBlock.java | 5 +- .../blocks/machines/ToolingStationBlock.java | 5 +- .../blocks/containers/VEContainerFactory.java | 1 + .../blocks/containers/VEContainers.java | 245 +++++++------- .../blocks/screens/AirCompressorScreen.java | 12 +- .../blocks/tiles/AqueoulizerTile.java | 2 +- .../blocks/tiles/CombustionGeneratorTile.java | 9 +- .../blocks/tiles/GasFiredFurnaceTile.java | 13 +- .../blocks/tiles/HydroponicIncubatorTile.java | 6 +- .../blocks/tiles/ToolingStationTile.java | 4 +- .../blocks/tiles/VETileEntities.java | 305 +++++++++++++++++- .../blocks/tiles/VETileEntity.java | 6 +- .../blocks/tiles/VETileFactory.java | 14 +- .../entity/LaserBlockEntityRenderer.java | 19 +- .../compat/jei/VoluminousEnergyPlugin.java | 4 +- .../jei/category/CombustionCategory.java | 13 +- .../tools/multitool/CombustionMultitool.java | 7 +- .../recipe/AqueoulizerRecipe.java | 13 +- .../recipe/CentrifugalAgitatorRecipe.java | 12 + .../recipe/CentrifugalSeparatorRecipe.java | 21 +- .../CombustionGeneratorFuelRecipe.java | 68 ---- .../CombustionGeneratorOxidizerRecipe.java | 65 ---- .../recipe/CombustionGeneratorRecipe.java | 68 ++++ .../recipe/CompressorRecipe.java | 12 +- .../recipe/CrusherRecipe.java | 15 +- .../recipe/DimensionalLaserRecipe.java | 8 + .../recipe/DistillationRecipe.java | 15 +- .../recipe/ElectrolyzerRecipe.java | 20 +- .../recipe/FluidElectrolyzerRecipe.java | 11 + .../recipe/FluidMixerRecipe.java | 11 + .../recipe/HydroponicIncubatorRecipe.java | 19 +- .../recipe/ImplosionCompressorRecipe.java | 14 +- .../recipe/IndustrialBlastingRecipe.java | 14 +- .../recipe/PrimitiveBlastFurnaceRecipe.java | 10 + .../voluminousenergy/recipe/RecipeCache.java | 84 ----- .../recipe/StirlingGeneratorRecipe.java | 15 +- .../recipe/ToolingRecipe.java | 10 +- .../recipe/VEFluidSawmillRecipe.java | 8 +- .../recipe/VERNGExperienceRecipe.java | 2 +- ...VEFluidRNGRecipe.java => VERNGRecipe.java} | 6 +- .../voluminousenergy/recipe/VERecipe.java | 4 +- .../voluminousenergy/recipe/VERecipes.java | 26 +- .../recipe/parser/DimensionalLaserParser.java | 75 +++++ .../recipe/parser/HydroponicParser.java | 60 ++++ .../recipe/parser/RNGRecipeParser.java | 65 ++++ .../recipe/parser/RecipeParser.java | 25 +- ...ssor.java => AbstractRecipeProcessor.java} | 2 +- .../processor/AirCompressorProcessor.java | 79 +++++ .../recipe/processor/DefaultProcessor.java | 2 +- .../recipe/processor/GeneratorProcessor.java | 8 +- .../serializer/FluidSerializerHelper.java | 7 +- .../IngredientSerializerHelper.java | 6 +- .../tools/sidemanager/VESlotManager.java | 22 -- .../util/VERelationalTank.java | 8 + .../recipes/fuel_combustion/biofuel.json | 10 - .../recipes/fuel_combustion/combustible.json | 13 + .../recipes/fuel_combustion/crude_oil.json | 10 - .../recipes/fuel_combustion/diesel.json | 10 - .../recipes/fuel_combustion/gasoline.json | 10 - .../recipes/fuel_combustion/light_fuel.json | 10 - .../fuel_combustion/liquefied_coal.json | 10 - .../fuel_combustion/liquefied_coke.json | 10 - .../recipes/fuel_combustion/naphtha.json | 10 - .../fuel_combustion/nitroglycerin.json | 10 - .../recipes/fuel_combustion/treethanol.json | 10 - .../{combustable.json => combustible.json} | 0 71 files changed, 1147 insertions(+), 659 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorFuelRecipe.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java rename src/main/java/com/veteam/voluminousenergy/recipe/{VEFluidRNGRecipe.java => VERNGRecipe.java} (74%) create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/parser/DimensionalLaserParser.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java rename src/main/java/com/veteam/voluminousenergy/recipe/processor/{RecipeProcessor.java => AbstractRecipeProcessor.java} (83%) create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java delete mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/biofuel.json create mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/combustible.json delete mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/crude_oil.json delete mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/diesel.json delete mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/gasoline.json delete mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/light_fuel.json delete mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coal.json delete mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coke.json delete mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/naphtha.json delete mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/nitroglycerin.json delete mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/treethanol.json rename src/main/resources/data/voluminousenergy/tags/fluids/{combustable.json => combustible.json} (100%) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java index 8649afe98..f4b13027a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java @@ -1,6 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks; import com.veteam.voluminousenergy.blocks.tiles.DimensionalLaserTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerPlayer; @@ -38,11 +39,11 @@ public DimensionalLaserBlock() { // NEW TICK SYSTEM @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { + protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, DimensionalLaserTile::serverTick); } - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { + public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { return blockEntityType == tile ? (BlockEntityTicker)serverTick : null; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java index 042f48429..052ae4cc1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java @@ -50,8 +50,8 @@ public class VEBlocks { //Primitive Blast public static RegistryObject PRIMITIVE_BLAST_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("primitiveblastfurnace", PrimitiveBlastFurnaceBlock::new); - public static RegistryObject> PRIMITIVE_BLAST_FURNACE_TILE = VE_TILE_REGISTRY.register("primitiveblastfurnace", - () -> BlockEntityType.Builder.of(PrimitiveBlastFurnaceTile::new,VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get()).build(null) ); + public static RegistryObject> PRIMITIVE_BLAST_FURNACE_TILE = VE_TILE_REGISTRY.register("primitiveblastfurnace", + () -> BlockEntityType.Builder.of(VETileEntities.PRIMITIVE_BLAST_FURNACE_FACTORY::create,VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get()).build(null) ); public static RegistryObject> PRIMITIVE_BLAST_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("primitiveblastfurnace", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -70,8 +70,8 @@ public class VEBlocks { //Crusher public static RegistryObject CRUSHER_BLOCK = VE_BLOCKS_REGISTRY.register("crusher", CrusherBlock::new); - public static RegistryObject> CRUSHER_TILE = VE_TILE_REGISTRY.register("crusher", - () -> BlockEntityType.Builder.of(CrusherTile::new,VEBlocks.CRUSHER_BLOCK.get()).build(null)); + public static RegistryObject> CRUSHER_TILE = VE_TILE_REGISTRY.register("crusher", + () -> BlockEntityType.Builder.of(VETileEntities.CRUSHER_FACTORY::create,VEBlocks.CRUSHER_BLOCK.get()).build(null)); public static RegistryObject> CRUSHER_CONTAINER = VE_CONTAINER_REGISTRY.register("crusher", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -80,8 +80,8 @@ public class VEBlocks { //Electrolyzer public static RegistryObject ELECTROLYZER_BLOCK = VE_BLOCKS_REGISTRY.register("electrolyzer", ElectrolyzerBlock::new); - public static RegistryObject> ELECTROLYZER_TILE = VE_TILE_REGISTRY.register("electrolyzer", - () -> BlockEntityType.Builder.of(ElectrolyzerTile::new,VEBlocks.ELECTROLYZER_BLOCK.get()).build(null)); + public static RegistryObject> ELECTROLYZER_TILE = VE_TILE_REGISTRY.register("electrolyzer", + () -> BlockEntityType.Builder.of(VETileEntities.ELECTROLYZER_FACTORY::create,VEBlocks.ELECTROLYZER_BLOCK.get()).build(null)); public static RegistryObject> ELECTROLYZER_CONTAINER = VE_CONTAINER_REGISTRY.register("electrolyzer", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -90,8 +90,8 @@ public class VEBlocks { // Centrifugal Agitator public static RegistryObject CENTRIFUGAL_AGITATOR_BLOCK = VE_BLOCKS_REGISTRY.register("centrifugal_agitator", CentrifugalAgitatorBlock::new); - public static RegistryObject> CENTRIFUGAL_AGITATOR_TILE = VE_TILE_REGISTRY.register("centrifugal_agitator", - () -> BlockEntityType.Builder.of(CentrifugalAgitatorTile::new,VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get()).build(null)); + public static RegistryObject> CENTRIFUGAL_AGITATOR_TILE = VE_TILE_REGISTRY.register("centrifugal_agitator", + () -> BlockEntityType.Builder.of(VETileEntities.CENTRIFUGAL_AGITATOR_FACTORY::create,VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get()).build(null)); public static RegistryObject> CENTRIFUGAL_AGITATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("centrifugal_agitator", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -100,8 +100,8 @@ public class VEBlocks { // Compressor public static RegistryObject COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("compressor", CompressorBlock::new); - public static RegistryObject> COMPRESSOR_TILE = VE_TILE_REGISTRY.register("compressor", - () -> BlockEntityType.Builder.of(CompressorTile::new,VEBlocks.COMPRESSOR_BLOCK.get()).build(null)); + public static RegistryObject> COMPRESSOR_TILE = VE_TILE_REGISTRY.register("compressor", + () -> BlockEntityType.Builder.of(VETileEntities.COMPRESSOR_FACTORY::create,VEBlocks.COMPRESSOR_BLOCK.get()).build(null)); public static RegistryObject> COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("compressor", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -110,8 +110,8 @@ public class VEBlocks { // Stirling Generator public static RegistryObject STIRLING_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("stirling_generator", StirlingGeneratorBlock::new); - public static RegistryObject> STIRLING_GENERATOR_TILE = VE_TILE_REGISTRY.register("stirling_generator", - () -> BlockEntityType.Builder.of(StirlingGeneratorTile::new,VEBlocks.STIRLING_GENERATOR_BLOCK.get()).build(null)); + public static RegistryObject> STIRLING_GENERATOR_TILE = VE_TILE_REGISTRY.register("stirling_generator", + () -> BlockEntityType.Builder.of(VETileEntities.STIRLING_GENERATOR_FACTORY::create,VEBlocks.STIRLING_GENERATOR_BLOCK.get()).build(null)); public static RegistryObject> STIRLING_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("stirling_generator", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -120,8 +120,8 @@ public class VEBlocks { // Combustion Generator public static RegistryObject COMBUSTION_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("combustion_generator", CombustionGeneratorBlock::new); - public static RegistryObject> COMBUSTION_GENERATOR_TILE = VE_TILE_REGISTRY.register("combustion_generator", - () -> BlockEntityType.Builder.of(CombustionGeneratorTile::new,VEBlocks.COMBUSTION_GENERATOR_BLOCK.get()).build(null)); + public static RegistryObject> COMBUSTION_GENERATOR_TILE = VE_TILE_REGISTRY.register("combustion_generator", + () -> BlockEntityType.Builder.of(VETileEntities.COMBUSTION_GENERATOR_FACTORY::create,VEBlocks.COMBUSTION_GENERATOR_BLOCK.get()).build(null)); public static RegistryObject> COMBUSTION_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("combustion_generator", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -140,8 +140,8 @@ public class VEBlocks { // Air Compressor public static RegistryObject AIR_COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("air_compressor", AirCompressorBlock::new); - public static RegistryObject> AIR_COMPRESSOR_TILE = VE_TILE_REGISTRY.register("air_compressor", - () -> BlockEntityType.Builder.of(AirCompressorTile::new,VEBlocks.AIR_COMPRESSOR_BLOCK.get()).build(null)); + public static RegistryObject> AIR_COMPRESSOR_TILE = VE_TILE_REGISTRY.register("air_compressor", + () -> BlockEntityType.Builder.of(VETileEntities.AIR_COMPRESSOR_FACTORY::create,VEBlocks.AIR_COMPRESSOR_BLOCK.get()).build(null)); public static RegistryObject> AIR_COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("air_compressor", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -150,8 +150,8 @@ public class VEBlocks { // Distillation Unit public static RegistryObject DISTILLATION_UNIT_BLOCK = VE_BLOCKS_REGISTRY.register("distillation_unit", DistillationUnitBlock::new); - public static RegistryObject> DISTILLATION_UNIT_TILE = VE_TILE_REGISTRY.register("distillation_unit", - () -> BlockEntityType.Builder.of(DistillationUnitTile::new,VEBlocks.DISTILLATION_UNIT_BLOCK.get()).build(null)); + public static RegistryObject> DISTILLATION_UNIT_TILE = VE_TILE_REGISTRY.register("distillation_unit", + () -> BlockEntityType.Builder.of(VETileEntities.DISTILLATION_UNIT_FACTORY::create,VEBlocks.DISTILLATION_UNIT_BLOCK.get()).build(null)); public static RegistryObject> DISTILLATION_UNIT_CONTAINER = VE_CONTAINER_REGISTRY.register("distillation_unit", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -160,8 +160,8 @@ public class VEBlocks { // Pump public static RegistryObject PUMP_BLOCK = VE_BLOCKS_REGISTRY.register("pump", PumpBlock::new); - public static RegistryObject> PUMP_TILE = VE_TILE_REGISTRY.register("pump", - () -> BlockEntityType.Builder.of(PumpTile::new,VEBlocks.PUMP_BLOCK.get()).build(null)); + public static RegistryObject> PUMP_TILE = VE_TILE_REGISTRY.register("pump", + () -> BlockEntityType.Builder.of(VETileEntities.PUMP_FACTORY::create,VEBlocks.PUMP_BLOCK.get()).build(null)); public static RegistryObject> PUMP_CONTAINER = VE_CONTAINER_REGISTRY.register("pump", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -170,8 +170,8 @@ public class VEBlocks { // Gas Fired Furnace public static RegistryObject GAS_FIRED_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("gas_fired_furnace", GasFiredFurnaceBlock::new); - public static RegistryObject> GAS_FIRED_FURNACE_TILE = VE_TILE_REGISTRY.register("gas_fired_furnace", - () -> BlockEntityType.Builder.of(GasFiredFurnaceTile::new,VEBlocks.GAS_FIRED_FURNACE_BLOCK.get()).build(null)); + public static RegistryObject> GAS_FIRED_FURNACE_TILE = VE_TILE_REGISTRY.register("gas_fired_furnace", + () -> BlockEntityType.Builder.of(VETileEntities.GAS_FIRED_FURNACE::create,VEBlocks.GAS_FIRED_FURNACE_BLOCK.get()).build(null)); public static RegistryObject> GAS_FIRED_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("gas_fired_furnace", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -180,8 +180,8 @@ public class VEBlocks { // Electric Furnace public static RegistryObject ELECTRIC_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("electric_furnace", ElectricFurnaceBlock::new); - public static RegistryObject> ELECTRIC_FURNACE_TILE = VE_TILE_REGISTRY.register("electric_furnace", - () -> BlockEntityType.Builder.of(ElectricFurnaceTile::new,VEBlocks.ELECTRIC_FURNACE_BLOCK.get()).build(null)); + public static RegistryObject> ELECTRIC_FURNACE_TILE = VE_TILE_REGISTRY.register("electric_furnace", + () -> BlockEntityType.Builder.of(VETileEntities.ELECTRIC_FURNACE_FACTORY::create,VEBlocks.ELECTRIC_FURNACE_BLOCK.get()).build(null)); public static RegistryObject> ELECTRIC_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("electric_furnace", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -190,8 +190,8 @@ public class VEBlocks { // Battery Box public static RegistryObject BATTERY_BOX_BLOCK = VE_BLOCKS_REGISTRY.register("battery_box", BatteryBoxBlock::new); - public static RegistryObject> BATTERY_BOX_TILE = VE_TILE_REGISTRY.register("battery_box", - () -> BlockEntityType.Builder.of(BatteryBoxTile::new,VEBlocks.BATTERY_BOX_BLOCK.get()).build(null)); + public static RegistryObject> BATTERY_BOX_TILE = VE_TILE_REGISTRY.register("battery_box", + () -> BlockEntityType.Builder.of(VETileEntities.BATTERY_BOX_FACTORY::create,VEBlocks.BATTERY_BOX_BLOCK.get()).build(null)); public static RegistryObject> BATTERY_BOX_CONTAINER = VE_CONTAINER_REGISTRY.register("battery_box", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -200,8 +200,8 @@ public class VEBlocks { // Primitive Solar Panel public static RegistryObject PRIMITIVE_SOLAR_PANEL_BLOCK = VE_BLOCKS_REGISTRY.register("primitive_solar_panel", PrimitiveSolarPanelBlock::new); - public static RegistryObject> PRIMITIVE_SOLAR_PANEL_TILE = VE_TILE_REGISTRY.register("primitive_solar_panel", - () -> BlockEntityType.Builder.of(PrimitiveSolarPanelTile::new,VEBlocks.PRIMITIVE_SOLAR_PANEL_BLOCK.get()).build(null)); + public static RegistryObject> PRIMITIVE_SOLAR_PANEL_TILE = VE_TILE_REGISTRY.register("primitive_solar_panel", + () -> BlockEntityType.Builder.of(VETileEntities.PRIMITIVE_SOLAR_PANEL_FACTORY::create,VEBlocks.PRIMITIVE_SOLAR_PANEL_BLOCK.get()).build(null)); public static RegistryObject> PRIMITIVE_SOLAR_PANEL_CONTAINER = VE_CONTAINER_REGISTRY.register("primitive_solar_panel", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -210,8 +210,8 @@ public class VEBlocks { // Solar Panel public static RegistryObject SOLAR_PANEL_BLOCK = VE_BLOCKS_REGISTRY.register("solar_panel", SolarPanelBlock::new); - public static RegistryObject> SOLAR_PANEL_TILE = VE_TILE_REGISTRY.register("solar_panel", - () -> BlockEntityType.Builder.of(SolarPanelTile::new,VEBlocks.SOLAR_PANEL_BLOCK.get()).build(null)); + public static RegistryObject> SOLAR_PANEL_TILE = VE_TILE_REGISTRY.register("solar_panel", + () -> BlockEntityType.Builder.of(VETileEntities.SOLAR_PANEL_FACTORY::create,VEBlocks.SOLAR_PANEL_BLOCK.get()).build(null)); public static RegistryObject> SOLAR_PANEL_CONTAINER = VE_CONTAINER_REGISTRY.register("solar_panel", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -220,8 +220,8 @@ public class VEBlocks { // Centrifugal Separator public static RegistryObject CENTRIFUGAL_SEPARATOR_BLOCK = VE_BLOCKS_REGISTRY.register("centrifugal_separator", CentrifugalSeparatorBlock::new); - public static RegistryObject> CENTRIFUGAL_SEPARATOR_TILE = VE_TILE_REGISTRY.register("centrifugal_separator", - () -> BlockEntityType.Builder.of(CentrifugalSeparatorTile::new,VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get()).build(null)); + public static RegistryObject> CENTRIFUGAL_SEPARATOR_TILE = VE_TILE_REGISTRY.register("centrifugal_separator", + () -> BlockEntityType.Builder.of(VETileEntities.CENTRIFUGAL_SEPARATOR_FACTORY::create,VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get()).build(null)); public static RegistryObject> CENTRIFUGAL_SEPARATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("centrifugal_separator", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -230,8 +230,8 @@ public class VEBlocks { // Implosion Compressor public static RegistryObject IMPLOSION_COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("implosion_compressor", ImplosionCompressorBlock::new); - public static RegistryObject> IMPLOSION_COMPRESSOR_TILE = VE_TILE_REGISTRY.register("implosion_compressor", - () -> BlockEntityType.Builder.of(ImplosionCompressorTile::new,VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get()).build(null)); + public static RegistryObject> IMPLOSION_COMPRESSOR_TILE = VE_TILE_REGISTRY.register("implosion_compressor", + () -> BlockEntityType.Builder.of(VETileEntities.IMPLOSION_COMPRESSOR_FACTORY::create,VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get()).build(null)); public static RegistryObject> IMPLOSION_COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("implosion_compressor", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -240,8 +240,8 @@ public class VEBlocks { // Blast Furnace public static RegistryObject BLAST_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("blast_furnace", BlastFurnaceBlock::new); - public static RegistryObject> BLAST_FURNACE_TILE = VE_TILE_REGISTRY.register("blast_furnace", - () -> BlockEntityType.Builder.of(BlastFurnaceTile::new,VEBlocks.BLAST_FURNACE_BLOCK.get()).build(null)); + public static RegistryObject> BLAST_FURNACE_TILE = VE_TILE_REGISTRY.register("blast_furnace", + () -> BlockEntityType.Builder.of(VETileEntities.BLAST_FURNACE_FACTORY::create,VEBlocks.BLAST_FURNACE_BLOCK.get()).build(null)); public static RegistryObject> BLAST_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("blast_furnace", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -250,8 +250,8 @@ public class VEBlocks { // Tooling Station public static RegistryObject TOOLING_STATION_BLOCK = VE_BLOCKS_REGISTRY.register("tooling_station", ToolingStationBlock::new); - public static RegistryObject> TOOLING_STATION_TILE = VE_TILE_REGISTRY.register("tooling_station", - () -> BlockEntityType.Builder.of(ToolingStationTile::new,VEBlocks.TOOLING_STATION_BLOCK.get()).build(null)); + public static RegistryObject> TOOLING_STATION_TILE = VE_TILE_REGISTRY.register("tooling_station", + () -> BlockEntityType.Builder.of(VETileEntities.TOOLING_STATION_FACTORY::create,VEBlocks.TOOLING_STATION_BLOCK.get()).build(null)); public static RegistryObject> TOOLING_STATION_CONTAINER = VE_CONTAINER_REGISTRY.register("tooling_station", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -260,8 +260,8 @@ public class VEBlocks { // Sawmill public static RegistryObject SAWMILL_BLOCK = VE_BLOCKS_REGISTRY.register("sawmill", SawmillBlock::new); - public static RegistryObject> SAWMILL_TILE = VE_TILE_REGISTRY.register("sawmill", - () -> BlockEntityType.Builder.of(SawmillTile::new,VEBlocks.SAWMILL_BLOCK.get()).build(null)); + public static RegistryObject> SAWMILL_TILE = VE_TILE_REGISTRY.register("sawmill", + () -> BlockEntityType.Builder.of(VETileEntities.SAWMILL_FACTORY::create,VEBlocks.SAWMILL_BLOCK.get()).build(null)); public static RegistryObject> SAWMILL_CONTAINER = VE_CONTAINER_REGISTRY.register("sawmill", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -270,8 +270,8 @@ public class VEBlocks { // Dimensional Laser public static RegistryObject DIMENSIONAL_LASER_BLOCK = VE_BLOCKS_REGISTRY.register("dimensional_laser", DimensionalLaserBlock::new); - public static RegistryObject> DIMENSIONAL_LASER_TILE = VE_TILE_REGISTRY.register("dimensional_laser", - () -> BlockEntityType.Builder.of(DimensionalLaserTile::new,VEBlocks.DIMENSIONAL_LASER_BLOCK.get()).build(null)); + public static RegistryObject> DIMENSIONAL_LASER_TILE = VE_TILE_REGISTRY.register("dimensional_laser", + () -> BlockEntityType.Builder.of(VETileEntities.DIMENSIONAL_LASER_FACTORY::create,VEBlocks.DIMENSIONAL_LASER_BLOCK.get()).build(null)); public static RegistryObject> DIMENSIONAL_LASER_CONTAINER = VE_CONTAINER_REGISTRY.register("dimensional_laser", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -280,8 +280,8 @@ public class VEBlocks { // Fluid Electrolyzer public static RegistryObject FLUID_ELECTROLYZER_BLOCK = VE_BLOCKS_REGISTRY.register("fluid_electrolyzer", FluidElectrolyzerBlock::new); - public static RegistryObject> FLUID_ELECTROLYZER_TILE = VE_TILE_REGISTRY.register("fluid_electrolyzer", - () -> BlockEntityType.Builder.of(FluidElectrolyzerTile::new,VEBlocks.FLUID_ELECTROLYZER_BLOCK.get()).build(null)); + public static RegistryObject> FLUID_ELECTROLYZER_TILE = VE_TILE_REGISTRY.register("fluid_electrolyzer", + () -> BlockEntityType.Builder.of(VETileEntities.FLUID_ELECTROLYZER_FACTORY::create,VEBlocks.FLUID_ELECTROLYZER_BLOCK.get()).build(null)); public static RegistryObject> FLUID_ELECTROLYZER_CONTAINER = VE_CONTAINER_REGISTRY.register("fluid_electrolyzer", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -290,8 +290,8 @@ public class VEBlocks { // Fluid Mixer public static RegistryObject FLUID_MIXER_BLOCK = VE_BLOCKS_REGISTRY.register("fluid_mixer", FluidMixerBlock::new); - public static RegistryObject> FLUID_MIXER_TILE = VE_TILE_REGISTRY.register("fluid_mixer", - () -> BlockEntityType.Builder.of(FluidMixerTile::new,VEBlocks.FLUID_MIXER_BLOCK.get()).build(null)); + public static RegistryObject> FLUID_MIXER_TILE = VE_TILE_REGISTRY.register("fluid_mixer", + () -> BlockEntityType.Builder.of(VETileEntities.FLUID_MIXER_FACTORY::create,VEBlocks.FLUID_MIXER_BLOCK.get()).build(null)); public static RegistryObject> FLUID_MIXER_CONTAINER = VE_CONTAINER_REGISTRY.register("fluid_mixer", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); @@ -300,8 +300,8 @@ public class VEBlocks { // Hydroponic Incubator public static RegistryObject HYDROPONIC_INCUBATOR_BLOCK = VE_BLOCKS_REGISTRY.register("hydroponic_incubator", HydroponicIncubatorBlock::new); - public static RegistryObject> HYDROPONIC_INCUBATOR_TILE = VE_TILE_REGISTRY.register("hydroponic_incubator", - () -> BlockEntityType.Builder.of(HydroponicIncubatorTile::new,VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get()).build(null)); + public static RegistryObject> HYDROPONIC_INCUBATOR_TILE = VE_TILE_REGISTRY.register("hydroponic_incubator", + () -> BlockEntityType.Builder.of(VETileEntities.HYDROPONIC_INCUBATOR_FACTORY::create,VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get()).build(null)); public static RegistryObject> HYDROPONIC_INCUBATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("hydroponic_incubator", () -> IForgeMenuType.create((id, inv, data)-> { BlockPos pos = data.readBlockPos(); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AirCompressorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AirCompressorBlock.java index 7eaf32bad..a71b46f16 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AirCompressorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AirCompressorBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.AirCompressorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -30,7 +30,7 @@ public AirCompressorBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new AirCompressorTile(pos, state); + return VETileEntities.AIR_COMPRESSOR_FACTORY.create(pos,state); } // NEW TICK SYSTEM diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java index 32e48c9a1..1082efc9f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java @@ -2,6 +2,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.tiles.CrusherTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -36,7 +37,7 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta // NEW TICK SYSTEM @Nullable - protected static BlockEntityTicker createCrusherTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType crusherTile) { + protected static BlockEntityTicker createCrusherTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType crusherTile) { return level.isClientSide ? null : createTickerHelper(passedBlockEntity, crusherTile, CrusherTile::serverTick); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java index 19a34adf3..03a428065 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java @@ -3,6 +3,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlock; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.tiles.SawmillTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -79,11 +80,11 @@ public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { // Replaces // NEW TICK SYSTEM @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { + protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, SawmillTile::serverTick); } - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { + public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { return blockEntityType == tile ? (BlockEntityTicker) serverTick : null; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java index 1f494ff4d..ea1be6fc1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java @@ -3,6 +3,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.blocks.util.FaceableBlock; import com.veteam.voluminousenergy.blocks.tiles.StirlingGeneratorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerPlayer; @@ -42,11 +43,11 @@ public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { // Replaces // NEW TICK SYSTEM @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { + protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, StirlingGeneratorTile::serverTick); } - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { + public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { return blockEntityType == tile ? (BlockEntityTicker) serverTick : null; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ToolingStationBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ToolingStationBlock.java index 693c1beae..36c2420f0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ToolingStationBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ToolingStationBlock.java @@ -3,6 +3,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.blocks.util.FaceableBlock; import com.veteam.voluminousenergy.blocks.tiles.ToolingStationTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerPlayer; @@ -43,11 +44,11 @@ public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { // Replaces // NEW TICK SYSTEM @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { + protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, ToolingStationTile::serverTick); } - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { + public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { return blockEntityType == tile ? (BlockEntityTicker) serverTick : null; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java index fc1a09945..4878c25d1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java @@ -85,6 +85,7 @@ public VEContainerFactoryBuilder create(RegistryObject> me private int index = 0; + @Deprecated public VEContainerFactoryBuilder addSlot(int x, int y) { this.factory.slots.add(new Slot(index++, x, y)); return this; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java index aeb747f33..898a1041c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java @@ -2,194 +2,195 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory.VEContainerFactoryBuilder; import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.*; -import net.minecraft.core.Direction; import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.*; +import static net.minecraft.core.Direction.*; public class VEContainers { public static final VEContainerFactory AIR_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() .create(AIR_COMPRESSOR_CONTAINER, AIR_COMPRESSOR_BLOCK) - .addSlot(70, 18,new BucketInputSlot(Direction.UP,0)) // Air Compressor bucket input tilePos - .addSlot(70, 49,new BucketOutputSlot(Direction.DOWN)) // Air Compressor bucket output tilePos + .addSlot(70, 18,new BucketInputSlot(UP,0)) // Air Compressor bucket input tilePos + .addSlot(70, 49,new BucketOutputSlot(DOWN)) // Air Compressor bucket output tilePos .addSlot(154, -14) // Upgrade Slot .build(); public static final VEContainerFactory AQUEOULIZER_FACTORY = new VEContainerFactoryBuilder() .create(AQUEOULIZER_CONTAINER, AQUEOULIZER_BLOCK) - .addSlot(38, 18, new BucketInputSlot(Direction.UP,0)) - .addSlot(38, 49, new BucketOutputSlot(Direction.DOWN)) - .addSlot(137, 18, new BucketInputSlot(Direction.NORTH,1)) - .addSlot(137, 49, new BucketOutputSlot(Direction.SOUTH)) - .addSlot(96, 32, new ItemInputSlot(Direction.EAST, 0)) + .addSlot(38, 18, new BucketInputSlot(UP,0)) + .addSlot(38, 49, new BucketOutputSlot(DOWN)) + .addSlot(137, 18, new BucketInputSlot(NORTH,1)) + .addSlot(137, 49, new BucketOutputSlot(SOUTH)) + .addSlot(96, 32, new ItemInputSlot(EAST)) .addUpgradeSlot(130, -14) .build(); public static final VEContainerFactory BATTERY_BOX_FACTORY = new VEContainerFactoryBuilder() .create(BATTERY_BOX_CONTAINER, BATTERY_BOX_BLOCK) - .addSlot(35, 17,new InputSlot(Direction.UP)) - .addSlot(53, 17,new InputSlot(Direction.UP)) - .addSlot(71, 17,new InputSlot(Direction.UP)) - .addSlot(89, 17,new InputSlot(Direction.UP)) - .addSlot(107, 17,new InputSlot(Direction.UP)) - .addSlot(125, 17,new InputSlot(Direction.UP)) + .addSlot(35, 17,new InputSlot(UP)) + .addSlot(53, 17,new InputSlot(UP)) + .addSlot(71, 17,new InputSlot(UP)) + .addSlot(89, 17,new InputSlot(UP)) + .addSlot(107, 17,new InputSlot(UP)) + .addSlot(125, 17,new InputSlot(UP)) //Bottom Slots - .addSlot(35, 54,new InputSlot(Direction.DOWN)) - .addSlot(53, 54,new InputSlot(Direction.DOWN)) - .addSlot(71, 54,new InputSlot(Direction.DOWN)) - .addSlot(89, 54,new InputSlot(Direction.DOWN)) - .addSlot(107, 54,new InputSlot(Direction.DOWN)) - .addSlot(125, 54,new InputSlot(Direction.DOWN)) + .addSlot(35, 54,new InputSlot(DOWN)) + .addSlot(53, 54,new InputSlot(DOWN)) + .addSlot(71, 54,new InputSlot(DOWN)) + .addSlot(89, 54,new InputSlot(DOWN)) + .addSlot(107, 54,new InputSlot(DOWN)) + .addSlot(125, 54,new InputSlot(DOWN)) .build(); public static final VEContainerFactory BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(BLAST_FURNACE_CONTAINER, BLAST_FURNACE_BLOCK) - .addSlot(38, 18) // Fluid input tilePos - .addSlot(38, 49) // Extract fluid from heat tank - .addSlot(80, 25) // First input tilePos - .addSlot(80, 43) // Second input tilePos - .addSlot(134, 34) // Third input tilePos - .addSlot(130, -14) // Upgrade tilePos. + .addSlot(38, 18,new BucketInputSlot(UP,0)) // Fluid input tilePos + .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from heat tank + .addSlot(80, 25, new InputSlot(EAST)) // First input tilePos + .addSlot(80, 43, new InputSlot(WEST)) // Second input tilePos + .addSlot(134, 34, new ItemOutputSlot(NORTH)) // Third input tilePos + .addUpgradeSlot(130, -14) // Upgrade tilePos. .build(); public static final VEContainerFactory CENTRIFUGAL_AGITATOR_FACTORY = new VEContainerFactoryBuilder() .create(CENTRIFUGAL_AGITATOR_CONTAINER, CENTRIFUGAL_AGITATOR_BLOCK) - .addSlot(38, 18) // Bucket insert; input tank - .addSlot(38, 49) // Bucket extract; input tank - .addSlot(96, 18) // Bucket insert; first output tank - .addSlot(96, 49) // Bucket extract; first output tank - .addSlot(137, 18) // Bucket insert; second output tank - .addSlot(137, 49) // Bucket extract; second output tank - .addSlot(130, -14) // Upgrade tilePos + .addSlot(38, 18,new BucketInputSlot(UP,0)) // Bucket insert; input tank + .addSlot(38, 49,new BucketOutputSlot(DOWN)) // Bucket extract; input tank + .addSlot(96, 18, new BucketInputSlot(NORTH,1)) // Bucket insert; first output tank + .addSlot(96, 49, new BucketOutputSlot(SOUTH)) // Bucket extract; first output tank + .addSlot(137, 18, new BucketInputSlot(EAST,2)) // Bucket insert; second output tank + .addSlot(137, 49, new BucketOutputSlot(WEST)) // Bucket extract; second output tank + .addUpgradeSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory CENTRIFUGAL_SEPARATOR_FACTORY = new VEContainerFactoryBuilder() .create(CENTRIFUGAL_SEPARATOR_CONTAINER, CENTRIFUGAL_SEPARATOR_BLOCK) - .addSlot(53, 24) // Primary input tilePos - .addSlot(53, 42) // Empty Bucket tilePos - .addSlot(99, 33) //Main Output - .addSlot(117, 15) //RNG #1 Slot - .addSlot(135, 33) //RNG #2 Slot - .addSlot(117, 51) //RNG #3 Slot - .addSlot(155, -14) // Upgrade Slot + .addSlot(53, 24,new ItemInputSlot(UP)) // Primary input tilePos + .addSlot(53, 42,new ItemInputSlot(WEST)) // Empty Bucket tilePos + .addSlot(99, 33, new ItemOutputSlot(DOWN)) //Main Output + .addSlot(117, 15, new ItemOutputSlot(NORTH)) //RNG #1 Slot + .addSlot(135, 33, new ItemOutputSlot(SOUTH)) //RNG #2 Slot + .addSlot(117, 51, new ItemOutputSlot(EAST)) //RNG #3 Slot + .addUpgradeSlot(155, -14) // Upgrade Slot .build(); public static final VEContainerFactory COMBUSTION_GENERATOR_FACTORY = new VEContainerFactoryBuilder() .create(COMBUSTION_GENERATOR_CONTAINER, COMBUSTION_GENERATOR_BLOCK) - .addSlot(38, 18) // Oxidizer input tilePos - .addSlot(38, 49) // Extract fluid from oxidizer tilePos - .addSlot(138, 18) // Fuel input tilePos - .addSlot(138, 49) // Extract fluid from fuel output + .addSlot(38, 18,new BucketInputSlot(UP,0)) // Oxidizer input tilePos + .addSlot(38, 49,new BucketOutputSlot(DOWN)) // Extract fluid from oxidizer tilePos + .addSlot(138, 18,new BucketInputSlot(NORTH,1)) // Fuel input tilePos + .addSlot(138, 49,new BucketOutputSlot(SOUTH)) // Extract fluid from fuel output .build(); public static final VEContainerFactory COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() .create(COMPRESSOR_CONTAINER, COMPRESSOR_BLOCK) - .addSlot(80, 13) - .addSlot(80, 58) //Main Output - .addSlot(154, -14) //Upgrade tilePos + .addSlot(80, 13,new ItemInputSlot(UP)) + .addSlot(80, 58,new ItemOutputSlot(DOWN)) //Main Output + .addUpgradeSlot(154, -14) //Upgrade tilePos .build(); public static final VEContainerFactory CRUSHER_FACTORY = new VEContainerFactoryBuilder() .create(CRUSHER_CONTAINER, CRUSHER_BLOCK) - .addSlot(80, 13) - .addSlot(80, 58) //Main Output - .addSlot(154, -14) //Upgrade tilePos + .addSlot(80, 13,new ItemInputSlot(UP)) // Input Slot + .addSlot(71, 58, new ItemOutputSlot(DOWN)) //Main Output + .addSlot(89,58,new ItemOutputSlot(NORTH)) // RNG slot + .addUpgradeSlot(154, -14) //Upgrade tilePos .build(); public static final VEContainerFactory DIMENSIONAL_LASER_FACTORY = new VEContainerFactoryBuilder() .create(DIMENSIONAL_LASER_CONTAINER, DIMENSIONAL_LASER_BLOCK) - .addSlot(138, 18) // Bucket top tilePos - .addSlot(138, 49) // Bucket bottom tilePos - .addSlot(38, 33) // RFID chip tilePos - .addSlot(130, -14) // Upgrade tilePos + .addSlot(138, 18,new BucketInputSlot(UP,0)) // Bucket top tilePos + .addSlot(138, 49, new BucketOutputSlot(DOWN)) // Bucket bottom tilePos + .addSlot(38, 33, new ItemInputSlot(NORTH)) // RFID chip tilePos + .addUpgradeSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory DISTILLATION_UNIT_FACTORY = new VEContainerFactoryBuilder() .create(DISTILLATION_UNIT_CONTAINER, DISTILLATION_UNIT_BLOCK) - .addSlot(38, 18) // Fluid input tilePos - .addSlot(38, 49) // Extract fluid from input - .addSlot(96, 11) // Top tilePos for first output - .addSlot(96, 42) // Bottom tilePos for first output - .addSlot(137, 11) // Top tilePos for from second output - .addSlot(137, 42) // Bottom tilePos for second output - .addSlot(122, 64) // Item Output Slot - .addSlot(130, -14) // Upgrade tilePos + .addSlot(38, 18,new BucketInputSlot(UP,0)) // Fluid input tilePos + .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from input + .addSlot(96, 11, new BucketInputSlot(UP,1)) // Top tilePos for first output + .addSlot(96, 42, new BucketOutputSlot(DOWN)) // Bottom tilePos for first output + .addSlot(137, 11,new BucketInputSlot(UP,2)) // Top tilePos for from second output + .addSlot(137, 42, new BucketOutputSlot(DOWN)) // Bottom tilePos for second output + .addSlot(122, 64,new ItemOutputSlot(DOWN)) // Item Output Slot + .addUpgradeSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory ELECTRIC_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(ELECTRIC_FURNACE_CONTAINER, ELECTRIC_FURNACE_BLOCK) - .addSlot(53, 33) // Furnace Input Slot - .addSlot(116, 33) // Furnace Output Slot - .addSlot(154, -14)// Upgrade Slot + .addSlot(53, 33,new ItemInputSlot(UP)) // Furnace Input Slot + .addSlot(116, 33, new ItemOutputSlot(DOWN)) // Furnace Output Slot + .addUpgradeSlot(154, -14)// Upgrade Slot .build(); public static final VEContainerFactory ELECTROLYZER_FACTORY = new VEContainerFactoryBuilder() .create(ELECTROLYZER_CONTAINER, ELECTROLYZER_BLOCK) - .addSlot(71, 13) - .addSlot(89, 13) // Empty Bucket tilePos - .addSlot(53, 57) //Main Output - .addSlot(71, 57) //RNG #1 Slot - .addSlot(89, 57) //RNG #2 Slot - .addSlot(107, 57) //RNG #3 Slot - .addSlot(154, -14) // Upgrade Slot + .addSlot(71, 13,new ItemInputSlot(UP)) + .addSlot(89, 13,new ItemInputSlot(WEST)) // Empty Bucket tilePos + .addSlot(53, 57, new ItemOutputSlot(DOWN)) //Main Output + .addSlot(71, 57, new ItemOutputSlot(NORTH)) //RNG #1 Slot + .addSlot(89, 57, new ItemOutputSlot(SOUTH)) //RNG #2 Slot + .addSlot(107, 57, new ItemOutputSlot(EAST)) //RNG #3 Slot + .addUpgradeSlot(154, -14) // Upgrade Slot .build(); public static final VEContainerFactory FLUID_ELECTROLYZER_FACTORY = new VEContainerFactoryBuilder() .create(FLUID_ELECTROLYZER_CONTAINER, FLUID_ELECTROLYZER_BLOCK) - .addSlot(38, 18) // Top input bucket - .addSlot(38, 49) // Bottom input bucket - .addSlot(96, 18) // Top output0 bucket - .addSlot(96, 49) // Bottom output0 bucket - .addSlot(137, 18) // Top output1 bucket - .addSlot(137, 49) // Bottom output1 bucket - .addSlot(130, -14) // Upgrade tilePos + .addSlot(38, 18,new BucketInputSlot(UP,0)) // Top input bucket + .addSlot(38, 49,new BucketOutputSlot(DOWN)) // Bottom input bucket + .addSlot(96, 18,new BucketInputSlot(EAST,1)) // Top output0 bucket + .addSlot(96, 49,new BucketOutputSlot(WEST)) // Bottom output0 bucket + .addSlot(137, 18,new BucketInputSlot(NORTH,2)) // Top output1 bucket + .addSlot(137, 49,new BucketOutputSlot(SOUTH)) // Bottom output1 bucket + .addUpgradeSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory FLUID_MIXER_FACTORY = new VEContainerFactoryBuilder() .create(FLUID_MIXER_CONTAINER, FLUID_MIXER_BLOCK) - .addSlot(38, 18) // Top input0 bucket - .addSlot(38, 49) // Bottom input0 bucket - .addSlot(86, 18) // Top input1 bucket - .addSlot(86, 49) // Bottom input1 bucket - .addSlot(136, 18) // Top output0 bucket - .addSlot(136, 49) // Bottom output0 bucket - .addSlot(130, -14) // Upgrade tilePos + .addSlot(38, 18,new BucketInputSlot(UP,0)) // Top input0 bucket + .addSlot(38, 49,new BucketOutputSlot(DOWN)) // Bottom input0 bucket + .addSlot(86, 18,new BucketInputSlot(EAST,1)) // Top input1 bucket + .addSlot(86, 49,new BucketOutputSlot(WEST)) // Bottom input1 bucket + .addSlot(136, 18,new BucketInputSlot(NORTH,2)) // Top output0 bucket + .addSlot(136, 49,new BucketOutputSlot(SOUTH)) // Bottom output0 bucket + .addUpgradeSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory GAS_FIRED_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(GAS_FIRED_FURNACE_CONTAINER, GAS_FIRED_FURNACE_BLOCK) - .addSlot(8, 18) // Fluid input tilePos - .addSlot(8, 49) // Extract fluid from input - .addSlot(53, 33) // Item input tilePos - .addSlot(116, 33) // Item output tilePos - .addSlot(154, -14) // Upgrade tilePos + .addSlot(8, 18,new BucketInputSlot(UP,0)) // Fluid input tilePos + .addSlot(8, 49,new BucketOutputSlot(DOWN)) // Extract fluid from input + .addSlot(53, 33,new ItemInputSlot(EAST)) // Item input tilePos + .addSlot(116, 33,new ItemOutputSlot(WEST)) // Item output tilePos + .addUpgradeSlot(154, -14) // Upgrade tilePos .build(); public static final VEContainerFactory HYDROPONIC_INCUBATOR_FACTORY = new VEContainerFactoryBuilder() .create(HYDROPONIC_INCUBATOR_CONTAINER, HYDROPONIC_INCUBATOR_BLOCK) - .addSlot(38, 18) // Bucket top tilePos - .addSlot(38, 49) // Bucket bottom tilePos - .addSlot(83, 34) // Primary input - .addSlot(123, 8) // Primary output - .addSlot(123, 26) // RNG0 output - .addSlot(123, 44) // RNG1 output - .addSlot(123, 62) // RNG2 output - .addSlot(154, -14) // Upgrade tilePos + .addSlot(38, 18, new BucketInputSlot(UP,0)) // Bucket top tilePos + .addSlot(38, 49,new BucketOutputSlot(DOWN)) // Bucket bottom tilePos + .addSlot(83, 34, new ItemInputSlot(NORTH)) // Primary input + .addSlot(123, 8, new ItemOutputSlot(NORTH)) // Primary output + .addSlot(123, 26, new ItemOutputSlot(NORTH)) // RNG0 output + .addSlot(123, 44, new ItemOutputSlot(NORTH)) // RNG1 output + .addSlot(123, 62, new ItemOutputSlot(NORTH)) // RNG2 output + .addUpgradeSlot(154, -14) // Upgrade tilePos .build(); public static final VEContainerFactory IMPLOSION_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() .create(IMPLOSION_COMPRESSOR_CONTAINER, IMPLOSION_COMPRESSOR_BLOCK) - .addSlot(53, 23) // Main input - .addSlot(53, 41) // Gunpowder tilePos - .addSlot(116, 33) //Main Output - .addSlot(154, -14) //Upgrade tilePos + .addSlot(53, 23,new ItemInputSlot(UP)) // Main input + .addSlot(53, 41, new ItemInputSlot(EAST)) // Gunpowder tilePos + .addSlot(116, 33, new ItemOutputSlot(DOWN)) //Main Output + .addUpgradeSlot(154, -14) //Upgrade tilePos .build(); public static final VEContainerFactory PRIMITIVE_BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(PRIMITIVE_BLAST_FURNACE_CONTAINER, PRIMITIVE_BLAST_FURNACE_BLOCK) - .addSlot(53, 33) - .addSlot(116, 33) - .addSlot(154, -14) + .addSlot(53, 33,new ItemInputSlot(UP)) + .addSlot(116, 33, new ItemOutputSlot(DOWN)) + .addUpgradeSlot(154, -14) .build(); public static final VEContainerFactory PRIMITIVE_SOLAR_PANEL_FACTORY = new VEContainerFactoryBuilder() @@ -198,23 +199,23 @@ public class VEContainers { public static final VEContainerFactory PRIMITIVE_STIRLING_GENERATOR_FACTORY = new VEContainerFactoryBuilder() .create(PRIMITIVE_STIRLING_GENERATOR_CONTAINER, PRIMITIVE_STIRLING_GENERATOR_BLOCK) - .addSlot(80, 35, new ItemInputSlot(Direction.UP, 0)) + .addSlot(80, 35, new ItemInputSlot(UP)) .build(); public static final VEContainerFactory PUMP_FACTORY = new VEContainerFactoryBuilder() .create(PUMP_CONTAINER, PUMP_BLOCK) - .addSlot(70, 18) // Pump bucket input tilePos - .addSlot(70, 49) // Pump bucket output tilePos + .addSlot(70, 18,new BucketInputSlot(UP, 0)) // Pump bucket input tilePos + .addSlot(70, 49, new BucketOutputSlot(DOWN)) // Pump bucket output tilePos .build(); public static final VEContainerFactory SAWMILL_FACTORY = new VEContainerFactoryBuilder() .create(SAWMILL_CONTAINER, SAWMILL_BLOCK) - .addSlot(44, 32) // Log input tilePos - .addSlot(80, 24) // Plank Output - .addSlot(80, 42) // Secondary Output - .addSlot(115, 18) // Bucket Input - .addSlot(115, 49) // Bucket Output - .addSlot(154, -14) // Upgrade Slot + .addSlot(44, 32,new ItemInputSlot(UP)) // Log input tilePos + .addSlot(80, 24,new ItemOutputSlot(DOWN)) // Plank Output + .addSlot(80, 42, new ItemOutputSlot(NORTH)) // Secondary Output + .addSlot(115, 18, new BucketInputSlot(SOUTH,0)) // Bucket Input + .addSlot(115, 49, new BucketOutputSlot(EAST)) // Bucket Output + .addUpgradeSlot(154, -14) // Upgrade Slot .build(); public static final VEContainerFactory SOLAR_PANEL_FACTORY = new VEContainerFactoryBuilder() @@ -223,17 +224,17 @@ public class VEContainers { public static final VEContainerFactory STIRLING_GENERATOR_FACTORY = new VEContainerFactoryBuilder() .create(STIRLING_GENERATOR_CONTAINER, STIRLING_GENERATOR_BLOCK) - .addSlot(80, 35) + .addSlot(80, 35,new ItemInputSlot(UP)) .build(); // TOOLING STATION UNUSED public static final VEContainerFactory TOOLING_STATION_FACTORY = new VEContainerFactoryBuilder() .create(TOOLING_STATION_CONTAINER, TOOLING_STATION_BLOCK) - .addSlot(38, 18) // Fluid input tilePos - .addSlot(38, 49) // Extract fluid from input - .addSlot(86, 32) // Main Tool tilePos - .addSlot(134, 18) // Bit Slot - .addSlot(134, 49) // Base Slot - .addSlot(154, -14) // Upgrade Slot + .addSlot(38, 18,new BucketInputSlot(UP,0)) // Fluid input tilePos + .addSlot(38, 49,new BucketOutputSlot(DOWN)) // Extract fluid from input + .addSlot(86, 32, new ItemInputSlot(NORTH)) // Main Tool tilePos + .addSlot(134, 18, new ItemInputSlot(SOUTH)) // Bit Slot + .addSlot(134, 49, new ItemInputSlot(EAST)) // Base Slot + .addUpgradeSlot(154, -14) // Upgrade Slot .build(); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java index be6ec8053..53efeae9f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.AirCompressorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; @@ -16,13 +16,13 @@ public class AirCompressorScreen extends VEContainerScreen { - private AirCompressorTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/air_compressor_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public AirCompressorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); - tileEntity = (AirCompressorTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -66,8 +66,8 @@ protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { } if (isHovering(93, 18, 12, 50, mouseX, mouseY)){ // Oxidizer Tank - String name = tileEntity.getAirTankFluid().getTranslationKey(); - int amount = tileEntity.getAirTankFluid().getAmount(); + String name = tileEntity.getFluidStackFromTank(0).getTranslationKey(); + int amount = tileEntity.getFluidStackFromTank(0).getAmount(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } @@ -97,7 +97,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(this.GUI,i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getAirTankFluid(),tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); } catch (Exception e){ } // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java index 2b2cc23b5..ab4c4bba9 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java @@ -33,7 +33,7 @@ public class AqueoulizerTile extends VETileEntity { add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); add(new VESlotManager(2, Direction.NORTH, true, SlotType.FLUID_INPUT, 3, 1)); add(new VESlotManager(3, Direction.SOUTH, true, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(4, 0, Direction.EAST, true, SlotType.INPUT)); +// add(new VESlotManager(4, 0, Direction.EAST, true, SlotType.INPUT)); }}; @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java index bfa7c28b9..07c57fd49 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java @@ -2,11 +2,10 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; +import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorOxidizerRecipe; import com.veteam.voluminousenergy.recipe.RecipeCache; import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -68,7 +67,7 @@ public class CombustionGeneratorTile extends VETileEntity { public CombustionGeneratorTile(BlockPos pos, BlockState state) { super(VEBlocks.COMBUSTION_GENERATOR_TILE.get(), pos, state, null); fluidManagers.get(0).getTank().setValidator(fluid -> { - List recipes = CombustionGeneratorFuelRecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE); + List recipes = CombustionGeneratorRecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE); return recipes.stream().anyMatch(r -> r.getFluidIngredient(0).test(fluid)); }); fluidManagers.get(1).getTank().setValidator(fluid -> { @@ -139,7 +138,7 @@ public void validateRecipe() { new ArrayList<>()); fuelRecipe = RecipeCache.getFluidRecipeFromCache(level, - CombustionGeneratorFuelRecipe.RECIPE_TYPE, + CombustionGeneratorRecipe.RECIPE_TYPE, Collections.singletonList(fluidManagers.get(0).getTank().getFluid()), new ArrayList<>()); } @@ -193,7 +192,7 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { if (fluid.isSame(Fluids.EMPTY)) return true; FluidStack testFluid = new FluidStack(fluid, COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT); if (slot == 0) { - List recipes = VERecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE); + List recipes = VERecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE); return recipes.stream().anyMatch(r -> r.getFluidIngredient(0).test(testFluid)); } else if (slot == 2) { List recipes = VERecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java index 40547f64a..ceadabdf4 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java @@ -3,15 +3,14 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.items.VEItems; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; +import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; import com.veteam.voluminousenergy.recipe.RecipeCache; import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TagUtil; import com.veteam.voluminousenergy.util.TankType; +import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; @@ -86,7 +85,7 @@ public List getSlotManagers() { private SmeltingRecipe furnaceRecipe; private BlastingRecipe blastingRecipe; - private CombustionGeneratorFuelRecipe fuelRecipe; + private CombustionGeneratorRecipe fuelRecipe; @Override public void tick() { @@ -172,8 +171,8 @@ public void validateRecipe() { else furnaceRecipe = null; if(blastingRecipeNew != null) blastingRecipe = blastingRecipeNew.value(); else blastingRecipe = null; - fuelRecipe = (CombustionGeneratorFuelRecipe) - RecipeCache.getFluidRecipeFromCache(level, CombustionGeneratorFuelRecipe.RECIPE_TYPE, Collections.singletonList(fuelTank.getTank().getFluid()), new ArrayList<>()); + fuelRecipe = (CombustionGeneratorRecipe) + RecipeCache.getFluidRecipeFromCache(level, CombustionGeneratorRecipe.RECIPE_TYPE, Collections.singletonList(fuelTank.getTank().getFluid()), new ArrayList<>()); } @Override @@ -213,7 +212,7 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { Fluid fluid = bucketItem.getFluid(); if (fluid.isSame(Fluids.EMPTY)) return true; FluidStack fluidStack = new FluidStack(bucketItem.getFluid(), 1000); - return VERecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE) + return VERecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE) .stream().anyMatch(r -> r.getFluidIngredient(0).test(fluidStack)); } else if (slot == 2) { return level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(stack), level).orElse(null) != null diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java index ce3992604..634e64dd7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java @@ -3,7 +3,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.HydroponicIncubatorRecipe; -import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; +import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; @@ -132,8 +132,8 @@ void processRecipe() { } } - VEFluidRNGRecipe irngRecipe = null; - if(recipe instanceof VEFluidRNGRecipe rec) { + VERNGRecipe irngRecipe = null; + if(recipe instanceof VERNGRecipe rec) { irngRecipe = rec; } Random r = new Random(); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java index bb4719a44..a7aac78e1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java @@ -5,7 +5,7 @@ import com.veteam.voluminousenergy.items.tools.multitool.Multitool; import com.veteam.voluminousenergy.items.tools.multitool.VEMultitools; import com.veteam.voluminousenergy.items.tools.multitool.bits.BitItem; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; +import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; import com.veteam.voluminousenergy.recipe.RecipeCache; import com.veteam.voluminousenergy.recipe.ToolingRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; @@ -158,7 +158,7 @@ public void validateRecipe() { } this.isRecipeDirty = false; fuelRecipe = - RecipeCache.getFluidRecipeFromCache(level, CombustionGeneratorFuelRecipe.RECIPE_TYPE, + RecipeCache.getFluidRecipeFromCache(level, CombustionGeneratorRecipe.RECIPE_TYPE, Collections.singletonList(this.fuelTank.getTank().getFluid()), new ArrayList<>()); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index 2d30625ad..001f8f94d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -4,17 +4,28 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.FluidInputTank; import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.FluidOutputTank; -import com.veteam.voluminousenergy.recipe.AqueoulizerRecipe; -import com.veteam.voluminousenergy.recipe.StirlingGeneratorRecipe; -import com.veteam.voluminousenergy.recipe.VERecipes; +import com.veteam.voluminousenergy.recipe.processor.AirCompressorProcessor; import com.veteam.voluminousenergy.recipe.processor.DefaultProcessor; import com.veteam.voluminousenergy.recipe.processor.GeneratorProcessor; import com.veteam.voluminousenergy.tools.Config; +import static com.veteam.voluminousenergy.recipe.VERecipes.VERecipeTypes.*; + public class VETileEntities { static final int DEFAULT_TANK_CAPACITY = 4000; + public static final VETileFactory AIR_COMPRESSOR_FACTORY = + new VETileFactory(VEBlocks.AIR_COMPRESSOR_TILE,VEContainers.AIR_COMPRESSOR_FACTORY) + .addEnergyStorageWithConsumption( + Config.AIR_COMPRESSOR_MAX_POWER.get(), + Config.AIR_COMPRESSOR_TRANSFER.get(), + Config.AIR_COMPRESSOR_POWER_USAGE.get() + ) + .countable() + .makesSound() + .withCustomRecipeProcessing(new AirCompressorProcessor()); + public static final VETileFactory AQUEOULIZER_TILE_FACTORY = new VETileFactory(VEBlocks.AQUEOULIZER_TILE, VEContainers.AQUEOULIZER_FACTORY) .addEnergyStorageWithConsumption( @@ -25,17 +36,295 @@ public class VETileEntities { new FluidOutputTank(0, DEFAULT_TANK_CAPACITY)) .countable() .makesSound() - .withRecipe(VERecipes.VERecipeTypes.AQUEOULIZING) - .withRecipeProcessing(new DefaultProcessor()); + .withRecipe(AQUEOULIZING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + + // TODO processing + public static final VETileFactory BATTERY_BOX_FACTORY = + new VETileFactory(VEBlocks.BATTERY_BOX_TILE, VEContainers.BATTERY_BOX_FACTORY) + .addEnergyStorage( + Config.BATTERY_BOX_MAX_POWER.get(), + Config.BATTERY_BOX_TRANSFER.get()); + + // TODO processing + public static final VETileFactory BLAST_FURNACE_FACTORY = + new VETileFactory(VEBlocks.BLAST_FURNACE_TILE, VEContainers.BLAST_FURNACE_FACTORY) + .addEnergyStorageWithConsumption( + Config.BLAST_FURNACE_MAX_POWER.get(), + Config.BLAST_FURNACE_TRANSFER.get(), + Config.BLAST_FURNACE_POWER_USAGE.get()) + .withTanks( + new FluidInputTank(0,DEFAULT_TANK_CAPACITY) + ) + .countable() + .makesSound() + .withRecipe(INDUSTRIAL_BLASTING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + public static final VETileFactory CENTRIFUGAL_AGITATOR_FACTORY = + new VETileFactory(VEBlocks.CENTRIFUGAL_AGITATOR_TILE, VEContainers.CENTRIFUGAL_AGITATOR_FACTORY) + .addEnergyStorageWithConsumption( + Config.CENTRIFUGAL_AGITATOR_MAX_POWER.get(), + Config.CENTRIFUGAL_AGITATOR_TRANSFER.get(), + Config.CENTRIFUGAL_AGITATOR_POWER_USAGE.get()) + .withTanks( + new FluidInputTank(0, DEFAULT_TANK_CAPACITY), + new FluidOutputTank(0, DEFAULT_TANK_CAPACITY), + new FluidOutputTank(1, DEFAULT_TANK_CAPACITY) + ) + .countable() + .makesSound() + .withRecipe(CENTRIFUGAL_AGITATING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + public static final VETileFactory CENTRIFUGAL_SEPARATOR_FACTORY = + new VETileFactory(VEBlocks.CENTRIFUGAL_SEPARATOR_TILE, VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY) + .addEnergyStorageWithConsumption( + Config.CENTRIFUGAL_SEPARATOR_MAX_POWER.get(), + Config.CENTRIFUGAL_SEPARATOR_TRANSFER.get(), + Config.CENTRIFUGAL_SEPARATOR_POWER_USAGE.get()) + .countable() + .makesSound() + .withRecipe(CENTRIFUGAL_SEPARATION) + .withCustomRecipeProcessing(new DefaultProcessor()); + + // TODO processing + + public static final VETileFactory COMBUSTION_GENERATOR_FACTORY = + new VETileFactory(VEBlocks.COMBUSTION_GENERATOR_TILE, VEContainers.COMBUSTION_GENERATOR_FACTORY) + .addEnergyStorage( + Config.COMBUSTION_GENERATOR_MAX_POWER.get(), + Config.COMBUSTION_GENERATOR_SEND.get()) + .withTanks( + new FluidInputTank(0, DEFAULT_TANK_CAPACITY), + new FluidInputTank(1, DEFAULT_TANK_CAPACITY)) + .countable() + .makesSound() + .sendsOutPower() + .withRecipe(FUEL_COMBUSTION) + .withCustomRecipeProcessing(new DefaultProcessor()); + + public static final VETileFactory COMPRESSOR_FACTORY = + new VETileFactory(VEBlocks.COMPRESSOR_TILE, VEContainers.COMPRESSOR_FACTORY) + .addEnergyStorageWithConsumption( + Config.COMPRESSOR_MAX_POWER.get(), + Config.COMPRESSOR_TRANSFER.get(), + Config.COMPRESSOR_POWER_USAGE.get()) + .countable() + .makesSound() + .withRecipe(COMPRESSING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + + // TODO needs the rng impl for the processor + public static final VETileFactory CRUSHER_FACTORY = + new VETileFactory(VEBlocks.CRUSHER_TILE, VEContainers.CRUSHER_FACTORY) + .addEnergyStorageWithConsumption( + Config.CRUSHER_MAX_POWER.get(), + Config.CRUSHER_TRANSFER.get(), + Config.CRUSHER_POWER_USAGE.get()) + .countable() + .makesSound() + .withRecipe(CRUSHING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + + // TODO needs some custom processing + public static final VETileFactory DIMENSIONAL_LASER_FACTORY = + new VETileFactory(VEBlocks.DIMENSIONAL_LASER_TILE, VEContainers.DIMENSIONAL_LASER_FACTORY) + .addEnergyStorageWithConsumption( + Config.DIMENSIONAL_LASER_MAX_POWER.get(), + Config.DIMENSIONAL_LASER_TRANSFER.get(), + Config.DIMENSIONAL_LASER_POWER_USAGE.get()) + .withTanks( + new FluidOutputTank(0, DEFAULT_TANK_CAPACITY) + ) + .countable() + .makesSound() + .withDataFlag("fully_built") + .withDataFlag("build_tick") + .withDataFlag("first_stage_built") + .withRecipe(DIMENSIONAL_LASING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + public static final VETileFactory DISTILLATION_UNIT_FACTORY = + new VETileFactory(VEBlocks.DISTILLATION_UNIT_TILE, VEContainers.DISTILLATION_UNIT_FACTORY) + .addEnergyStorageWithConsumption( + Config.DISTILLATION_UNIT_MAX_POWER.get(), + Config.DISTILLATION_UNIT_TRANSFER.get(), + Config.DIMENSIONAL_LASER_POWER_USAGE.get()) + .withTanks( + new FluidInputTank(0, DEFAULT_TANK_CAPACITY), + new FluidOutputTank(0, DEFAULT_TANK_CAPACITY), + new FluidOutputTank(1, DEFAULT_TANK_CAPACITY) + ) + .countable() + .makesSound() + .withRecipe(DISTILLING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + // TODO needs a furnace processor + public static final VETileFactory ELECTRIC_FURNACE_FACTORY = + new VETileFactory(VEBlocks.ELECTRIC_FURNACE_TILE, VEContainers.ELECTRIC_FURNACE_FACTORY) + .addEnergyStorageWithConsumption(Config.ELECTROLYZER_MAX_POWER.get(), + Config.ELECTRIC_FURNACE_TRANSFER.get(), + Config.ELECTRIC_FURNACE_POWER_USAGE.get()) + .countable() + .makesSound() + .withCustomRecipeProcessing(new DefaultProcessor()); + + public static final VETileFactory ELECTROLYZER_FACTORY = + new VETileFactory(VEBlocks.ELECTROLYZER_TILE, VEContainers.ELECTROLYZER_FACTORY) + .addEnergyStorageWithConsumption(Config.ELECTROLYZER_MAX_POWER.get(), + Config.ELECTRIC_FURNACE_TRANSFER.get(), + Config.ELECTRIC_FURNACE_POWER_USAGE.get()) + .countable() + .makesSound() + .withRecipe(ELECTROLYZING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + public static final VETileFactory FLUID_ELECTROLYZER_FACTORY = + new VETileFactory(VEBlocks.FLUID_ELECTROLYZER_TILE, VEContainers.FLUID_ELECTROLYZER_FACTORY) + .addEnergyStorageWithConsumption( + Config.FLUID_ELECTROLYZER_MAX_POWER.get(), + Config.FLUID_ELECTROLYZER_TRANSFER.get(), + Config.FLUID_ELECTROLYZER_POWER_USAGE.get() + ) + .countable() + .makesSound() + .withRecipe(ELECTROLYZING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + public static final VETileFactory FLUID_MIXER_FACTORY = + new VETileFactory(VEBlocks.FLUID_MIXER_TILE, VEContainers.FLUID_MIXER_FACTORY) + .addEnergyStorageWithConsumption( + Config.FLUID_MIXER_MAX_POWER.get(), + Config.FLUID_MIXER_TRANSFER.get(), + Config.FLUID_MIXER_POWER_USAGE.get() + ) + .withTanks( + new FluidInputTank(0, DEFAULT_TANK_CAPACITY), + new FluidInputTank(1, DEFAULT_TANK_CAPACITY), + new FluidOutputTank(0, DEFAULT_TANK_CAPACITY) + ) + .countable() + .makesSound() + .withRecipe(FLUID_MIXING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + // TODO needs processing + public static final VETileFactory GAS_FIRED_FURNACE = + new VETileFactory(VEBlocks.GAS_FIRED_FURNACE_TILE,VEContainers.GAS_FIRED_FURNACE_FACTORY) + .withTanks( + new FluidInputTank(0,DEFAULT_TANK_CAPACITY) + ) + .countable() + .makesSound() + .withCustomRecipeProcessing(new DefaultProcessor()); + + public static final VETileFactory HYDROPONIC_INCUBATOR_FACTORY = + new VETileFactory(VEBlocks.HYDROPONIC_INCUBATOR_TILE, VEContainers.HYDROPONIC_INCUBATOR_FACTORY) + .addEnergyStorageWithConsumption( + Config.HYDROPONIC_INCUBATOR_MAX_POWER.get(), + Config.HYDROPONIC_INCUBATOR_TRANSFER.get(), + Config.HYDROPONIC_INCUBATOR_POWER_USAGE.get() + ) + .withTanks( + new FluidInputTank(0, DEFAULT_TANK_CAPACITY) + ) + .countable() + .makesSound() + .withRecipe(HYDROPONIC_INCUBATING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + public static final VETileFactory IMPLOSION_COMPRESSOR_FACTORY = + new VETileFactory(VEBlocks.IMPLOSION_COMPRESSOR_TILE, VEContainers.IMPLOSION_COMPRESSOR_FACTORY) + .addEnergyStorageWithConsumption( + Config.IMPLOSION_COMPRESSOR_MAX_POWER.get(), + Config.IMPLOSION_COMPRESSOR_TRANSFER.get(), + Config.IMPLOSION_COMPRESSOR_POWER_USAGE.get() + ) + .countable() + .makesSound() + .withRecipe(IMPLOSION_COMPRESSING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + public static final VETileFactory PRIMITIVE_BLAST_FURNACE_FACTORY = + new VETileFactory(VEBlocks.PRIMITIVE_BLAST_FURNACE_TILE, VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY) + .countable() + .makesSound() + .withRecipe(INDUSTRIAL_BLASTING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + // TODO needs custom processor + public static final VETileFactory PRIMITIVE_SOLAR_PANEL_FACTORY = + new VETileFactory(VEBlocks.PRIMITIVE_SOLAR_PANEL_TILE,VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY) + .addEnergyStorage( + Config.PRIMITIVE_SOLAR_PANEL_MAX_POWER.get(), + Config.PRIMITIVE_SOLAR_PANEL_SEND.get() + ) + .sendsOutPower() + .withCustomRecipeProcessing(new DefaultProcessor()); public static final VETileFactory PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY = - new VETileFactory(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_TILE,VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY) + new VETileFactory(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_TILE, VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY) .addEnergyStorage( Config.PRIMITIVE_STIRLING_GENERATOR_MAX_POWER.get(), Config.PRIMITIVE_STIRLING_GENERATOR_SEND.get()) .countable() .makesSound() .sendsOutPower() - .withRecipe(VERecipes.VERecipeTypes.STIRLING) - .withRecipeProcessing(new GeneratorProcessor(true,4)); + .withRecipe(STIRLING) + .withCustomRecipeProcessing(new GeneratorProcessor(true, 4)); + + // TODO make a custom processor + public static final VETileFactory PUMP_FACTORY = + new VETileFactory(VEBlocks.PUMP_TILE,VEContainers.PUMP_FACTORY) + .addEnergyStorage( + Config.PUMP_MAX_POWER.get(), + Config.PUMP_TRANSFER.get() + ) + .withTanks(new FluidOutputTank(0,DEFAULT_TANK_CAPACITY)) + .countable() + .makesSound() + .withCustomRecipeProcessing(new DefaultProcessor()); + + // TODO make a custom processor + public static final VETileFactory SAWMILL_FACTORY = + new VETileFactory(VEBlocks.SAWMILL_TILE,VEContainers.SAWMILL_FACTORY) + .addEnergyStorage( + Config.SAWMILL_MAX_POWER.get(), + Config.SAWMILL_TRANSFER.get() + ) + .countable() + .makesSound() + .withRecipe(SAWMILLING) + .withCustomRecipeProcessing(new DefaultProcessor()); + + // TODO needs a custom processor + public static final VETileFactory SOLAR_PANEL_FACTORY = + new VETileFactory(VEBlocks.SOLAR_PANEL_TILE,VEContainers.SOLAR_PANEL_FACTORY) + .addEnergyStorage( + Config.SOLAR_PANEL_MAX_POWER.get(), + Config.SOLAR_PANEL_SEND.get() + ) + .sendsOutPower() + .withCustomRecipeProcessing(new DefaultProcessor()); + + public static final VETileFactory STIRLING_GENERATOR_FACTORY = + new VETileFactory(VEBlocks.STIRLING_GENERATOR_TILE,VEContainers.STIRLING_GENERATOR_FACTORY) + .addEnergyStorage( + Config.STIRLING_GENERATOR_MAX_POWER.get(), + Config.STIRLING_GENERATOR_SEND.get() + ) + .sendsOutPower() + .withRecipe(STIRLING) + .withCustomRecipeProcessing(new GeneratorProcessor()); + + // TODO needs a custom processor + public static final VETileFactory TOOLING_STATION_FACTORY = + new VETileFactory(VEBlocks.TOOLING_STATION_TILE,VEContainers.TOOLING_STATION_FACTORY) + .withRecipe(TOOLING) + .withCustomRecipeProcessing(new DefaultProcessor()); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 361a66704..2900cc496 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -1,11 +1,9 @@ package com.veteam.voluminousenergy.blocks.tiles; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.items.upgrades.MysteriousMultiplier; import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.processor.RecipeProcessor; +import com.veteam.voluminousenergy.recipe.processor.AbstractRecipeProcessor; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -60,7 +58,7 @@ public abstract class VETileEntity extends BlockEntity implements MenuProvider { final List tanks = new ArrayList<>(); final List managers = new ArrayList<>(); final HashMap dataMap = new HashMap<>(); - RecipeProcessor recipeProcessor; + AbstractRecipeProcessor recipeProcessor; boolean sendsOutPower; public VETileEntity(BlockEntityType type, BlockPos pos, BlockState state, RecipeType> recipeType) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java index 99c325d3b..b32694fb5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory; import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.processor.RecipeProcessor; +import com.veteam.voluminousenergy.recipe.processor.AbstractRecipeProcessor; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.SlotType; @@ -34,7 +34,7 @@ public class VETileFactory { private VEEnergyStorage storage; private final HashMap dataMap = new HashMap<>(); - private RecipeProcessor processor; + private AbstractRecipeProcessor processor; private boolean sendsOutPower = false; public VETileFactory(RegistryObject> tileRegistry, VEContainerFactory containerFactory) { @@ -132,7 +132,7 @@ public VETileFactory makesSound() { return this; } - public VETileFactory withRecipeProcessing(RecipeProcessor processor) { + public VETileFactory withCustomRecipeProcessing(AbstractRecipeProcessor processor) { this.processor = processor; return this; } @@ -142,10 +142,10 @@ public VETileFactory sendsOutPower() { return this; } - public record ItemInputSlot(Direction direction,int recipePos) implements TileSlot { + public record ItemInputSlot(Direction direction) implements TileSlot { @Override public VESlotManager asManager(int id) { - return new VESlotManager(id, recipePos, direction, true, SlotType.INPUT); + return new VESlotManager(id, direction, true, SlotType.INPUT); } } @@ -156,10 +156,10 @@ public VESlotManager asManager(int id) { } } - public record ItemOutputSlot(Direction direction,int recipePos) implements TileSlot { + public record ItemOutputSlot(Direction direction) implements TileSlot { @Override public VESlotManager asManager(int id) { - return new VESlotManager(id, recipePos, direction, true, SlotType.OUTPUT); + return new VESlotManager(id, direction, true, SlotType.OUTPUT); } } diff --git a/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java b/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java index 291ae29d9..f28585f01 100644 --- a/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java +++ b/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java @@ -5,6 +5,7 @@ import com.mojang.math.Axis; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.tiles.DimensionalLaserTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.sounds.VESounds; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.MultiBufferSource; @@ -29,7 +30,7 @@ import javax.annotation.Nonnull; @OnlyIn(Dist.CLIENT) -public class LaserBlockEntityRenderer implements BlockEntityRenderer { +public class LaserBlockEntityRenderer implements BlockEntityRenderer { public static final ResourceLocation BEAM_RESOURCE_LOCATION = new ResourceLocation(VoluminousEnergy.MODID, "textures/entity/beacon_beam.png"); @@ -38,7 +39,7 @@ public LaserBlockEntityRenderer(BlockEntityRendererProvider.Context pContext) { // If you want to modify things pull it from the DimensionalLaserTile @Override - public void render(DimensionalLaserTile dimensionalLaserTile, float f1, @NotNull PoseStack poseStack, @NotNull MultiBufferSource multiBufferSource, int i1, int i2) { + public void render(VETileEntity dimensionalLaserTile, float f1, @NotNull PoseStack poseStack, @NotNull MultiBufferSource multiBufferSource, int i1, int i2) { long gameTime = dimensionalLaserTile.getLevel().getGameTime(); // If this float is not 1,1,1 expect a black screen. You can modify these if you want special colors @@ -48,13 +49,17 @@ public void render(DimensionalLaserTile dimensionalLaserTile, float f1, @NotNull } - public void renderBeaconBeam(DimensionalLaserTile tile, PoseStack poseStack, MultiBufferSource multiBufferSource, float p_112188_, long gameTime, int totalHeight, int beaconListSize, float[] beaconColor, int height) { + public void renderBeaconBeam(VETileEntity tile, PoseStack poseStack, MultiBufferSource multiBufferSource, float p_112188_, long gameTime, int totalHeight, int beaconListSize, float[] beaconColor, int height) { + + int buildTick = tile.getData("build_tick"); + boolean fullyBuilt = tile.getData("fully_built") == 1; + boolean firstStageBuilt = tile.getData("first_stage_built") == 1; height += 2; - if (!tile.isFirstStageComplete()) { + if (!fullyBuilt) { height = 1; - } else if (tile.getTickTimer() < 5) { + } else if (buildTick < 5) { SoundManager manager = Minecraft.getInstance().getSoundManager(); manager.stop(VESounds.ENERGY_BEAM_ACTIVATE.getLocation(), SoundSource.BLOCKS); } @@ -86,7 +91,7 @@ public void renderBeaconBeam(DimensionalLaserTile tile, PoseStack poseStack, Mul PoseStack.Pose pose = poseStack.last(); Matrix4f matrix4f = pose.pose(); - if (!tile.isFirstStageComplete()) { + if (!firstStageBuilt) { poseStack.popPose(); return; } @@ -96,7 +101,7 @@ public void renderBeaconBeam(DimensionalLaserTile tile, PoseStack poseStack, Mul int zMiddle = (int) Math.ceil(arrayMap[0].length / 2F); // Calculate the completion percentage - float completionPercentage = (float) tile.getTickTimer() / 600; + float completionPercentage = (float) buildTick / 600; // Calculate the max radius for the spiral based on the completion percentage float maxRadius = (float) Math.sqrt(arrayMap.length * arrayMap.length + arrayMap[0].length * arrayMap[0].length) * completionPercentage; diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java index ef2fdc418..ddc84ca9a 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java @@ -12,7 +12,7 @@ import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.items.upgrades.MysteriousMultiplier; import com.veteam.voluminousenergy.recipe.*; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; +import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; import com.veteam.voluminousenergy.util.TextUtil; import mezz.jei.api.IModPlugin; import mezz.jei.api.JeiPlugin; @@ -92,7 +92,7 @@ public void registerRecipes(IRecipeRegistration registration) {// Add recipes registration.addRecipes(CrushingCategory.RECIPE_TYPE, getRecipesOfType(CrusherRecipe.RECIPE_TYPE)); registration.addRecipes(ElectrolyzingCategory.RECIPE_TYPE, getRecipesOfType(ElectrolyzerRecipe.RECIPE_TYPE)); registration.addRecipes(CompressingCategory.RECIPE_TYPE, getRecipesOfType(CompressorRecipe.RECIPE_TYPE)); - registration.addRecipes(CombustionCategory.RECIPE_TYPE, getRecipesOfType(CombustionGeneratorFuelRecipe.RECIPE_TYPE)); + registration.addRecipes(CombustionCategory.RECIPE_TYPE, getRecipesOfType(CombustionGeneratorRecipe.RECIPE_TYPE)); registration.addRecipes(StirlingCategory.RECIPE_TYPE, getRecipesOfType(StirlingGeneratorRecipe.RECIPE_TYPE)); registration.addRecipes(CentrifugalAgitationCategory.RECIPE_TYPE, getRecipesOfType(CentrifugalAgitatorRecipe.RECIPE_TYPE)); registration.addRecipes(AqueoulizingCategory.RECIPE_TYPE, getRecipesOfType(AqueoulizerRecipe.RECIPE_TYPE)); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java index b059bab30..a3b3616de 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java @@ -4,10 +4,9 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.screens.VEContainerScreen; import com.veteam.voluminousenergy.compat.jei.VoluminousEnergyPlugin; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; +import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorOxidizerRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.util.NumberUtil; import com.veteam.voluminousenergy.util.TextUtil; import mezz.jei.api.constants.VanillaTypes; @@ -35,12 +34,12 @@ import java.util.List; import java.util.Optional; -public class CombustionCategory implements IRecipeCategory { +public class CombustionCategory implements IRecipeCategory { private final IDrawable background; private final IDrawable icon; private final IDrawable slotDrawable; - public static final RecipeType RECIPE_TYPE = new RecipeType(VoluminousEnergyPlugin.COMBUSTING_UID, CombustionGeneratorFuelRecipe.class); + public static final RecipeType RECIPE_TYPE = new RecipeType(VoluminousEnergyPlugin.COMBUSTING_UID, CombustionGeneratorRecipe.class); public CombustionCategory(IGuiHelper guiHelper){ // 68, 12 | 40, 65 -> 10 px added for chance @@ -71,7 +70,7 @@ public CombustionCategory(IGuiHelper guiHelper){ } @Override - public void draw(CombustionGeneratorFuelRecipe recipe, IRecipeSlotsView slotsView, @NotNull GuiGraphics matrixStack, double mouseX, double mouseY){ + public void draw(CombustionGeneratorRecipe recipe, IRecipeSlotsView slotsView, @NotNull GuiGraphics matrixStack, double mouseX, double mouseY){ // Volumetric Energy label TextUtil.renderShadowedText( @@ -151,7 +150,7 @@ public void draw(CombustionGeneratorFuelRecipe recipe, IRecipeSlotsView slotsVie } - public void ingredientHandler(CombustionGeneratorFuelRecipe recipe, + public void ingredientHandler(CombustionGeneratorRecipe recipe, IIngredientAcceptor fuelAcceptor, IIngredientAcceptor oxidizerAcceptor) { @@ -169,7 +168,7 @@ public void ingredientHandler(CombustionGeneratorFuelRecipe recipe, } @Override - public void setRecipe(IRecipeLayoutBuilder recipeLayout, @NotNull CombustionGeneratorFuelRecipe recipe, @NotNull IFocusGroup focusGroup) { + public void setRecipe(IRecipeLayoutBuilder recipeLayout, @NotNull CombustionGeneratorRecipe recipe, @NotNull IFocusGroup focusGroup) { // Init IRecipeSlotBuilder fuel = recipeLayout.addSlot(RecipeIngredientRole.INPUT, 18, 36); IRecipeSlotBuilder oxidizer = recipeLayout.addSlot(RecipeIngredientRole.CATALYST, 86, 36); diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java index f9fa2bc2e..b7a954235 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java @@ -2,8 +2,7 @@ import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.items.tools.multitool.bits.MultitoolBit; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.util.NumberUtil; import com.veteam.voluminousenergy.util.TextUtil; @@ -213,14 +212,14 @@ public float getDestroySpeed(ItemStack itemStack, BlockState blockStateToMine) { private static int getVolumetricEnergyFromFluid(Fluid fluid) { - for(VERecipe recipe : VERecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE)) { + for(VERecipe recipe : VERecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE)) { if(recipe.getFluidIngredient(0).test(fluid)) return recipe.getFluidIngredientAmount(0); } return 0; } public static boolean isCombustibleFuel(Fluid fluid) { - for(VERecipe recipe : VERecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE)) { + for(VERecipe recipe : VERecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE)) { if(recipe.getFluidIngredient(0).test(fluid)) return true; } return false; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java index 8028649f5..9adf59d5d 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java @@ -20,21 +20,16 @@ public class AqueoulizerRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.AQUEOULIZING.get(); - private final RecipeParser parser; + private final RecipeParser parser = RecipeParser.forRecipe(this) + .addIngredient(4, 0) + .addFluidIngredient(0, 0) + .addFluidResult(1, 0); public AqueoulizerRecipe() { - parser = RecipeParser.forRecipe(this) - .addIngredient(new RecipeParser.SlotAndRecipePos(4, 0)) - .addFluidIngredient(new RecipeParser.SlotAndRecipePos(0, 0)) - .addFluidResult(new RecipeParser.SlotAndRecipePos(1, 0)); } public AqueoulizerRecipe(List i, List fi, List of, int processTime) { super(i, fi, of, List.of(), processTime); - parser = RecipeParser.forRecipe(this) - .addIngredient(new RecipeParser.SlotAndRecipePos(4, 0)) - .addFluidIngredient(new RecipeParser.SlotAndRecipePos(0, 0)) - .addFluidResult(new RecipeParser.SlotAndRecipePos(1, 0)); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java index c68796218..8263f74f8 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java @@ -3,6 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -18,7 +19,13 @@ public class CentrifugalAgitatorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_AGITATING.get(); + private final RecipeParser parser = RecipeParser.forRecipe(this) + .addFluidIngredient(0,0) + .addFluidResult(1,0) + .addFluidResult(2,1); + public CentrifugalAgitatorRecipe() { + } public CentrifugalAgitatorRecipe(List fi, List of, int processTime) { @@ -62,4 +69,9 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull VERecipe recipe) public @NotNull ItemStack getToastSymbol() { return new ItemStack(VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get()); } + + @Override + public RecipeParser getParser() { + return parser; + } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java index 494a61d19..02923a9eb 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java @@ -3,6 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.RNGRecipeParser; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -15,9 +17,18 @@ import java.util.ArrayList; import java.util.List; -public class CentrifugalSeparatorRecipe extends VEFluidRNGRecipe { +public class CentrifugalSeparatorRecipe extends VERNGRecipe { + + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_SEPARATION.get(); + + private final RecipeParser parser = RNGRecipeParser.forRecipe(this) + .addChancedItemResult(2,0) + .addChancedItemResult(3,1) + .addChancedItemResult(4,2) + .addChancedItemResult(5,3) + .addIngredient(0,0) + .addIngredient(1,1); - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_SEPARATION.get(); public CentrifugalSeparatorRecipe() { } @@ -56,6 +67,12 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CentrifugalSepar @Override public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + + @Override + public RecipeParser getParser() { + return parser; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorFuelRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorFuelRecipe.java deleted file mode 100644 index 7f2b28f07..000000000 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorFuelRecipe.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.veteam.voluminousenergy.recipe.CombustionGenerator; - -import com.mojang.serialization.Codec; -import com.mojang.serialization.codecs.RecordCodecBuilder; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.VERecipes; -import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; -import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.world.item.crafting.RecipeSerializer; -import net.minecraft.world.item.crafting.RecipeType; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class CombustionGeneratorFuelRecipe extends VERecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FUEL_COMBUSTION.get(); - private int volumetricEnergy; - - public CombustionGeneratorFuelRecipe() { - } - - public CombustionGeneratorFuelRecipe(List fi,int volumetricEnergy) { - super(new ArrayList<>(), fi, new ArrayList<>(), new ArrayList<>(), volumetricEnergy); - this.volumetricEnergy = volumetricEnergy; - } - - public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { - - public static final Codec VE_RECIPE_CODEC = RecordCodecBuilder.create((instance) -> instance.group( - VERecipeCodecs.VE_FLUID_INGREDIENT_CODEC.listOf().fieldOf("fluid_ingredients").forGetter((getter) -> getter.registryFluidIngredients), - Codec.INT.fieldOf("volumetric_energy").forGetter((getter) -> getter.volumetricEnergy) - ).apply(instance, CombustionGeneratorFuelRecipe::new)); - - private static final FluidSerializerHelper helper = new FluidSerializerHelper<>(); - - @Nullable - @Override - public CombustionGeneratorFuelRecipe fromNetwork(@NotNull FriendlyByteBuf buffer) { - CombustionGeneratorFuelRecipe recipe = new CombustionGeneratorFuelRecipe(); - recipe.volumetricEnergy = buffer.readInt(); - return helper.fromNetwork(recipe, buffer); - } - - @Override - public @NotNull Codec codec() { - return VE_RECIPE_CODEC; - } - - @Override - public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CombustionGeneratorFuelRecipe recipe) { - buffer.writeInt(recipe.volumetricEnergy); - helper.toNetwork(buffer, recipe); - } - }; - - @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} - - @Override - public @NotNull RecipeType getType(){return RECIPE_TYPE;} - - public int getVolumetricEnergy() {return volumetricEnergy;} - -} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java deleted file mode 100644 index 5ecf90f7e..000000000 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.veteam.voluminousenergy.recipe.CombustionGenerator; - -import com.mojang.serialization.Codec; -import com.mojang.serialization.codecs.RecordCodecBuilder; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.VERecipes; -import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; -import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; -import net.minecraft.network.FriendlyByteBuf; -import net.minecraft.world.item.crafting.RecipeSerializer; -import net.minecraft.world.item.crafting.RecipeType; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.ArrayList; -import java.util.List; - -public class CombustionGeneratorOxidizerRecipe extends VERecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.OXIDIZING.get(); - - public CombustionGeneratorOxidizerRecipe() { - - } - - public CombustionGeneratorOxidizerRecipe(List fi, int processTime) { - super(new ArrayList<>(), fi, new ArrayList<>(), new ArrayList<>(), processTime); - } - - public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { - public static final Codec VE_RECIPE_CODEC = RecordCodecBuilder.create((instance) -> instance.group( - VERecipeCodecs.VE_FLUID_INGREDIENT_CODEC.listOf().fieldOf("fluid_ingredients").forGetter((getter) -> getter.registryFluidIngredients), - Codec.INT.fieldOf("process_time").forGetter((getter) -> getter.processTime) - ).apply(instance, CombustionGeneratorOxidizerRecipe::new)); - - private static final FluidSerializerHelper helper = new FluidSerializerHelper<>(); - - @Nullable - @Override - public CombustionGeneratorOxidizerRecipe fromNetwork(@NotNull FriendlyByteBuf buffer) { - return helper.fromNetwork(new CombustionGeneratorOxidizerRecipe(), buffer); - } - - @Override - public @NotNull Codec codec() { - return VE_RECIPE_CODEC; - } - - @Override - public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CombustionGeneratorOxidizerRecipe recipe) { - helper.toNetwork(buffer, recipe); - } - }; - - @Override - public @NotNull RecipeSerializer getSerializer() { - return SERIALIZER; - } - - @Override - public @NotNull RecipeType getType() { - return RECIPE_TYPE; - } - -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java new file mode 100644 index 000000000..d809d6523 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java @@ -0,0 +1,68 @@ +package com.veteam.voluminousenergy.recipe; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; +import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.world.item.crafting.RecipeSerializer; +import net.minecraft.world.item.crafting.RecipeType; +import org.jetbrains.annotations.NotNull; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.List; + +public class CombustionGeneratorRecipe extends VERecipe { + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FUEL_COMBUSTION.get(); + + private final RecipeParser parser = RecipeParser.forRecipe(this) + .addFluidIngredient(0,0) + .addFluidIngredient(1,1); + + public CombustionGeneratorRecipe() { + } + + public CombustionGeneratorRecipe(List fi) { + super(new ArrayList<>(), fi, new ArrayList<>(), new ArrayList<>(), Config.COMBUSTION_GENERATOR_FIXED_TICK_TIME.get()); + } + + public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { + + public static final Codec VE_RECIPE_CODEC = RecordCodecBuilder.create((instance) -> instance.group( + VERecipeCodecs.VE_FLUID_INGREDIENT_CODEC.listOf().fieldOf("fluid_ingredients").forGetter((getter) -> getter.registryFluidIngredients) + ).apply(instance, CombustionGeneratorRecipe::new)); + + private static final FluidSerializerHelper helper = new FluidSerializerHelper<>(); + + @Nullable + @Override + public CombustionGeneratorRecipe fromNetwork(@NotNull FriendlyByteBuf buffer) { + return helper.fromNetwork(new CombustionGeneratorRecipe(), buffer); + } + + @Override + public @NotNull Codec codec() { + return VE_RECIPE_CODEC; + } + + @Override + public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CombustionGeneratorRecipe recipe) { + helper.toNetwork(buffer, recipe); + } + }; + + @Override + public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + + @Override + public RecipeParser getParser() { + return parser; + } + + @Override + public @NotNull RecipeType getType(){return RECIPE_TYPE;} + +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java index ef094cb9b..df0a5701c 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java @@ -3,6 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -16,7 +17,11 @@ import java.util.List; public class CompressorRecipe extends VERecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.COMPRESSING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.COMPRESSING.get(); + + private final RecipeParser parser = RecipeParser.forRecipe(this) + .addIngredient(0,0) + .addItemResult(1,0); public CompressorRecipe() { } @@ -57,6 +62,11 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CompressorRecipe return SERIALIZER; } + @Override + public RecipeParser getParser() { + return parser; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java index 0fd94104d..fc21a0bf7 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java @@ -3,6 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.RNGRecipeParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -16,7 +18,12 @@ public class CrusherRecipe extends VERNGExperienceRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CRUSHING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CRUSHING.get(); + + private final RecipeParser parser = RNGRecipeParser.forRecipe(this) + .addChancedItemResult(2,1) + .addIngredient(4, 0) + .addItemResult(0, 1); public CrusherRecipe() { } @@ -56,6 +63,12 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CrusherRecipe re @Override public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + + @Override + public RecipeParser getParser() { + return parser; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java index 91465160f..208f6db91 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java @@ -3,6 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.DimensionalLaserParser; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.util.ServerSideOnly; import com.veteam.voluminousenergy.util.climate.FluidClimateSpawn; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; @@ -24,6 +26,7 @@ public class DimensionalLaserRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.DIMENSIONAL_LASING.get(); + private final DimensionalLaserParser parser = new DimensionalLaserParser(this); @ServerSideOnly private ClimateData climateData; @@ -244,6 +247,11 @@ public FluidStack getOutputFluid(int slot) { return FluidStack.EMPTY; } + @Override + public RecipeParser getParser() { + return parser; + } + @Override public @NotNull ItemStack getToastSymbol() { return new ItemStack(VEBlocks.DIMENSIONAL_LASER_BLOCK.get()); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java index 6700e87ed..a94d8d757 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java @@ -3,6 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.RNGRecipeParser; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -15,9 +17,15 @@ import javax.annotation.Nullable; import java.util.List; -public class DistillationRecipe extends VEFluidRNGRecipe { +public class DistillationRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.DISTILLING.get(); + private final RecipeParser parser = RNGRecipeParser.forRecipe(this) + .addChancedItemResult(6,0) + .addFluidIngredient(0,0) + .addFluidResult(1,0) + .addFluidResult(2,1); + public DistillationRecipe() { } @@ -56,6 +64,11 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull DistillationReci @Override public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + @Override + public RecipeParser getParser() { + return parser; + } + @Override public @NotNull ItemStack getToastSymbol(){ return new ItemStack(VEBlocks.DISTILLATION_UNIT_BLOCK.get()); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java index fb4d5996e..ea5e7d53b 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java @@ -3,6 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.RNGRecipeParser; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -15,15 +17,24 @@ import java.util.ArrayList; import java.util.List; -public class ElectrolyzerRecipe extends VEFluidRNGRecipe { +public class ElectrolyzerRecipe extends VERNGRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.ELECTROLYZING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.ELECTROLYZING.get(); + + private final RecipeParser parser = RNGRecipeParser.forRecipe(this) + .addChancedItemResult(2,0) + .addChancedItemResult(3,1) + .addChancedItemResult(4,2) + .addChancedItemResult(5,3) + .addIngredient(0,0) + .addIngredient(1,1); public ElectrolyzerRecipe() { } public ElectrolyzerRecipe(List ingredients, List results, int processTime) { super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); + ingredients.add(new VERecipeCodecs.RegistryIngredient("","minecraft:bucket",1)); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { @@ -55,6 +66,11 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ElectrolyzerReci @Override public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + @Override + public RecipeParser getParser() { + return parser; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java index 99e8f1611..4b1d9e040 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java @@ -3,6 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -18,6 +19,11 @@ public class FluidElectrolyzerRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FLUID_ELECTROLYZING.get(); + private final RecipeParser parser = RecipeParser.forRecipe(this) + .addFluidIngredient(0,0) + .addFluidResult(1,0) + .addFluidResult(2,1); + public FluidElectrolyzerRecipe() { } @@ -57,6 +63,11 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull FluidElectrolyze return SERIALIZER; } + @Override + public RecipeParser getParser() { + return parser; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java index 0b278f974..7d0ec4cce 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java @@ -3,6 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -18,6 +19,11 @@ public class FluidMixerRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FLUID_MIXING.get(); + private final RecipeParser parser = RecipeParser.forRecipe(this) + .addFluidIngredient(0,0) + .addFluidResult(1,0) + .addFluidResult(2,1); + public FluidMixerRecipe() { } @@ -55,6 +61,11 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull FluidMixerRecipe @Override public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + @Override + public RecipeParser getParser() { + return parser; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java index 03ded8cc2..fbe50b537 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java @@ -3,6 +3,9 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.HydroponicParser; +import com.veteam.voluminousenergy.recipe.parser.RNGRecipeParser; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -14,9 +17,17 @@ import javax.annotation.Nullable; import java.util.List; -public class HydroponicIncubatorRecipe extends VEFluidRNGRecipe { +public class HydroponicIncubatorRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.HYDROPONIC_INCUBATING.get(); + private final RecipeParser parser = HydroponicParser.forRecipe(this) + .addChancedItemResult(2,0) + .addChancedItemResult(3,1) + .addChancedItemResult(4,2) + .addChancedItemResult(5,3) + .addChancedItemResult(6,4) + .addFluidIngredient(0,0); + public HydroponicIncubatorRecipe() { } @@ -54,6 +65,12 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull HydroponicIncuba @Override public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + + @Override + public RecipeParser getParser() { + return parser; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java index 27657b85f..562eee37f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java @@ -3,6 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -16,13 +17,19 @@ import java.util.List; public class ImplosionCompressorRecipe extends VERecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.IMPLOSION_COMPRESSING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.IMPLOSION_COMPRESSING.get(); + + private final RecipeParser parser = RecipeParser.forRecipe(this) + .addIngredient(0,0) + .addIngredient(1,1) + .addItemResult(2,0); public ImplosionCompressorRecipe() { } public ImplosionCompressorRecipe(List ingredients, List results, int processTime) { super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); + ingredients.add(new VERecipeCodecs.RegistryIngredient("","minecraft:gunpowder",1)); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { @@ -55,6 +62,11 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ImplosionCompres @Override public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + @Override + public RecipeParser getParser() { + return parser; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java index 010e17302..eda34d083 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java @@ -3,6 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.recipe.FluidIngredient; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; @@ -24,7 +25,13 @@ public class IndustrialBlastingRecipe extends VERecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.INDUSTRIAL_BLASTING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.INDUSTRIAL_BLASTING.get(); + + private final RecipeParser parser = RecipeParser.forRecipe(this) + .addFluidIngredient(0,0) + .addIngredient(0,0) + .addItemResult(1,0); + private static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { public static final Codec VE_RECIPE_CODEC = RecordCodecBuilder.create((instance) -> instance.group( @@ -115,6 +122,11 @@ public List getFluidIngredients() { return List.of(fluidIngredient); } + @Override + public RecipeParser getParser() { + return parser; + } + public boolean isFluidHotEnough(Fluid fluid) { return isFluidHotEnough(fluid.getFluidType()); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java index 9519d419c..f783db939 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java @@ -3,6 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -20,6 +21,10 @@ public class PrimitiveBlastFurnaceRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.PRIMITIVE_BLAST_FURNACING.get(); + private final RecipeParser parser = RecipeParser.forRecipe(this) + .addIngredient(0,0) + .addItemResult(1,0); + public PrimitiveBlastFurnaceRecipe() { } @@ -56,6 +61,11 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull PrimitiveBlastFu @Override public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + @Override + public RecipeParser getParser() { + return parser; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java index fbc8fc3dd..4d71f10bc 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java @@ -19,26 +19,6 @@ public class RecipeCache { - @Nullable - public static VERecipe getRecipeFromCache(Level level, RecipeType> type, List items) { - - var recipes = VERecipe.getCachedRecipes(type); - - for (VERecipe recipe : recipes) { - boolean isValid = true; - for (int i = 0; i < items.size(); i++) { - if(recipe.getIngredient(i).isEmpty()) continue; - if (!recipe.getIngredient(i).test(items.get(i)) - || items.get(i).getCount() < recipe.getIngredientCount(i)) { - isValid = false; - break; - } - } - if (isValid) return recipe; - } - return null; - } - @Nullable public static VERecipe getFluidRecipeFromCache(Level level, RecipeType> type, List fluids, List items) { @@ -67,68 +47,4 @@ public static VERecipe getFluidRecipeFromCache(Level level, RecipeType getRecipesFromCache(Level level, RecipeType> type, List slots, VETileEntity entity, boolean ignoreEmpty) { - - var recipes = VERecipe.getCachedRecipes(type); - - List recipeList = new ArrayList<>(); - - for (VERecipe recipe : recipes) { - boolean isValid = true; - - ItemStackHandler handler = entity.getInventoryHandler(); - if (handler != null) { - for (VESlotManager manager : slots) { - if (manager.getSlotType() != SlotType.INPUT) continue; - ItemStack stack = manager.getItem(handler); - if (ignoreEmpty && stack.isEmpty()) continue; - if(recipe.getIngredient(manager.getRecipePos()).isEmpty()) continue; - if (!recipe.getIngredient(manager.getRecipePos()).test(stack)) { - isValid = false; - break; - } - } - } - if (isValid) recipeList.add(recipe); - } - return recipeList; - } - - public static @NotNull List getFluidRecipesFromCache(VETileEntity tile, boolean ignoreEmpty) { - - var recipes = VERecipe.getCachedRecipes(tile.getRecipeType()); - - List recipeList = new ArrayList<>(); - - for (VERecipe recipe : recipes) { - boolean isValid = true; - - for (VERelationalTank tank : tile.getTanks()) { - if (ignoreEmpty && tank.getTank().isEmpty()) continue; - if (tank.getTankType() != TankType.INPUT) continue; - FluidStack currentFluid = tank.getTank().getFluid(); - if (!recipe.getFluidIngredient(tank.getRecipePos()).test(currentFluid)) { - isValid = false; - break; - } - } - - ItemStackHandler handler = tile.getInventoryHandler(); - if (handler != null) { - for (VESlotManager manager : tile.getSlotManagers()) { - if (manager.getSlotType() != SlotType.INPUT) continue; - ItemStack stack = manager.getItem(handler); - if (ignoreEmpty && stack.isEmpty()) continue; - if(recipe.getIngredient(manager.getRecipePos()).isEmpty()) continue; - if (!recipe.getIngredient(manager.getRecipePos()).test(stack)) { - isValid = false; - break; - } - } - } - - if (isValid) recipeList.add(recipe); - } - return recipeList; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java index 250eff672..36309e97a 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java @@ -19,17 +19,14 @@ public class StirlingGeneratorRecipe extends VEEnergyRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.STIRLING.get(); - private final RecipeParser parser; + private final RecipeParser parser = RecipeParser.forRecipe(this) + .addIngredient(0, 0); public StirlingGeneratorRecipe() { - parser = RecipeParser.forRecipe(this) - .addIngredient(new RecipeParser.SlotAndRecipePos(0,0)); } public StirlingGeneratorRecipe(List ingredients, int processTime, int energy_per_tick) { super(ingredients, processTime, energy_per_tick); - parser = RecipeParser.forRecipe(this) - .addIngredient(new RecipeParser.SlotAndRecipePos(0,0)); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { @@ -63,15 +60,17 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull StirlingGenerato }; @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } @Override - public @NotNull RecipeType getType(){ + public @NotNull RecipeType getType() { return RECIPE_TYPE; } @Override - public @NotNull ItemStack getToastSymbol(){ + public @NotNull ItemStack getToastSymbol() { return new ItemStack(VEBlocks.STIRLING_GENERATOR_BLOCK.get()); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java index 19d4ff52b..b631cbe89 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java @@ -5,6 +5,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.items.tools.multitool.Multitool; import com.veteam.voluminousenergy.items.tools.multitool.bits.BitItem; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -22,12 +23,14 @@ import java.util.List; public class ToolingRecipe extends VERecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.TOOLING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.TOOLING.get(); public ToolingRecipe() { } + private final RecipeParser parser = RecipeParser.forRecipe(this); + public ToolingRecipe(List i, List oi) { super(i,new ArrayList<>(),new ArrayList<>(), oi, 0); @@ -132,6 +135,11 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ToolingRecipe re @Override public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + @Override + public RecipeParser getParser() { + return parser; + } + protected Lazy> bits; protected ArrayList basesAndBits; protected Lazy> bases; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java index 47df4309f..494769366 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java @@ -3,6 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; @@ -22,7 +23,7 @@ public class VEFluidSawmillRecipe extends VERecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.SAWMILLING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.SAWMILLING.get(); private boolean isLogRecipe; public VEFluidSawmillRecipe() { @@ -103,4 +104,9 @@ public FluidStack getOutputFluid(int slot) { return super.getOutputFluid(slot); } + @Override + public RecipeParser getParser() { + return null; + } + } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java index cc5cc0682..c01cca650 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java @@ -5,7 +5,7 @@ import java.util.ArrayList; import java.util.List; -public abstract class VERNGExperienceRecipe extends VEFluidRNGRecipe { +public abstract class VERNGExperienceRecipe extends VERNGRecipe { @Deprecated public int minExp; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRNGRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java similarity index 74% rename from src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRNGRecipe.java rename to src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java index 9e0a6c52e..6b49e0469 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRNGRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java @@ -5,16 +5,16 @@ import java.util.List; -public abstract class VEFluidRNGRecipe extends VERecipe { +public abstract class VERNGRecipe extends VERecipe { public List rngValues; public List itemResultsWithChance; - public VEFluidRNGRecipe() { + public VERNGRecipe() { } - public VEFluidRNGRecipe(List i, List fi, List of, List oi, int processTime) { + public VERNGRecipe(List i, List fi, List of, List oi, int processTime) { super(i,fi,of,oi.stream().map(VERecipeCodecs.VEChancedItemWithCount::getAsItemStack).toList(), processTime); this.itemResultsWithChance = oi; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java index f3d56c5d9..0dcfb76e4 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java @@ -245,7 +245,5 @@ public static VERecipe getCompleteRecipe(VETileEntity tile) { return null; } - public RecipeParser getParser() { - throw new NotImplementedException("Unable to get parser for recipe: " + this.getClass().getName()); - } + public abstract RecipeParser getParser(); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java index 702180e1d..7924527f2 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java @@ -1,8 +1,6 @@ package com.veteam.voluminousenergy.recipe; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorOxidizerRecipe; import com.veteam.voluminousenergy.util.RecipeConstants; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; @@ -20,24 +18,21 @@ public static final class VERecipeTypes{ public static final RegistryObject> PRIMITIVE_BLAST_FURNACING = VE_RECIPE_TYPES_REGISTRY.register("primitive_blast_furnacing", () -> new VERecipeType<>(RecipeConstants.PRIMITIVE_BLAST_FURNACING)); - public static final RegistryObject> CRUSHING = + public static final RegistryObject> CRUSHING = VE_RECIPE_TYPES_REGISTRY.register("crushing", () -> new VERecipeType<>(RecipeConstants.CRUSHING)); - public static final RegistryObject> ELECTROLYZING = + public static final RegistryObject> ELECTROLYZING = VE_RECIPE_TYPES_REGISTRY.register("electrolyzing", () -> new VERecipeType<>(RecipeConstants.ELECTROLYZING)); public static final RegistryObject> CENTRIFUGAL_AGITATING = VE_RECIPE_TYPES_REGISTRY.register("centrifugal_agitating", () -> new VERecipeType<>(RecipeConstants.CENTRIFUGAL_AGITATING)); - public static final RegistryObject> COMPRESSING = + public static final RegistryObject> COMPRESSING = VE_RECIPE_TYPES_REGISTRY.register("compressing", () -> new VERecipeType<>(RecipeConstants.COMPRESSING)); public static final RegistryObject> STIRLING = VE_RECIPE_TYPES_REGISTRY.register("stirling", () -> new VERecipeType<>(RecipeConstants.STIRLING)); - public static final RegistryObject> OXIDIZING = - VE_RECIPE_TYPES_REGISTRY.register("oxidizer_combustion", () -> new VERecipeType<>(RecipeConstants.OXIDIZING)); - public static final RegistryObject> FUEL_COMBUSTION = VE_RECIPE_TYPES_REGISTRY.register("fuel_combustion", () -> new VERecipeType<>(RecipeConstants.FUEL_COMBUSTION)); @@ -47,19 +42,19 @@ public static final class VERecipeTypes{ public static final RegistryObject> DISTILLING = VE_RECIPE_TYPES_REGISTRY.register("distilling", () -> new VERecipeType<>(RecipeConstants.DISTILLING)); - public static final RegistryObject> CENTRIFUGAL_SEPARATION = + public static final RegistryObject> CENTRIFUGAL_SEPARATION = VE_RECIPE_TYPES_REGISTRY.register("centrifugal_separation", () -> new VERecipeType<>(RecipeConstants.CENTRIFUGAL_SEPARATION)); - public static final RegistryObject> IMPLOSION_COMPRESSING = + public static final RegistryObject> IMPLOSION_COMPRESSING = VE_RECIPE_TYPES_REGISTRY.register("implosion_compressing", () -> new VERecipeType<>(RecipeConstants.IMPLOSION_COMPRESSING)); - public static final RegistryObject> INDUSTRIAL_BLASTING = + public static final RegistryObject> INDUSTRIAL_BLASTING = VE_RECIPE_TYPES_REGISTRY.register("industrial_blasting", () -> new VERecipeType<>(RecipeConstants.INDUSTRIAL_BLASTING)); - public static final RegistryObject> TOOLING = + public static final RegistryObject> TOOLING = VE_RECIPE_TYPES_REGISTRY.register("tooling", () -> new VERecipeType<>(RecipeConstants.TOOLING)); - public static final RegistryObject> SAWMILLING = + public static final RegistryObject> SAWMILLING = VE_RECIPE_TYPES_REGISTRY.register("sawmilling", () -> new VERecipeType<>(RecipeConstants.SAWMILLING)); public static final RegistryObject> DIMENSIONAL_LASING = @@ -87,10 +82,9 @@ public static final class VERecipeTypes{ VE_RECIPE_SERIALIZERS_REGISTRY.register("compressing", () -> new CompressorRecipe().getSerializer()); public static final RegistryObject> STIRLING = VE_RECIPE_SERIALIZERS_REGISTRY.register("stirling", () -> new StirlingGeneratorRecipe().getSerializer()); - public static final RegistryObject> OXIDIZING = - VE_RECIPE_SERIALIZERS_REGISTRY.register("oxidizer_combustion", () -> new CombustionGeneratorOxidizerRecipe().getSerializer()); + public static final RegistryObject> FUEL_COMBUSTION = - VE_RECIPE_SERIALIZERS_REGISTRY.register("fuel_combustion", () -> new CombustionGeneratorFuelRecipe().getSerializer()); + VE_RECIPE_SERIALIZERS_REGISTRY.register("fuel_combustion", () -> new CombustionGeneratorRecipe().getSerializer()); public static final RegistryObject> AQUEOULIZING = VE_RECIPE_SERIALIZERS_REGISTRY.register("aqueoulizing", () -> new AqueoulizerRecipe().getSerializer()); public static final RegistryObject> DISTILLING = diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/DimensionalLaserParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/DimensionalLaserParser.java new file mode 100644 index 000000000..12d9d2184 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/DimensionalLaserParser.java @@ -0,0 +1,75 @@ +package com.veteam.voluminousenergy.recipe.parser; + +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.items.tools.RFIDChip; +import com.veteam.voluminousenergy.persistence.ChunkFluid; +import com.veteam.voluminousenergy.persistence.ChunkFluids; +import com.veteam.voluminousenergy.persistence.SingleChunkFluid; +import com.veteam.voluminousenergy.recipe.VERecipe; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.ChunkPos; +import net.minecraftforge.fluids.FluidStack; + +import static com.veteam.voluminousenergy.blocks.tiles.VETileEntity.DEFAULT_TANK_CAPACITY; + +public class DimensionalLaserParser extends RecipeParser { + + public DimensionalLaserParser(VERecipe recipe) { + super(recipe); + } + + @Override + public boolean isPartialRecipe(VETileEntity tile) { + return tile.getStackInSlot(0).getItem() instanceof RFIDChip; + } + + @Override + public boolean isCompleteRecipe(VETileEntity tile) { + return tile.getStackInSlot(0).getItem() instanceof RFIDChip; + } + + @Override + public boolean canCompleteRecipe(VETileEntity tile) { + + ItemStack stack = tile.getStackInSlot(0); + + if (!(stack.getItem() instanceof RFIDChip)) return false; + CompoundTag tag = stack.getOrCreateTag(); + + if (!tag.contains("ve_x")) return false; + + int x = tag.getInt("ve_x"); + int z = tag.getInt("ve_z"); + + ChunkFluid fluid = ChunkFluids.getInstance().getChunkFluid(new ChunkPos(x,z)); + + if(fluid == null) { + VoluminousEnergy.LOGGER.warn("Unable to find chunk fluid for what appears to be a scanned chunk: " + x + " | " + z); + return false; + } + + // If we ever need to validate a selected fluid we do so here. + SingleChunkFluid singleChunkFluid = fluid.getFluids().get(0); + FluidStack currentFluid = tile.getFluidStackFromTank(0); + int amount = Math.min(singleChunkFluid.getAmount(),DEFAULT_TANK_CAPACITY - currentFluid.getAmount()); + + return tile.getTank(0).testFillTank(new FluidStack(singleChunkFluid.getFluid(),amount)) > 0; + } + + @Override + public void completeRecipe(VETileEntity tile) { + + ItemStack stack = tile.getStackInSlot(0); + CompoundTag tag = stack.getOrCreateTag(); + int x = tag.getInt("ve_x"); + int z = tag.getInt("ve_z"); + + ChunkFluid fluid = ChunkFluids.getInstance().getChunkFluid(new ChunkPos(x,z)); + SingleChunkFluid singleChunkFluid = fluid.getFluids().get(0); + FluidStack currentFluid = tile.getFluidStackFromTank(0); + int insertAmount = Math.min(singleChunkFluid.getAmount(),DEFAULT_TANK_CAPACITY - currentFluid.getAmount()); + tile.getTank(0).fillTank(new FluidStack(singleChunkFluid.getFluid(),insertAmount)); + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java new file mode 100644 index 000000000..f80a5b2e7 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java @@ -0,0 +1,60 @@ +package com.veteam.voluminousenergy.recipe.parser; + +import com.veteam.voluminousenergy.blocks.tiles.VEItemStackHandler; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.VERNGRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import java.util.Random; + +import static net.minecraft.util.Mth.abs; + +public class HydroponicParser extends RNGRecipeParser { + public HydroponicParser(VERecipe recipe) { + super(recipe); + } + + // We don't subtract the ingredient amounts for the hydroponic incubator + @Override + public void completeRecipe(VETileEntity tile) { + VEItemStackHandler handler = tile.getInventory(); + + Random randomInstance = new Random(); + + // Insert the rng results + for (SlotAndRecipePos pos : randomItemResultPositions) { + + VERNGRecipe rngRecipe = (VERNGRecipe) recipe; + + float randomness = rngRecipe.getOutputChance(pos.recipePos()); + if(randomness != 1) { + float random = abs(0 + randomInstance.nextFloat() * (-1)); + if(random > randomness) continue; + ItemStack result = rngRecipe.getResult(pos.recipePos()); + handler.insertItem(pos.tilePos(), result.copy(), false); + } + } + + for (SlotAndRecipePos pos : fluidIngredientPositions) { + FluidStack fluidStack = tile.getFluidStackFromTank(pos.tilePos()); + fluidStack.setAmount(fluidStack.getAmount() - recipe.getFluidIngredientAmount(pos.recipePos())); + } + + // Insert the results + for (SlotAndRecipePos pos : itemResultPositions) { + ItemStack result = recipe.getResult(pos.recipePos()); + handler.insertItem(pos.tilePos(), result.copy(), false); + } + + for (SlotAndRecipePos pos : fluidResultPositions) { + FluidStack result = recipe.getOutputFluid(pos.recipePos()); + FluidStack tileFluid = tile.getFluidStackFromTank(pos.tilePos()); + tileFluid.setAmount(tileFluid.getAmount() + result.getAmount()); + } + + // mark fluid IO as dirty + tile.markFluidInputDirty(); + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java new file mode 100644 index 000000000..32a538442 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java @@ -0,0 +1,65 @@ +package com.veteam.voluminousenergy.recipe.parser; + +import com.veteam.voluminousenergy.blocks.tiles.VEItemStackHandler; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.VERNGRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; +import net.minecraft.world.item.ItemStack; + +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import static net.minecraft.util.Mth.abs; + +public class RNGRecipeParser extends RecipeParser { + public RNGRecipeParser(VERecipe recipe) { + super(recipe); + } + List randomItemResultPositions = new ArrayList<>(); + + public static RNGRecipeParser forRecipe(VERecipe recipe) { + return new RNGRecipeParser(recipe); + } + + public RNGRecipeParser addChancedItemResult(int tilePos, int recipePos) { + this.randomItemResultPositions.add(new SlotAndRecipePos(tilePos,recipePos)); + return this; + } + + @Override + public boolean canCompleteRecipe(VETileEntity tile) { + for (SlotAndRecipePos pos : randomItemResultPositions) { + ItemStack stack = tile.getStackInSlot(pos.tilePos()); + ItemStack result = recipe.getResult(pos.recipePos()); + if(stack.isEmpty()) continue; + if (!stack.is(result.getItem()) || result.getCount() + stack.getCount() > result.getMaxStackSize()) + return false; + } + return super.canCompleteRecipe(tile); + } + + @Override + public void completeRecipe(VETileEntity tile) { + + VEItemStackHandler handler = tile.getInventory(); + + Random randomInstance = new Random(); + + // Insert the rng results + for (SlotAndRecipePos pos : randomItemResultPositions) { + + VERNGRecipe rngRecipe = (VERNGRecipe) recipe; + + float randomness = rngRecipe.getOutputChance(pos.recipePos()); + if(randomness != 1) { + float random = abs(0 + randomInstance.nextFloat() * (-1)); + if(random > randomness) continue; + ItemStack result = rngRecipe.getResult(pos.recipePos()); + handler.insertItem(pos.tilePos(), result.copy(), false); + } + } + + super.completeRecipe(tile); + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java index a11a98701..9d4d60b36 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java @@ -1,6 +1,5 @@ package com.veteam.voluminousenergy.recipe.parser; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.tiles.VEItemStackHandler; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.recipe.VERecipe; @@ -19,7 +18,7 @@ public class RecipeParser { List fluidIngredientPositions = new ArrayList<>(); List fluidResultPositions = new ArrayList<>(); - private final VERecipe recipe; + final VERecipe recipe; public RecipeParser(VERecipe recipe) { this.recipe = recipe; @@ -29,23 +28,23 @@ public static RecipeParser forRecipe(VERecipe recipe) { return new RecipeParser(recipe); } - public RecipeParser addIngredient(SlotAndRecipePos pos) { - this.ingredientPositions.add(pos); + public RecipeParser addIngredient(int tilePos,int recipePos) { + this.ingredientPositions.add(new SlotAndRecipePos(tilePos,recipePos)); return this; } - public RecipeParser addFluidIngredient(SlotAndRecipePos pos) { - this.fluidIngredientPositions.add(pos); + public RecipeParser addFluidIngredient(int tilePos,int recipePos) { + this.fluidIngredientPositions.add(new SlotAndRecipePos(tilePos,recipePos)); return this; } - public RecipeParser addItemResult(SlotAndRecipePos pos) { - this.itemResultPositions.add(pos); + public RecipeParser addItemResult(int tilePos,int recipePos) { + this.itemResultPositions.add(new SlotAndRecipePos(tilePos,recipePos)); return this; } - public RecipeParser addFluidResult(SlotAndRecipePos pos) { - this.fluidResultPositions.add(pos); + public RecipeParser addFluidResult(int tilePos,int recipePos) { + this.fluidResultPositions.add(new SlotAndRecipePos(tilePos,recipePos)); return this; } @@ -73,6 +72,7 @@ public boolean isCompleteRecipe(VETileEntity tile) { ItemStack stackInSlot = tile.getStackInSlot(pos.tilePos); Ingredient ingredient = recipe.getIngredient(pos.recipePos); int amountNeeded = recipe.getIngredientCount(pos.recipePos); + if(ingredient.isEmpty()) continue; if (!ingredient.test(stackInSlot) || stackInSlot.getCount() < amountNeeded) return false; } @@ -80,6 +80,7 @@ public boolean isCompleteRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : fluidIngredientPositions) { FluidStack stack = tile.getFluidStackFromTank(pos.tilePos); FluidIngredient fluidIngredient = recipe.getFluidIngredient(pos.recipePos); + if(fluidIngredient.isEmpty()) continue; int amountNeeded = fluidIngredient.getAmountNeeded(); if (!fluidIngredient.test(stack) || stack.getAmount() < amountNeeded) return false; @@ -92,12 +93,14 @@ public boolean canCompleteRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : itemResultPositions) { ItemStack stack = tile.getStackInSlot(pos.tilePos); ItemStack result = recipe.getResult(pos.recipePos); + if(stack.isEmpty()) continue; if (!stack.is(result.getItem()) || result.getCount() + stack.getCount() > result.getMaxStackSize()) return false; } for (SlotAndRecipePos pos : fluidResultPositions) { FluidStack stack = tile.getFluidStackFromTank(pos.tilePos); FluidStack result = recipe.getOutputFluid(pos.recipePos); + if(stack.isEmpty()) continue; if (!stack.isFluidEqual(result) || result.getAmount() + stack.getAmount() > tile.getTankCapacity(pos.tilePos)) return false; } @@ -144,7 +147,7 @@ public boolean canInsertItem(int slot, ItemStack stack) { return false; } - public record SlotAndRecipePos(int tilePos, int recipePos) { + record SlotAndRecipePos(int tilePos, int recipePos) { } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/RecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java similarity index 83% rename from src/main/java/com/veteam/voluminousenergy/recipe/processor/RecipeProcessor.java rename to src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java index efaada432..8a0ea1454 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/RecipeProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -public interface RecipeProcessor { +public interface AbstractRecipeProcessor { void processRecipe(VETileEntity tile); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java new file mode 100644 index 000000000..555be2ea4 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java @@ -0,0 +1,79 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.fluids.VEFluids; +import com.veteam.voluminousenergy.sounds.VESounds; +import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.util.VERelationalTank; +import net.minecraft.core.BlockPos; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Blocks; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.IFluidHandler; + +public class AirCompressorProcessor implements AbstractRecipeProcessor { + + @Override + public void processRecipe(VETileEntity tile) { + if (!tile.canConsumeEnergy()) return; + + int soundTick = tile.getData("sound_tick"); + + int counter = tile.getData("counter"); + + if (counter <= 0) { + // Check blocks around the Air Compressor to see if it's air + int x = tile.getBlockPos().getX(); + int y = tile.getBlockPos().getY(); + int z = tile.getBlockPos().getZ(); + + Level level = tile.getLevel(); + + int airMultiplier = 0; + // Check X offsets + if (Blocks.AIR == level.getBlockState(new BlockPos(x + 1, y, z)).getBlock()) + airMultiplier++; + if (Blocks.AIR == level.getBlockState(new BlockPos(x - 1, y, z)).getBlock()) + airMultiplier++; + // Check Y offsets + if (Blocks.AIR == level.getBlockState(new BlockPos(x, y + 1, z)).getBlock()) + airMultiplier++; + if (Blocks.AIR == level.getBlockState(new BlockPos(x, y - 1, z)).getBlock()) + airMultiplier++; + if (Blocks.AIR == level.getBlockState(new BlockPos(x, y, z + 1)).getBlock()) + airMultiplier++; + if (Blocks.AIR == level.getBlockState(new BlockPos(x, y, z - 1)).getBlock()) + airMultiplier++; + if (addAirToTank(airMultiplier,tile.getTank(0))) { + tile.consumeEnergy(); + if (++soundTick == 19) { + soundTick = 0; + if (Config.PLAY_MACHINE_SOUNDS.get()) { + level.playSound(null, tile.getBlockPos(), VESounds.AIR_COMPRESSOR, SoundSource.BLOCKS, 1.0F, 1.0F); + } + } + tile.setData("sound_tick",soundTick); + counter = (byte) tile.calculateCounter(20, tile.getInventory().getStackInSlot(tile.getEnergy().getUpgradeSlotId())); + tile.setChanged(); + } + } else { + --counter; + } + tile.setData("counter",--counter); + } + + // We don't need to validate the recipe because it doesn't have one. + @Override + public void validateRecipe(VETileEntity tile) {} + + public boolean addAirToTank(int multiplier, VERelationalTank tank) { + + int totalToAdd = 250 * multiplier; + int amountToAdd = Math.min(totalToAdd, (tank.getTank().getFluidAmount() + totalToAdd)); + if (amountToAdd == 0) return false; + tank.getTank().fill(new FluidStack(VEFluids.COMPRESSED_AIR_REG.get(), amountToAdd), IFluidHandler.FluidAction.EXECUTE); + return true; + } + +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java index 0d6a6823f..ae210ee53 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java @@ -9,7 +9,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.ItemStackHandler; -public class DefaultProcessor implements RecipeProcessor { +public class DefaultProcessor implements AbstractRecipeProcessor { @Override public void validateRecipe(VETileEntity tile) { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java index 3adcd72a1..9cbe3c44c 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java @@ -11,10 +11,9 @@ import net.minecraft.sounds.SoundSource; import org.apache.commons.lang3.NotImplementedException; -import java.util.ArrayList; import java.util.List; -public class GeneratorProcessor implements RecipeProcessor { +public class GeneratorProcessor implements AbstractRecipeProcessor { private int divisor = 1; private boolean allowOverflow = false; @@ -24,8 +23,9 @@ public GeneratorProcessor(boolean allowOverflow, int divisor) { this.divisor = divisor; } - public GeneratorProcessor(int divisor) { - this.divisor = divisor; + + + public GeneratorProcessor() { } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/serializer/FluidSerializerHelper.java b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/FluidSerializerHelper.java index c0a889ede..6e639f814 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/serializer/FluidSerializerHelper.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/FluidSerializerHelper.java @@ -1,7 +1,6 @@ package com.veteam.voluminousenergy.recipe.serializer; -import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.util.recipe.FluidIngredient; import net.minecraft.core.NonNullList; @@ -50,7 +49,7 @@ public T fromNetwork(T recipe, FriendlyByteBuf buffer) { recipe.setProcessTime(buffer.readInt()); - if (recipe instanceof VEFluidRNGRecipe irngRecipe) { + if (recipe instanceof VERNGRecipe irngRecipe) { int totalRandom = buffer.readInt(); List randomValues = new ArrayList<>(); for (int i = 0; i < totalRandom; i++) { @@ -87,7 +86,7 @@ public void toNetwork(FriendlyByteBuf buffer, T recipe) { buffer.writeInt(recipe.getProcessTime()); - if (recipe instanceof VEFluidRNGRecipe irngRecipe) { + if (recipe instanceof VERNGRecipe irngRecipe) { buffer.writeInt(irngRecipe.getRNGOutputs().size()); for(float f : irngRecipe.getRNGOutputs()) { buffer.writeFloat(f); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java index 55187d230..3dc05ca5d 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.recipe.serializer; -import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; +import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERNGExperienceRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import net.minecraft.core.NonNullList; @@ -35,7 +35,7 @@ public T fromNetwork(T recipe, FriendlyByteBuf buffer) { recipe.setProcessTime(buffer.readInt()); - if (recipe instanceof VEFluidRNGRecipe irngRecipe) { + if (recipe instanceof VERNGRecipe irngRecipe) { int totalRandom = buffer.readInt(); List values = new ArrayList<>(); for (int i = 0; i < totalRandom; i++) { @@ -66,7 +66,7 @@ public void toNetwork(FriendlyByteBuf buffer, T recipe) { buffer.writeInt(recipe.getProcessTime()); - if (recipe instanceof VEFluidRNGRecipe irngRecipe) { + if (recipe instanceof VERNGRecipe irngRecipe) { buffer.writeInt(irngRecipe.getRNGOutputs().size()); for(float f : irngRecipe.getRNGOutputs()) { buffer.writeFloat(f); diff --git a/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java b/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java index 2ee5b52c2..3a42da1db 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java @@ -21,8 +21,6 @@ public class VESlotManager { private final String nbtName; private int output = -1; private int tankId = -1; - private int recipePos = -1; - private final Set allowedItems = new HashSet<>(); public VESlotManager(int slotNum, Direction direction, boolean status, SlotType slotType) { @@ -52,22 +50,6 @@ public VESlotManager(int slotNum, Direction direction, boolean status, SlotType this.tankId = tankId; } - /** - * Use this for an input tilePos or others - * @param slotNum The tilePos number is the index in the array of the slotManagers - * @param direction The direction it will be facing by default - * @param status The status of the IO - * @param slotType The type of tilePos - */ - public VESlotManager(int slotNum, int recipePos, Direction direction, boolean status, SlotType slotType) { - this.side.set(direction); - this.slot = slotNum; - this.enabled.set(status); - this.slotType = slotType; - this.nbtName = slotType.getNBTName(slotNum); - this.recipePos = recipePos; - } - public void setStatus(boolean bool) { this.enabled.set(bool); } @@ -96,10 +78,6 @@ public String getTranslationKey() { return slotType.getTranslationKey(); } - public int getRecipePos() { - return recipePos; - } - public String getNbtName() { return nbtName; } diff --git a/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java b/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java index 6667b40f1..a70866bc6 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java +++ b/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java @@ -105,6 +105,14 @@ public void fillOutput(VERecipe recipe, int id) { } } + public void fillTank(FluidStack stack) { + this.getTank().fill(stack, IFluidHandler.FluidAction.EXECUTE); + } + + public int testFillTank(FluidStack stack) { + return this.getTank().fill(stack, IFluidHandler.FluidAction.SIMULATE); + } + /** * The id will be located in the Recipe file itself. * To find the id the easiest way is to go to the fromJson in a recipe's serializer. diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/biofuel.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/biofuel.json deleted file mode 100644 index 96d9b92b3..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/biofuel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:fuel_combustion", - "fluid_ingredients": [ - { - "tag": "forge:biofuel", - "amount" : 250 - } - ], - "volumetric_energy": 115200 -} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/combustible.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/combustible.json new file mode 100644 index 000000000..1e3253887 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/combustible.json @@ -0,0 +1,13 @@ +{ + "type": "voluminousenergy:fuel_combustion", + "fluid_ingredients": [ + { + "tag": "voluminousenergy:combustible", + "amount" : 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "amount" : 250 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/crude_oil.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/crude_oil.json deleted file mode 100644 index d7950d083..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/crude_oil.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:fuel_combustion", - "fluid_ingredients": [ - { - "tag": "forge:crude_oil", - "amount" : 250 - } - ], - "volumetric_energy": 25600 -} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/diesel.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/diesel.json deleted file mode 100644 index e0c56cdd5..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/diesel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:fuel_combustion", - "fluid_ingredients": [ - { - "tag": "forge:diesel", - "amount" : 250 - } - ], - "volumetric_energy": 256000 -} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/gasoline.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/gasoline.json deleted file mode 100644 index 2eeaff7a2..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/gasoline.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:fuel_combustion", - "fluid_ingredients": [ - { - "tag": "forge:gasoline", - "amount" : 250 - } - ], - "volumetric_energy": 204800 -} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/light_fuel.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/light_fuel.json deleted file mode 100644 index 145521151..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/light_fuel.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:fuel_combustion", - "fluid_ingredients": [ - { - "tag": "forge:light_fuel", - "amount" : 250 - } - ], - "volumetric_energy": 102400 -} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coal.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coal.json deleted file mode 100644 index 17ceabf78..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coal.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:fuel_combustion", - "fluid_ingredients": [ - { - "tag": "forge:liquefied_coal", - "amount" : 250 - } - ], - "volumetric_energy": 102400 -} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coke.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coke.json deleted file mode 100644 index ee2293976..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coke.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:fuel_combustion", - "fluid_ingredients": [ - { - "tag": "forge:liquefied_coke", - "amount" : 250 - } - ], - "volumetric_energy": 204800 -} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/naphtha.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/naphtha.json deleted file mode 100644 index 35c7ec53d..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/naphtha.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:fuel_combustion", - "fluid_ingredients": [ - { - "tag": "forge:naphtha", - "amount" : 250 - } - ], - "volumetric_energy": 51200 -} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/nitroglycerin.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/nitroglycerin.json deleted file mode 100644 index b25b3d3c6..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/nitroglycerin.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:fuel_combustion", - "fluid_ingredients": [ - { - "tag": "forge:nitroglycerin", - "amount" : 250 - } - ], - "volumetric_energy": 374400 -} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/treethanol.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/treethanol.json deleted file mode 100644 index 02ad7816a..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/treethanol.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:fuel_combustion", - "fluid_ingredients": [ - { - "tag": "forge:treethanol", - "amount" : 250 - } - ], - "volumetric_energy": 102400 -} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/tags/fluids/combustable.json b/src/main/resources/data/voluminousenergy/tags/fluids/combustible.json similarity index 100% rename from src/main/resources/data/voluminousenergy/tags/fluids/combustable.json rename to src/main/resources/data/voluminousenergy/tags/fluids/combustible.json From aada0a8ff44c43376c38a5b64c61f31ec4c183fd Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Sat, 6 Apr 2024 19:59:01 -0400 Subject: [PATCH 08/27] Removed non-essential tile classes. Fixed a few recipe parser issues --- .../voluminousenergy/VoluminousEnergy.java | 4 + .../blocks/blocks/VEBlocks.java | 3 +- .../blocks/machines/BlastFurnaceBlock.java | 4 +- .../machines/CentrifugalAgitatorBlock.java | 4 +- .../machines/CentrifugalSeparatorBlock.java | 4 +- .../blocks/machines/CompressorBlock.java | 4 +- .../blocks/blocks/machines/CrusherBlock.java | 12 +- .../machines/DistillationUnitBlock.java | 4 +- .../blocks/machines/ElectrolyzerBlock.java | 4 +- .../machines/FluidElectrolyzerBlock.java | 4 +- .../blocks/machines/FluidMixerBlock.java | 4 +- .../machines/HydroponicIncubatorBlock.java | 4 +- .../machines/ImplosionCompressorBlock.java | 4 +- .../machines/PrimitiveBlastFurnaceBlock.java | 4 +- .../machines/PrimitiveSolarPanelBlock.java | 4 +- .../blocks/blocks/machines/PumpBlock.java | 36 +--- .../blocks/machines/SolarPanelBlock.java | 4 +- .../machines/StirlingGeneratorBlock.java | 33 +-- .../util/VEItemStackWithFluidHandler.java | 2 +- .../blocks/containers/VEContainerFactory.java | 2 +- .../blocks/containers/VEContainers.java | 4 +- .../blocks/screens/BlastFurnaceScreen.java | 20 +- .../screens/CentrifugalAgitatorScreen.java | 6 +- .../screens/CentrifugalSeparatorScreen.java | 6 +- .../blocks/screens/CompressorScreen.java | 6 +- .../blocks/screens/CrusherScreen.java | 6 +- .../screens/DistillationUnitScreen.java | 13 +- .../blocks/screens/ElectrolyzerScreen.java | 6 +- .../screens/FluidElectrolyzerScreen.java | 6 +- .../blocks/screens/FluidMixerScreen.java | 6 +- .../screens/HydroponicIncubatorScreen.java | 6 +- .../screens/ImplosionCompressorScreen.java | 21 +- .../screens/PrimitiveBlastFurnaceScreen.java | 20 +- .../screens/PrimitiveSolarPanelScreen.java | 8 +- .../blocks/screens/SolarPanelScreen.java | 8 +- .../screens/StirlingGeneratorScreen.java | 6 +- .../blocks/screens/VEContainerScreen.java | 2 +- .../blocks/tiles/AirCompressorTile.java | 157 -------------- .../blocks/tiles/AqueoulizerTile.java | 63 ------ .../blocks/tiles/BlastFurnaceTile.java | 109 ---------- .../blocks/tiles/CentrifugalAgitatorTile.java | 74 ------- .../tiles/CentrifugalSeparatorTile.java | 55 ----- .../blocks/tiles/CombustionGeneratorTile.java | 63 +----- .../blocks/tiles/CompressorTile.java | 65 ------ .../blocks/tiles/CrusherTile.java | 62 ------ .../blocks/tiles/DimensionalLaserTile.java | 2 +- .../blocks/tiles/DistillationUnitTile.java | 89 -------- .../blocks/tiles/ElectrolyzerTile.java | 55 ----- .../blocks/tiles/FluidElectrolyzerTile.java | 77 ------- .../blocks/tiles/FluidMixerTile.java | 68 ------- .../blocks/tiles/HydroponicIncubatorTile.java | 191 ------------------ .../blocks/tiles/ImplosionCompressorTile.java | 65 ------ .../tiles/PrimitiveBlastFurnaceTile.java | 73 ------- .../blocks/tiles/PrimitiveSolarPanelTile.java | 31 --- .../tiles/PrimitiveStirlingGeneratorTile.java | 140 ------------- .../blocks/tiles/PumpTile.java | 2 +- .../blocks/tiles/SawmillTile.java | 8 +- .../blocks/tiles/SolarPanelTile.java | 31 --- .../blocks/tiles/StirlingGeneratorTile.java | 158 --------------- .../blocks/tiles/ToolingStationTile.java | 2 +- .../blocks/tiles/VEItemStackHandler.java | 7 +- .../blocks/tiles/VESolarTile.java | 124 ------------ .../blocks/tiles/VETileEntities.java | 141 +++++++------ .../blocks/tiles/VETileEntity.java | 4 + ...eFactory.java => VETileEntityFactory.java} | 31 +-- .../blocks/tiles/tank/TankTile.java | 2 +- .../entity/LaserBlockEntityRenderer.java | 10 - .../compat/jei/VoluminousEnergyPlugin.java | 1 - .../jei/category/CombustionCategory.java | 159 ++++++++------- .../events/VERecipeReloadListener.java | 16 ++ .../recipe/AqueoulizerRecipe.java | 2 +- .../recipe/CentrifugalAgitatorRecipe.java | 2 +- .../recipe/CentrifugalSeparatorRecipe.java | 2 +- .../recipe/CombustionGeneratorRecipe.java | 2 +- .../recipe/CompressorRecipe.java | 2 +- .../recipe/CrusherRecipe.java | 4 +- .../recipe/DimensionalLaserRecipe.java | 2 +- .../recipe/DistillationRecipe.java | 2 +- .../recipe/ElectrolyzerRecipe.java | 3 +- .../recipe/FluidElectrolyzerRecipe.java | 2 +- .../recipe/FluidMixerRecipe.java | 2 +- .../recipe/HydroponicIncubatorRecipe.java | 3 +- .../recipe/ImplosionCompressorRecipe.java | 5 +- .../recipe/IndustrialBlastingRecipe.java | 4 +- .../recipe/PrimitiveBlastFurnaceRecipe.java | 2 +- .../voluminousenergy/recipe/RecipeCache.java | 8 - .../recipe/StirlingGeneratorRecipe.java | 2 +- .../recipe/ToolingRecipe.java | 2 +- .../recipe/VEFluidSawmillRecipe.java | 2 +- .../parser/ImplosionCompressorParser.java | 33 +++ .../recipe/parser/RNGRecipeParser.java | 22 +- .../recipe/parser/RecipeParser.java | 18 +- .../recipe/processor/GeneratorProcessor.java | 3 - .../processor/MultiBlockRecipeProcessor.java | 44 ++++ .../IngredientSerializerHelper.java | 2 +- .../buttons/tanks/TankDirectionButton.java | 2 +- .../tools/energy/VEEnergyStorage.java | 2 - .../util/MultiFluidSlotWrapper.java | 1 - .../util/VERelationalTank.java | 2 - .../util/tiles/CapabilityMap.java | 1 - 100 files changed, 453 insertions(+), 2159 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java rename src/main/java/com/veteam/voluminousenergy/blocks/tiles/{VETileFactory.java => VETileEntityFactory.java} (86%) create mode 100644 src/main/java/com/veteam/voluminousenergy/events/VERecipeReloadListener.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java diff --git a/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java b/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java index 023d7bbc5..279b6fd39 100644 --- a/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java +++ b/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java @@ -5,6 +5,7 @@ import com.veteam.voluminousenergy.client.renderers.entity.LaserBlockEntityRenderer; import com.veteam.voluminousenergy.datagen.VEGlobalLootModifierData; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; +import com.veteam.voluminousenergy.events.VERecipeReloadListener; import com.veteam.voluminousenergy.fluids.VEFluids; import com.veteam.voluminousenergy.items.VEBlockItems; import com.veteam.voluminousenergy.items.VEItems; @@ -20,12 +21,15 @@ import com.veteam.voluminousenergy.tools.networking.VENetwork; import com.veteam.voluminousenergy.world.feature.VEFeatures; import com.veteam.voluminousenergy.world.modifiers.VEModifiers; +import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemBlockRenderTypes; import net.minecraft.client.renderer.RenderType; import net.minecraft.core.HolderLookup; import net.minecraft.data.DataGenerator; import net.minecraft.data.PackOutput; import net.minecraft.server.MinecraftServer; +import net.minecraft.server.packs.resources.ReloadableResourceManager; +import net.minecraft.server.packs.resources.ResourceManager; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.EntityRenderersEvent; import net.minecraftforge.common.MinecraftForge; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java index 052ae4cc1..03c0b8ec5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java @@ -16,7 +16,8 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.blocks.containers.tank.*; -import com.veteam.voluminousenergy.blocks.tiles.*; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.blocks.tiles.tank.*; import net.minecraft.core.BlockPos; import net.minecraft.world.inventory.MenuType; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BlastFurnaceBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BlastFurnaceBlock.java index 10661c8ec..048732c71 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BlastFurnaceBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BlastFurnaceBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.BlastFurnaceTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -31,7 +31,7 @@ public BlastFurnaceBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new BlastFurnaceTile(pos, state); + return VETileEntities.BLAST_FURNACE_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalAgitatorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalAgitatorBlock.java index 5dedc0de4..7de94479f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalAgitatorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalAgitatorBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.CentrifugalAgitatorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -31,7 +31,7 @@ public CentrifugalAgitatorBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new CentrifugalAgitatorTile(pos, state); + return VETileEntities.CENTRIFUGAL_AGITATOR_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalSeparatorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalSeparatorBlock.java index 975538e0e..d50cc3f45 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalSeparatorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalSeparatorBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.CentrifugalSeparatorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -31,7 +31,7 @@ public CentrifugalSeparatorBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new CentrifugalSeparatorTile(pos, state); + return VETileEntities.CENTRIFUGAL_SEPARATOR_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CompressorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CompressorBlock.java index ed3e0978b..5fdfe3a73 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CompressorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CompressorBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.CompressorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -30,7 +30,7 @@ public CompressorBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new CompressorTile(pos, state); + return VETileEntities.COMPRESSOR_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java index 1082efc9f..bf96dc1fc 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.CrusherTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; @@ -32,17 +32,11 @@ public CrusherBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new CrusherTile(pos, state); - } - - // NEW TICK SYSTEM - @Nullable - protected static BlockEntityTicker createCrusherTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType crusherTile) { - return level.isClientSide ? null : createTickerHelper(passedBlockEntity, crusherTile, CrusherTile::serverTick); + return VETileEntities.CRUSHER_FACTORY.create(pos, state); } @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createCrusherTicker(level, blockEntityType, VEBlocks.CRUSHER_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.CRUSHER_TILE.get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/DistillationUnitBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/DistillationUnitBlock.java index 3d8fe1ac0..32cb33489 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/DistillationUnitBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/DistillationUnitBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.DistillationUnitTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -31,7 +31,7 @@ public DistillationUnitBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new DistillationUnitTile(pos, state); + return VETileEntities.DISTILLATION_UNIT_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectrolyzerBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectrolyzerBlock.java index b26cfbd15..8423be9e6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectrolyzerBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectrolyzerBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.ElectrolyzerTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -31,7 +31,7 @@ public ElectrolyzerBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new ElectrolyzerTile(pos, state); + return VETileEntities.ELECTROLYZER_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidElectrolyzerBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidElectrolyzerBlock.java index f1489beb6..e9d3e399c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidElectrolyzerBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidElectrolyzerBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.FluidElectrolyzerTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -31,7 +31,7 @@ public FluidElectrolyzerBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new FluidElectrolyzerTile(pos, state); + return VETileEntities.FLUID_ELECTROLYZER_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidMixerBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidMixerBlock.java index 1a39ce342..dcdcf8902 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidMixerBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidMixerBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.FluidMixerTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -30,7 +30,7 @@ public FluidMixerBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new FluidMixerTile(pos, state); + return VETileEntities.FLUID_MIXER_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/HydroponicIncubatorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/HydroponicIncubatorBlock.java index d0ae7b2af..6dc5b7f08 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/HydroponicIncubatorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/HydroponicIncubatorBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.HydroponicIncubatorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -30,7 +30,7 @@ public HydroponicIncubatorBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new HydroponicIncubatorTile(pos, state); + return VETileEntities.HYDROPONIC_INCUBATOR_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ImplosionCompressorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ImplosionCompressorBlock.java index 6830466ef..f1193c9e4 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ImplosionCompressorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ImplosionCompressorBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.ImplosionCompressorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -30,7 +30,7 @@ public ImplosionCompressorBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new ImplosionCompressorTile(pos, state); + return VETileEntities.IMPLOSION_COMPRESSOR_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveBlastFurnaceBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveBlastFurnaceBlock.java index a820bcc7a..aa5ce9894 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveBlastFurnaceBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveBlastFurnaceBlock.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.PrimitiveBlastFurnaceTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -37,7 +37,7 @@ public PrimitiveBlastFurnaceBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new PrimitiveBlastFurnaceTile(pos, state); + return VETileEntities.PRIMITIVE_BLAST_FURNACE_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveSolarPanelBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveSolarPanelBlock.java index 8dec76479..6a451432f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveSolarPanelBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveSolarPanelBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.PrimitiveSolarPanelTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -30,7 +30,7 @@ public PrimitiveSolarPanelBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new PrimitiveSolarPanelTile(pos, state); + return VETileEntities.PRIMITIVE_SOLAR_PANEL_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PumpBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PumpBlock.java index a9c281ce4..589d22498 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PumpBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PumpBlock.java @@ -3,6 +3,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.blocks.util.FaceableBlock; import com.veteam.voluminousenergy.blocks.tiles.PumpTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.server.level.ServerPlayer; @@ -19,10 +20,11 @@ import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.BlockHitResult; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; -public class PumpBlock extends FaceableBlock implements EntityBlock { +public class PumpBlock extends VEFaceableMachineBlock { public PumpBlock() { super(Block.Properties.of() .sound(SoundType.METAL) @@ -36,37 +38,13 @@ public PumpBlock() { } @Nullable - @Override - public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { // Replaces old createBlockEntity method - return new PumpTile(pos, state); - } - - // NEW TICK SYSTEM - @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { - return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, PumpTile::serverTick); - } - - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { - return blockEntityType == tile ? (BlockEntityTicker) serverTick : null; - } - - @Nullable - public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType blockEntityType) { + public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { return createTicker(level, blockEntityType, VEBlocks.PUMP_TILE.get()); } + @Nullable @Override - public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) { - if (!world.isClientSide) { - BlockEntity tileEntity = world.getBlockEntity(pos); - if (tileEntity instanceof MenuProvider menuProvider && player instanceof ServerPlayer serverPlayer) { - serverPlayer.openMenu(menuProvider, tileEntity.getBlockPos()); - } else { - throw new IllegalStateException(this.getClass().getName() + " named container provider is missing!"); - } - return InteractionResult.SUCCESS; - } - return InteractionResult.SUCCESS; + public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { + return VETileEntities.PUMP_FACTORY.create(pos, state); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SolarPanelBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SolarPanelBlock.java index ebde53857..81e892ed6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SolarPanelBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SolarPanelBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.SolarPanelTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -30,7 +30,7 @@ public SolarPanelBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new SolarPanelTile(pos, state); + return VETileEntities.SOLAR_PANEL_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java index ea1be6fc1..3cc1fad94 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.blocks.util.FaceableBlock; -import com.veteam.voluminousenergy.blocks.tiles.StirlingGeneratorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; @@ -12,17 +12,15 @@ import net.minecraft.world.MenuProvider; import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.BlockHitResult; import javax.annotation.Nullable; -public class StirlingGeneratorBlock extends FaceableBlock implements EntityBlock { +public class StirlingGeneratorBlock extends VEFaceableMachineBlock { public StirlingGeneratorBlock() { super(Properties.of() .sound(SoundType.METAL) @@ -38,36 +36,11 @@ public StirlingGeneratorBlock() { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { // Replaces old createBlockEntity method - return new StirlingGeneratorTile(pos, state); - } - - // NEW TICK SYSTEM - @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { - return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, StirlingGeneratorTile::serverTick); - } - - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { - return blockEntityType == tile ? (BlockEntityTicker) serverTick : null; + return VETileEntities.STIRLING_GENERATOR_FACTORY.create(pos, state); } @Nullable public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType blockEntityType) { return createTicker(level, blockEntityType, VEBlocks.STIRLING_GENERATOR_TILE.get()); } - - @Override - public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) { - if (!world.isClientSide) { - BlockEntity tileEntity = world.getBlockEntity(pos); - if (tileEntity instanceof MenuProvider menuProvider && player instanceof ServerPlayer serverPlayer) { - serverPlayer.openMenu(menuProvider, tileEntity.getBlockPos()); - } else { - throw new IllegalStateException(this.getClass().getName() + " named container provider is missing!"); - } - return InteractionResult.SUCCESS; - } - return InteractionResult.SUCCESS; - - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java index e3f3eb01b..1d04ab135 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java @@ -2,8 +2,8 @@ import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.TagUtil; +import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.core.NonNullList; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Level; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java index 4878c25d1..ba5bf80a6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.containers; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.TileSlot; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.TileSlot; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.SlotType; import net.minecraft.core.BlockPos; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java index 898a1041c..4142697b0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.containers; import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory.VEContainerFactoryBuilder; -import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.*; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.*; import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.*; import static net.minecraft.core.Direction.*; @@ -12,7 +12,7 @@ public class VEContainers { .create(AIR_COMPRESSOR_CONTAINER, AIR_COMPRESSOR_BLOCK) .addSlot(70, 18,new BucketInputSlot(UP,0)) // Air Compressor bucket input tilePos .addSlot(70, 49,new BucketOutputSlot(DOWN)) // Air Compressor bucket output tilePos - .addSlot(154, -14) // Upgrade Slot + .addUpgradeSlot(154, -14) // Upgrade Slot .build(); public static final VEContainerFactory AQUEOULIZER_FACTORY = new VEContainerFactoryBuilder() diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java index 2c75e5756..2c6a8e3cf 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java @@ -3,7 +3,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.BlastFurnaceTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.processor.MultiBlockRecipeProcessor; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; @@ -19,14 +20,14 @@ import java.util.List; public class BlastFurnaceScreen extends VEContainerScreen { - private BlastFurnaceTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/blast_furnace_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); private static final ResourceLocation MULTIBLOCK_WARN = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/multiblock_invalid_warning.png"); public BlastFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); - tileEntity = (BlastFurnaceTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -46,14 +47,17 @@ protected void init(){ @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - if (tileEntity.getMultiblockValidity()){ + + MultiBlockRecipeProcessor processor = (MultiBlockRecipeProcessor) tileEntity.getRecipeProcessor(); + + if (processor.isMultiBlockValid(tileEntity)){ TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("blast_furnace"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.temperature").getString() + ": " + - tileEntity.getTemperatureKelvin() + " K (" + - tileEntity.getTemperatureCelsius() + " \u00B0C) "), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + tileEntity.getData("temperature_kelvin") + " K (" + + tileEntity.getData("temperature_celsius") + " \u00B0C) "), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,Component.nullToEmpty(tileEntity.getTemperatureFahrenheit() + " \u00B0F"), 101, (this.imageHeight - 103), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font,Component.nullToEmpty(tileEntity.getData("temperature_fahrenheit") + " \u00B0F"), 101, (this.imageHeight - 103), WHITE_TEXT_STYLE); } super.renderLabels(matrixStack, mouseX, mouseY); @@ -108,7 +112,7 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; matrixStack.blit(this.GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null && tileEntity.getMultiblockValidity()){ + if(tileEntity != null && tileEntity.getRecipeProcessor() instanceof MultiBlockRecipeProcessor multiBlockRecipeProcessor && multiBlockRecipeProcessor.isMultiBlockValid(tileEntity)){ int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java index f6004cb05..04c4bb8a1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.CentrifugalAgitatorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; @@ -19,14 +19,14 @@ import java.util.List; public class CentrifugalAgitatorScreen extends VEContainerScreen { - private final CentrifugalAgitatorTile tileEntity; + private final VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/centrifugal_agitator_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public CentrifugalAgitatorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (CentrifugalAgitatorTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java index 65b264978..eef833b16 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.CentrifugalSeparatorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; @@ -18,14 +18,14 @@ import java.util.List; public class CentrifugalSeparatorScreen extends VEContainerScreen { - private CentrifugalSeparatorTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/centrifugal_separator_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public CentrifugalSeparatorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); - tileEntity = (CentrifugalSeparatorTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java index e43bffa9a..e81d5143e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.CompressorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; @@ -19,14 +19,14 @@ public class CompressorScreen extends VEContainerScreen { - private CompressorTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/compressor_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public CompressorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); - tileEntity = (CompressorTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java index e5bf029bf..c2c9e5695 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.CrusherTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; @@ -18,14 +18,14 @@ import java.util.List; public class CrusherScreen extends VEContainerScreen { - private final CrusherTile tileEntity; + private final VETileEntity tileEntity; private final static ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/crushergui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public CrusherScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); - tileEntity = (CrusherTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java index 59dc2b3c4..bfb766715 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java @@ -3,7 +3,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.DistillationUnitTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.processor.MultiBlockRecipeProcessor; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; @@ -19,7 +20,7 @@ import java.util.List; public class DistillationUnitScreen extends VEContainerScreen { - private DistillationUnitTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/distillation_unit_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); private static final ResourceLocation MULTIBLOCK_WARN = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/multiblock_invalid_warning.png"); @@ -27,7 +28,7 @@ public class DistillationUnitScreen extends VEContainerScreen { public DistillationUnitScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); - tileEntity = (DistillationUnitTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -47,7 +48,8 @@ protected void init(){ @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - if (tileEntity.getMultiblockValidity()){ + MultiBlockRecipeProcessor processor = (MultiBlockRecipeProcessor) tileEntity.getRecipeProcessor(); + if (processor.isMultiBlockValid(tileEntity)){ TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("distillation_unit"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); } @@ -118,7 +120,8 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null && tileEntity.getMultiblockValidity()){ + MultiBlockRecipeProcessor processor = (MultiBlockRecipeProcessor) tileEntity.getRecipeProcessor(); + if(tileEntity != null && processor.isMultiBlockValid(tileEntity)){ int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java index a4cbc70d7..aa3028cea 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.ElectrolyzerTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; @@ -18,14 +18,14 @@ import java.util.List; public class ElectrolyzerScreen extends VEContainerScreen { - private ElectrolyzerTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/electrolyzer_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public ElectrolyzerScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); - tileEntity = (ElectrolyzerTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java index 4285316f3..b4cb267bf 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.FluidElectrolyzerTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; @@ -19,14 +19,14 @@ import java.util.List; public class FluidElectrolyzerScreen extends VEContainerScreen { - private final FluidElectrolyzerTile tileEntity; + private final VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/fluid_electrolyzer_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public FluidElectrolyzerScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); - tileEntity = (FluidElectrolyzerTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java index 32a50545e..606a83885 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.FluidMixerTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; @@ -20,14 +20,14 @@ import java.util.List; public class FluidMixerScreen extends VEContainerScreen { - private final FluidMixerTile tileEntity; + private final VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/fluid_mixer_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public FluidMixerScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); - tileEntity = (FluidMixerTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java index 8758ecd57..49987006b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.HydroponicIncubatorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; @@ -19,14 +19,14 @@ import java.util.List; public class HydroponicIncubatorScreen extends VEContainerScreen { - private final HydroponicIncubatorTile tileEntity; + private final VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/hydroponic_incubator_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public HydroponicIncubatorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ super(screenContainer,inv,titleIn); - tileEntity = (HydroponicIncubatorTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java index fb44e74ab..7b96ba945 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java @@ -3,11 +3,12 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.ImplosionCompressorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotBoolButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotDirectionButton; +import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.GameRenderer; @@ -22,14 +23,14 @@ public class ImplosionCompressorScreen extends VEContainerScreen { - private ImplosionCompressorTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/implosion_compressor_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public ImplosionCompressorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (ImplosionCompressorTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -41,30 +42,32 @@ protected void init() { })); + List managers = tileEntity.getSlotManagers(); + // Input insert - addRenderableWidget(new SlotBoolButton(tileEntity.inputSlotManager, (this.width / 2) - 198, this.topPos, button -> { + addRenderableWidget(new SlotBoolButton(managers.get(0), (this.width / 2) - 198, this.topPos, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.inputSlotManager, (this.width / 2) - 184, this.topPos, button -> { + addRenderableWidget(new SlotDirectionButton(managers.get(0), (this.width / 2) - 184, this.topPos, button -> { // Do nothing })); // Input Gunpowder - addRenderableWidget(new SlotBoolButton(tileEntity.gunpowderSlotManager, (this.width / 2) - 198, this.topPos + 20, button -> { + addRenderableWidget(new SlotBoolButton(managers.get(1), (this.width / 2) - 198, this.topPos + 20, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.gunpowderSlotManager, (this.width / 2) - 184, this.topPos + 20, button -> { + addRenderableWidget(new SlotDirectionButton(managers.get(1), (this.width / 2) - 184, this.topPos + 20, button -> { // Do nothing })); // Output - addRenderableWidget(new SlotBoolButton(tileEntity.outputSlotManager, (this.width / 2) - 198, this.topPos + 40, button -> { + addRenderableWidget(new SlotBoolButton(managers.get(2), (this.width / 2) - 198, this.topPos + 40, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.outputSlotManager, (this.width / 2) - 184, this.topPos + 40, button -> { + addRenderableWidget(new SlotDirectionButton(managers.get(2), (this.width / 2) - 184, this.topPos + 40, button -> { // Do nothing })); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java index 103e0096c..a2ef12c91 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java @@ -3,10 +3,11 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.PrimitiveBlastFurnaceTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotBoolButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotDirectionButton; +import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.GameRenderer; @@ -16,18 +17,19 @@ import net.minecraft.world.entity.player.Inventory; import org.jetbrains.annotations.NotNull; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class PrimitiveBlastFurnaceScreen extends VEContainerScreen { - private PrimitiveBlastFurnaceTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID,"textures/gui/primitiveblastgui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public PrimitiveBlastFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (PrimitiveBlastFurnaceTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -46,21 +48,23 @@ protected void init(){ })); + List managers = tileEntity.getSlotManagers(); + // Input - addRenderableWidget(new SlotBoolButton(tileEntity.inputSm, (this.width/2)-198, this.topPos, button->{ + addRenderableWidget(new SlotBoolButton(managers.get(0), (this.width/2)-198, this.topPos, button->{ // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.inputSm, (this.width/2)-184, this.topPos, button ->{ + addRenderableWidget(new SlotDirectionButton(managers.get(0), (this.width/2)-184, this.topPos, button ->{ // Do nothing })); // Output - addRenderableWidget(new SlotBoolButton(tileEntity.outputSm, (this.width/2)-198, this.topPos+20, button ->{ + addRenderableWidget(new SlotBoolButton(managers.get(1), (this.width/2)-198, this.topPos+20, button ->{ // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.outputSm, (this.width/2)-184, this.topPos+20, button ->{ + addRenderableWidget(new SlotDirectionButton(managers.get(1), (this.width/2)-184, this.topPos+20, button ->{ // Do nothing })); } @@ -99,7 +103,7 @@ public Rect2i getTooltipArea() { public List getTooltips() { return Arrays.asList( Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.percent_complete").getString() + ": " + tileEntity.progressCounterPercent() + "%"), - Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.getCounter())); + Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.getData("counter"))); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java index 98214deb2..dde278bc3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.PrimitiveSolarPanelTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.Minecraft; @@ -17,11 +17,11 @@ public class PrimitiveSolarPanelScreen extends VEContainerScreen { private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/solar_panel_gui.png"); - private final PrimitiveSolarPanelTile tileEntity; + private final VETileEntity tileEntity; public PrimitiveSolarPanelScreen(VEContainer container, Inventory inv, Component name) { super(container, inv, name); - tileEntity = (PrimitiveSolarPanelTile) container.getTileEntity(); + tileEntity = container.getTileEntity(); container.setScreen(this); } @@ -44,7 +44,7 @@ protected void renderTooltip(@NotNull GuiGraphics matrixStack, int mouseX, int m protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY){ TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("primitive_solar_panel"), 8, 6, WHITE_TEXT_STYLE); if (tileEntity.getLevel().isDay()) - TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getGeneration() + " FE/t"), 90, 32, WHITE_TEXT_STYLE); + TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergy().getProduction() + " FE/t"), 90, 32, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); //super.renderLabels(matrixStack, mouseX, mouseY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java index ea4d0002a..af3b73a56 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.SolarPanelTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.Minecraft; @@ -17,11 +17,11 @@ public class SolarPanelScreen extends VEContainerScreen { private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/solar_panel_gui.png"); - private final SolarPanelTile tileEntity; + private final VETileEntity tileEntity; public SolarPanelScreen(VEContainer container, Inventory inv, Component name) { super(container, inv, name); - tileEntity = (SolarPanelTile) container.getTileEntity(); + tileEntity = container.getTileEntity(); container.setScreen(this); } @@ -43,7 +43,7 @@ protected void renderTooltip(@NotNull GuiGraphics matrixStack, int mouseX, int m protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY){ TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("solar_panel"), 8, 6, WHITE_TEXT_STYLE); if (tileEntity.getLevel().isDay()) - TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getGeneration() + " FE/t"), 90, 32, WHITE_TEXT_STYLE); + TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergy().getProduction() + " FE/t"), 90, 32, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); //super.renderLabels(matrixStack, mouseX, mouseY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java index cd25da30b..48f6c5f73 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.StirlingGeneratorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotBoolButton; @@ -22,14 +22,14 @@ import java.util.List; public class StirlingGeneratorScreen extends VEContainerScreen { - private final StirlingGeneratorTile tileEntity; + private final VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/stirling_generator.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public StirlingGeneratorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (StirlingGeneratorTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java index e0271954c..62372a416 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java @@ -11,8 +11,8 @@ import com.veteam.voluminousenergy.tools.networking.VENetwork; import com.veteam.voluminousenergy.tools.networking.packets.UuidPacket; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.TextUtil; +import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Renderable; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java deleted file mode 100644 index 698594fec..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java +++ /dev/null @@ -1,157 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.fluids.VEFluids; -import com.veteam.voluminousenergy.sounds.VESounds; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TagUtil; -import com.veteam.voluminousenergy.util.TankType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.sounds.SoundSource; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.BucketItem; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Fluids; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.Collections; -import java.util.List; - -public class AirCompressorTile extends VETileEntity { - - public VESlotManager[] slotManagers = new VESlotManager[]{ - new VESlotManager(0,Direction.UP,true, SlotType.FLUID_INPUT,1,0), - new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT) - }; - - private final ItemStackHandler inventory = createHandler(3, this); - - private final VERelationalTank airTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, TankType.OUTPUT, "air_tank:air_tank_properties"); - - public AirCompressorTile(BlockPos pos, BlockState state) { - super(VEBlocks.AIR_COMPRESSOR_TILE.get(), pos, state, null); - airTank.setAllowAny(true); - } - - @Override - public void tick() { - updateClients(); - processFluidIO(); - - if (!canConsumeEnergy()) return; - if (counter <= 0) { - // Check blocks around the Air Compressor to see if it's air - int x = this.worldPosition.getX(); - int y = this.worldPosition.getY(); - int z = this.worldPosition.getZ(); - - int airMultiplier = 0; - // Check X offsets - if (Blocks.AIR == level.getBlockState(new BlockPos(x + 1, y, z)).getBlock()) - airMultiplier++; - if (Blocks.AIR == level.getBlockState(new BlockPos(x - 1, y, z)).getBlock()) - airMultiplier++; - // Check Y offsets - if (Blocks.AIR == level.getBlockState(new BlockPos(x, y + 1, z)).getBlock()) - airMultiplier++; - if (Blocks.AIR == level.getBlockState(new BlockPos(x, y - 1, z)).getBlock()) - airMultiplier++; - if (Blocks.AIR == level.getBlockState(new BlockPos(x, y, z + 1)).getBlock()) - airMultiplier++; - if (Blocks.AIR == level.getBlockState(new BlockPos(x, y, z - 1)).getBlock()) - airMultiplier++; - if (addAirToTank(airMultiplier)) { - consumeEnergy(); - if (++sound_tick == 19) { - sound_tick = 0; - if (Config.PLAY_MACHINE_SOUNDS.get()) { - level.playSound(null, this.getBlockPos(), VESounds.AIR_COMPRESSOR, SoundSource.BLOCKS, 1.0F, 1.0F); - } - } - counter = (byte) this.calculateCounter(20, this.inventory.getStackInSlot(this.energy.getUpgradeSlotId())); - } - } else { - counter--; - } - } - - public ItemStackHandler createHandler(int size, AirCompressorTile tileEntity) { - return new ItemStackHandler(size) { - @Override - protected void onContentsChanged(int slot) { - setChanged(); - tileEntity.markFluidInputDirty(); - } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if (tileEntity.energy.getUpgradeSlotId() == slot) { - return TagUtil.isTaggedMachineUpgradeItem(stack); - } - if(slot == 0 && stack.getItem() instanceof BucketItem bucketItem) { - return bucketItem.getFluid().isSame(Fluids.EMPTY); - } - return true; - } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if(!isItemValid(slot,stack)) return stack; - return super.insertItem(slot, stack, simulate); - } - }; - } - - public boolean addAirToTank(int multiplier) { - - int totalToAdd = 250 * multiplier; - int amountToAdd = Math.min(totalToAdd, (airTank.getTank().getFluidAmount() + totalToAdd)); - if (amountToAdd == 0) return false; - airTank.getTank().fill(new FluidStack(VEFluids.COMPRESSED_AIR_REG.get(), amountToAdd), IFluidHandler.FluidAction.EXECUTE); - return true; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.AIR_COMPRESSOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - public FluidStack getAirTankFluid() { - return this.airTank.getTank().getFluid(); - } - - @Override - public @Nonnull List getRelationalTanks() { - return Collections.singletonList(airTank); - } - - public VERelationalTank getAirTank() { - return this.airTank; - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return this.inventory; - } - - @Override - public @Nonnull List getSlotManagers() { - return List.of(slotManagers); - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java deleted file mode 100644 index ab4c4bba9..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.AqueoulizerRecipe; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; - -import javax.annotation.Nonnull; -import java.util.ArrayList; -import java.util.List; - -public class AqueoulizerTile extends VETileEntity { - private final ItemStackHandler inventory = new VEItemStackHandler(this,6); - - public List fluidManagers = new ArrayList<>() {{ - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank:input_tank_gui")); - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 1, 0, TankType.OUTPUT, "outputTank:output_tank_gui")); - }}; - - public List slotManagers = new ArrayList<>(){{ - add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); - add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(2, Direction.NORTH, true, SlotType.FLUID_INPUT, 3, 1)); - add(new VESlotManager(3, Direction.SOUTH, true, SlotType.FLUID_OUTPUT)); -// add(new VESlotManager(4, 0, Direction.EAST, true, SlotType.INPUT)); - }}; - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - public AqueoulizerTile(BlockPos pos, BlockState state) { - super(VEBlocks.AQUEOULIZER_TILE.get(), pos, state, AqueoulizerRecipe.RECIPE_TYPE); - } - - @Nonnull - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.AQUEOULIZER_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull List getRelationalTanks() { - return fluidManagers; - } - - @Override - public @Nonnull List getSlotManagers() { - return slotManagers; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java deleted file mode 100644 index d6d7754f9..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.IndustrialBlastingRecipe; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class BlastFurnaceTile extends VEMultiBlockTileEntity { - - List slotManagers = new ArrayList<>() { - { - add(new VESlotManager(0, Direction.UP, false, SlotType.FLUID_INPUT, 1, 0)); - add(new VESlotManager(1, Direction.DOWN, false, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(2,0, Direction.EAST, false, SlotType.INPUT)); - add(new VESlotManager(3,1, Direction.WEST, false, SlotType.INPUT)); - add(new VESlotManager(4,0, Direction.NORTH, false, SlotType.OUTPUT)); - } - }; - - VERelationalTank[] fluidManagers = new VERelationalTank[]{ - new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0,0, TankType.INPUT, "heatTank:heat_tank_gui") - }; - - private byte tick = 19; - - public ItemStackHandler inventory = new VEItemStackHandler(this,6); - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @Override - public @Nonnull List getSlotManagers() { - return this.slotManagers; - } - - public BlastFurnaceTile(BlockPos pos, BlockState state) { - super(VEBlocks.BLAST_FURNACE_TILE.get(), pos, state, IndustrialBlastingRecipe.RECIPE_TYPE); - fluidManagers[0].setAllowAny(true); - } - - @Override - public void tick() { - updateClients(); - tick++; - if (tick == 20) { - tick = 0; - validity = isMultiBlockValid(VEBlocks.TITANIUM_MACHINE_CASING_BLOCK.get()); - } - if (!(validity)) { - return; - } - - super.tick(); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.BLAST_FURNACE_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - public FluidStack getFluidStackFromTank(int num) { - if (num == 0) { - return fluidManagers[num].getTank().getFluid(); - } - return FluidStack.EMPTY; - } - - public boolean getMultiblockValidity() { - return validity; - } - - public int getTemperatureKelvin() { - return fluidManagers[0].getTank().getFluid().getRawFluid().getFluidType().getTemperature(); - } - - public int getTemperatureCelsius() { - return getTemperatureKelvin() - 273; - } - - public int getTemperatureFahrenheit() { - return (int) ((getTemperatureKelvin() - 273) * 1.8) + 32; - } - - @Override - public @NotNull List getRelationalTanks() { - return List.of(fluidManagers); - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java deleted file mode 100644 index e17badc6d..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.CentrifugalAgitatorRecipe; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class CentrifugalAgitatorTile extends VETileEntity { - - public List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); - add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(2, Direction.NORTH, true, SlotType.FLUID_INPUT, 3, 1)); - add(new VESlotManager(3, Direction.SOUTH, true, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(4, Direction.EAST, true, SlotType.FLUID_INPUT, 5, 2)); - add(new VESlotManager(5, Direction.WEST, true, SlotType.FLUID_OUTPUT)); - }}; - - public List fluidManagers = new ArrayList<>() {{ - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank:input_tank_gui")); - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 1, 0, TankType.OUTPUT, "outputTank0:output_tank_0_gui")); - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 2, 1, TankType.OUTPUT, "outputTank1:output_tank_1_gui")); - }}; - - public CentrifugalAgitatorTile(BlockPos pos, BlockState state) { - super(VEBlocks.CENTRIFUGAL_AGITATOR_TILE.get(), pos, state, CentrifugalAgitatorRecipe.RECIPE_TYPE); - } - - public ItemStackHandler inventory = new VEItemStackHandler(this, 7); - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @Override - public void tick() { - super.tick(); - } - - @Nonnull - @Override - public List getSlotManagers() { - return slotManagers; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.CENTRIFUGAL_AGITATOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @NotNull List getRelationalTanks() { - return fluidManagers; - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java deleted file mode 100644 index 70d990f70..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.CentrifugalSeparatorRecipe; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class CentrifugalSeparatorTile extends VETileEntity { - private final ItemStackHandler handler = new VEItemStackHandler(this,7); - - public List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0,0, Direction.UP,true, SlotType.INPUT)); - add(new VESlotManager(1,1,Direction.WEST,true,SlotType.INPUT)); - add(new VESlotManager(2,0,Direction.DOWN,true,SlotType.OUTPUT)); - add(new VESlotManager(3,1, Direction.NORTH, true,SlotType.OUTPUT)); - add(new VESlotManager(4,2,Direction.SOUTH,true,SlotType.OUTPUT)); - add(new VESlotManager(5,3,Direction.EAST,true,SlotType.OUTPUT)); - }}; - - public CentrifugalSeparatorTile(BlockPos pos, BlockState state) { - super(VEBlocks.CENTRIFUGAL_SEPARATOR_TILE.get(), pos, state,CentrifugalSeparatorRecipe.RECIPE_TYPE); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return handler; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java index 07c57fd49..6cb2d5508 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java @@ -3,15 +3,13 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorOxidizerRecipe; -import com.veteam.voluminousenergy.recipe.RecipeCache; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; +import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; @@ -19,12 +17,8 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.BucketItem; -import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Fluid; -import net.minecraft.world.level.material.Fluids; import net.minecraftforge.common.capabilities.ForgeCapabilities; import net.minecraftforge.common.util.LazyOptional; import net.minecraftforge.energy.IEnergyStorage; @@ -37,7 +31,6 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import java.util.ArrayList; -import java.util.Collections; import java.util.List; public class CombustionGeneratorTile extends VETileEntity { @@ -62,18 +55,12 @@ public class CombustionGeneratorTile extends VETileEntity { }; private int energyRate; - private final ItemStackHandler inventory = createHandler(); - public CombustionGeneratorTile(BlockPos pos, BlockState state) { super(VEBlocks.COMBUSTION_GENERATOR_TILE.get(), pos, state, null); fluidManagers.get(0).getTank().setValidator(fluid -> { List recipes = CombustionGeneratorRecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE); return recipes.stream().anyMatch(r -> r.getFluidIngredient(0).test(fluid)); }); - fluidManagers.get(1).getTank().setValidator(fluid -> { - List recipes = CombustionGeneratorOxidizerRecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE); - return recipes.stream().anyMatch(r -> r.getFluidIngredient(0).test(fluid)); - }); } private LazyOptional energyCapability = null; @@ -124,25 +111,6 @@ public void tick() { sendOutPower(); } - - @Override - public void validateRecipe() { - if (!this.isRecipeDirty) { - return; - } - this.isRecipeDirty = false; - oxidizerRecipe = - RecipeCache.getFluidRecipeFromCache(level, - CombustionGeneratorOxidizerRecipe.RECIPE_TYPE, - Collections.singletonList(fluidManagers.get(1).getTank().getFluid()), - new ArrayList<>()); - - fuelRecipe = RecipeCache.getFluidRecipeFromCache(level, - CombustionGeneratorRecipe.RECIPE_TYPE, - Collections.singletonList(fluidManagers.get(0).getTank().getFluid()), - new ArrayList<>()); - } - @Override public void load(CompoundTag tag) { energyRate = tag.getInt("energy_rate"); @@ -176,35 +144,6 @@ void sendOutPower() { } } - private ItemStackHandler createHandler() { - return new ItemStackHandler(4) { - @Override - protected void onContentsChanged(int slot) { - setChanged(); - markFluidInputDirty(); - } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - - if (stack.getItem() instanceof BucketItem bucketItem) { - Fluid fluid = bucketItem.getFluid(); - if (fluid.isSame(Fluids.EMPTY)) return true; - FluidStack testFluid = new FluidStack(fluid, COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT); - if (slot == 0) { - List recipes = VERecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE); - return recipes.stream().anyMatch(r -> r.getFluidIngredient(0).test(testFluid)); - } else if (slot == 2) { - List recipes = VERecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE); - return recipes.stream().anyMatch(r -> r.getFluidIngredient(0).test(testFluid)); - } - return true; - } - return false; - } - }; - } - @Nullable @Override public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java deleted file mode 100644 index daff60fbb..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.CompressorRecipe; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.crafting.Recipe; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class CompressorTile extends VETileEntity { - - public List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0,0, Direction.UP, true, SlotType.INPUT)); - add(new VESlotManager(1,0, Direction.DOWN, true, SlotType.OUTPUT)); - }}; - - public CompressorTile(BlockPos pos, BlockState state) { - super(VEBlocks.COMPRESSOR_TILE.get(), pos, state, null); - } - - @Deprecated - public CompressorTile(BlockEntityType type, BlockPos pos, BlockState state) { - super(VEBlocks.COMPRESSOR_TILE.get(), pos, state, null); - } - - private final ItemStackHandler inventory = new VEItemStackHandler(this,3); - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.COMPRESSOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } - - @Override - public RecipeType> getRecipeType() { - return CompressorRecipe.RECIPE_TYPE; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java deleted file mode 100644 index 7c0413fed..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.CrusherRecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TagUtil; -import com.veteam.voluminousenergy.util.randoms.JavaRandomSource; -import com.veteam.voluminousenergy.util.recipe.RecipeUtil; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.util.Mth; -import net.minecraft.world.entity.ExperienceOrb; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.Random; - -public class CrusherTile extends VETileEntity { - - public List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0,0, Direction.UP, true, SlotType.INPUT)); - add(new VESlotManager(1,0, Direction.DOWN, true, SlotType.OUTPUT)); - add(new VESlotManager(2,1, Direction.NORTH, true, SlotType.OUTPUT)); - }}; - - public CrusherTile(BlockPos pos, BlockState state) { - super(VEBlocks.CRUSHER_TILE.get(), pos, state, CrusherRecipe.RECIPE_TYPE); - } - - public ItemStackHandler inventory = new VEItemStackHandler(this,4); - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.CRUSHER_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java index 0cefd18c7..88b261136 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java @@ -10,9 +10,9 @@ import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.WorldUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java deleted file mode 100644 index e09e6041f..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.DistillationRecipe; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; -import org.apache.commons.lang3.NotImplementedException; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class DistillationUnitTile extends VEMultiBlockTileEntity { - public List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0, Direction.UP, false, SlotType.FLUID_INPUT,1,0)); - add(new VESlotManager(1, Direction.DOWN, false, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(2, Direction.UP, false, SlotType.FLUID_INPUT,3,1)); - add(new VESlotManager(3, Direction.DOWN, false, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(4, Direction.UP, false, SlotType.FLUID_INPUT,5,2)); - add(new VESlotManager(5, Direction.DOWN, false, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(6, 0, Direction.DOWN, false, SlotType.OUTPUT)); - }}; - - public List fluidManagers = new ArrayList<>() {{ - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank:input_tank_gui")); - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 1, 0, TankType.OUTPUT, "outputTank0:output_tank_0_gui")); - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 2, 1, TankType.OUTPUT, "outputTank1:output_tank_1_gui")); - }}; - - private byte tick = 19; - - public DistillationUnitTile(BlockPos pos, BlockState state) { - super(VEBlocks.DISTILLATION_UNIT_TILE.get(), pos, state, DistillationRecipe.RECIPE_TYPE); - } - - @Override - public void tick() { - updateClients(); - tick++; - if (tick == 20) { - tick = 0; - validity = isMultiBlockValid(VEBlocks.ALUMINUM_MACHINE_CASING_BLOCK.get()); - } - if (!(validity)) { - return; - } - super.tick(); - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.DISTILLATION_UNIT_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Nullable - @Override - public ItemStackHandler getInventoryHandler() { - throw new NotImplementedException("Missing impl for Distillation tile inventory handler!"); - } - - @Override - public @NotNull List getRelationalTanks() { - return fluidManagers; - } - - public boolean getMultiblockValidity() { - return validity; - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.java deleted file mode 100644 index e5a0cc98b..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.ElectrolyzerRecipe; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class ElectrolyzerTile extends VETileEntity { - - List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0,0, Direction.UP, true, SlotType.INPUT)); - add(new VESlotManager(1,1, Direction.WEST, true, SlotType.INPUT)); - add(new VESlotManager(2,0, Direction.DOWN, true, SlotType.OUTPUT)); - add(new VESlotManager(3,1, Direction.NORTH, true, SlotType.OUTPUT)); - add(new VESlotManager(4,2, Direction.SOUTH, true, SlotType.OUTPUT)); - add(new VESlotManager(5,3, Direction.EAST, true, SlotType.OUTPUT)); - }}; - - public ElectrolyzerTile(BlockPos pos, BlockState state) { - super(VEBlocks.ELECTROLYZER_TILE.get(), pos, state, ElectrolyzerRecipe.RECIPE_TYPE); - } - - public ItemStackHandler inventory = new VEItemStackHandler(this,7); - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.ELECTROLYZER_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java deleted file mode 100644 index 4838cd2e8..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.FluidElectrolyzerRecipe; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.crafting.Recipe; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class FluidElectrolyzerTile extends VETileEntity { - - - public List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); - add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(2, Direction.EAST, true, SlotType.FLUID_INPUT, 3, 1)); - add(new VESlotManager(3, Direction.WEST, true, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(4, Direction.NORTH, true, SlotType.FLUID_INPUT, 5, 2)); - add(new VESlotManager(5, Direction.SOUTH, true, SlotType.FLUID_OUTPUT)); - }}; - - public List fluidManagers = new ArrayList<>() {{ - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank:input_tank_gui")); - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 1, 0, TankType.OUTPUT, "outputTank0:output_tank_0_gui")); - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 2, 1, TankType.OUTPUT, "outputTank1:output_tank_1_gui")); - }}; - - public FluidElectrolyzerTile(BlockPos pos, BlockState state) { - super(VEBlocks.FLUID_ELECTROLYZER_TILE.get(), pos, state, FluidElectrolyzerRecipe.RECIPE_TYPE); - } - - public ItemStackHandler inventory = new VEItemStackHandler(this,7); - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @Nonnull - @Override - public List getSlotManagers() { - return slotManagers; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.FLUID_ELECTROLYZER_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @NotNull List getRelationalTanks() { - return fluidManagers; - } - - @Override - public RecipeType> getRecipeType() { - return FluidElectrolyzerRecipe.RECIPE_TYPE; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java deleted file mode 100644 index ada6da6cd..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.FluidMixerRecipe; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class FluidMixerTile extends VETileEntity { - List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); - add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(2, Direction.EAST, true, SlotType.FLUID_INPUT, 3, 1)); - add(new VESlotManager(3, Direction.WEST, true, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(4, Direction.NORTH, true, SlotType.FLUID_INPUT, 5, 2)); - add(new VESlotManager(5, Direction.SOUTH, true, SlotType.FLUID_OUTPUT)); - }}; - - List fluidManagers = new ArrayList<>() {{ - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.INPUT, "inputTank0:input_tank_0_gui")); - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 1, 1, TankType.INPUT, "inputTank1:input_tank_1_gui")); - add(new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 2, 0, TankType.OUTPUT, "outputTank0:output_tank_0_gui")); - }}; - - public FluidMixerTile(BlockPos pos, BlockState state) { - super(VEBlocks.FLUID_MIXER_TILE.get(), pos, state, FluidMixerRecipe.RECIPE_TYPE); - } - - public ItemStackHandler inventory = new VEItemStackHandler(this, 7); - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @Nonnull - @Override - public List getSlotManagers() { - return slotManagers; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.FLUID_MIXER_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @NotNull List getRelationalTanks() { - return fluidManagers; - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java deleted file mode 100644 index 634e64dd7..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.HydroponicIncubatorRecipe; -import com.veteam.voluminousenergy.recipe.VERNGRecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.sounds.VESounds; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.sounds.SoundSource; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -import static net.minecraft.util.Mth.abs; - -public class HydroponicIncubatorTile extends VETileEntity { - - private final ItemStackHandler inventory = new VEItemStackHandler(this, 8); - - List slotManagers = new ArrayList<>() { - { - add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT,1,0)); - add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(2,0, Direction.NORTH, true, SlotType.INPUT)); - add(new VESlotManager(3,0, Direction.NORTH, true, SlotType.OUTPUT)); - add(new VESlotManager(4,1, Direction.NORTH, true, SlotType.OUTPUT)); - add(new VESlotManager(5,2, Direction.NORTH, true, SlotType.OUTPUT)); - add(new VESlotManager(6,3, Direction.NORTH, true, SlotType.OUTPUT)); - } - }; - - VERelationalTank inputTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0,0, TankType.INPUT, "inputTank:input_tank_gui"); - - List fluidManagers = new ArrayList<>() { - { - add(inputTank); - } - }; - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @Override - public @Nonnull List getSlotManagers() { - return slotManagers; - } - - public HydroponicIncubatorTile(BlockPos pos, BlockState state) { - super(VEBlocks.HYDROPONIC_INCUBATOR_TILE.get(), pos, state,HydroponicIncubatorRecipe.RECIPE_TYPE); - inputTank.setAllowAny(true); - } - - @Override - public @Nonnull CompoundTag getUpdateTag() { - CompoundTag compoundTag = new CompoundTag(); - this.saveAdditional(compoundTag); - return compoundTag; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.HYDROPONIC_INCUBATOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - public FluidStack getFluidStackFromTank(int num) { - if (num == 0) { - return inputTank.getTank().getFluid(); - } - return FluidStack.EMPTY; - } - - // We copy the whole method to prevent the input from being decremented - @Override - void processRecipe() { - if (selectedRecipe == null) return; - VERecipe recipe = selectedRecipe; - - if (canConsumeEnergy()) { - - if (counter == 1) { - // Validate output - for (VERelationalTank relationalTank : getRelationalTanks()) { - if (relationalTank.getTankType() == TankType.OUTPUT) { - FluidStack recipeFluid = recipe.getOutputFluid(relationalTank.getRecipePos()); - FluidTank tank = relationalTank.getTank(); - FluidStack currentFluid = tank.getFluid(); - if(currentFluid.isEmpty()) continue; - // If the output fluid amount won't fit, then you must acquit - if (!recipeFluid.isFluidEqual(currentFluid) - || tank.getFluidAmount() + recipeFluid.getAmount() > tank.getCapacity()) { - return; - } - } - } - - ItemStackHandler handler = getInventoryHandler(); - - if (handler != null) { - // Validate output - for (VESlotManager slotManager : getSlotManagers()) { - if(slotManager.getSlotType() != SlotType.OUTPUT) continue; - ItemStack recipeStack = recipe.getResult(slotManager.getRecipePos()); - ItemStack currentItem = slotManager.getItem(handler); - if(currentItem.isEmpty()) continue; - // If the output item amount won't fit, then you must acquit - if(!recipeStack.is(currentItem.getItem()) - || recipeStack.getCount() + currentItem.getCount() > currentItem.getMaxStackSize()) { - return; - } - } - - VERNGRecipe irngRecipe = null; - if(recipe instanceof VERNGRecipe rec) { - irngRecipe = rec; - } - Random r = new Random(); - - // process recipe - for(VESlotManager slotManager : getSlotManagers()) { - if(slotManager.getSlotType() == SlotType.OUTPUT) { - ItemStack output = recipe.getResult(slotManager.getRecipePos()); - ItemStack currentStack = slotManager.getItem(handler); - // rng calculations - if(irngRecipe != null) { - float randomness = irngRecipe.getOutputChance(slotManager.getRecipePos()); - if(randomness != 1) { - float random = abs(0 + r.nextFloat() * (-1)); - if(random > randomness) continue; - } - - } - if(currentStack.isEmpty()) slotManager.setItem(output,handler); - else currentStack.setCount(currentStack.getCount() + output.getCount()); - } - } - } - - // process recipe - for (VERelationalTank relationalTank : getRelationalTanks()) { - if (relationalTank.getTankType() == TankType.OUTPUT) { - relationalTank.fillOutput(recipe,relationalTank.getRecipePos()); - } else if(relationalTank.getTankType() == TankType.INPUT) { - relationalTank.drainInput(recipe,relationalTank.getRecipePos()); - } - } - doExtraRecipeProcessing(); - - this.markRecipeDirty(); - this.markFluidInputDirty(); - this.setChanged(); - } else if (counter > 0) { - if (++sound_tick == 19 && Config.PLAY_MACHINE_SOUNDS.get()) { - sound_tick = 0; - level.playSound(null, this.getBlockPos(), VESounds.AQUEOULIZER, SoundSource.BLOCKS, 1.0F, 1.0F); - } - } else { - counter = length; - } - counter--; - consumeEnergy(); - } - } - - @Override - public @NotNull List getRelationalTanks() { - return this.fluidManagers; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java deleted file mode 100644 index 58d7abc3f..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.ImplosionCompressorRecipe; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.crafting.Recipe; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class ImplosionCompressorTile extends VETileEntity { - - public VESlotManager inputSlotManager = new VESlotManager(0,0,Direction.UP,true, SlotType.INPUT); - public VESlotManager gunpowderSlotManager = new VESlotManager(1,1, Direction.EAST, true,SlotType.INPUT); - public VESlotManager outputSlotManager = new VESlotManager(2,0, Direction.DOWN, true,SlotType.OUTPUT); - - public List slotManagers = new ArrayList<>() {{ - add(inputSlotManager); - add(gunpowderSlotManager); - add(outputSlotManager); - }}; - - public ImplosionCompressorTile(BlockPos pos, BlockState state) { - super(VEBlocks.IMPLOSION_COMPRESSOR_TILE.get(), pos, state,ImplosionCompressorRecipe.RECIPE_TYPE); - } - - private final ItemStackHandler inventory = new VEItemStackHandler(this,4); - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) - { - return VEContainers.IMPLOSION_COMPRESSOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } - - @Override - public RecipeType> getRecipeType() { - return ImplosionCompressorRecipe.RECIPE_TYPE; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java deleted file mode 100644 index 635770141..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.PrimitiveBlastFurnaceRecipe; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.network.Connection; -import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.crafting.Recipe; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - - -public class PrimitiveBlastFurnaceTile extends VETileEntity { - - public VESlotManager inputSm = new VESlotManager(0,0,Direction.UP,true, SlotType.INPUT); - public VESlotManager outputSm = new VESlotManager(1,0, Direction.DOWN,true,SlotType.OUTPUT); - - List slotManagers = new ArrayList<>() {{ - add(inputSm); - add(outputSm); - }}; - - public PrimitiveBlastFurnaceTile(BlockPos pos, BlockState state) { - super(VEBlocks.PRIMITIVE_BLAST_FURNACE_TILE.get(), pos, state,PrimitiveBlastFurnaceRecipe.RECIPE_TYPE); - } - - private final ItemStackHandler inventory = new VEItemStackHandler(this,3); - - - @Override - public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) { - this.load(pkt.getTag()); - super.onDataPacket(net, pkt); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } - - public int getCounter(){ return counter; } - - @Override - public RecipeType> getRecipeType() { - return PrimitiveBlastFurnaceRecipe.RECIPE_TYPE; - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java deleted file mode 100644 index e258b786c..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.tools.Config; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nullable; - -public class PrimitiveSolarPanelTile extends VESolarTile { - - public PrimitiveSolarPanelTile(BlockPos pos, BlockState state) { - super(VEBlocks.PRIMITIVE_SOLAR_PANEL_TILE.get(), pos, state); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player playerEntity){ - return VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - public int getGeneration(){ - return (int)(Config.PRIMITIVE_SOLAR_PANEL_GENERATE.get()*this.solarIntensity()); - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java deleted file mode 100644 index b400992b9..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.StirlingGeneratorRecipe; -import com.veteam.voluminousenergy.sounds.VESounds; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.recipe.RecipeUtil; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.sounds.SoundSource; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class PrimitiveStirlingGeneratorTile extends VETileEntity { - - List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0, Direction.UP, true, SlotType.INPUT)); - }}; - - private final ItemStackHandler inventory = this.createHandler(); - - public PrimitiveStirlingGeneratorTile(BlockPos pos, BlockState state) { - super(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_TILE.get(), pos, state, null); - this.energyCap = this.getCapability(ForgeCapabilities.ENERGY); - this.maxPower = Config.PRIMITIVE_STIRLING_GENERATOR_MAX_POWER.get(); - this.generateAmount = Config.PRIMITIVE_STIRLING_GENERATOR_GENERATE.get(); - } - - @NotNull LazyOptional energyCap; - - private final int maxPower; - private final int generateAmount; - - @Override - public void tick() { - updateClients(); - if (counter > 0) { - counter--; - if (energyCap.map(IEnergyStorage::getEnergyStored).orElse(0) < maxPower) { - energy.addEnergy(generateAmount); //Amount of energy to add per tick - } - if (++sound_tick == 19) { - sound_tick = 0; - if (Config.PLAY_MACHINE_SOUNDS.get()) { - level.playSound(null, this.getBlockPos(), VESounds.GENERAL_MACHINE_NOISE, SoundSource.BLOCKS, 1.0F, 1.0F); - } - } - setChanged(); - } else { - ItemStack stack = inventory.getStackInSlot(0); - StirlingGeneratorRecipe recipe = RecipeUtil.getStirlingGeneratorRecipe(level, stack.copy()); - - if (recipe != null) { - inventory.extractItem(0, 1, false); - counter = recipe.getProcessTime(); - length = counter; - setChanged(); - } - } - sendOutPower(); - } - - private ItemStackHandler createHandler() { - return new ItemStackHandler(1) { - @Override - protected void onContentsChanged(int slot) { - setChanged(); - } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - ItemStack referenceStack = stack.copy(); - referenceStack.setCount(64); - return StirlingGeneratorRecipe.getCachedRecipes(StirlingGeneratorRecipe.RECIPE_TYPE).stream().anyMatch(r -> r.getIngredient(0).test(stack)); - } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if (!isItemValid(slot, stack)) return stack; - return super.insertItem(slot, stack, simulate); - } - }; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player playerEntity) { - return VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Nonnull - @Override - public ItemStackHandler getInventoryHandler() { - return this.inventory; - } - - @Nonnull - @Override - public List getSlotManagers() { - return this.slotManagers; - } - - - // TODO check if these methods are identical to super. If they are remove them - public int progressBurnCounterPX(int px) { - if (counter == 0) { - return 0; - } else { - return (px * (((counter * 100) / length))) / 100; - } - } - - public int progressCounterPercent() { - if (counter != 0 && length != 0) return (int) (100 - (((float) counter / (float) length) * 100)); - return 0; - } - - public int getEnergyRate() { - return 40; - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java index 033716c9b..9dad2ef26 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java @@ -6,9 +6,9 @@ import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.IntToDirection; -import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; +import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java index 0b93ebe34..a360de959 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java @@ -6,10 +6,10 @@ import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TagUtil; import com.veteam.voluminousenergy.util.TankType; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.recipe.RecipeUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; @@ -40,9 +40,9 @@ public class SawmillTile extends VETileEntity { List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0,0, Direction.UP, true, SlotType.INPUT)); - add(new VESlotManager(1,0, Direction.DOWN, true,SlotType.OUTPUT)); - add(new VESlotManager(2,1, Direction.NORTH, true,SlotType.OUTPUT)); +// add(new VESlotManager(0,0, Direction.UP, true, SlotType.INPUT)); +// add(new VESlotManager(1,0, Direction.DOWN, true,SlotType.OUTPUT)); +// add(new VESlotManager(2,1, Direction.NORTH, true,SlotType.OUTPUT)); add(new VESlotManager(3, Direction.SOUTH,true,SlotType.FLUID_INPUT,4,0)); add(new VESlotManager(4, Direction.EAST,true,SlotType.FLUID_OUTPUT)); }}; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java deleted file mode 100644 index a56cbcb87..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.tools.Config; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nullable; - -public class SolarPanelTile extends VESolarTile { - - public SolarPanelTile(BlockPos pos, BlockState state) { - super(VEBlocks.SOLAR_PANEL_TILE.get(), pos, state); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player playerEntity){ - return VEContainers.SOLAR_PANEL_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - public int getGeneration(){ - return (int)(Config.SOLAR_PANEL_GENERATE.get()*this.solarIntensity()); - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java deleted file mode 100644 index a6773b80b..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.StirlingGeneratorRecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.recipe.RecipeUtil; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.Connection; -import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class StirlingGeneratorTile extends VETileEntity { - List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0, Direction.UP, true, SlotType.INPUT)); - }}; - - private int energyRate; - private final ItemStackHandler inventory = this.createHandler(); - - public StirlingGeneratorTile(BlockPos pos, BlockState state) { - super(VEBlocks.STIRLING_GENERATOR_TILE.get(), pos, state, null); - this.energyCap = this.getCapability(ForgeCapabilities.ENERGY); - this.maxPower = Config.STIRLING_GENERATOR_MAX_POWER.get(); - } - - StirlingGeneratorRecipe recipe; - - @NotNull LazyOptional energyCap; - - private final int maxPower; - - @Override - public void tick() { - updateClients(); - validateRecipe(); - sendOutPower(); - } - - @Override - public void validateRecipe() { - if (!this.isRecipeDirty) { - return; - } - ItemStack input = this.inventory.getStackInSlot(0).copy(); - recipe = RecipeUtil.getStirlingGeneratorRecipe(level, input.copy()); - } - - public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxReceive) { - return tileEntity.getCapability(ForgeCapabilities.ENERGY, from).map(handler -> - handler.receiveEnergy(maxReceive, false)).orElse(0); - } - - void sendOutPower() { - for (Direction dir : Direction.values()) { - BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); - Direction opposite = dir.getOpposite(); - if (tileEntity != null) { - // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount - int smallest = Math.min(Config.STIRLING_GENERATOR_SEND.get(), energy.getEnergyStored()); - int received = receiveEnergy(tileEntity, opposite, smallest); - energy.consumeEnergy(received); - if (energy.getEnergyStored() <= 0) { - break; - } - } - } - } - - @Override - public void load(CompoundTag tag) { - energyRate = tag.getInt("energy_rate"); - super.load(tag); - } - - @Override - public void saveAdditional(@NotNull CompoundTag tag) { - tag.putInt("energy_rate", energyRate); - super.saveAdditional(tag); - } - - @Override - public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) { - this.load(pkt.getTag()); - super.onDataPacket(net, pkt); - } - - private ItemStackHandler createHandler() { - StirlingGeneratorTile tile = this; - return new ItemStackHandler(1) { - @Override - protected void onContentsChanged(int slot) { - setChanged(); - tile.markRecipeDirty(); - } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - ItemStack referenceStack = stack.copy(); - referenceStack.setCount(64); - return VERecipe.getCachedRecipes(StirlingGeneratorRecipe.RECIPE_TYPE).stream().anyMatch(r -> r.getIngredient(0).test(referenceStack)); - } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if (!isItemValid(slot, stack)) return stack; - return super.insertItem(slot, stack, simulate); - } - }; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.STIRLING_GENERATOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Nullable - @Override - public ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } - - public int progressBurnCounterPX(int px) { - if (counter == 0) { - return 0; - } else { - return (px * (((counter * 100) / length))) / 100; - } - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java index a7aac78e1..7107fc6a0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java @@ -10,9 +10,9 @@ import com.veteam.voluminousenergy.recipe.ToolingRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; +import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.recipe.RecipeUtil; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java index b80a4e982..24f600904 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java @@ -2,16 +2,13 @@ import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.VERecipes; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TagUtil; import com.veteam.voluminousenergy.util.TankType; +import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.world.item.BucketItem; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.level.material.Fluids; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.items.ItemStackHandler; @@ -67,7 +64,7 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { return true; } } - } else if (manager.getSlotType() == SlotType.INPUT) { + } else if (manager.getSlotType() == SlotType.INPUT || manager.getSlotType() == SlotType.OUTPUT) { for (VERecipe recipe : tileEntity.getPotentialRecipes()) { if(recipe.getParser().canInsertItem(slot,stack)) { return true; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java deleted file mode 100644 index fb61a0cb6..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.util.Mth; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public abstract class VESolarTile extends VETileEntity { - int generation; - int currentEnergy; - - public VESolarTile(BlockEntityType type, BlockPos pos, BlockState state) { - super(type, pos, state,null); - } - - @Override - public void tick() { - updateClients(); - if (this.level != null){ - if (level.dimensionType().hasSkyLight() && isClear()) { - this.generation = this.getGeneration(); - generateEnergy(this.generation); - setChanged(); - } - } - sendOutPower(); - } - - void generateEnergy(int fe){ - energy.addEnergy(fe); - } - - public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxReceive){ - return tileEntity.getCapability(ForgeCapabilities.ENERGY, from).map(handler -> - handler.receiveEnergy(maxReceive, false)).orElse(0); - } - - void sendOutPower() { - for (Direction dir : Direction.values()){ - BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); - Direction opposite = dir.getOpposite(); - if(tileEntity != null){ - // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount - int smallest = Math.min(energy.getMaxTransfer(), energy.getEnergyStored()); - int received = receiveEnergy(tileEntity, opposite, smallest); - energy.consumeEnergy(received); - if (energy.getEnergyStored() <=0){ - break; - } - } - } - } - - /** - * Cosine curve based off the location of the Sun(? I think, at least it looks like that) - * Noon is the Zenith, hence why we use a cosine curve, since cosine curves start at a max - * amplitude, which of course is Noon/Zenith. We do manipulate the curve a bit to make it more "reasonable" - */ - protected float solarIntensity(){ - if(level == null) return 0; - float celestialAngle = this.level.getSunAngle(1.0f); // Zenith = 0rad - - if(celestialAngle > Math.PI) celestialAngle = (2 * ((float) Math.PI) - celestialAngle); - - float intensity = Mth.cos(0.2f + (celestialAngle / 1.2f)); - intensity = Mth.clamp(intensity, 0, 1); - - if(intensity > 0.1f) { - intensity = intensity * 1.5f; - if(intensity > 1f) intensity = 1f; - } - - if(intensity > 0){ - if(this.level.isRaining()) return intensity * 0.6f; - if(this.level.isThundering()) return intensity * 0.2f; - } - - return intensity; - } - - protected boolean isClear(){ - if (level == null) return false; - return level.canSeeSky(new BlockPos(this.getBlockPos().getX(), this.getBlockPos().getY()+1, this.getBlockPos().getZ())); - } - - @Override - public void load(CompoundTag tag) { - tag.putInt("generation_rate", this.generation); - super.load(tag); - this.currentEnergy = this.getEnergyStored(); - - } - - @Override - public void saveAdditional(@NotNull CompoundTag tag) { - this.generation = tag.getInt("generation_rate"); - super.saveAdditional(tag); - } - - public abstract int getGeneration(); - - @Nullable - @Override - public ItemStackHandler getInventoryHandler() { - return null; - } - - @NotNull - @Override - public List getSlotManagers() { - return new ArrayList<>(); - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index 001f8f94d..91219fef1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -2,11 +2,12 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.FluidInputTank; -import com.veteam.voluminousenergy.blocks.tiles.VETileFactory.FluidOutputTank; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidInputTank; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidOutputTank; import com.veteam.voluminousenergy.recipe.processor.AirCompressorProcessor; import com.veteam.voluminousenergy.recipe.processor.DefaultProcessor; import com.veteam.voluminousenergy.recipe.processor.GeneratorProcessor; +import com.veteam.voluminousenergy.recipe.processor.MultiBlockRecipeProcessor; import com.veteam.voluminousenergy.tools.Config; import static com.veteam.voluminousenergy.recipe.VERecipes.VERecipeTypes.*; @@ -15,8 +16,8 @@ public class VETileEntities { static final int DEFAULT_TANK_CAPACITY = 4000; - public static final VETileFactory AIR_COMPRESSOR_FACTORY = - new VETileFactory(VEBlocks.AIR_COMPRESSOR_TILE,VEContainers.AIR_COMPRESSOR_FACTORY) + public static final VETileEntityFactory AIR_COMPRESSOR_FACTORY = + new VETileEntityFactory(VEBlocks.AIR_COMPRESSOR_TILE,VEContainers.AIR_COMPRESSOR_FACTORY) .addEnergyStorageWithConsumption( Config.AIR_COMPRESSOR_MAX_POWER.get(), Config.AIR_COMPRESSOR_TRANSFER.get(), @@ -26,8 +27,8 @@ public class VETileEntities { .makesSound() .withCustomRecipeProcessing(new AirCompressorProcessor()); - public static final VETileFactory AQUEOULIZER_TILE_FACTORY = - new VETileFactory(VEBlocks.AQUEOULIZER_TILE, VEContainers.AQUEOULIZER_FACTORY) + public static final VETileEntityFactory AQUEOULIZER_TILE_FACTORY = + new VETileEntityFactory(VEBlocks.AQUEOULIZER_TILE, VEContainers.AQUEOULIZER_FACTORY) .addEnergyStorageWithConsumption( Config.AQUEOULIZER_MAX_POWER.get(), Config.AQUEOULIZER_TRANSFER.get(), @@ -41,15 +42,14 @@ public class VETileEntities { // TODO processing - public static final VETileFactory BATTERY_BOX_FACTORY = - new VETileFactory(VEBlocks.BATTERY_BOX_TILE, VEContainers.BATTERY_BOX_FACTORY) + public static final VETileEntityFactory BATTERY_BOX_FACTORY = + new VETileEntityFactory(VEBlocks.BATTERY_BOX_TILE, VEContainers.BATTERY_BOX_FACTORY) .addEnergyStorage( Config.BATTERY_BOX_MAX_POWER.get(), Config.BATTERY_BOX_TRANSFER.get()); - // TODO processing - public static final VETileFactory BLAST_FURNACE_FACTORY = - new VETileFactory(VEBlocks.BLAST_FURNACE_TILE, VEContainers.BLAST_FURNACE_FACTORY) + public static final VETileEntityFactory BLAST_FURNACE_FACTORY = + new VETileEntityFactory(VEBlocks.BLAST_FURNACE_TILE, VEContainers.BLAST_FURNACE_FACTORY) .addEnergyStorageWithConsumption( Config.BLAST_FURNACE_MAX_POWER.get(), Config.BLAST_FURNACE_TRANSFER.get(), @@ -58,12 +58,15 @@ public class VETileEntities { new FluidInputTank(0,DEFAULT_TANK_CAPACITY) ) .countable() + .withDataFlag("temperature_kelvin") + .withDataFlag("temperature_celsius") + .withDataFlag("temperature_fahrenheit") .makesSound() .withRecipe(INDUSTRIAL_BLASTING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new MultiBlockRecipeProcessor(VEBlocks.TITANIUM_MACHINE_CASING_BLOCK)); - public static final VETileFactory CENTRIFUGAL_AGITATOR_FACTORY = - new VETileFactory(VEBlocks.CENTRIFUGAL_AGITATOR_TILE, VEContainers.CENTRIFUGAL_AGITATOR_FACTORY) + public static final VETileEntityFactory CENTRIFUGAL_AGITATOR_FACTORY = + new VETileEntityFactory(VEBlocks.CENTRIFUGAL_AGITATOR_TILE, VEContainers.CENTRIFUGAL_AGITATOR_FACTORY) .addEnergyStorageWithConsumption( Config.CENTRIFUGAL_AGITATOR_MAX_POWER.get(), Config.CENTRIFUGAL_AGITATOR_TRANSFER.get(), @@ -78,8 +81,8 @@ public class VETileEntities { .withRecipe(CENTRIFUGAL_AGITATING) .withCustomRecipeProcessing(new DefaultProcessor()); - public static final VETileFactory CENTRIFUGAL_SEPARATOR_FACTORY = - new VETileFactory(VEBlocks.CENTRIFUGAL_SEPARATOR_TILE, VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY) + public static final VETileEntityFactory CENTRIFUGAL_SEPARATOR_FACTORY = + new VETileEntityFactory(VEBlocks.CENTRIFUGAL_SEPARATOR_TILE, VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY) .addEnergyStorageWithConsumption( Config.CENTRIFUGAL_SEPARATOR_MAX_POWER.get(), Config.CENTRIFUGAL_SEPARATOR_TRANSFER.get(), @@ -90,9 +93,8 @@ public class VETileEntities { .withCustomRecipeProcessing(new DefaultProcessor()); // TODO processing - - public static final VETileFactory COMBUSTION_GENERATOR_FACTORY = - new VETileFactory(VEBlocks.COMBUSTION_GENERATOR_TILE, VEContainers.COMBUSTION_GENERATOR_FACTORY) + public static final VETileEntityFactory COMBUSTION_GENERATOR_FACTORY = + new VETileEntityFactory(VEBlocks.COMBUSTION_GENERATOR_TILE, VEContainers.COMBUSTION_GENERATOR_FACTORY) .addEnergyStorage( Config.COMBUSTION_GENERATOR_MAX_POWER.get(), Config.COMBUSTION_GENERATOR_SEND.get()) @@ -105,8 +107,8 @@ public class VETileEntities { .withRecipe(FUEL_COMBUSTION) .withCustomRecipeProcessing(new DefaultProcessor()); - public static final VETileFactory COMPRESSOR_FACTORY = - new VETileFactory(VEBlocks.COMPRESSOR_TILE, VEContainers.COMPRESSOR_FACTORY) + public static final VETileEntityFactory COMPRESSOR_FACTORY = + new VETileEntityFactory(VEBlocks.COMPRESSOR_TILE, VEContainers.COMPRESSOR_FACTORY) .addEnergyStorageWithConsumption( Config.COMPRESSOR_MAX_POWER.get(), Config.COMPRESSOR_TRANSFER.get(), @@ -116,10 +118,8 @@ public class VETileEntities { .withRecipe(COMPRESSING) .withCustomRecipeProcessing(new DefaultProcessor()); - - // TODO needs the rng impl for the processor - public static final VETileFactory CRUSHER_FACTORY = - new VETileFactory(VEBlocks.CRUSHER_TILE, VEContainers.CRUSHER_FACTORY) + public static final VETileEntityFactory CRUSHER_FACTORY = + new VETileEntityFactory(VEBlocks.CRUSHER_TILE, VEContainers.CRUSHER_FACTORY) .addEnergyStorageWithConsumption( Config.CRUSHER_MAX_POWER.get(), Config.CRUSHER_TRANSFER.get(), @@ -131,8 +131,8 @@ public class VETileEntities { // TODO needs some custom processing - public static final VETileFactory DIMENSIONAL_LASER_FACTORY = - new VETileFactory(VEBlocks.DIMENSIONAL_LASER_TILE, VEContainers.DIMENSIONAL_LASER_FACTORY) + public static final VETileEntityFactory DIMENSIONAL_LASER_FACTORY = + new VETileEntityFactory(VEBlocks.DIMENSIONAL_LASER_TILE, VEContainers.DIMENSIONAL_LASER_FACTORY) .addEnergyStorageWithConsumption( Config.DIMENSIONAL_LASER_MAX_POWER.get(), Config.DIMENSIONAL_LASER_TRANSFER.get(), @@ -148,8 +148,8 @@ public class VETileEntities { .withRecipe(DIMENSIONAL_LASING) .withCustomRecipeProcessing(new DefaultProcessor()); - public static final VETileFactory DISTILLATION_UNIT_FACTORY = - new VETileFactory(VEBlocks.DISTILLATION_UNIT_TILE, VEContainers.DISTILLATION_UNIT_FACTORY) + public static final VETileEntityFactory DISTILLATION_UNIT_FACTORY = + new VETileEntityFactory(VEBlocks.DISTILLATION_UNIT_TILE, VEContainers.DISTILLATION_UNIT_FACTORY) .addEnergyStorageWithConsumption( Config.DISTILLATION_UNIT_MAX_POWER.get(), Config.DISTILLATION_UNIT_TRANSFER.get(), @@ -162,11 +162,11 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(DISTILLING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new MultiBlockRecipeProcessor(VEBlocks.ALUMINUM_MACHINE_CASING_BLOCK)); // TODO needs a furnace processor - public static final VETileFactory ELECTRIC_FURNACE_FACTORY = - new VETileFactory(VEBlocks.ELECTRIC_FURNACE_TILE, VEContainers.ELECTRIC_FURNACE_FACTORY) + public static final VETileEntityFactory ELECTRIC_FURNACE_FACTORY = + new VETileEntityFactory(VEBlocks.ELECTRIC_FURNACE_TILE, VEContainers.ELECTRIC_FURNACE_FACTORY) .addEnergyStorageWithConsumption(Config.ELECTROLYZER_MAX_POWER.get(), Config.ELECTRIC_FURNACE_TRANSFER.get(), Config.ELECTRIC_FURNACE_POWER_USAGE.get()) @@ -174,8 +174,8 @@ public class VETileEntities { .makesSound() .withCustomRecipeProcessing(new DefaultProcessor()); - public static final VETileFactory ELECTROLYZER_FACTORY = - new VETileFactory(VEBlocks.ELECTROLYZER_TILE, VEContainers.ELECTROLYZER_FACTORY) + public static final VETileEntityFactory ELECTROLYZER_FACTORY = + new VETileEntityFactory(VEBlocks.ELECTROLYZER_TILE, VEContainers.ELECTROLYZER_FACTORY) .addEnergyStorageWithConsumption(Config.ELECTROLYZER_MAX_POWER.get(), Config.ELECTRIC_FURNACE_TRANSFER.get(), Config.ELECTRIC_FURNACE_POWER_USAGE.get()) @@ -184,8 +184,8 @@ public class VETileEntities { .withRecipe(ELECTROLYZING) .withCustomRecipeProcessing(new DefaultProcessor()); - public static final VETileFactory FLUID_ELECTROLYZER_FACTORY = - new VETileFactory(VEBlocks.FLUID_ELECTROLYZER_TILE, VEContainers.FLUID_ELECTROLYZER_FACTORY) + public static final VETileEntityFactory FLUID_ELECTROLYZER_FACTORY = + new VETileEntityFactory(VEBlocks.FLUID_ELECTROLYZER_TILE, VEContainers.FLUID_ELECTROLYZER_FACTORY) .addEnergyStorageWithConsumption( Config.FLUID_ELECTROLYZER_MAX_POWER.get(), Config.FLUID_ELECTROLYZER_TRANSFER.get(), @@ -196,8 +196,8 @@ public class VETileEntities { .withRecipe(ELECTROLYZING) .withCustomRecipeProcessing(new DefaultProcessor()); - public static final VETileFactory FLUID_MIXER_FACTORY = - new VETileFactory(VEBlocks.FLUID_MIXER_TILE, VEContainers.FLUID_MIXER_FACTORY) + public static final VETileEntityFactory FLUID_MIXER_FACTORY = + new VETileEntityFactory(VEBlocks.FLUID_MIXER_TILE, VEContainers.FLUID_MIXER_FACTORY) .addEnergyStorageWithConsumption( Config.FLUID_MIXER_MAX_POWER.get(), Config.FLUID_MIXER_TRANSFER.get(), @@ -213,9 +213,9 @@ public class VETileEntities { .withRecipe(FLUID_MIXING) .withCustomRecipeProcessing(new DefaultProcessor()); - // TODO needs processing - public static final VETileFactory GAS_FIRED_FURNACE = - new VETileFactory(VEBlocks.GAS_FIRED_FURNACE_TILE,VEContainers.GAS_FIRED_FURNACE_FACTORY) + // TODO needs a furnace processor + public static final VETileEntityFactory GAS_FIRED_FURNACE = + new VETileEntityFactory(VEBlocks.GAS_FIRED_FURNACE_TILE,VEContainers.GAS_FIRED_FURNACE_FACTORY) .withTanks( new FluidInputTank(0,DEFAULT_TANK_CAPACITY) ) @@ -223,8 +223,8 @@ public class VETileEntities { .makesSound() .withCustomRecipeProcessing(new DefaultProcessor()); - public static final VETileFactory HYDROPONIC_INCUBATOR_FACTORY = - new VETileFactory(VEBlocks.HYDROPONIC_INCUBATOR_TILE, VEContainers.HYDROPONIC_INCUBATOR_FACTORY) + public static final VETileEntityFactory HYDROPONIC_INCUBATOR_FACTORY = + new VETileEntityFactory(VEBlocks.HYDROPONIC_INCUBATOR_TILE, VEContainers.HYDROPONIC_INCUBATOR_FACTORY) .addEnergyStorageWithConsumption( Config.HYDROPONIC_INCUBATOR_MAX_POWER.get(), Config.HYDROPONIC_INCUBATOR_TRANSFER.get(), @@ -238,8 +238,8 @@ public class VETileEntities { .withRecipe(HYDROPONIC_INCUBATING) .withCustomRecipeProcessing(new DefaultProcessor()); - public static final VETileFactory IMPLOSION_COMPRESSOR_FACTORY = - new VETileFactory(VEBlocks.IMPLOSION_COMPRESSOR_TILE, VEContainers.IMPLOSION_COMPRESSOR_FACTORY) + public static final VETileEntityFactory IMPLOSION_COMPRESSOR_FACTORY = + new VETileEntityFactory(VEBlocks.IMPLOSION_COMPRESSOR_TILE, VEContainers.IMPLOSION_COMPRESSOR_FACTORY) .addEnergyStorageWithConsumption( Config.IMPLOSION_COMPRESSOR_MAX_POWER.get(), Config.IMPLOSION_COMPRESSOR_TRANSFER.get(), @@ -250,16 +250,16 @@ public class VETileEntities { .withRecipe(IMPLOSION_COMPRESSING) .withCustomRecipeProcessing(new DefaultProcessor()); - public static final VETileFactory PRIMITIVE_BLAST_FURNACE_FACTORY = - new VETileFactory(VEBlocks.PRIMITIVE_BLAST_FURNACE_TILE, VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY) + public static final VETileEntityFactory PRIMITIVE_BLAST_FURNACE_FACTORY = + new VETileEntityFactory(VEBlocks.PRIMITIVE_BLAST_FURNACE_TILE, VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY) .countable() .makesSound() .withRecipe(INDUSTRIAL_BLASTING) .withCustomRecipeProcessing(new DefaultProcessor()); // TODO needs custom processor - public static final VETileFactory PRIMITIVE_SOLAR_PANEL_FACTORY = - new VETileFactory(VEBlocks.PRIMITIVE_SOLAR_PANEL_TILE,VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY) + public static final VETileEntityFactory PRIMITIVE_SOLAR_PANEL_FACTORY = + new VETileEntityFactory(VEBlocks.PRIMITIVE_SOLAR_PANEL_TILE,VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY) .addEnergyStorage( Config.PRIMITIVE_SOLAR_PANEL_MAX_POWER.get(), Config.PRIMITIVE_SOLAR_PANEL_SEND.get() @@ -267,8 +267,18 @@ public class VETileEntities { .sendsOutPower() .withCustomRecipeProcessing(new DefaultProcessor()); - public static final VETileFactory PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY = - new VETileFactory(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_TILE, VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY) + // TODO needs a custom processor + public static final VETileEntityFactory SOLAR_PANEL_FACTORY = + new VETileEntityFactory(VEBlocks.SOLAR_PANEL_TILE,VEContainers.SOLAR_PANEL_FACTORY) + .addEnergyStorage( + Config.SOLAR_PANEL_MAX_POWER.get(), + Config.SOLAR_PANEL_SEND.get() + ) + .sendsOutPower() + .withCustomRecipeProcessing(new DefaultProcessor()); + + public static final VETileEntityFactory PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY = + new VETileEntityFactory(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_TILE, VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY) .addEnergyStorage( Config.PRIMITIVE_STIRLING_GENERATOR_MAX_POWER.get(), Config.PRIMITIVE_STIRLING_GENERATOR_SEND.get()) @@ -279,20 +289,19 @@ public class VETileEntities { .withCustomRecipeProcessing(new GeneratorProcessor(true, 4)); // TODO make a custom processor - public static final VETileFactory PUMP_FACTORY = - new VETileFactory(VEBlocks.PUMP_TILE,VEContainers.PUMP_FACTORY) + public static final VETileEntityFactory PUMP_FACTORY = + new VETileEntityFactory(VEBlocks.PUMP_TILE,VEContainers.PUMP_FACTORY) .addEnergyStorage( Config.PUMP_MAX_POWER.get(), Config.PUMP_TRANSFER.get() ) .withTanks(new FluidOutputTank(0,DEFAULT_TANK_CAPACITY)) .countable() - .makesSound() - .withCustomRecipeProcessing(new DefaultProcessor()); + .makesSound(); // TODO make a custom processor - public static final VETileFactory SAWMILL_FACTORY = - new VETileFactory(VEBlocks.SAWMILL_TILE,VEContainers.SAWMILL_FACTORY) + public static final VETileEntityFactory SAWMILL_FACTORY = + new VETileEntityFactory(VEBlocks.SAWMILL_TILE,VEContainers.SAWMILL_FACTORY) .addEnergyStorage( Config.SAWMILL_MAX_POWER.get(), Config.SAWMILL_TRANSFER.get() @@ -302,18 +311,8 @@ public class VETileEntities { .withRecipe(SAWMILLING) .withCustomRecipeProcessing(new DefaultProcessor()); - // TODO needs a custom processor - public static final VETileFactory SOLAR_PANEL_FACTORY = - new VETileFactory(VEBlocks.SOLAR_PANEL_TILE,VEContainers.SOLAR_PANEL_FACTORY) - .addEnergyStorage( - Config.SOLAR_PANEL_MAX_POWER.get(), - Config.SOLAR_PANEL_SEND.get() - ) - .sendsOutPower() - .withCustomRecipeProcessing(new DefaultProcessor()); - - public static final VETileFactory STIRLING_GENERATOR_FACTORY = - new VETileFactory(VEBlocks.STIRLING_GENERATOR_TILE,VEContainers.STIRLING_GENERATOR_FACTORY) + public static final VETileEntityFactory STIRLING_GENERATOR_FACTORY = + new VETileEntityFactory(VEBlocks.STIRLING_GENERATOR_TILE,VEContainers.STIRLING_GENERATOR_FACTORY) .addEnergyStorage( Config.STIRLING_GENERATOR_MAX_POWER.get(), Config.STIRLING_GENERATOR_SEND.get() @@ -323,8 +322,8 @@ public class VETileEntities { .withCustomRecipeProcessing(new GeneratorProcessor()); // TODO needs a custom processor - public static final VETileFactory TOOLING_STATION_FACTORY = - new VETileFactory(VEBlocks.TOOLING_STATION_TILE,VEContainers.TOOLING_STATION_FACTORY) + public static final VETileEntityFactory TOOLING_STATION_FACTORY = + new VETileEntityFactory(VEBlocks.TOOLING_STATION_TILE,VEContainers.TOOLING_STATION_FACTORY) .withRecipe(TOOLING) .withCustomRecipeProcessing(new DefaultProcessor()); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 2900cc496..376fbbd35 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -661,4 +661,8 @@ public void setSendsOutPower(boolean sendsOutPower) { public void setSelectedRecipe(VERecipe recipe) { this.selectedRecipe = recipe; } + + public AbstractRecipeProcessor getRecipeProcessor() { + return recipeProcessor; + } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java similarity index 86% rename from src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java rename to src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java index b32694fb5..551c2568f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java @@ -26,7 +26,7 @@ import java.util.List; import java.util.concurrent.atomic.AtomicInteger; -public class VETileFactory { +public class VETileEntityFactory { private List tanks = new ArrayList<>(); private RegistryObject> recipeType; private final RegistryObject> tileRegistry; @@ -37,7 +37,7 @@ public class VETileFactory { private AbstractRecipeProcessor processor; private boolean sendsOutPower = false; - public VETileFactory(RegistryObject> tileRegistry, VEContainerFactory containerFactory) { + public VETileEntityFactory(RegistryObject> tileRegistry, VEContainerFactory containerFactory) { this.tileRegistry = tileRegistry; this.containerFactory = containerFactory; } @@ -80,24 +80,24 @@ public AbstractContainerMenu createMenu(int id, @NotNull Inventory playerInvento return newTile; } - public VETileFactory withRecipe(RegistryObject> recipe) { + public VETileEntityFactory withRecipe(RegistryObject> recipe) { this.recipeType = recipe; return this; } - public VETileFactory addEnergyStorageWithConsumption(int maxPower, int transferRate, int consumption) { + public VETileEntityFactory addEnergyStorageWithConsumption(int maxPower, int transferRate, int consumption) { VEEnergyStorage storage = new VEEnergyStorage(maxPower, transferRate); storage.setConsumption(consumption); this.storage = storage; return this; } - public VETileFactory addEnergyStorage(int maxPower, int transferRate) { + public VETileEntityFactory addEnergyStorage(int maxPower, int transferRate) { this.storage = new VEEnergyStorage(maxPower, transferRate); return this; } - public VETileFactory addUpgradeSlot(int upgradeSlotId) { + public VETileEntityFactory addUpgradeSlot(int upgradeSlotId) { if (storage == null) throw new IllegalStateException("Attempted to add upgrade tilePos without first adding energy storage!"); @@ -106,38 +106,43 @@ public VETileFactory addUpgradeSlot(int upgradeSlotId) { return this; } - public VETileFactory countable() { + public VETileEntityFactory countable() { this.dataMap.put("counter",0); this.dataMap.put("length",0); return this; } - public VETileFactory withDataFlag(String flag) { + public VETileEntityFactory isMultiBlock() { + this.dataMap.put("multiblock_complete",0); + return this; + } + + public VETileEntityFactory withDataFlag(String flag) { this.dataMap.put(flag,0); return this; } - public VETileFactory includeSoundTick() { + public VETileEntityFactory includeSoundTick() { this.dataMap.put("sound_tick",0); return this; } - public VETileFactory withTanks(TileTank... tanks) { + public VETileEntityFactory withTanks(TileTank... tanks) { this.tanks = List.of(tanks); return this; } - public VETileFactory makesSound() { + public VETileEntityFactory makesSound() { this.dataMap.put("sound_tick",0); return this; } - public VETileFactory withCustomRecipeProcessing(AbstractRecipeProcessor processor) { + public VETileEntityFactory withCustomRecipeProcessing(AbstractRecipeProcessor processor) { this.processor = processor; return this; } - public VETileFactory sendsOutPower() { + public VETileEntityFactory sendsOutPower() { this.sendsOutPower = true; return this; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java index f603ce316..8564218b6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java @@ -3,9 +3,9 @@ import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.MultiFluidSlotWrapper; -import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.SlotType; import com.veteam.voluminousenergy.util.TankType; +import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; diff --git a/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java b/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java index f28585f01..6c9e5bd17 100644 --- a/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java +++ b/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java @@ -270,16 +270,6 @@ private static void renderFace(Matrix4f matrix4f, VertexConsumer vertexConsumer, vertexConsumer.vertex(matrix4f, xPoint1 * scale, heightOffset2, zPoint4 * scale).endVertex(); } - @Override - public boolean shouldRenderOffScreen(@NonNull DimensionalLaserTile dimensionalLaserTile) { - return true; - } - - @Override - public boolean shouldRender(@NonNull DimensionalLaserTile p_173531_, @Nonnull Vec3 p_173532_) { - return Vec3.atCenterOf(p_173531_.getBlockPos()).multiply(1.0D, 0.0D, 1.0D).closerThan(p_173532_.multiply(1.0D, 0.0D, 1.0D), this.getViewDistance()); - } - @Override public int getViewDistance() { return 256; diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java index ddc84ca9a..b7c9d82f7 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java @@ -12,7 +12,6 @@ import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.items.upgrades.MysteriousMultiplier; import com.veteam.voluminousenergy.recipe.*; -import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; import com.veteam.voluminousenergy.util.TextUtil; import mezz.jei.api.IModPlugin; import mezz.jei.api.JeiPlugin; diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java index a3b3616de..40d90943c 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java @@ -5,7 +5,6 @@ import com.veteam.voluminousenergy.blocks.screens.VEContainerScreen; import com.veteam.voluminousenergy.compat.jei.VoluminousEnergyPlugin; import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorOxidizerRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.util.NumberUtil; import com.veteam.voluminousenergy.util.TextUtil; @@ -71,82 +70,82 @@ public CombustionCategory(IGuiHelper guiHelper){ @Override public void draw(CombustionGeneratorRecipe recipe, IRecipeSlotsView slotsView, @NotNull GuiGraphics matrixStack, double mouseX, double mouseY){ - - // Volumetric Energy label - TextUtil.renderShadowedText( - matrixStack, - Minecraft.getInstance().font, - TextUtil.translateString("jei.voluminousenergy.volumetric_energy").copy().append(": "), - 16, - 4, - VEContainerScreen.WHITE_TEXT_STYLE - ); - - // Actual Volumetric Energy value + FE/B units added on the end - TextUtil.renderUnshadowedText( - matrixStack, - Minecraft.getInstance().font, - Component.nullToEmpty(recipe.getVolumetricEnergy() + " FE/B"), - 35, - 16, - VEContainerScreen.GREY_TEXT_STYLE - ); - - slotDrawable.draw(matrixStack, 17, 35); // Fuel fluid - slotDrawable.draw(matrixStack, 85, 35); // Oxidizer fluid - - Optional oxiStack = slotsView.getSlotViews(RecipeIngredientRole.CATALYST).get(0).getDisplayedIngredient(ForgeTypes.FLUID_STACK); - - if (oxiStack.isPresent()){ - - List recipes = VERecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE); - - CombustionGeneratorOxidizerRecipe oxidizerRecipe = null; - - for(VERecipe VERecipe : recipes) { - if(VERecipe instanceof CombustionGeneratorOxidizerRecipe cor) { - if(cor.getFluidIngredient(0).test(oxiStack.get())) { - oxidizerRecipe = cor; - } - } - } - if(oxidizerRecipe == null) throw new IllegalStateException("No matching oxidizer for category: " + this.getClass().getName()); - - int fePerTick = recipe.getVolumetricEnergy()/oxidizerRecipe.getProcessTime(); - Component fePerTickComponent = Component.nullToEmpty(fePerTick+""); - int x = 50; - if (fePerTick < 100){ - x = 54; - } else if (fePerTick > 999 && fePerTick < 10_000){ - x = 46; - } else if (fePerTick > 9999){ - NumberUtil.numberToTextComponent4FE(fePerTick); - x = 46; - } - - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, fePerTickComponent, x, 45,VEContainerScreen.GREY_TEXT_STYLE); - } - - TextUtil.renderShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("FE/t:"), 48,35,VEContainerScreen.WHITE_TEXT_STYLE); - - TextUtil.renderUnshadowedText( - matrixStack, - Minecraft.getInstance().font, - TextUtil.translateString("jei.voluminousenergy.fluid.fuel").copy().append(":"), - 16, - 26, - VEContainerScreen.GREY_TEXT_STYLE - ); - - // Oxidizer Label - TextUtil.renderUnshadowedText( - matrixStack, - Minecraft.getInstance().font, - TextUtil.translateString("jei.voluminousenergy.fluid.oxidizer").copy().append(":"), - 76, - 26, - VEContainerScreen.GREY_TEXT_STYLE - ); +// +// // Volumetric Energy label +// TextUtil.renderShadowedText( +// matrixStack, +// Minecraft.getInstance().font, +// TextUtil.translateString("jei.voluminousenergy.volumetric_energy").copy().append(": "), +// 16, +// 4, +// VEContainerScreen.WHITE_TEXT_STYLE +// ); +// +// // Actual Volumetric Energy value + FE/B units added on the end +// TextUtil.renderUnshadowedText( +// matrixStack, +// Minecraft.getInstance().font, +// Component.nullToEmpty(recipe.getVolumetricEnergy() + " FE/B"), +// 35, +// 16, +// VEContainerScreen.GREY_TEXT_STYLE +// ); +// +// slotDrawable.draw(matrixStack, 17, 35); // Fuel fluid +// slotDrawable.draw(matrixStack, 85, 35); // Oxidizer fluid +// +// Optional oxiStack = slotsView.getSlotViews(RecipeIngredientRole.CATALYST).get(0).getDisplayedIngredient(ForgeTypes.FLUID_STACK); +// +// if (oxiStack.isPresent()){ +// +// List recipes = VERecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE); +// +// CombustionGeneratorOxidizerRecipe oxidizerRecipe = null; +// +// for(VERecipe VERecipe : recipes) { +// if(VERecipe instanceof CombustionGeneratorOxidizerRecipe cor) { +// if(cor.getFluidIngredient(0).test(oxiStack.get())) { +// oxidizerRecipe = cor; +// } +// } +// } +// if(oxidizerRecipe == null) throw new IllegalStateException("No matching oxidizer for category: " + this.getClass().getName()); +// +// int fePerTick = recipe.getVolumetricEnergy()/oxidizerRecipe.getProcessTime(); +// Component fePerTickComponent = Component.nullToEmpty(fePerTick+""); +// int x = 50; +// if (fePerTick < 100){ +// x = 54; +// } else if (fePerTick > 999 && fePerTick < 10_000){ +// x = 46; +// } else if (fePerTick > 9999){ +// NumberUtil.numberToTextComponent4FE(fePerTick); +// x = 46; +// } +// +// TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, fePerTickComponent, x, 45,VEContainerScreen.GREY_TEXT_STYLE); +// } +// +// TextUtil.renderShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("FE/t:"), 48,35,VEContainerScreen.WHITE_TEXT_STYLE); +// +// TextUtil.renderUnshadowedText( +// matrixStack, +// Minecraft.getInstance().font, +// TextUtil.translateString("jei.voluminousenergy.fluid.fuel").copy().append(":"), +// 16, +// 26, +// VEContainerScreen.GREY_TEXT_STYLE +// ); +// +// // Oxidizer Label +// TextUtil.renderUnshadowedText( +// matrixStack, +// Minecraft.getInstance().font, +// TextUtil.translateString("jei.voluminousenergy.fluid.oxidizer").copy().append(":"), +// 76, +// 26, +// VEContainerScreen.GREY_TEXT_STYLE +// ); } @@ -158,9 +157,9 @@ public void ingredientHandler(CombustionGeneratorRecipe recipe, fuelAcceptor.addIngredients(ForgeTypes.FLUID_STACK, inputList); ArrayList oxiStacks = new ArrayList<>(); - for (VERecipe oxidizerRecipe : VERecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE)) { - oxiStacks.addAll(Arrays.asList(oxidizerRecipe.getFluidIngredient(0).getFluids())); - } +// for (VERecipe oxidizerRecipe : VERecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE)) { +// oxiStacks.addAll(Arrays.asList(oxidizerRecipe.getFluidIngredient(0).getFluids())); +// } oxidizerAcceptor.addIngredients(ForgeTypes.FLUID_STACK, oxiStacks); diff --git a/src/main/java/com/veteam/voluminousenergy/events/VERecipeReloadListener.java b/src/main/java/com/veteam/voluminousenergy/events/VERecipeReloadListener.java new file mode 100644 index 000000000..ff8c76352 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/events/VERecipeReloadListener.java @@ -0,0 +1,16 @@ +package com.veteam.voluminousenergy.events; + +import com.veteam.voluminousenergy.VoluminousEnergy; +import net.minecraft.server.packs.resources.ResourceManager; +import net.minecraft.server.packs.resources.ResourceManagerReloadListener; +import org.jetbrains.annotations.NotNull; + +public class VERecipeReloadListener implements ResourceManagerReloadListener { + + @Override + public void onResourceManagerReload(@NotNull ResourceManager resourceManager) { + VoluminousEnergy.LOGGER.info("We are reloading right now!"); + } + +} + diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java index 9adf59d5d..7f2a18a73 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java @@ -20,7 +20,7 @@ public class AqueoulizerRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.AQUEOULIZING.get(); - private final RecipeParser parser = RecipeParser.forRecipe(this) + private final RecipeParser parser = new RecipeParser(this) .addIngredient(4, 0) .addFluidIngredient(0, 0) .addFluidResult(1, 0); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java index 8263f74f8..2c78536e3 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java @@ -19,7 +19,7 @@ public class CentrifugalAgitatorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_AGITATING.get(); - private final RecipeParser parser = RecipeParser.forRecipe(this) + private final RecipeParser parser = new RecipeParser(this) .addFluidIngredient(0,0) .addFluidResult(1,0) .addFluidResult(2,1); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java index 02923a9eb..3bdc09a1f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java @@ -21,7 +21,7 @@ public class CentrifugalSeparatorRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_SEPARATION.get(); - private final RecipeParser parser = RNGRecipeParser.forRecipe(this) + private final RecipeParser parser = new RNGRecipeParser(this) .addChancedItemResult(2,0) .addChancedItemResult(3,1) .addChancedItemResult(4,2) diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java index d809d6523..3f8b7db79 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java @@ -18,7 +18,7 @@ public class CombustionGeneratorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FUEL_COMBUSTION.get(); - private final RecipeParser parser = RecipeParser.forRecipe(this) + private final RecipeParser parser = new RecipeParser(this) .addFluidIngredient(0,0) .addFluidIngredient(1,1); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java index df0a5701c..0dafa9792 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java @@ -19,7 +19,7 @@ public class CompressorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.COMPRESSING.get(); - private final RecipeParser parser = RecipeParser.forRecipe(this) + private final RecipeParser parser = new RecipeParser(this) .addIngredient(0,0) .addItemResult(1,0); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java index fc21a0bf7..dc3683234 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java @@ -3,8 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.parser.RNGRecipeParser; +import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -20,7 +20,7 @@ public class CrusherRecipe extends VERNGExperienceRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CRUSHING.get(); - private final RecipeParser parser = RNGRecipeParser.forRecipe(this) + private final RecipeParser parser = new RNGRecipeParser(this) .addChancedItemResult(2,1) .addIngredient(4, 0) .addItemResult(0, 1); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java index 208f6db91..36baba9f2 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java @@ -5,9 +5,9 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.recipe.parser.DimensionalLaserParser; import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.ServerSideOnly; import com.veteam.voluminousenergy.util.climate.FluidClimateSpawn; -import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.RecipeSerializer; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java index a94d8d757..917802948 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java @@ -20,7 +20,7 @@ public class DistillationRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.DISTILLING.get(); - private final RecipeParser parser = RNGRecipeParser.forRecipe(this) + private final RecipeParser parser = new RNGRecipeParser(this) .addChancedItemResult(6,0) .addFluidIngredient(0,0) .addFluidResult(1,0) diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java index ea5e7d53b..fb54eda57 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java @@ -21,7 +21,7 @@ public class ElectrolyzerRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.ELECTROLYZING.get(); - private final RecipeParser parser = RNGRecipeParser.forRecipe(this) + private final RecipeParser parser = new RNGRecipeParser(this) .addChancedItemResult(2,0) .addChancedItemResult(3,1) .addChancedItemResult(4,2) @@ -34,7 +34,6 @@ public ElectrolyzerRecipe() { public ElectrolyzerRecipe(List ingredients, List results, int processTime) { super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); - ingredients.add(new VERecipeCodecs.RegistryIngredient("","minecraft:bucket",1)); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java index 4b1d9e040..5dee82699 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java @@ -19,7 +19,7 @@ public class FluidElectrolyzerRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FLUID_ELECTROLYZING.get(); - private final RecipeParser parser = RecipeParser.forRecipe(this) + private final RecipeParser parser = new RecipeParser(this) .addFluidIngredient(0,0) .addFluidResult(1,0) .addFluidResult(2,1); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java index 7d0ec4cce..a23495964 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java @@ -19,7 +19,7 @@ public class FluidMixerRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FLUID_MIXING.get(); - private final RecipeParser parser = RecipeParser.forRecipe(this) + private final RecipeParser parser = new RecipeParser(this) .addFluidIngredient(0,0) .addFluidResult(1,0) .addFluidResult(2,1); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java index fbe50b537..3aed3bc81 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java @@ -4,7 +4,6 @@ import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.recipe.parser.HydroponicParser; -import com.veteam.voluminousenergy.recipe.parser.RNGRecipeParser; import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; @@ -20,7 +19,7 @@ public class HydroponicIncubatorRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.HYDROPONIC_INCUBATING.get(); - private final RecipeParser parser = HydroponicParser.forRecipe(this) + private final RecipeParser parser = new HydroponicParser(this) .addChancedItemResult(2,0) .addChancedItemResult(3,1) .addChancedItemResult(4,2) diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java index 562eee37f..9cd8e6b2a 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java @@ -3,6 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.ImplosionCompressorParser; import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; @@ -19,9 +20,8 @@ public class ImplosionCompressorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.IMPLOSION_COMPRESSING.get(); - private final RecipeParser parser = RecipeParser.forRecipe(this) + private final RecipeParser parser = new ImplosionCompressorParser(this) .addIngredient(0,0) - .addIngredient(1,1) .addItemResult(2,0); public ImplosionCompressorRecipe() { @@ -29,7 +29,6 @@ public ImplosionCompressorRecipe() { public ImplosionCompressorRecipe(List ingredients, List results, int processTime) { super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); - ingredients.add(new VERecipeCodecs.RegistryIngredient("","minecraft:gunpowder",1)); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java index eda34d083..29d67d063 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java @@ -4,9 +4,9 @@ import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.recipe.FluidIngredient; -import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -27,7 +27,7 @@ public class IndustrialBlastingRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.INDUSTRIAL_BLASTING.get(); - private final RecipeParser parser = RecipeParser.forRecipe(this) + private final RecipeParser parser = new RecipeParser(this) .addFluidIngredient(0,0) .addIngredient(0,0) .addItemResult(1,0); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java index f783db939..51e5b97bb 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java @@ -21,7 +21,7 @@ public class PrimitiveBlastFurnaceRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.PRIMITIVE_BLAST_FURNACING.get(); - private final RecipeParser parser = RecipeParser.forRecipe(this) + private final RecipeParser parser = new RecipeParser(this) .addIngredient(0,0) .addItemResult(1,0); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java index 4d71f10bc..578266bb0 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java @@ -1,20 +1,12 @@ package com.veteam.voluminousenergy.recipe; -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.VERelationalTank; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.Level; import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; -import java.util.ArrayList; import java.util.List; public class RecipeCache { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java index 36309e97a..288875d8a 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java @@ -19,7 +19,7 @@ public class StirlingGeneratorRecipe extends VEEnergyRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.STIRLING.get(); - private final RecipeParser parser = RecipeParser.forRecipe(this) + private final RecipeParser parser = new RecipeParser(this) .addIngredient(0, 0); public StirlingGeneratorRecipe() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java index b631cbe89..fb7ed3631 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java @@ -29,7 +29,7 @@ public ToolingRecipe() { } - private final RecipeParser parser = RecipeParser.forRecipe(this); + private final RecipeParser parser = new RecipeParser(this); public ToolingRecipe(List i, List oi) { super(i,new ArrayList<>(),new ArrayList<>(), oi, 0); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java index 494769366..61fbce2a5 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java @@ -4,8 +4,8 @@ import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.recipe.parser.RecipeParser; -import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; +import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java new file mode 100644 index 000000000..0eb515276 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java @@ -0,0 +1,33 @@ +package com.veteam.voluminousenergy.recipe.parser; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.VERecipe; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; + +public class ImplosionCompressorParser extends RecipeParser { + + public ImplosionCompressorParser(VERecipe recipe) { + super(recipe); + } + + @Override + public boolean isCompleteRecipe(VETileEntity tile) { + ItemStack stack = tile.getStackInSlot(1); + if (stack.getItem() != Items.GUNPOWDER) return false; + return super.isCompleteRecipe(tile); + } + + @Override + public void completeRecipe(VETileEntity tile) { + super.completeRecipe(tile); + tile.getInventory().extractItem(1,1,false); + } + + @Override + public boolean canInsertItem(int slot, ItemStack stack) { + if (slot == 1) + return stack.getItem() == Items.GUNPOWDER; + return super.canInsertItem(slot, stack); + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java index 32a538442..5e7fe8983 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java @@ -1,5 +1,6 @@ package com.veteam.voluminousenergy.recipe.parser; +import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.tiles.VEItemStackHandler; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.recipe.VERNGRecipe; @@ -18,10 +19,6 @@ public RNGRecipeParser(VERecipe recipe) { } List randomItemResultPositions = new ArrayList<>(); - public static RNGRecipeParser forRecipe(VERecipe recipe) { - return new RNGRecipeParser(recipe); - } - public RNGRecipeParser addChancedItemResult(int tilePos, int recipePos) { this.randomItemResultPositions.add(new SlotAndRecipePos(tilePos,recipePos)); return this; @@ -50,16 +47,29 @@ public void completeRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : randomItemResultPositions) { VERNGRecipe rngRecipe = (VERNGRecipe) recipe; - float randomness = rngRecipe.getOutputChance(pos.recipePos()); + ItemStack result = rngRecipe.getResult(pos.recipePos()); + if (result == ItemStack.EMPTY) continue; if(randomness != 1) { float random = abs(0 + randomInstance.nextFloat() * (-1)); if(random > randomness) continue; - ItemStack result = rngRecipe.getResult(pos.recipePos()); + handler.insertItem(pos.tilePos(), result.copy(), false); + } else { handler.insertItem(pos.tilePos(), result.copy(), false); } } super.completeRecipe(tile); } + + @Override + public boolean canInsertItem(int slot, ItemStack stack) { + for(SlotAndRecipePos pos : randomItemResultPositions) { + if (pos.tilePos() == slot) { + ItemStack itemStack = recipe.getResult(pos.recipePos()); + return itemStack.is(stack.getItem()); + } + } + return super.canInsertItem(slot, stack); + } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java index 9d4d60b36..174b6ec8e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java @@ -7,6 +7,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.IFluidHandler; import java.util.ArrayList; import java.util.List; @@ -24,10 +25,6 @@ public RecipeParser(VERecipe recipe) { this.recipe = recipe; } - public static RecipeParser forRecipe(VERecipe recipe) { - return new RecipeParser(recipe); - } - public RecipeParser addIngredient(int tilePos,int recipePos) { this.ingredientPositions.add(new SlotAndRecipePos(tilePos,recipePos)); return this; @@ -117,8 +114,8 @@ public void completeRecipe(VETileEntity tile) { } for (SlotAndRecipePos pos : fluidIngredientPositions) { - FluidStack fluidStack = tile.getFluidStackFromTank(pos.tilePos); - fluidStack.setAmount(fluidStack.getAmount() - recipe.getFluidIngredientAmount(pos.recipePos)); + tile.getTank(pos.tilePos) + .getTank().drain(recipe.getFluidIngredientAmount(pos.recipePos), IFluidHandler.FluidAction.EXECUTE); } // Insert the results @@ -129,8 +126,7 @@ public void completeRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : fluidResultPositions) { FluidStack result = recipe.getOutputFluid(pos.recipePos); - FluidStack tileFluid = tile.getFluidStackFromTank(pos.tilePos); - tileFluid.setAmount(tileFluid.getAmount() + result.getAmount()); + tile.getTank(pos.tilePos).fillTank(result.copy()); } // mark fluid IO as dirty @@ -144,6 +140,12 @@ public boolean canInsertItem(int slot, ItemStack stack) { return recipeIngredient.test(stack); } } + for(SlotAndRecipePos pos : itemResultPositions) { + if (pos.tilePos == slot) { + ItemStack itemStack = recipe.getResult(pos.recipePos); + return itemStack.is(stack.getItem()); + } + } return false; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java index 9cbe3c44c..084a951d9 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java @@ -72,9 +72,6 @@ public void processRecipe(VETileEntity tile) { if(!parser.canCompleteRecipe(tile)) return; // Check to see if the energy produced will overflow the tile if(tile.getEnergy().isFullyCharged()) return; - - VoluminousEnergy.LOGGER.info("recipe completed!"); - // Since we're a generator we want to subtract the amounts at the start rather than at the end veEnergyRecipe.getParser().completeRecipe(tile); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java new file mode 100644 index 000000000..4e3889e22 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java @@ -0,0 +1,44 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraftforge.registries.RegistryObject; + +public class MultiBlockRecipeProcessor extends DefaultProcessor { + + private RegistryObject block; + + public MultiBlockRecipeProcessor(RegistryObject block) { + this.block = block; + } + + public boolean isMultiBlockValid(VETileEntity tile) { + int rawDirection = tile.getBlockState().getValue(BlockStateProperties.FACING).get2DDataValue(); + + int sXMultiplier = 1; + int sZMultiplier = 1; + + int sX = (rawDirection == 1 ? 1 : -1) * sXMultiplier; + int sZ = (rawDirection < 2 ? -1 : 1) * sZMultiplier; + + int lxMultiplier = (rawDirection == 3 ? -1 : 1); + int lzMultiplier = (rawDirection == 0 || rawDirection == 3 ? -1 : 1); + + int lX = sX + (lxMultiplier * 2); + int lZ = sZ + (lzMultiplier * 2); + + // Tweak box based on direction -- This is the search range to ensure this is a valid multiblock before operation + for (final BlockPos blockPos : BlockPos.betweenClosed(tile.getBlockPos().offset(sX, 0, sZ), tile.getBlockPos().offset(lX, 2, lZ))) { + final BlockState blockState = tile.getLevel().getBlockState(blockPos); + + if (blockState.getBlock() != block.get()) { // Fails MultiBlock condition + return false; + } + } + return true; + } + +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java index 3dc05ca5d..0bddb52f5 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.recipe.serializer; -import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERNGExperienceRecipe; +import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import net.minecraft.core.NonNullList; import net.minecraft.network.FriendlyByteBuf; diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankDirectionButton.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankDirectionButton.java index 941d3bd0d..c442512f6 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankDirectionButton.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankDirectionButton.java @@ -6,8 +6,8 @@ import com.veteam.voluminousenergy.tools.networking.VENetwork; import com.veteam.voluminousenergy.tools.networking.packets.TankDirectionPacket; import com.veteam.voluminousenergy.util.IntToDirection; -import com.veteam.voluminousenergy.util.VERelationalTank; import com.veteam.voluminousenergy.util.TextUtil; +import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.core.Direction; diff --git a/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java b/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java index 2d2ac0864..a0d757cb1 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java @@ -1,7 +1,5 @@ package com.veteam.voluminousenergy.tools.energy; -import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.IntTag; import net.minecraft.nbt.Tag; diff --git a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java index 58c3b87c2..661b3fd81 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java +++ b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java @@ -4,7 +4,6 @@ import com.veteam.voluminousenergy.blocks.tiles.tank.TankTile; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.Config; -import net.minecraft.world.item.crafting.Recipe; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; diff --git a/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java b/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java index a70866bc6..7878ec734 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java +++ b/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java @@ -1,11 +1,9 @@ package com.veteam.voluminousenergy.util; -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.recipe.VERecipe; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.level.material.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; diff --git a/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java b/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java index fd1d9c538..a906ac88d 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java +++ b/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java @@ -1,6 +1,5 @@ package com.veteam.voluminousenergy.util.tiles; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; From 6def9154909a1826cb43a8f8cf5369e882305dfd Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Sun, 7 Apr 2024 19:12:09 -0400 Subject: [PATCH 09/27] Fixed some recipe issues with count. Fixed the DimensionalLaser --- .../voluminousenergy/VoluminousEnergy.java | 16 +- .../achievements/VEMachineAdvancements.java | 1 - .../triggers/VECriteriaTriggers.java | 2 +- .../blocks/blocks/DimensionalLaserBlock.java | 44 +- .../blocks/blocks/VEBlocks.java | 126 +- .../blocks/blocks/VEMultiBlockBase.java | 1 - .../blocks/blocks/crops/RiceCrop.java | 4 +- .../blocks/blocks/crops/VELandCrop.java | 22 +- .../blocks/blocks/crops/VEWaterCrop.java | 50 +- .../blocks/machines/AirCompressorBlock.java | 2 +- .../blocks/blocks/machines/CrusherBlock.java | 1 - .../blocks/blocks/machines/PumpBlock.java | 9 - .../machines/StirlingGeneratorBlock.java | 7 - .../machines/VEFaceableMachineBlock.java | 4 +- .../blocks/blocks/ores/BauxiteOre.java | 8 +- .../blocks/blocks/ores/CinnabarOre.java | 8 +- .../blocks/blocks/ores/EighzoOre.java | 2 +- .../blocks/blocks/ores/GalenaOre.java | 2 +- .../blocks/blocks/ores/RutileOre.java | 8 +- .../blocks/blocks/ores/SaltpeterOre.java | 12 +- .../blocks/blocks/ores/VEOreBlock.java | 2 +- .../ores/deepslate/DeepslateBauxiteOre.java | 2 +- .../ores/deepslate/DeepslateCinnabarOre.java | 2 +- .../ores/deepslate/DeepslateGalenaOre.java | 2 +- .../ores/deepslate/DeepslateRutileOre.java | 2 +- .../blocks/ores/red_sand/RedSaltpeterOre.java | 12 +- .../util/VEItemStackWithFluidHandler.java | 1 - .../containers/ToolingStationContainer.java | 24 +- .../blocks/containers/VEContainer.java | 78 +- .../blocks/containers/VEContainerFactory.java | 24 +- .../blocks/containers/VEContainers.java | 132 +- .../tank/AluminumTankContainer.java | 4 +- .../containers/tank/EighzoTankContainer.java | 2 +- .../tank/NetheriteTankContainer.java | 2 +- .../tank/NighaliteTankContainer.java | 2 +- .../tank/SolariumTankContainer.java | 2 +- .../blocks/containers/tank/TankContainer.java | 4 +- .../tank/TitaniumTankContainer.java | 2 +- .../TileEntitySlots/CompressorInputSlot.java | 1 + .../TileEntitySlots/CrusherInputSlot.java | 5 +- .../ElectrolyzerInputSlot.java | 5 +- .../PrimitiveBlastFurnaceInsertSlot.java | 8 +- .../PrimitiveBlastFurnaceOutputSlot.java | 2 +- .../StirlingGeneratorInputSlot.java | 3 +- .../blocks/inventory/slots/VEBucketSlot.java | 2 +- .../blocks/inventory/slots/VEInsertSlot.java | 6 +- .../blocks/inventory/slots/VEOutputSlot.java | 2 +- .../blocks/screens/AirCompressorScreen.java | 33 +- .../blocks/screens/BatteryBoxScreen.java | 107 +- .../blocks/screens/BlastFurnaceScreen.java | 64 +- .../screens/CentrifugalSeparatorScreen.java | 48 +- .../blocks/screens/CompressorScreen.java | 42 +- .../blocks/screens/CrusherScreen.java | 45 +- .../screens/DimensionalLaserScreen.java | 58 +- .../screens/DistillationUnitScreen.java | 98 +- .../blocks/screens/ElectrolyzerScreen.java | 50 +- .../screens/FluidElectrolyzerScreen.java | 80 +- .../blocks/screens/FluidMixerScreen.java | 78 +- .../blocks/screens/GasFiredFurnaceScreen.java | 62 +- .../screens/HydroponicIncubatorScreen.java | 43 +- .../screens/PrimitiveBlastFurnaceScreen.java | 45 +- .../screens/PrimitiveSolarPanelScreen.java | 23 +- .../PrimitiveStirlingGeneratorScreen.java | 42 +- .../blocks/screens/PumpScreen.java | 43 +- .../blocks/screens/SawmillScreen.java | 56 +- .../blocks/screens/SolarPanelScreen.java | 27 +- .../screens/StirlingGeneratorScreen.java | 8 +- .../blocks/screens/ToolingStationScreen.java | 50 +- .../blocks/screens/VEContainerScreen.java | 42 +- .../blocks/screens/tank/EighzoTankScreen.java | 2 +- .../screens/tank/NetheriteTankScreen.java | 2 +- .../screens/tank/NighaliteTankScreen.java | 2 +- .../screens/tank/SolariumTankScreen.java | 2 +- .../blocks/screens/tank/TankScreen.java | 65 +- .../screens/tank/TitaniumTankScreen.java | 2 +- .../blocks/tiles/BatteryBoxTile.java | 2 +- .../blocks/tiles/DimensionalLaserTile.java | 7 +- .../blocks/tiles/ElectricFurnaceTile.java | 4 +- .../blocks/tiles/GasFiredFurnaceTile.java | 6 +- .../blocks/tiles/PumpTile.java | 48 +- .../blocks/tiles/SawmillTile.java | 62 +- .../blocks/tiles/ToolingStationTile.java | 2 +- .../blocks/tiles/VETileEntities.java | 57 +- .../blocks/tiles/VETileEntity.java | 36 +- .../blocks/tiles/VETileEntityFactory.java | 74 +- .../handlers/AbstractItemStackValidator.java | 9 + .../DimensionalLaserInventoryValidator.java | 26 + .../{ => handlers}/VEItemStackHandler.java | 23 +- .../blocks/tiles/tank/AluminumTankTile.java | 2 +- .../blocks/tiles/tank/EighzoTankTile.java | 2 +- .../blocks/tiles/tank/NetheriteTankTile.java | 2 +- .../blocks/tiles/tank/NighaliteTankTile.java | 2 +- .../blocks/tiles/tank/SolariumTankTile.java | 2 +- .../blocks/tiles/tank/TankTile.java | 9 +- .../blocks/tiles/tank/TitaniumTankTile.java | 2 +- .../entity/LaserBlockEntityRenderer.java | 25 +- .../compat/jei/VoluminousEnergyPlugin.java | 4 +- .../jei/category/AqueoulizingCategory.java | 25 +- .../CentrifugalAgitationCategory.java | 26 +- .../CentrifugalSeparationCategory.java | 67 +- .../jei/category/CombustionCategory.java | 11 +- .../jei/category/CompressingCategory.java | 16 +- .../compat/jei/category/CrushingCategory.java | 20 +- .../category/DimensionalLasingCategory.java | 24 +- .../jei/category/DistillingCategory.java | 32 +- .../category/FluidElectrolyzingCategory.java | 8 +- .../jei/category/FluidMixingCategory.java | 8 +- .../category/HydroponicIncubatorCategory.java | 42 +- .../ImplosionCompressionCategory.java | 18 +- .../category/IndustrialBlastingCategory.java | 22 +- .../category/PrimitiveBlastingCategory.java | 14 +- .../compat/jei/category/SawmillCategory.java | 28 +- .../compat/jei/category/StirlingCategory.java | 14 +- .../compat/jei/category/ToolingCategory.java | 14 +- .../datagen/MaterialConstants.java | 12 +- .../datagen/VEGlobalLootModifierData.java | 14 +- .../datagen/VETagDataGenerator.java | 28 +- .../events/VEServerSideListener.java | 2 +- .../voluminousenergy/fluids/Ammonia.java | 12 +- .../fluids/AmmoniumNitrateSolution.java | 12 +- .../voluminousenergy/fluids/Biofuel.java | 12 +- .../fluids/CompressedAir.java | 10 +- .../voluminousenergy/fluids/CrudeOil.java | 12 +- .../voluminousenergy/fluids/Diesel.java | 12 +- .../fluids/DinitrogenTetroxide.java | 12 +- .../voluminousenergy/fluids/Gasoline.java | 12 +- .../voluminousenergy/fluids/Hydrogen.java | 16 +- .../voluminousenergy/fluids/LightFuel.java | 16 +- .../fluids/LiquefiedCoal.java | 12 +- .../fluids/LiquefiedCoke.java | 12 +- .../voluminousenergy/fluids/Mercury.java | 12 +- .../voluminousenergy/fluids/Naphtha.java | 12 +- .../voluminousenergy/fluids/Nitrogen.java | 12 +- .../fluids/Nitroglycerin.java | 12 +- .../voluminousenergy/fluids/Oxygen.java | 12 +- .../fluids/RedFumingNitricAcid.java | 12 +- .../voluminousenergy/fluids/SulfuricAcid.java | 12 +- .../voluminousenergy/fluids/TreeSap.java | 12 +- .../voluminousenergy/fluids/Treethanol.java | 12 +- .../fluids/VEFlowingGasFluid.java | 50 +- .../voluminousenergy/fluids/VEFluidType.java | 10 +- .../fluids/WhiteFumingNitricAcid.java | 15 +- .../AcidFlowingFluidBlock.java | 4 +- .../CrudeOilFlowingFluidBlock.java | 2 +- .../FumingAcidFlowingFluidBlock.java | 2 +- .../VEFlowingFluidBlock.java | 6 +- .../CrudeOilFlowingFluidSource.java | 4 +- .../items/AmmoniumNitrateBucket.java | 21 +- .../veteam/voluminousenergy/items/Dough.java | 2 +- .../items/SaltpeterChunk.java | 2 +- .../items/ShreddedBiomass.java | 2 +- .../voluminousenergy/items/Silicon.java | 2 +- .../items/TitaniumSawblade.java | 2 +- .../voluminousenergy/items/VEBlockItems.java | 144 +- .../voluminousenergy/items/VEItems.java | 172 +- .../items/batteries/LeadAcidBattery.java | 2 +- .../items/batteries/MercuryBattery.java | 4 +- .../items/batteries/MercuryBatteryPack.java | 2 +- .../items/batteries/VEEnergyItem.java | 34 +- .../items/crops/RiceItem.java | 2 +- .../items/crops/WaterCropItem.java | 12 +- .../items/dusts/AluminumDust.java | 2 +- .../items/dusts/BasaltDust.java | 2 +- .../items/dusts/BauxiteDust.java | 2 +- .../items/dusts/CarbonDust.java | 2 +- .../items/dusts/CinnabarDust.java | 2 +- .../items/dusts/CoalDust.java | 4 +- .../items/dusts/CokeDust.java | 4 +- .../items/dusts/CopperCarbonateDust.java | 2 +- .../items/dusts/CopperDust.java | 2 +- .../items/dusts/CupricOxideDust.java | 2 +- .../items/dusts/EighzoDust.java | 2 +- .../items/dusts/EndStoneDust.java | 2 +- .../items/dusts/FlintDust.java | 2 +- .../items/dusts/FlourDust.java | 2 +- .../items/dusts/GalenaDust.java | 2 +- .../items/dusts/GoldDust.java | 2 +- .../items/dusts/IronDust.java | 2 +- .../items/dusts/LapisDust.java | 4 +- .../items/dusts/LeadDust.java | 2 +- .../items/dusts/NetheriteDust.java | 2 +- .../items/dusts/NetherrackDust.java | 2 +- .../items/dusts/PhotovoltaicDust.java | 2 +- .../items/dusts/QuartzDust.java | 2 +- .../items/dusts/RutileDust.java | 2 +- .../items/dusts/SaltpeterDust.java | 2 +- .../items/dusts/SandDust.java | 2 +- .../voluminousenergy/items/dusts/SawDust.java | 2 +- .../items/dusts/SilverDust.java | 2 +- .../items/dusts/SolariumDust.java | 2 +- .../items/dusts/SoulsandDust.java | 2 +- .../items/dusts/SulfurDust.java | 2 +- .../items/dusts/TitaniumDust.java | 2 +- .../items/dusts/TungstenDust.java | 2 +- .../items/gears/CarbonGear.java | 2 +- .../items/gears/IronGear.java | 8 +- .../items/gears/SolariumGear.java | 2 +- .../items/gears/StoneGear.java | 4 +- .../items/ingots/AluminumIngot.java | 2 +- .../items/ingots/CarbonBrick.java | 4 +- .../items/ingots/EighzoIngot.java | 2 +- .../items/ingots/LeadIngot.java | 2 +- .../items/ingots/NighaliteIngot.java | 4 +- .../items/ingots/SilverIngot.java | 2 +- .../items/ingots/SolariumIngot.java | 2 +- .../items/ingots/SteelIngot.java | 2 +- .../items/ingots/TitaniumIngot.java | 2 +- .../items/ingots/TungstenIngot.java | 2 +- .../items/ingots/TungstenSteelIngot.java | 2 +- .../items/microchips/GoldMicrochip.java | 2 +- .../items/microchips/SilverMicrochip.java | 4 +- .../items/ores/RawBauxite.java | 2 +- .../items/plates/AluminumPlate.java | 2 +- .../items/plates/CarbonPlate.java | 2 +- .../items/plates/SolariumPlate.java | 2 +- .../items/plates/TitaniumPlate.java | 2 +- .../items/solid_fuels/CoalCoke.java | 2 +- .../items/solid_fuels/Petcoke.java | 2 +- .../items/tools/CreativeFluidScanner.java | 8 +- .../items/tools/VEAxeItem.java | 17 +- .../items/tools/VEHoeItem.java | 17 +- .../items/tools/VEPickaxeItem.java | 17 +- .../items/tools/VEShovelItem.java | 17 +- .../items/tools/VESwordItem.java | 17 +- .../voluminousenergy/items/tools/VETools.java | 96 +- .../tools/multitool/CombustionMultitool.java | 78 +- .../items/tools/multitool/Multitool.java | 10 +- .../items/tools/multitool/VEMultitools.java | 24 +- .../items/tools/multitool/bits/BitItem.java | 2 +- .../tools/multitool/bits/MultitoolBit.java | 8 +- .../tools/multitool/bits/TrimmerBit.java | 8 +- .../items/upgrades/MysteriousMultiplier.java | 87 +- .../veteam/voluminousenergy/loot/VELoot.java | 3 +- .../loot/modifiers/AnimalFatLootModifier.java | 10 +- .../MysteriousMultiplierModifier.java | 2 +- .../persistence/ChunkFluid.java | 6 +- .../recipe/CentrifugalAgitatorRecipe.java | 12 +- .../recipe/CentrifugalSeparatorRecipe.java | 18 +- .../recipe/CombustionGeneratorRecipe.java | 12 +- .../recipe/CompressorRecipe.java | 6 +- .../recipe/CrusherRecipe.java | 10 +- .../recipe/DimensionalLaserRecipe.java | 11 +- .../recipe/DistillationRecipe.java | 18 +- .../recipe/ElectrolyzerRecipe.java | 19 +- .../recipe/FluidElectrolyzerRecipe.java | 6 +- .../recipe/FluidMixerRecipe.java | 10 +- .../recipe/HydroponicIncubatorRecipe.java | 16 +- .../recipe/ImplosionCompressorRecipe.java | 10 +- .../recipe/IndustrialBlastingRecipe.java | 21 +- .../recipe/PrimitiveBlastFurnaceRecipe.java | 14 +- .../voluminousenergy/recipe/RecipeCache.java | 2 +- .../recipe/ToolingRecipe.java | 16 +- .../recipe/VEEnergyRecipe.java | 2 +- .../recipe/VEFluidSawmillRecipe.java | 4 +- .../recipe/VERNGExperienceRecipe.java | 2 +- .../voluminousenergy/recipe/VERNGRecipe.java | 2 +- .../voluminousenergy/recipe/VERecipe.java | 39 +- .../voluminousenergy/recipe/VERecipeType.java | 4 +- .../voluminousenergy/recipe/VERecipes.java | 4 +- .../recipe/parser/DimensionalLaserParser.java | 75 - .../recipe/parser/HydroponicParser.java | 6 +- .../parser/ImplosionCompressorParser.java | 2 +- .../recipe/parser/RNGRecipeParser.java | 14 +- .../recipe/parser/RecipeParser.java | 66 +- .../processor/AbstractRecipeProcessor.java | 18 + .../processor/AirCompressorProcessor.java | 9 +- .../recipe/processor/DefaultProcessor.java | 14 +- .../DimensionalLaserRecipeProcessor.java | 151 + .../recipe/processor/GeneratorProcessor.java | 6 +- .../processor/MultiBlockRecipeProcessor.java | 38 +- .../serializer/FluidSerializerHelper.java | 2 +- .../IngredientSerializerHelper.java | 8 +- .../voluminousenergy/setup/ClientProxy.java | 7 +- .../voluminousenergy/setup/ServerProxy.java | 4 +- .../voluminousenergy/setup/VESetup.java | 3 +- .../voluminousenergy/sounds/VESounds.java | 2 +- .../voluminousenergy/tools/VERender.java | 12 +- .../tools/buttons/VEIOButton.java | 2 +- .../tools/buttons/VEPowerIOManager.java | 4 +- .../BatteryBoxSendOutPowerButton.java | 16 +- .../batteryBox/BatteryBoxSlotPairButton.java | 22 +- .../batteryBox/VEBatterySwitchManager.java | 4 +- .../tools/buttons/ioMenuButton.java | 14 +- .../tools/buttons/slots/SlotBoolButton.java | 22 +- .../buttons/slots/SlotDirectionButton.java | 24 +- .../tools/buttons/tanks/TankBoolButton.java | 20 +- .../buttons/tanks/TankDirectionButton.java | 26 +- .../tools/energy/VEEnergyItemStorage.java | 22 +- .../tools/energy/VEEnergyStorage.java | 20 +- .../tools/networking/VENetwork.java | 5 +- .../packets/BatteryBoxSendOutPowerPacket.java | 26 +- .../packets/BatteryBoxSlotPairPacket.java | 16 +- .../networking/packets/BoolButtonPacket.java | 29 +- .../packets/DirectionButtonPacket.java | 28 +- .../networking/packets/TankBoolPacket.java | 22 +- .../packets/TankDirectionPacket.java | 20 +- .../tools/networking/packets/UuidPacket.java | 12 +- .../tools/sidemanager/VESlotManager.java | 15 +- .../voluminousenergy/util/IntToDirection.java | 14 +- .../util/MultiBlockStateMatchRuleTest.java | 8 +- .../util/MultiFluidSlotWrapper.java | 33 +- .../util/MultiSlotWrapper.java | 17 +- .../voluminousenergy/util/NumberUtil.java | 6 +- .../util/RegistryLookups.java | 27 +- .../voluminousenergy/util/SlotType.java | 8 +- .../veteam/voluminousenergy/util/TagUtil.java | 51 +- .../voluminousenergy/util/TankType.java | 2 +- .../voluminousenergy/util/TextUtil.java | 58 +- .../voluminousenergy/util/ToolUtil.java | 6 +- .../voluminousenergy/util/WorldUtil.java | 40 +- .../util/climate/ClimateSpawn.java | 2 +- .../util/climate/FluidClimateSpawn.java | 4 +- .../util/randoms/JavaRandomSource.java | 4 +- .../util/randoms/JavaSecureRandomSource.java | 8 +- .../util/recipe/FluidIngredient.java | 18 +- .../util/recipe/RecipeFluid.java | 4 +- .../util/recipe/RecipeItem.java | 4 +- .../util/recipe/RecipeUtil.java | 146 +- .../recipe/VEFluidIngredientSerializer.java | 13 +- .../util/recipe/VEOutputItem.java | 2 +- .../util/recipe/VERecipeCodecs.java | 25 +- .../world/feature/GeyserFeature.java | 46 +- .../world/feature/RiceFeature.java | 8 +- .../feature/SurfaceMattersLakesFeature.java | 2 +- .../world/feature/VEFeatures.java | 4 +- .../world/feature/VELakesFeature.java | 40 +- .../world/feature/VEOreDepositFeature.java | 43 +- .../modifiers/VEAndedMultiBiomeModifier.java | 32 +- .../world/modifiers/VEOreBiomeModifier.java | 2 +- .../world/ores/VEOreGeneration.java | 2 +- .../voluminousenergy/world/ores/VEOres.java | 5 +- src/main/resources/META-INF/mods.toml | 67 +- .../blockstates/air_compressor.json | 19 +- .../blockstates/aluminum_machine_casing.json | 4 +- .../blockstates/aluminum_shell.json | 4 +- .../blockstates/aluminum_tank.json | 19 +- .../blockstates/aqueoulizer.json | 19 +- .../blockstates/battery_box.json | 19 +- .../blockstates/bauxiteore.json | 4 +- .../blockstates/blast_furnace.json | 19 +- ...arbon_shielded_aluminum_machine_frame.json | 4 +- .../blockstates/centrifugal_agitator.json | 19 +- .../blockstates/centrifugal_separator.json | 19 +- .../blockstates/cinnabarore.json | 4 +- .../blockstates/combustion_generator.json | 19 +- .../blockstates/compressor.json | 19 +- .../voluminousenergy/blockstates/crusher.json | 19 +- .../blockstates/deepslate_bauxite_ore.json | 4 +- .../blockstates/deepslate_cinnabar_ore.json | 4 +- .../blockstates/deepslate_galena_ore.json | 4 +- .../blockstates/deepslate_rutile_ore.json | 4 +- .../blockstates/distillation_unit.json | 19 +- .../blockstates/eighzo_ore.json | 4 +- .../blockstates/eighzo_tank.json | 19 +- .../blockstates/electric_furnace.json | 19 +- .../blockstates/electrolyzer.json | 19 +- .../blockstates/fluid_electrolyzer.json | 19 +- .../blockstates/fluid_mixer.json | 19 +- .../blockstates/galena_ore.json | 4 +- .../blockstates/gas_fired_furnace.json | 19 +- .../blockstates/hydroponic_incubator.json | 19 +- .../blockstates/implosion_compressor.json | 19 +- .../blockstates/netherite_tank.json | 19 +- .../blockstates/nighalite_tank.json | 19 +- .../blockstates/primitive_solar_panel.json | 19 +- .../blockstates/primitiveblastfurnace.json | 38 +- .../primitivestirlinggenerator.json | 19 +- .../voluminousenergy/blockstates/pump.json | 19 +- .../blockstates/raw_bauxite_block.json | 4 +- .../blockstates/raw_cinnabar_block.json | 4 +- .../blockstates/raw_eighzo_block.json | 4 +- .../blockstates/raw_galena_block.json | 4 +- .../blockstates/raw_rutile_block.json | 4 +- .../blockstates/red_saltpeter_ore.json | 4 +- .../blockstates/rutileore.json | 4 +- .../blockstates/saltpeterore.json | 4 +- .../blockstates/solar_panel.json | 19 +- .../blockstates/solarium_block.json | 4 +- .../blockstates/solarium_machine_casing.json | 4 +- .../blockstates/solarium_tank.json | 19 +- .../blockstates/stirling_generator.json | 19 +- .../blockstates/titanium_machine_casing.json | 4 +- .../blockstates/titanium_tank.json | 19 +- .../blockstates/tooling_station.json | 19 +- .../assets/voluminousenergy/lang/en_us.json | 947 ++- .../assets/voluminousenergy/lang/ja_jp.json | 18 +- .../assets/voluminousenergy/lang/ko_kr.json | 772 ++- .../assets/voluminousenergy/lang/pt_br.json | 515 +- .../models/block/dimensional_laser.json | 5493 ++++++++++++++--- .../models/block/pressure_ladder.json | 33 +- .../models/block/primitiveblastfurnace.json | 20 +- .../models/block/sawmill.json | 116 +- .../models/item/creative_fluid_scanner.json | 869 ++- .../models/item/fluid_scanner.json | 981 ++- .../models/item/rfid_chip.json | 113 +- .../models/item/titanium_sawblade.json | 35 +- .../assets/voluminousenergy/sounds.json | 80 +- .../block/fluids/crude_oil_flowing.png.mcmeta | 8 +- .../forge/tags/blocks/storage_blocks.json | 1 - .../data/forge/tags/items/storage_blocks.json | 1 - .../loot_tables/blocks/compressor.json | 2 +- .../recipes/fuel_combustion/combustible.json | 4 +- src/main/resources/pack.mcmeta | 10 +- 403 files changed, 11287 insertions(+), 5270 deletions(-) create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/AbstractItemStackValidator.java create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/DimensionalLaserInventoryValidator.java rename src/main/java/com/veteam/voluminousenergy/blocks/tiles/{ => handlers}/VEItemStackHandler.java (79%) delete mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/parser/DimensionalLaserParser.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java diff --git a/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java b/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java index 279b6fd39..0dbb79bdc 100644 --- a/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java +++ b/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java @@ -73,6 +73,7 @@ public class VoluminousEnergy { VoluminousEnergy voluminousEnergy = new VoluminousEnergy(); voluminousEnergy.init(); } + public void init() { ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.COMMON_CONFIG); @@ -128,7 +129,7 @@ public void init() { getOrCreateDirectory(FMLPaths.CONFIGDIR.get().resolve(VoluminousEnergy.MODID), VoluminousEnergy.MODID); // TODO: Get Or Create Directory Config.loadConfig(Config.COMMON_CONFIG, FMLPaths.CONFIGDIR.get().resolve(VoluminousEnergy.MODID + "-common.toml")); //Config.loadConfig(Config.CLIENT_CONFIG, FMLPaths.CONFIGDIR.get().resolve("voluminousenergy-client.toml")); - ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT,Config.CLIENT_BUILDER.build(), VoluminousEnergy.MODID + "/" + VoluminousEnergy.MODID + "-client.toml"); + ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, Config.CLIENT_BUILDER.build(), VoluminousEnergy.MODID + "/" + VoluminousEnergy.MODID + "-client.toml"); modEventBus.addListener(this::registerRenderers); // Register renderer for Dimensional Laser @@ -137,10 +138,9 @@ public void init() { private static Path getOrCreateDirectory(Path dirPath, String dirLabel) { // Extracted from Forge 45 if (!Files.isDirectory(dirPath.getParent())) { - getOrCreateDirectory(dirPath.getParent(), "parent of "+dirLabel); + getOrCreateDirectory(dirPath.getParent(), "parent of " + dirLabel); } - if (!Files.isDirectory(dirPath)) - { + if (!Files.isDirectory(dirPath)) { LOGGER.debug("Making {} directory : {}", dirLabel, dirPath); try { Files.createDirectory(dirPath); @@ -181,7 +181,7 @@ private void registerRenderers(EntityRenderersEvent.RegisterRenderers event) { event.registerBlockEntityRenderer(VEBlocks.DIMENSIONAL_LASER_TILE.get(), LaserBlockEntityRenderer::new); } - private void setupWhenLoadingComplete(final FMLLoadCompleteEvent event){ + private void setupWhenLoadingComplete(final FMLLoadCompleteEvent event) { } public static MinecraftServer server; @@ -198,7 +198,7 @@ public static void onRegistry(final RegisterEvent blockRegistryEvent) { public static class ClientRegister { @SubscribeEvent - public static void RegisterClientOnSetupEvent(FMLClientSetupEvent event){ + public static void RegisterClientOnSetupEvent(FMLClientSetupEvent event) { event.enqueueWork(() -> ItemBlockRenderTypes.setRenderLayer(VEBlocks.RICE_CROP.get(), RenderType.cutout())); event.enqueueWork(() -> ItemBlockRenderTypes.setRenderLayer(VEBlocks.SAWMILL_BLOCK.get(), RenderType.cutout())); event.enqueueWork(() -> ItemBlockRenderTypes.setRenderLayer(VEBlocks.PRESSURE_LADDER.get(), RenderType.cutout())); @@ -210,12 +210,12 @@ public static void RegisterClientOnSetupEvent(FMLClientSetupEvent event){ public static class OnDatagenEvent { @SubscribeEvent - public static void onGatherData(GatherDataEvent event){ + public static void onGatherData(GatherDataEvent event) { DataGenerator dataGenerator = event.getGenerator(); PackOutput packOutput = dataGenerator.getPackOutput(); CompletableFuture lookupProvider = event.getLookupProvider(); - if(event.includeServer()) { + if (event.includeServer()) { dataGenerator.addProvider(true, new VETagDataGenerator(dataGenerator.getPackOutput(), lookupProvider, event.getExistingFileHelper())); dataGenerator.addProvider(true, new VEGlobalLootModifierData(dataGenerator.getPackOutput())); } diff --git a/src/main/java/com/veteam/voluminousenergy/achievements/VEMachineAdvancements.java b/src/main/java/com/veteam/voluminousenergy/achievements/VEMachineAdvancements.java index 02a44e9bf..7db7473e1 100644 --- a/src/main/java/com/veteam/voluminousenergy/achievements/VEMachineAdvancements.java +++ b/src/main/java/com/veteam/voluminousenergy/achievements/VEMachineAdvancements.java @@ -3,5 +3,4 @@ public class VEMachineAdvancements { - } diff --git a/src/main/java/com/veteam/voluminousenergy/achievements/triggers/VECriteriaTriggers.java b/src/main/java/com/veteam/voluminousenergy/achievements/triggers/VECriteriaTriggers.java index 878f61691..226c187ff 100644 --- a/src/main/java/com/veteam/voluminousenergy/achievements/triggers/VECriteriaTriggers.java +++ b/src/main/java/com/veteam/voluminousenergy/achievements/triggers/VECriteriaTriggers.java @@ -8,7 +8,7 @@ public class VECriteriaTriggers { public static final ConstructDimensionalLaserTrigger CONSTRUCT_DIMENSIONAL_LASER_TRIGGER = register(new ConstructDimensionalLaserTrigger()); public static > T register(T p_10596_) { - return CriteriaTriggers.register(ConstructDimensionalLaserTrigger.ID.toString(),p_10596_); + return CriteriaTriggers.register(ConstructDimensionalLaserTrigger.ID.toString(), p_10596_); } public static void init() { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java index f4b13027a..5deaa5d08 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java @@ -1,29 +1,21 @@ package com.veteam.voluminousenergy.blocks.blocks; -import com.veteam.voluminousenergy.blocks.tiles.DimensionalLaserTile; -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.blocks.blocks.machines.VEFaceableMachineBlock; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.MenuProvider; -import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.BlockHitResult; import javax.annotation.Nonnull; import javax.annotation.Nullable; -public class DimensionalLaserBlock extends Block implements EntityBlock { +public class DimensionalLaserBlock extends VEFaceableMachineBlock { public DimensionalLaserBlock() { super(BlockBehaviour.Properties.of() @@ -37,38 +29,14 @@ public DimensionalLaserBlock() { VETagDataGenerator.setRequiresPickaxe(this); } - // NEW TICK SYSTEM - @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { - return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, DimensionalLaserTile::serverTick); - } - - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { - return blockEntityType == tile ? (BlockEntityTicker)serverTick : null; - } - @Nullable @Override - public BlockEntity newBlockEntity(@Nonnull BlockPos blockPos,@Nonnull BlockState blockState) { - return new DimensionalLaserTile(blockPos,blockState); + public BlockEntity newBlockEntity(@Nonnull BlockPos blockPos, @Nonnull BlockState blockState) { + return VETileEntities.DIMENSIONAL_LASER_FACTORY.create(blockPos, blockState); } @Nullable - public BlockEntityTicker getTicker(@Nonnull Level level,@Nonnull BlockState state,@Nonnull BlockEntityType blockEntityType) { + public BlockEntityTicker getTicker(@Nonnull Level level, @Nonnull BlockState state, @Nonnull BlockEntityType blockEntityType) { return createTicker(level, blockEntityType, VEBlocks.DIMENSIONAL_LASER_TILE.get()); } - - @Override - public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit){ - if(!world.isClientSide) { - BlockEntity tileEntity = world.getBlockEntity(pos); - if(tileEntity instanceof MenuProvider menuProvider && player instanceof ServerPlayer serverPlayer) { - serverPlayer.openMenu(menuProvider,tileEntity.getBlockPos()); - } else { - throw new IllegalStateException( this.getClass().getName() + " named container provider is missing!"); - } - return InteractionResult.SUCCESS; - } - return InteractionResult.SUCCESS; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java index 03c0b8ec5..8274f36fa 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java @@ -52,9 +52,9 @@ public class VEBlocks { //Primitive Blast public static RegistryObject PRIMITIVE_BLAST_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("primitiveblastfurnace", PrimitiveBlastFurnaceBlock::new); public static RegistryObject> PRIMITIVE_BLAST_FURNACE_TILE = VE_TILE_REGISTRY.register("primitiveblastfurnace", - () -> BlockEntityType.Builder.of(VETileEntities.PRIMITIVE_BLAST_FURNACE_FACTORY::create,VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get()).build(null) ); + () -> BlockEntityType.Builder.of(VETileEntities.PRIMITIVE_BLAST_FURNACE_FACTORY::create, VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get()).build(null)); public static RegistryObject> PRIMITIVE_BLAST_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("primitiveblastfurnace", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -62,9 +62,9 @@ public class VEBlocks { //Primitive Stirling public static RegistryObject PRIMITIVE_STIRLING_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("primitivestirlinggenerator", PrimitiveStirlingGeneratorBlock::new); public static RegistryObject> PRIMITIVE_STIRLING_GENERATOR_TILE = VE_TILE_REGISTRY.register("primitivestirlinggenerator", - () -> BlockEntityType.Builder.of(VETileEntities.PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY::create,VEBlocks.PRIMITIVE_STIRLING_GENERATOR_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY::create, VEBlocks.PRIMITIVE_STIRLING_GENERATOR_BLOCK.get()).build(null)); public static RegistryObject> PRIMITIVE_STIRLING_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("primitivestirlinggenerator", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -72,9 +72,9 @@ public class VEBlocks { //Crusher public static RegistryObject CRUSHER_BLOCK = VE_BLOCKS_REGISTRY.register("crusher", CrusherBlock::new); public static RegistryObject> CRUSHER_TILE = VE_TILE_REGISTRY.register("crusher", - () -> BlockEntityType.Builder.of(VETileEntities.CRUSHER_FACTORY::create,VEBlocks.CRUSHER_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.CRUSHER_FACTORY::create, VEBlocks.CRUSHER_BLOCK.get()).build(null)); public static RegistryObject> CRUSHER_CONTAINER = VE_CONTAINER_REGISTRY.register("crusher", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.CRUSHER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -82,9 +82,9 @@ public class VEBlocks { //Electrolyzer public static RegistryObject ELECTROLYZER_BLOCK = VE_BLOCKS_REGISTRY.register("electrolyzer", ElectrolyzerBlock::new); public static RegistryObject> ELECTROLYZER_TILE = VE_TILE_REGISTRY.register("electrolyzer", - () -> BlockEntityType.Builder.of(VETileEntities.ELECTROLYZER_FACTORY::create,VEBlocks.ELECTROLYZER_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.ELECTROLYZER_FACTORY::create, VEBlocks.ELECTROLYZER_BLOCK.get()).build(null)); public static RegistryObject> ELECTROLYZER_CONTAINER = VE_CONTAINER_REGISTRY.register("electrolyzer", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.ELECTROLYZER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -92,9 +92,9 @@ public class VEBlocks { // Centrifugal Agitator public static RegistryObject CENTRIFUGAL_AGITATOR_BLOCK = VE_BLOCKS_REGISTRY.register("centrifugal_agitator", CentrifugalAgitatorBlock::new); public static RegistryObject> CENTRIFUGAL_AGITATOR_TILE = VE_TILE_REGISTRY.register("centrifugal_agitator", - () -> BlockEntityType.Builder.of(VETileEntities.CENTRIFUGAL_AGITATOR_FACTORY::create,VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.CENTRIFUGAL_AGITATOR_FACTORY::create, VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get()).build(null)); public static RegistryObject> CENTRIFUGAL_AGITATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("centrifugal_agitator", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.CENTRIFUGAL_AGITATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -102,9 +102,9 @@ public class VEBlocks { // Compressor public static RegistryObject COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("compressor", CompressorBlock::new); public static RegistryObject> COMPRESSOR_TILE = VE_TILE_REGISTRY.register("compressor", - () -> BlockEntityType.Builder.of(VETileEntities.COMPRESSOR_FACTORY::create,VEBlocks.COMPRESSOR_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.COMPRESSOR_FACTORY::create, VEBlocks.COMPRESSOR_BLOCK.get()).build(null)); public static RegistryObject> COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("compressor", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.COMPRESSOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -112,9 +112,9 @@ public class VEBlocks { // Stirling Generator public static RegistryObject STIRLING_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("stirling_generator", StirlingGeneratorBlock::new); public static RegistryObject> STIRLING_GENERATOR_TILE = VE_TILE_REGISTRY.register("stirling_generator", - () -> BlockEntityType.Builder.of(VETileEntities.STIRLING_GENERATOR_FACTORY::create,VEBlocks.STIRLING_GENERATOR_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.STIRLING_GENERATOR_FACTORY::create, VEBlocks.STIRLING_GENERATOR_BLOCK.get()).build(null)); public static RegistryObject> STIRLING_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("stirling_generator", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.STIRLING_GENERATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -122,9 +122,9 @@ public class VEBlocks { // Combustion Generator public static RegistryObject COMBUSTION_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("combustion_generator", CombustionGeneratorBlock::new); public static RegistryObject> COMBUSTION_GENERATOR_TILE = VE_TILE_REGISTRY.register("combustion_generator", - () -> BlockEntityType.Builder.of(VETileEntities.COMBUSTION_GENERATOR_FACTORY::create,VEBlocks.COMBUSTION_GENERATOR_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.COMBUSTION_GENERATOR_FACTORY::create, VEBlocks.COMBUSTION_GENERATOR_BLOCK.get()).build(null)); public static RegistryObject> COMBUSTION_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("combustion_generator", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.COMBUSTION_GENERATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -132,9 +132,9 @@ public class VEBlocks { // Aqueoulizer public static RegistryObject AQUEOULIZER_BLOCK = VE_BLOCKS_REGISTRY.register("aqueoulizer", AqueoulizerBlock::new); public static RegistryObject> AQUEOULIZER_TILE = VE_TILE_REGISTRY.register("aqueoulizer", - () -> BlockEntityType.Builder.of(VETileEntities.AQUEOULIZER_TILE_FACTORY::create,VEBlocks.AQUEOULIZER_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.AQUEOULIZER_TILE_FACTORY::create, VEBlocks.AQUEOULIZER_BLOCK.get()).build(null)); public static RegistryObject> AQUEOULIZER_CONTAINER = VE_CONTAINER_REGISTRY.register("aqueoulizer", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.AQUEOULIZER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -142,9 +142,9 @@ public class VEBlocks { // Air Compressor public static RegistryObject AIR_COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("air_compressor", AirCompressorBlock::new); public static RegistryObject> AIR_COMPRESSOR_TILE = VE_TILE_REGISTRY.register("air_compressor", - () -> BlockEntityType.Builder.of(VETileEntities.AIR_COMPRESSOR_FACTORY::create,VEBlocks.AIR_COMPRESSOR_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.AIR_COMPRESSOR_FACTORY::create, VEBlocks.AIR_COMPRESSOR_BLOCK.get()).build(null)); public static RegistryObject> AIR_COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("air_compressor", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.AIR_COMPRESSOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -152,9 +152,9 @@ public class VEBlocks { // Distillation Unit public static RegistryObject DISTILLATION_UNIT_BLOCK = VE_BLOCKS_REGISTRY.register("distillation_unit", DistillationUnitBlock::new); public static RegistryObject> DISTILLATION_UNIT_TILE = VE_TILE_REGISTRY.register("distillation_unit", - () -> BlockEntityType.Builder.of(VETileEntities.DISTILLATION_UNIT_FACTORY::create,VEBlocks.DISTILLATION_UNIT_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.DISTILLATION_UNIT_FACTORY::create, VEBlocks.DISTILLATION_UNIT_BLOCK.get()).build(null)); public static RegistryObject> DISTILLATION_UNIT_CONTAINER = VE_CONTAINER_REGISTRY.register("distillation_unit", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.DISTILLATION_UNIT_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -162,9 +162,9 @@ public class VEBlocks { // Pump public static RegistryObject PUMP_BLOCK = VE_BLOCKS_REGISTRY.register("pump", PumpBlock::new); public static RegistryObject> PUMP_TILE = VE_TILE_REGISTRY.register("pump", - () -> BlockEntityType.Builder.of(VETileEntities.PUMP_FACTORY::create,VEBlocks.PUMP_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.PUMP_FACTORY::create, VEBlocks.PUMP_BLOCK.get()).build(null)); public static RegistryObject> PUMP_CONTAINER = VE_CONTAINER_REGISTRY.register("pump", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.PUMP_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -172,9 +172,9 @@ public class VEBlocks { // Gas Fired Furnace public static RegistryObject GAS_FIRED_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("gas_fired_furnace", GasFiredFurnaceBlock::new); public static RegistryObject> GAS_FIRED_FURNACE_TILE = VE_TILE_REGISTRY.register("gas_fired_furnace", - () -> BlockEntityType.Builder.of(VETileEntities.GAS_FIRED_FURNACE::create,VEBlocks.GAS_FIRED_FURNACE_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.GAS_FIRED_FURNACE::create, VEBlocks.GAS_FIRED_FURNACE_BLOCK.get()).build(null)); public static RegistryObject> GAS_FIRED_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("gas_fired_furnace", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.GAS_FIRED_FURNACE_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -182,9 +182,9 @@ public class VEBlocks { // Electric Furnace public static RegistryObject ELECTRIC_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("electric_furnace", ElectricFurnaceBlock::new); public static RegistryObject> ELECTRIC_FURNACE_TILE = VE_TILE_REGISTRY.register("electric_furnace", - () -> BlockEntityType.Builder.of(VETileEntities.ELECTRIC_FURNACE_FACTORY::create,VEBlocks.ELECTRIC_FURNACE_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.ELECTRIC_FURNACE_FACTORY::create, VEBlocks.ELECTRIC_FURNACE_BLOCK.get()).build(null)); public static RegistryObject> ELECTRIC_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("electric_furnace", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.ELECTRIC_FURNACE_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -192,9 +192,9 @@ public class VEBlocks { // Battery Box public static RegistryObject BATTERY_BOX_BLOCK = VE_BLOCKS_REGISTRY.register("battery_box", BatteryBoxBlock::new); public static RegistryObject> BATTERY_BOX_TILE = VE_TILE_REGISTRY.register("battery_box", - () -> BlockEntityType.Builder.of(VETileEntities.BATTERY_BOX_FACTORY::create,VEBlocks.BATTERY_BOX_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.BATTERY_BOX_FACTORY::create, VEBlocks.BATTERY_BOX_BLOCK.get()).build(null)); public static RegistryObject> BATTERY_BOX_CONTAINER = VE_CONTAINER_REGISTRY.register("battery_box", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.BATTERY_BOX_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -202,9 +202,9 @@ public class VEBlocks { // Primitive Solar Panel public static RegistryObject PRIMITIVE_SOLAR_PANEL_BLOCK = VE_BLOCKS_REGISTRY.register("primitive_solar_panel", PrimitiveSolarPanelBlock::new); public static RegistryObject> PRIMITIVE_SOLAR_PANEL_TILE = VE_TILE_REGISTRY.register("primitive_solar_panel", - () -> BlockEntityType.Builder.of(VETileEntities.PRIMITIVE_SOLAR_PANEL_FACTORY::create,VEBlocks.PRIMITIVE_SOLAR_PANEL_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.PRIMITIVE_SOLAR_PANEL_FACTORY::create, VEBlocks.PRIMITIVE_SOLAR_PANEL_BLOCK.get()).build(null)); public static RegistryObject> PRIMITIVE_SOLAR_PANEL_CONTAINER = VE_CONTAINER_REGISTRY.register("primitive_solar_panel", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -212,9 +212,9 @@ public class VEBlocks { // Solar Panel public static RegistryObject SOLAR_PANEL_BLOCK = VE_BLOCKS_REGISTRY.register("solar_panel", SolarPanelBlock::new); public static RegistryObject> SOLAR_PANEL_TILE = VE_TILE_REGISTRY.register("solar_panel", - () -> BlockEntityType.Builder.of(VETileEntities.SOLAR_PANEL_FACTORY::create,VEBlocks.SOLAR_PANEL_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.SOLAR_PANEL_FACTORY::create, VEBlocks.SOLAR_PANEL_BLOCK.get()).build(null)); public static RegistryObject> SOLAR_PANEL_CONTAINER = VE_CONTAINER_REGISTRY.register("solar_panel", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.SOLAR_PANEL_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -222,9 +222,9 @@ public class VEBlocks { // Centrifugal Separator public static RegistryObject CENTRIFUGAL_SEPARATOR_BLOCK = VE_BLOCKS_REGISTRY.register("centrifugal_separator", CentrifugalSeparatorBlock::new); public static RegistryObject> CENTRIFUGAL_SEPARATOR_TILE = VE_TILE_REGISTRY.register("centrifugal_separator", - () -> BlockEntityType.Builder.of(VETileEntities.CENTRIFUGAL_SEPARATOR_FACTORY::create,VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.CENTRIFUGAL_SEPARATOR_FACTORY::create, VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get()).build(null)); public static RegistryObject> CENTRIFUGAL_SEPARATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("centrifugal_separator", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -232,9 +232,9 @@ public class VEBlocks { // Implosion Compressor public static RegistryObject IMPLOSION_COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("implosion_compressor", ImplosionCompressorBlock::new); public static RegistryObject> IMPLOSION_COMPRESSOR_TILE = VE_TILE_REGISTRY.register("implosion_compressor", - () -> BlockEntityType.Builder.of(VETileEntities.IMPLOSION_COMPRESSOR_FACTORY::create,VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.IMPLOSION_COMPRESSOR_FACTORY::create, VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get()).build(null)); public static RegistryObject> IMPLOSION_COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("implosion_compressor", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.IMPLOSION_COMPRESSOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -242,9 +242,9 @@ public class VEBlocks { // Blast Furnace public static RegistryObject BLAST_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("blast_furnace", BlastFurnaceBlock::new); public static RegistryObject> BLAST_FURNACE_TILE = VE_TILE_REGISTRY.register("blast_furnace", - () -> BlockEntityType.Builder.of(VETileEntities.BLAST_FURNACE_FACTORY::create,VEBlocks.BLAST_FURNACE_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.BLAST_FURNACE_FACTORY::create, VEBlocks.BLAST_FURNACE_BLOCK.get()).build(null)); public static RegistryObject> BLAST_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("blast_furnace", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.BLAST_FURNACE_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -252,9 +252,9 @@ public class VEBlocks { // Tooling Station public static RegistryObject TOOLING_STATION_BLOCK = VE_BLOCKS_REGISTRY.register("tooling_station", ToolingStationBlock::new); public static RegistryObject> TOOLING_STATION_TILE = VE_TILE_REGISTRY.register("tooling_station", - () -> BlockEntityType.Builder.of(VETileEntities.TOOLING_STATION_FACTORY::create,VEBlocks.TOOLING_STATION_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.TOOLING_STATION_FACTORY::create, VEBlocks.TOOLING_STATION_BLOCK.get()).build(null)); public static RegistryObject> TOOLING_STATION_CONTAINER = VE_CONTAINER_REGISTRY.register("tooling_station", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return new ToolingStationContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -262,9 +262,9 @@ public class VEBlocks { // Sawmill public static RegistryObject SAWMILL_BLOCK = VE_BLOCKS_REGISTRY.register("sawmill", SawmillBlock::new); public static RegistryObject> SAWMILL_TILE = VE_TILE_REGISTRY.register("sawmill", - () -> BlockEntityType.Builder.of(VETileEntities.SAWMILL_FACTORY::create,VEBlocks.SAWMILL_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.SAWMILL_FACTORY::create, VEBlocks.SAWMILL_BLOCK.get()).build(null)); public static RegistryObject> SAWMILL_CONTAINER = VE_CONTAINER_REGISTRY.register("sawmill", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.SAWMILL_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -272,9 +272,9 @@ public class VEBlocks { // Dimensional Laser public static RegistryObject DIMENSIONAL_LASER_BLOCK = VE_BLOCKS_REGISTRY.register("dimensional_laser", DimensionalLaserBlock::new); public static RegistryObject> DIMENSIONAL_LASER_TILE = VE_TILE_REGISTRY.register("dimensional_laser", - () -> BlockEntityType.Builder.of(VETileEntities.DIMENSIONAL_LASER_FACTORY::create,VEBlocks.DIMENSIONAL_LASER_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.DIMENSIONAL_LASER_FACTORY::create, VEBlocks.DIMENSIONAL_LASER_BLOCK.get()).build(null)); public static RegistryObject> DIMENSIONAL_LASER_CONTAINER = VE_CONTAINER_REGISTRY.register("dimensional_laser", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.DIMENSIONAL_LASER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -282,9 +282,9 @@ public class VEBlocks { // Fluid Electrolyzer public static RegistryObject FLUID_ELECTROLYZER_BLOCK = VE_BLOCKS_REGISTRY.register("fluid_electrolyzer", FluidElectrolyzerBlock::new); public static RegistryObject> FLUID_ELECTROLYZER_TILE = VE_TILE_REGISTRY.register("fluid_electrolyzer", - () -> BlockEntityType.Builder.of(VETileEntities.FLUID_ELECTROLYZER_FACTORY::create,VEBlocks.FLUID_ELECTROLYZER_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.FLUID_ELECTROLYZER_FACTORY::create, VEBlocks.FLUID_ELECTROLYZER_BLOCK.get()).build(null)); public static RegistryObject> FLUID_ELECTROLYZER_CONTAINER = VE_CONTAINER_REGISTRY.register("fluid_electrolyzer", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.FLUID_ELECTROLYZER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -292,9 +292,9 @@ public class VEBlocks { // Fluid Mixer public static RegistryObject FLUID_MIXER_BLOCK = VE_BLOCKS_REGISTRY.register("fluid_mixer", FluidMixerBlock::new); public static RegistryObject> FLUID_MIXER_TILE = VE_TILE_REGISTRY.register("fluid_mixer", - () -> BlockEntityType.Builder.of(VETileEntities.FLUID_MIXER_FACTORY::create,VEBlocks.FLUID_MIXER_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.FLUID_MIXER_FACTORY::create, VEBlocks.FLUID_MIXER_BLOCK.get()).build(null)); public static RegistryObject> FLUID_MIXER_CONTAINER = VE_CONTAINER_REGISTRY.register("fluid_mixer", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.FLUID_MIXER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -302,9 +302,9 @@ public class VEBlocks { // Hydroponic Incubator public static RegistryObject HYDROPONIC_INCUBATOR_BLOCK = VE_BLOCKS_REGISTRY.register("hydroponic_incubator", HydroponicIncubatorBlock::new); public static RegistryObject> HYDROPONIC_INCUBATOR_TILE = VE_TILE_REGISTRY.register("hydroponic_incubator", - () -> BlockEntityType.Builder.of(VETileEntities.HYDROPONIC_INCUBATOR_FACTORY::create,VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(VETileEntities.HYDROPONIC_INCUBATOR_FACTORY::create, VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get()).build(null)); public static RegistryObject> HYDROPONIC_INCUBATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("hydroponic_incubator", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return VEContainers.HYDROPONIC_INCUBATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -316,7 +316,7 @@ public class VEBlocks { public static RegistryObject> ALUMINUM_TANK_TILE = VE_TILE_REGISTRY.register("aluminum_tank", () -> BlockEntityType.Builder.of(AluminumTankTile::new, VEBlocks.ALUMINUM_TANK_BLOCK.get()).build(null)); public static RegistryObject> ALUMINUM_TANK_CONTAINER = VE_CONTAINER_REGISTRY.register("aluminum_tank", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return new AluminumTankContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -324,9 +324,9 @@ public class VEBlocks { // Titanium Tank public static RegistryObject TITANIUM_TANK_BLOCK = VE_BLOCKS_REGISTRY.register("titanium_tank", TitaniumTankBlock::new); public static RegistryObject> TITANIUM_TANK_TILE = VE_TILE_REGISTRY.register("titanium_tank", - () -> BlockEntityType.Builder.of(TitaniumTankTile::new,VEBlocks.TITANIUM_TANK_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(TitaniumTankTile::new, VEBlocks.TITANIUM_TANK_BLOCK.get()).build(null)); public static RegistryObject> TITANIUM_TANK_CONTAINER = VE_CONTAINER_REGISTRY.register("titanium_tank", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return new TitaniumTankContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -334,9 +334,9 @@ public class VEBlocks { // Netherite Tank public static RegistryObject NETHERITE_TANK_BLOCK = VE_BLOCKS_REGISTRY.register("netherite_tank", NetheriteTankBlock::new); public static RegistryObject> NETHERITE_TANK_TILE = VE_TILE_REGISTRY.register("netherite_tank", - () -> BlockEntityType.Builder.of(NetheriteTankTile::new,VEBlocks.NETHERITE_TANK_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(NetheriteTankTile::new, VEBlocks.NETHERITE_TANK_BLOCK.get()).build(null)); public static RegistryObject> NETHERITE_TANK_CONTAINER = VE_CONTAINER_REGISTRY.register("netherite_tank", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return new NetheriteTankContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -344,9 +344,9 @@ public class VEBlocks { // Nighalite Tank public static RegistryObject NIGHALITE_TANK_BLOCK = VE_BLOCKS_REGISTRY.register("nighalite_tank", NighaliteTankBlock::new); public static RegistryObject> NIGHALITE_TANK_TILE = VE_TILE_REGISTRY.register("nighalite_tank", - () -> BlockEntityType.Builder.of(NighaliteTankTile::new,VEBlocks.NIGHALITE_TANK_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(NighaliteTankTile::new, VEBlocks.NIGHALITE_TANK_BLOCK.get()).build(null)); public static RegistryObject> NIGHALITE_TANK_CONTAINER = VE_CONTAINER_REGISTRY.register("nighalite_tank", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return new NighaliteTankContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -354,9 +354,9 @@ public class VEBlocks { // Eighzo Tank public static RegistryObject EIGHZO_TANK_BLOCK = VE_BLOCKS_REGISTRY.register("eighzo_tank", EighzoTankBlock::new); public static RegistryObject> EIGHZO_TANK_TILE = VE_TILE_REGISTRY.register("eighzo_tank", - () -> BlockEntityType.Builder.of(EighzoTankTile::new,VEBlocks.EIGHZO_TANK_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(EighzoTankTile::new, VEBlocks.EIGHZO_TANK_BLOCK.get()).build(null)); public static RegistryObject> EIGHZO_TANK_CONTAINER = VE_CONTAINER_REGISTRY.register("eighzo_tank", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return new EighzoTankContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); @@ -364,9 +364,9 @@ public class VEBlocks { // Solarium Tank public static RegistryObject SOLARIUM_TANK_BLOCK = VE_BLOCKS_REGISTRY.register("solarium_tank", SolariumTankBlock::new); public static RegistryObject> SOLARIUM_TANK_TILE = VE_TILE_REGISTRY.register("solarium_tank", - () -> BlockEntityType.Builder.of(SolariumTankTile::new,VEBlocks.SOLARIUM_TANK_BLOCK.get()).build(null)); + () -> BlockEntityType.Builder.of(SolariumTankTile::new, VEBlocks.SOLARIUM_TANK_BLOCK.get()).build(null)); public static RegistryObject> SOLARIUM_TANK_CONTAINER = VE_CONTAINER_REGISTRY.register("solarium_tank", () -> - IForgeMenuType.create((id, inv, data)-> { + IForgeMenuType.create((id, inv, data) -> { BlockPos pos = data.readBlockPos(); return new SolariumTankContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); })); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEMultiBlockBase.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEMultiBlockBase.java index 8ba9ffc64..08e43e3a3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEMultiBlockBase.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEMultiBlockBase.java @@ -3,5 +3,4 @@ public abstract class VEMultiBlockBase extends VERotatableBlock { - } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/crops/RiceCrop.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/crops/RiceCrop.java index dac2cffb8..f7e92b500 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/crops/RiceCrop.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/crops/RiceCrop.java @@ -17,12 +17,12 @@ public RiceCrop() { } @Override - public Item cropItem(){ + public Item cropItem() { return VEItems.RICE_GRAIN.get(); } @Override - public void randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, RandomSource random){ + public void randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, RandomSource random) { if (random.nextFloat() <= Config.RICE_TICK_CHANCE.get()) { super.randomTick(state, worldIn, pos, random); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/crops/VELandCrop.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/crops/VELandCrop.java index e6e7b7175..c654f8dc3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/crops/VELandCrop.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/crops/VELandCrop.java @@ -32,7 +32,7 @@ public class VELandCrop extends BushBlock implements BonemealableBlock { public VELandCrop(Properties properties) { super(properties); - this.registerDefaultState(this.stateDefinition.any().setValue(BlockStateProperties.AGE_2,0)); // set the age of the crop to 0 by default + this.registerDefaultState(this.stateDefinition.any().setValue(BlockStateProperties.AGE_2, 0)); // set the age of the crop to 0 by default setRegistryName("land_crop"); } @@ -43,8 +43,8 @@ protected MapCodec codec() { // Voxel shape @Override - public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context){ - if(state.getValue(BlockStateProperties.AGE_2) == 0){ + public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) { + if (state.getValue(BlockStateProperties.AGE_2) == 0) { return Block.box(7.0D, 0.0D, 7.0D, 9.0D, 2.0D, 9.0D); } return Block.box(0.0D, 0.0D, 0.0D, 16.0D, 16.0D, 16.0D); @@ -52,17 +52,17 @@ public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, // Ticks @Override - public boolean isRandomlyTicking(BlockState state){ + public boolean isRandomlyTicking(BlockState state) { return state.getValue(BlockStateProperties.AGE_2) < 2; } @Override - public void randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, RandomSource random){ + public void randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, RandomSource random) { //VoluminousEnergy.LOGGER.debug("LAND CROP TICK RANDOMLY!"); int age = state.getValue(BlockStateProperties.AGE_2); - if (age < 2 && worldIn.getRawBrightness(pos.above(), 0) > 12){ // light level may need tweaking + if (age < 2 && worldIn.getRawBrightness(pos.above(), 0) > 12) { // light level may need tweaking //VoluminousEnergy.LOGGER.debug("LAND CROP GOING TO INCREMENT AGE!"); age++; worldIn.setBlockAndUpdate(pos, state.setValue(BlockStateProperties.AGE_2, age)); @@ -71,7 +71,7 @@ public void randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, Rand // Add aging property to the block state @Override - protected void createBlockStateDefinition(StateDefinition.Builder builder){ + protected void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(BlockStateProperties.AGE_2); } @@ -89,7 +89,7 @@ public boolean isBonemealSuccess(Level world, RandomSource random, BlockPos pos, @Override public void performBonemeal(ServerLevel serverWorld, RandomSource random, BlockPos pos, BlockState state) { int age = state.getValue(BlockStateProperties.AGE_2); - if(age < 2) { + if (age < 2) { age++; serverWorld.setBlockAndUpdate(pos, state.setValue(BlockStateProperties.AGE_2, age));// May need flags } @@ -97,11 +97,11 @@ public void performBonemeal(ServerLevel serverWorld, RandomSource random, BlockP // Action on use @Override - public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit){ + public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand handIn, BlockHitResult hit) { int age = state.getValue(BlockStateProperties.AGE_2); - if(age < 2 && player.getItemInHand(handIn).is(Items.BONE_MEAL)){ + if (age < 2 && player.getItemInHand(handIn).is(Items.BONE_MEAL)) { return InteractionResult.PASS; - } else if (age > 1){ + } else if (age > 1) { popResource(world, pos, new ItemStack(Items.WHEAT_SEEDS, 1)); world.playSound(null, pos, SoundEvents.CROP_BREAK, SoundSource.BLOCKS, 1.0F, 0.8F + world.random.nextFloat() * 0.4F); // to tweak world.setBlockAndUpdate(pos, state.setValue(BlockStateProperties.AGE_2, 0)); // may not work diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/crops/VEWaterCrop.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/crops/VEWaterCrop.java index 9c55ceb4c..48e3b2f6e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/crops/VEWaterCrop.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/crops/VEWaterCrop.java @@ -39,7 +39,7 @@ public class VEWaterCrop extends BushBlock implements BonemealableBlock, SimpleW public VEWaterCrop(Properties properties) { super(properties); - this.registerDefaultState(this.stateDefinition.any().setValue(BlockStateProperties.AGE_2,0)); // set the age of the crop to 0 by default + this.registerDefaultState(this.stateDefinition.any().setValue(BlockStateProperties.AGE_2, 0)); // set the age of the crop to 0 by default //setRegistryName("water_crop"); } @@ -48,19 +48,19 @@ protected MapCodec codec() { return CODEC; } - public Item cropItem(){ + public Item cropItem() { return null; // MUST override this to prevent NPE. } @Override - public boolean mayPlaceOn(BlockState state, BlockGetter world, BlockPos pos){ + public boolean mayPlaceOn(BlockState state, BlockGetter world, BlockPos pos) { BlockPos abovePos = pos.above(); return world.getBlockState(pos).is(Blocks.WATER) && world.getBlockState(abovePos).isAir(); } // Voxel shape @Override - public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context){ + public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, CollisionContext context) { Vec3 vector3d = state.getOffset(worldIn, pos); VoxelShape voxelShape = Block.box(2.0D, 0.0D, 2.0D, 14.0D, 16.0D, 14.0D); return voxelShape.move(vector3d.x, vector3d.y, vector3d.z); @@ -74,16 +74,16 @@ public VoxelShape getShape(BlockState state, BlockGetter worldIn, BlockPos pos, //Placement @Override - public BlockState updateShape(BlockState state, Direction facing, BlockState facingState, LevelAccessor worldIn, BlockPos currentPos, BlockPos facingPos){ - if(state.getValue(BlockStateProperties.WATERLOGGED)){ + public BlockState updateShape(BlockState state, Direction facing, BlockState facingState, LevelAccessor worldIn, BlockPos currentPos, BlockPos facingPos) { + if (state.getValue(BlockStateProperties.WATERLOGGED)) { //worldIn.getFluidState().scheduleTick(currentPos, Fluids.WATER, Fluids.WATER.getTickDelay(worldIn)); worldIn.getFluidTicks().hasScheduledTick(currentPos, Fluids.WATER); } DoubleBlockHalf doubleBlockHalf = state.getValue(BlockStateProperties.DOUBLE_BLOCK_HALF); - if(facing.getAxis() != Direction.Axis.Y || doubleBlockHalf == DoubleBlockHalf.LOWER != (facing == Direction.UP) - || facingState.is(this) && facingState.getValue(BlockStateProperties.DOUBLE_BLOCK_HALF) != doubleBlockHalf){ - if(doubleBlockHalf == DoubleBlockHalf.LOWER && facing == Direction.DOWN && !state.canSurvive(worldIn, currentPos)){ + if (facing.getAxis() != Direction.Axis.Y || doubleBlockHalf == DoubleBlockHalf.LOWER != (facing == Direction.UP) + || facingState.is(this) && facingState.getValue(BlockStateProperties.DOUBLE_BLOCK_HALF) != doubleBlockHalf) { + if (doubleBlockHalf == DoubleBlockHalf.LOWER && facing == Direction.DOWN && !state.canSurvive(worldIn, currentPos)) { return Blocks.AIR.defaultBlockState(); } return super.updateShape(state, facing, facingState, worldIn, currentPos, facingPos); // Excluding this super will cause neighbours to break @@ -93,20 +93,20 @@ public BlockState updateShape(BlockState state, Direction facing, BlockState fac @Override @Nullable - public BlockState getStateForPlacement(BlockPlaceContext context){ + public BlockState getStateForPlacement(BlockPlaceContext context) { BlockPos pos = context.getClickedPos(); - if(pos.getY() <255 && context.getLevel().getBlockState(pos.above()).canBeReplaced(context)){ + if (pos.getY() < 255 && context.getLevel().getBlockState(pos.above()).canBeReplaced(context)) { return super.getStateForPlacement(context); } return null; } @Override - public boolean canSurvive(BlockState state, LevelReader worldIn, BlockPos pos){ - if(state.getValue(BlockStateProperties.DOUBLE_BLOCK_HALF) != DoubleBlockHalf.UPPER) + public boolean canSurvive(BlockState state, LevelReader worldIn, BlockPos pos) { + if (state.getValue(BlockStateProperties.DOUBLE_BLOCK_HALF) != DoubleBlockHalf.UPPER) return state.getValue(BlockStateProperties.WATERLOGGED); - if(state.getBlock() != this) return super.canSurvive(state, worldIn, pos); + if (state.getBlock() != this) return super.canSurvive(state, worldIn, pos); BlockState stateBelow = worldIn.getBlockState(pos.below()); return (stateBelow.is(this) && stateBelow.getValue(BlockStateProperties.DOUBLE_BLOCK_HALF) == DoubleBlockHalf.LOWER @@ -114,7 +114,7 @@ public boolean canSurvive(BlockState state, LevelReader worldIn, BlockPos pos){ } // Item place to block - public void place(LevelAccessor world, BlockPos pos, int flags){ + public void place(LevelAccessor world, BlockPos pos, int flags) { // Create bottom half/roots in the water world.setBlock(pos.below(), this.defaultBlockState().setValue(BlockStateProperties.DOUBLE_BLOCK_HALF, DoubleBlockHalf.LOWER).setValue(BlockStateProperties.WATERLOGGED, true).setValue(BlockStateProperties.AGE_2, 0), flags); @@ -124,16 +124,16 @@ public void place(LevelAccessor world, BlockPos pos, int flags){ // Ticks @Override - public boolean isRandomlyTicking(BlockState state){ + public boolean isRandomlyTicking(BlockState state) { return state.getValue(BlockStateProperties.AGE_2) < 2; } // On a random tick, increment the age of the crop to the next state @Override - public void randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, RandomSource random){ + public void randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, RandomSource random) { int age = state.getValue(BlockStateProperties.AGE_2); - if (age < 2 && worldIn.getBlockState(pos.above()).getBlock() != this.defaultBlockState().getBlock() && worldIn.getRawBrightness(pos.above(), 0) > 12){ // light level may need tweaking + if (age < 2 && worldIn.getBlockState(pos.above()).getBlock() != this.defaultBlockState().getBlock() && worldIn.getRawBrightness(pos.above(), 0) > 12) { // light level may need tweaking age++; // Perform on bottom half worldIn.setBlock(pos.below(), this.defaultBlockState().setValue(BlockStateProperties.DOUBLE_BLOCK_HALF, DoubleBlockHalf.LOWER).setValue(BlockStateProperties.WATERLOGGED, true).setValue(BlockStateProperties.AGE_2, age), 18); @@ -146,7 +146,7 @@ public void randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, Rand // Add properties to the block state // this includes aging, half block, and waterlogged status @Override - protected void createBlockStateDefinition(StateDefinition.Builder builder){ + protected void createBlockStateDefinition(StateDefinition.Builder builder) { builder.add(BlockStateProperties.AGE_2); builder.add(BlockStateProperties.DOUBLE_BLOCK_HALF); builder.add(BlockStateProperties.WATERLOGGED); @@ -154,8 +154,8 @@ protected void createBlockStateDefinition(StateDefinition.Builder 1 && world.getBlockState(pos.above()).getBlock() != this.defaultBlockState().getBlock()){ // Make sure the player isn't targetting the bottom + } else if (age > 1 && world.getBlockState(pos.above()).getBlock() != this.defaultBlockState().getBlock()) { // Make sure the player isn't targetting the bottom popResource(world, pos, new ItemStack(cropItem(), 1)); world.playSound(null, pos, SoundEvents.CROP_BREAK, SoundSource.BLOCKS, 1.0F, 0.8F + world.random.nextFloat() * 0.4F); // to tweak diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AirCompressorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AirCompressorBlock.java index a71b46f16..0afce8c63 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AirCompressorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AirCompressorBlock.java @@ -30,7 +30,7 @@ public AirCompressorBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return VETileEntities.AIR_COMPRESSOR_FACTORY.create(pos,state); + return VETileEntities.AIR_COMPRESSOR_FACTORY.create(pos, state); } // NEW TICK SYSTEM diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java index bf96dc1fc..bb7d81743 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java @@ -2,7 +2,6 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PumpBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PumpBlock.java index 589d22498..8f75edd95 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PumpBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PumpBlock.java @@ -1,25 +1,16 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.blocks.util.FaceableBlock; -import com.veteam.voluminousenergy.blocks.tiles.PumpTile; import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.MenuProvider; -import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.EntityBlock; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.BlockHitResult; import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java index 3cc1fad94..6a228abda 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java @@ -1,16 +1,9 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.blocks.util.FaceableBlock; import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.world.InteractionHand; -import net.minecraft.world.InteractionResult; -import net.minecraft.world.MenuProvider; -import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntity; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/VEFaceableMachineBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/VEFaceableMachineBlock.java index 3e3008331..26b6563b3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/VEFaceableMachineBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/VEFaceableMachineBlock.java @@ -24,7 +24,7 @@ public VEFaceableMachineBlock(Properties properties) { super(properties); } - public VEFaceableMachineBlock(Properties properties,String rnName) { + public VEFaceableMachineBlock(Properties properties, String rnName) { super(properties); setRName(rnName); } @@ -48,7 +48,7 @@ public VEFaceableMachineBlock(Properties properties,String rnName) { public abstract BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state); @Nullable - public abstract BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType); + public abstract BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType); @Nullable protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tileEntity) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/BauxiteOre.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/BauxiteOre.java index 131898c3f..66948beae 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/BauxiteOre.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/BauxiteOre.java @@ -6,11 +6,11 @@ import net.minecraft.world.level.block.SoundType; public class BauxiteOre extends VEOreBlock { - public BauxiteOre(){ + public BauxiteOre() { super(Properties.of() - .sound(SoundType.STONE) - .strength(2.0f) - .requiresCorrectToolForDrops() + .sound(SoundType.STONE) + .strength(2.0f) + .requiresCorrectToolForDrops() ); setRName("bauxiteore"); VETagDataGenerator.setRequiresPickaxe(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/CinnabarOre.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/CinnabarOre.java index 511c8c1c5..fee2a410b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/CinnabarOre.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/CinnabarOre.java @@ -6,11 +6,11 @@ import net.minecraft.world.level.block.SoundType; public class CinnabarOre extends VEOreBlock { - public CinnabarOre(){ + public CinnabarOre() { super(Properties.of() - .sound(SoundType.STONE) - .strength(1.5f) - .requiresCorrectToolForDrops() + .sound(SoundType.STONE) + .strength(1.5f) + .requiresCorrectToolForDrops() ); setRName("cinnabarore"); VETagDataGenerator.setRequiresPickaxe(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/EighzoOre.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/EighzoOre.java index e6a31cb15..280a25d63 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/EighzoOre.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/EighzoOre.java @@ -6,7 +6,7 @@ import net.minecraft.world.level.block.SoundType; public class EighzoOre extends VEOreBlock { - public EighzoOre(){ + public EighzoOre() { super(Properties.of() .sound(SoundType.STONE) .strength(30F, 1200F) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/GalenaOre.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/GalenaOre.java index 832b5a1c2..324722474 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/GalenaOre.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/GalenaOre.java @@ -7,7 +7,7 @@ import net.minecraft.world.level.block.SoundType; public class GalenaOre extends VEOreBlock { - public GalenaOre(){ + public GalenaOre() { super(Properties.of() .sound(SoundType.STONE) .lightLevel(l -> Config.GALENA_ORE_BLOCK_LIGHT_LEVEL.get()) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/RutileOre.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/RutileOre.java index 495aa769a..cbce0b859 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/RutileOre.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/RutileOre.java @@ -6,11 +6,11 @@ import net.minecraft.world.level.block.SoundType; public class RutileOre extends VEOreBlock { - public RutileOre(){ + public RutileOre() { super(Properties.of() - .sound(SoundType.STONE) - .strength(4.0f) - .requiresCorrectToolForDrops() + .sound(SoundType.STONE) + .strength(4.0f) + .requiresCorrectToolForDrops() ); setRName("rutileore"); VETagDataGenerator.setRequiresPickaxe(this); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/SaltpeterOre.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/SaltpeterOre.java index b21b389e5..28162cc0e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/SaltpeterOre.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/SaltpeterOre.java @@ -10,12 +10,12 @@ import net.minecraft.world.level.block.state.BlockState; public class SaltpeterOre extends ColoredFallingBlock { - public SaltpeterOre(){ + public SaltpeterOre() { super(new ColorRGBA(14406560), - Properties.of() - .sound(SoundType.SAND) - .strength(0.6f) - .requiresCorrectToolForDrops() + Properties.of() + .sound(SoundType.SAND) + .strength(0.6f) + .requiresCorrectToolForDrops() ); VETagDataGenerator.setRequiresShovel(this); VETagDataGenerator.setRequiresWood(this); @@ -27,6 +27,6 @@ public int xpOnDrop(RandomSource randomSource) { @Override public int getExpDrop(BlockState state, net.minecraft.world.level.LevelReader reader, RandomSource randomSource, BlockPos pos, int fortune, int silktouch) { - return silktouch == 0 ? this.xpOnDrop(randomSource)*(1+fortune) : 0; + return silktouch == 0 ? this.xpOnDrop(randomSource) * (1 + fortune) : 0; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/VEOreBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/VEOreBlock.java index cc33cd058..83d3045c3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/VEOreBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/VEOreBlock.java @@ -19,6 +19,6 @@ protected int xpOnDrop(RandomSource randomSource) { @Override public int getExpDrop(BlockState state, net.minecraft.world.level.LevelReader reader, RandomSource randomSource, BlockPos pos, int fortune, int silktouch) { - return silktouch == 0 ? this.xpOnDrop(randomSource)*(1+fortune) : 0; + return silktouch == 0 ? this.xpOnDrop(randomSource) * (1 + fortune) : 0; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateBauxiteOre.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateBauxiteOre.java index 00fc794f6..2a2cdd8af 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateBauxiteOre.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateBauxiteOre.java @@ -7,7 +7,7 @@ import net.minecraft.world.level.block.SoundType; public class DeepslateBauxiteOre extends VEOreBlock { - public DeepslateBauxiteOre(){ + public DeepslateBauxiteOre() { super(Properties.of() .sound(SoundType.STONE) .strength(2.0f) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateCinnabarOre.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateCinnabarOre.java index 2a4673854..3ceadaf1f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateCinnabarOre.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateCinnabarOre.java @@ -8,7 +8,7 @@ import net.minecraft.world.level.block.state.BlockBehaviour; public class DeepslateCinnabarOre extends VEOreBlock { - public DeepslateCinnabarOre(){ + public DeepslateCinnabarOre() { super(BlockBehaviour.Properties.of() .sound(SoundType.STONE) .strength(1.5f) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateGalenaOre.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateGalenaOre.java index 5d6b2289a..aa9dd59f1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateGalenaOre.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateGalenaOre.java @@ -8,7 +8,7 @@ import net.minecraft.world.level.block.SoundType; public class DeepslateGalenaOre extends VEOreBlock { - public DeepslateGalenaOre(){ + public DeepslateGalenaOre() { super(Properties.of() .sound(SoundType.STONE) .lightLevel(l -> Config.GALENA_ORE_BLOCK_LIGHT_LEVEL.get()) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateRutileOre.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateRutileOre.java index 20e2d5f6f..611d4d438 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateRutileOre.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/deepslate/DeepslateRutileOre.java @@ -7,7 +7,7 @@ import net.minecraft.world.level.block.SoundType; public class DeepslateRutileOre extends VEOreBlock { - public DeepslateRutileOre(){ + public DeepslateRutileOre() { super(Properties.of() .sound(SoundType.STONE) .strength(4.0f) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/red_sand/RedSaltpeterOre.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/red_sand/RedSaltpeterOre.java index 872406126..a272ff134 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/red_sand/RedSaltpeterOre.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/ores/red_sand/RedSaltpeterOre.java @@ -10,12 +10,12 @@ import net.minecraft.world.level.block.state.BlockState; public class RedSaltpeterOre extends ColoredFallingBlock { - public RedSaltpeterOre(){ - super( new ColorRGBA(-8356741), + public RedSaltpeterOre() { + super(new ColorRGBA(-8356741), Properties.of() - .sound(SoundType.SAND) - .strength(0.6f) - .requiresCorrectToolForDrops() + .sound(SoundType.SAND) + .strength(0.6f) + .requiresCorrectToolForDrops() ); VETagDataGenerator.setRequiresShovel(this); VETagDataGenerator.setRequiresWood(this); @@ -27,6 +27,6 @@ public int xpOnDrop(RandomSource randomSource) { @Override public int getExpDrop(BlockState state, net.minecraft.world.level.LevelReader reader, RandomSource randomSource, BlockPos pos, int fortune, int silktouch) { - return silktouch == 0 ? this.xpOnDrop(randomSource)*(1+fortune) : 0; + return silktouch == 0 ? this.xpOnDrop(randomSource) * (1 + fortune) : 0; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java index 1d04ab135..f71e02d3b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java @@ -45,7 +45,6 @@ public boolean isItemValid(int slot, @NotNull ItemStack stack) { if (slot == upgradeSlot) return TagUtil.isTaggedMachineUpgradeItem(stack); - return false; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java index 0cbefe895..184d4bc11 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java @@ -29,7 +29,7 @@ public class ToolingStationContainer extends VEContainer { public static final int NUMBER_OF_SLOTS = 6; public ToolingStationContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(TOOLING_STATION_CONTAINER.get(), id,world,pos,inventory,player,VEBlocks.TOOLING_STATION_BLOCK.get()); + super(TOOLING_STATION_CONTAINER.get(), id, world, pos, inventory, player, VEBlocks.TOOLING_STATION_BLOCK.get()); } @Nonnull @@ -66,22 +66,22 @@ protected void addSlotsToGUI(IItemHandler h) { addSlot(new VEBucketSlot(h, 1, 38, 49)); // Extract fluid from input addSlot(new VEInsertSlot(h, 2, 86, 32)); // Main Tool tilePos addSlot(new VEInsertSlot(h, 3, 134, 18)); // Bit Slot - addSlot(new VEInsertSlot(h, 4, 134,49)); // Base Slot - addSlot(new VEInsertSlot(h, 5,154, -14)); // Upgrade Slot + addSlot(new VEInsertSlot(h, 4, 134, 49)); // Base Slot + addSlot(new VEInsertSlot(h, 5, 154, -14)); // Upgrade Slot } @Override - public ItemStack handleCoreQuickMoveStackLogic(final int index, final int containerSlots, ItemStack slotStack){ + public ItemStack handleCoreQuickMoveStackLogic(final int index, final int containerSlots, ItemStack slotStack) { if (index < containerSlots) { // Container --> Inventory if (!moveItemStackTo(slotStack, containerSlots, this.slots.size(), true)) { return ItemStack.EMPTY; } } else { // Inventory --> Container - if (slotStack.getItem() instanceof CombustionMultitool){ + if (slotStack.getItem() instanceof CombustionMultitool) { if (((CombustionMultitool) slotStack.getItem()).getBit() == null - || slotStack.getItem() == VEMultitools.EMPTY_MULTITOOL.get()){ // Multitool Base Slot id is 4 - if (!this.slots.get(2).hasItem() && !this.slots.get(4).hasItem() && !moveItemStackTo(slotStack, 4, 5, false)){ + || slotStack.getItem() == VEMultitools.EMPTY_MULTITOOL.get()) { // Multitool Base Slot id is 4 + if (!this.slots.get(2).hasItem() && !this.slots.get(4).hasItem() && !moveItemStackTo(slotStack, 4, 5, false)) { return ItemStack.EMPTY; } } else if (!this.slots.get(3).hasItem() @@ -92,14 +92,14 @@ public ItemStack handleCoreQuickMoveStackLogic(final int index, final int contai } } - if (slotStack.getItem() instanceof BitItem){ // Bit Slot id is 3 - if (!this.slots.get(2).hasItem() && !this.slots.get(3).hasItem() && !moveItemStackTo(slotStack, 3, 4, false)){ + if (slotStack.getItem() instanceof BitItem) { // Bit Slot id is 3 + if (!this.slots.get(2).hasItem() && !this.slots.get(3).hasItem() && !moveItemStackTo(slotStack, 3, 4, false)) { return ItemStack.EMPTY; } } - if (slotStack.getItem() instanceof BucketItem){ - if (slotStack.getItem().equals(Items.BUCKET)){ + if (slotStack.getItem() instanceof BucketItem) { + if (slotStack.getItem().equals(Items.BUCKET)) { return !moveItemStackTo(slotStack, 0, 1, false) ? ItemStack.EMPTY : null; } @@ -110,7 +110,7 @@ public ItemStack handleCoreQuickMoveStackLogic(final int index, final int contai // if (RecipeUtil.isCombustibleFuel(slotFluid, this.tileEntity.getLevel()) && !moveItemStackTo(slotStack, 0, 1, false)){ // return ItemStack.EMPTY; // } TODO FIX ME - } catch (Exception e){ + } catch (Exception e) { VoluminousEnergy.LOGGER.error("Item: " + RegistryLookups.lookupItem(slotStack) + " Appears to be a bucket, this error is likely caused by it not containing a fluid. " + "This may be a modded bucket that extends BucketItem, but contains no fluid. If not, here's the stacktrace: "); e.printStackTrace(); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java index 9aebcee62..c1f8d7e46 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java @@ -47,7 +47,7 @@ protected VEContainer(@Nullable MenuType menuType, int id, Level world, Block this.playerEntity = player; this.playerInventory = new InvWrapper(inventory); this.block = block; - this.access = ContainerLevelAccess.create(this.tileEntity.getLevel(),this.tileEntity.getBlockPos()); + this.access = ContainerLevelAccess.create(this.tileEntity.getLevel(), this.tileEntity.getBlockPos()); this.world = world; // we add slots to GUI here tileEntity.getCapability(ForgeCapabilities.ITEM_HANDLER).ifPresent(this::addSlotsToGUI); @@ -56,7 +56,7 @@ protected VEContainer(@Nullable MenuType menuType, int id, Level world, Block layoutPlayerInventorySlots(); // We assume if it's a powered tile entity that it requires a dataslot for energy - if(this.tileEntity.getEnergy() != null) { + if (this.tileEntity.getEnergy() != null) { addDataSlot(new DataSlot() { @Override public int get() { @@ -87,15 +87,15 @@ void layoutPlayerInventorySlots() { @Override public boolean stillValid(@NotNull Player player) { - return stillValid(this.access,this.playerEntity, this.block); + return stillValid(this.access, this.playerEntity, this.block); } - public VETileEntity getTileEntity(){ + public VETileEntity getTileEntity() { return tileEntity; } protected int addSlotRange(IItemHandler handler, int index, int x, int y, int amount, int dx) { - for (int i = 0 ; i < amount ; i++) { + for (int i = 0; i < amount; i++) { addSlot(new SlotItemHandler(handler, index, x, y)); x += dx; index++; @@ -104,48 +104,48 @@ protected int addSlotRange(IItemHandler handler, int index, int x, int y, int am } protected int addSlotBox(IItemHandler handler, int index, int x, int y, int horAmount, int dx, int verAmount, int dy) { - for (int j = 0 ; j < verAmount ; j++) { + for (int j = 0; j < verAmount; j++) { index = addSlotRange(handler, index, x, y, horAmount, dx); y += dy; } return index; } - public int getEnergy(){ + public int getEnergy() { return tileEntity.getCapability(ForgeCapabilities.ENERGY).map(IEnergyStorage::getEnergyStored).orElse(0); } - public int powerScreen(int px){ + public int powerScreen(int px) { int stored = tileEntity.getCapability(ForgeCapabilities.ENERGY).map(IEnergyStorage::getEnergyStored).orElse(0); int max = tileEntity.getCapability(ForgeCapabilities.ENERGY).map(IEnergyStorage::getMaxEnergyStored).orElse(0); - return (((stored*100/max*100)/100)*px)/100; + return (((stored * 100 / max * 100) / 100) * px) / 100; } // For the battery box. Might remove later - public void updateSendOutPowerButton(boolean status){ - if(this.screen instanceof BatteryBoxScreen batteryBoxScreen) { + public void updateSendOutPowerButton(boolean status) { + if (this.screen instanceof BatteryBoxScreen batteryBoxScreen) { batteryBoxScreen.updateSendOutPowerButton(status); } } - public ItemStack handleCoreQuickMoveStackLogicWithUpgradeSlot(final int index, final int containerSlots, final int upgradeSlotId, ItemStack slotStack){ + public ItemStack handleCoreQuickMoveStackLogicWithUpgradeSlot(final int index, final int containerSlots, final int upgradeSlotId, ItemStack slotStack) { if (index < containerSlots) { // Container --> Inventory if (!moveItemStackTo(slotStack, containerSlots, this.slots.size(), true)) { return ItemStack.EMPTY; } } else { // Inventory --> Container - if(/*slotStack.is(VEItems.QUARTZ_MULTIPLIER)*/ TagUtil.isTaggedMachineUpgradeItem(slotStack) && !moveItemStackTo(slotStack, upgradeSlotId, upgradeSlotId+1, false)) { + if (/*slotStack.is(VEItems.QUARTZ_MULTIPLIER)*/ TagUtil.isTaggedMachineUpgradeItem(slotStack) && !moveItemStackTo(slotStack, upgradeSlotId, upgradeSlotId + 1, false)) { return ItemStack.EMPTY; } - if (/*!slotStack.is(VEItems.QUARTZ_MULTIPLIER)*/ !TagUtil.isTaggedMachineUpgradeItem(slotStack) && !moveItemStackTo(slotStack, 0, upgradeSlotId, false)){ + if (/*!slotStack.is(VEItems.QUARTZ_MULTIPLIER)*/ !TagUtil.isTaggedMachineUpgradeItem(slotStack) && !moveItemStackTo(slotStack, 0, upgradeSlotId, false)) { return ItemStack.EMPTY; } } return null; } - public ItemStack handleCoreQuickMoveStackLogic(final int index, final int containerSlots, ItemStack slotStack){ + public ItemStack handleCoreQuickMoveStackLogic(final int index, final int containerSlots, ItemStack slotStack) { if (index < containerSlots) { // Container --> Inventory if (!moveItemStackTo(slotStack, containerSlots, this.slots.size(), true)) { return ItemStack.EMPTY; @@ -156,34 +156,34 @@ public ItemStack handleCoreQuickMoveStackLogic(final int index, final int contai return null; } - public void setTileEntity(VETileEntity tileEntity){ + public void setTileEntity(VETileEntity tileEntity) { this.tileEntity = tileEntity; } // Unauthorized call to this method can be dangerous. Can't not be public AFAIK. :( - public void setScreen(VEContainerScreen screen){ + public void setScreen(VEContainerScreen screen) { this.screen = screen; } - public void updateDirectionButton(int direction, int slotId){ - screen.updateButtonDirection(direction,slotId); + public void updateDirectionButton(int direction, int slotId) { + screen.updateButtonDirection(direction, slotId); } - public void updateStatusButton(boolean status, int slotId){ + public void updateStatusButton(boolean status, int slotId) { screen.updateBooleanButton(status, slotId); } - public void updateStatusTank(boolean status, int id){ + public void updateStatusTank(boolean status, int id) { screen.updateTankStatus(status, id); } - public void updateDirectionTank(int direction, int id){ + public void updateDirectionTank(int direction, int id) { screen.updateTankDirection(direction, id); } - public int getUpgradeSlotId(){ + public int getUpgradeSlotId() { VEEnergyStorage storage = this.tileEntity.getEnergy(); - if (storage != null){ + if (storage != null) { return storage.getUpgradeSlotId(); } VoluminousEnergy.LOGGER.error("A container called getUpgradeSlotId when tile doesn't support upgrade slots! Offending tile is: " + RegistryLookups.getBlockEntityTypeKey(tileEntity.getType())); @@ -199,13 +199,14 @@ public ItemStack quickMoveStack(final @NotNull Player player, final int index) { int numberOfSlots = this.tileEntity.getSlotManagers().size() + (this.tileEntity.getEnergy() != null ? 1 : 0); // TODO why is this a dangling if? - if(this.tileEntity.getEnergy() != null){} + if (this.tileEntity.getEnergy() != null) { + } if (slot.hasItem()) { final ItemStack slotStack = slot.getItem(); returnStack = slotStack.copy(); - if (handleItemMove(index, numberOfSlots, slotStack,index) != null) + if (handleItemMove(index, numberOfSlots, slotStack, index) != null) return ItemStack.EMPTY; if (slotStack.getCount() == 0) { @@ -223,12 +224,11 @@ public ItemStack quickMoveStack(final @NotNull Player player, final int index) { return returnStack; } - public ItemStack handleItemMove(final int index, final int containerSlots, ItemStack slotStack, int slotId){ - if(index < containerSlots && !super.moveItemStackTo(slotStack, containerSlots, this.slots.size(), true)) { + public ItemStack handleItemMove(final int index, final int containerSlots, ItemStack slotStack, int slotId) { + if (index < containerSlots && !super.moveItemStackTo(slotStack, containerSlots, this.slots.size(), true)) { this.tileEntity.markRecipeDirty(); return ItemStack.EMPTY; - } - else if(!moveItemStackTo(slotStack,this.slots.size(),slotId)) { + } else if (!moveItemStackTo(slotStack, this.slots.size(), slotId)) { this.tileEntity.markRecipeDirty(); return ItemStack.EMPTY; } @@ -242,7 +242,7 @@ protected boolean moveItemStackTo(@NotNull ItemStack stackToMove, int endPos, in List slotManagers = this.tileEntity.getSlotManagers(); ItemStackHandler handler = this.tileEntity.getInventoryHandler(); int powerId = -1; - if(tileEntity.getEnergy() != null) powerId = tileEntity.getEnergy().getUpgradeSlotId(); + if (tileEntity.getEnergy() != null) powerId = tileEntity.getEnergy().getUpgradeSlotId(); if (stackToMove.isStackable()) { while (!stackToMove.isEmpty()) { if (currentPos >= endPos) { @@ -254,13 +254,13 @@ protected boolean moveItemStackTo(@NotNull ItemStack stackToMove, int endPos, in boolean isInput; - if(currentPos < slotManagers.size()) { + if (currentPos < slotManagers.size()) { VESlotManager manager = slotManagers.get(currentPos); isInput = manager.getSlotType() == SlotType.INPUT || manager.getSlotType() == SlotType.FLUID_INPUT; - if(handler != null && isInput) { - isInput = handler.isItemValid(currentPos,stackToMove.copy()); + if (handler != null && isInput) { + isInput = handler.isItemValid(currentPos, stackToMove.copy()); } - } else if(currentPos == powerId) { + } else if (currentPos == powerId) { isInput = TagUtil.isTaggedMachineUpgradeItem(stackToMove); } else { isInput = true; @@ -296,13 +296,13 @@ protected boolean moveItemStackTo(@NotNull ItemStack stackToMove, int endPos, in boolean isInput; - if(currentPos < slotManagers.size()) { + if (currentPos < slotManagers.size()) { VESlotManager manager = slotManagers.get(currentPos); isInput = manager.getSlotType() == SlotType.INPUT || manager.getSlotType() == SlotType.FLUID_INPUT; - if(handler != null && isInput) { - isInput = handler.isItemValid(currentPos,stackToMove.copy()); + if (handler != null && isInput) { + isInput = handler.isItemValid(currentPos, stackToMove.copy()); } - } else if(currentPos == powerId) { + } else if (currentPos == powerId) { isInput = TagUtil.isTaggedMachineUpgradeItem(stackToMove); } else { isInput = true; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java index ba5bf80a6..8fabd314f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java @@ -44,24 +44,24 @@ protected void addSlotsToGUI(IItemHandler h) { int energySlotId = -1; - if( this.tileEntity.getEnergy() != null) { + if (this.tileEntity.getEnergy() != null) { energySlotId = this.tileEntity.getEnergy().getUpgradeSlotId(); } - for(int i = 0; i < slots.size(); i++) { - if(i == energySlotId) { + for (int i = 0; i < slots.size(); i++) { + if (i == energySlotId) { Slot slot = slots.get(i); - addSlot(new VESlot(h, slot.index, slot.x, slot.y,true)); + addSlot(new VESlot(h, slot.index, slot.x, slot.y, true)); continue; } - if(i >= this.tileEntity.getSlotManagers().size()) { + if (i == this.tileEntity.getSlotManagers().size()) { VoluminousEnergy.LOGGER.error("Unable to properly create " + menuTypeRegistryObject.getId() + ". The VEContainerFactory tried to process more slots than were available."); - continue; + break; } SlotType slotType = this.tileEntity.getSlotManagers().get(i).getSlotType(); boolean isOutput = slotType == SlotType.FLUID_OUTPUT || slotType == SlotType.OUTPUT; Slot slot = slots.get(i); - addSlot(new VESlot(h, slot.index, slot.x, slot.y,!isOutput)); + addSlot(new VESlot(h, slot.index, slot.x, slot.y, !isOutput)); } } }; @@ -85,19 +85,13 @@ public VEContainerFactoryBuilder create(RegistryObject> me private int index = 0; - @Deprecated - public VEContainerFactoryBuilder addSlot(int x, int y) { - this.factory.slots.add(new Slot(index++, x, y)); - return this; - } - public VEContainerFactoryBuilder addUpgradeSlot(int x, int y) { this.factory.slots.add(new Slot(index, x, y)); this.factory.upgradeSlotId = index++; return this; } - public VEContainerFactoryBuilder addSlot(int x, int y,TileSlot slot) { + public VEContainerFactoryBuilder addSlot(int x, int y, TileSlot slot) { this.factory.slots.add(new Slot(index++, x, y)); this.factory.tileSlots.add(slot); return this; @@ -118,7 +112,7 @@ public static class VESlot extends SlotItemHandler { private final int index; private final boolean allowInsertion; - public VESlot(IItemHandler itemHandler, int index, int xPos, int yPos,boolean allowInsertion) { + public VESlot(IItemHandler itemHandler, int index, int xPos, int yPos, boolean allowInsertion) { super(itemHandler, index, xPos, yPos); this.handler = itemHandler; this.index = index; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java index 4142697b0..4f6824371 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java @@ -10,16 +10,16 @@ public class VEContainers { public static final VEContainerFactory AIR_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() .create(AIR_COMPRESSOR_CONTAINER, AIR_COMPRESSOR_BLOCK) - .addSlot(70, 18,new BucketInputSlot(UP,0)) // Air Compressor bucket input tilePos - .addSlot(70, 49,new BucketOutputSlot(DOWN)) // Air Compressor bucket output tilePos + .addSlot(70, 18, new BucketInputSlot(UP, 0)) // Air Compressor bucket input tilePos + .addSlot(70, 49, new BucketOutputSlot(DOWN)) // Air Compressor bucket output tilePos .addUpgradeSlot(154, -14) // Upgrade Slot .build(); public static final VEContainerFactory AQUEOULIZER_FACTORY = new VEContainerFactoryBuilder() .create(AQUEOULIZER_CONTAINER, AQUEOULIZER_BLOCK) - .addSlot(38, 18, new BucketInputSlot(UP,0)) + .addSlot(38, 18, new BucketInputSlot(UP, 0)) .addSlot(38, 49, new BucketOutputSlot(DOWN)) - .addSlot(137, 18, new BucketInputSlot(NORTH,1)) + .addSlot(137, 18, new BucketInputSlot(NORTH, 1)) .addSlot(137, 49, new BucketOutputSlot(SOUTH)) .addSlot(96, 32, new ItemInputSlot(EAST)) .addUpgradeSlot(130, -14) @@ -27,24 +27,24 @@ public class VEContainers { public static final VEContainerFactory BATTERY_BOX_FACTORY = new VEContainerFactoryBuilder() .create(BATTERY_BOX_CONTAINER, BATTERY_BOX_BLOCK) - .addSlot(35, 17,new InputSlot(UP)) - .addSlot(53, 17,new InputSlot(UP)) - .addSlot(71, 17,new InputSlot(UP)) - .addSlot(89, 17,new InputSlot(UP)) - .addSlot(107, 17,new InputSlot(UP)) - .addSlot(125, 17,new InputSlot(UP)) + .addSlot(35, 17, new InputSlot(UP)) + .addSlot(53, 17, new InputSlot(UP)) + .addSlot(71, 17, new InputSlot(UP)) + .addSlot(89, 17, new InputSlot(UP)) + .addSlot(107, 17, new InputSlot(UP)) + .addSlot(125, 17, new InputSlot(UP)) //Bottom Slots - .addSlot(35, 54,new InputSlot(DOWN)) - .addSlot(53, 54,new InputSlot(DOWN)) - .addSlot(71, 54,new InputSlot(DOWN)) - .addSlot(89, 54,new InputSlot(DOWN)) - .addSlot(107, 54,new InputSlot(DOWN)) - .addSlot(125, 54,new InputSlot(DOWN)) + .addSlot(35, 54, new InputSlot(DOWN)) + .addSlot(53, 54, new InputSlot(DOWN)) + .addSlot(71, 54, new InputSlot(DOWN)) + .addSlot(89, 54, new InputSlot(DOWN)) + .addSlot(107, 54, new InputSlot(DOWN)) + .addSlot(125, 54, new InputSlot(DOWN)) .build(); public static final VEContainerFactory BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(BLAST_FURNACE_CONTAINER, BLAST_FURNACE_BLOCK) - .addSlot(38, 18,new BucketInputSlot(UP,0)) // Fluid input tilePos + .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Fluid input tilePos .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from heat tank .addSlot(80, 25, new InputSlot(EAST)) // First input tilePos .addSlot(80, 43, new InputSlot(WEST)) // Second input tilePos @@ -54,19 +54,19 @@ public class VEContainers { public static final VEContainerFactory CENTRIFUGAL_AGITATOR_FACTORY = new VEContainerFactoryBuilder() .create(CENTRIFUGAL_AGITATOR_CONTAINER, CENTRIFUGAL_AGITATOR_BLOCK) - .addSlot(38, 18,new BucketInputSlot(UP,0)) // Bucket insert; input tank - .addSlot(38, 49,new BucketOutputSlot(DOWN)) // Bucket extract; input tank - .addSlot(96, 18, new BucketInputSlot(NORTH,1)) // Bucket insert; first output tank + .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Bucket insert; input tank + .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Bucket extract; input tank + .addSlot(96, 18, new BucketInputSlot(NORTH, 1)) // Bucket insert; first output tank .addSlot(96, 49, new BucketOutputSlot(SOUTH)) // Bucket extract; first output tank - .addSlot(137, 18, new BucketInputSlot(EAST,2)) // Bucket insert; second output tank + .addSlot(137, 18, new BucketInputSlot(EAST, 2)) // Bucket insert; second output tank .addSlot(137, 49, new BucketOutputSlot(WEST)) // Bucket extract; second output tank .addUpgradeSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory CENTRIFUGAL_SEPARATOR_FACTORY = new VEContainerFactoryBuilder() .create(CENTRIFUGAL_SEPARATOR_CONTAINER, CENTRIFUGAL_SEPARATOR_BLOCK) - .addSlot(53, 24,new ItemInputSlot(UP)) // Primary input tilePos - .addSlot(53, 42,new ItemInputSlot(WEST)) // Empty Bucket tilePos + .addSlot(53, 24, new ItemInputSlot(UP)) // Primary input tilePos + .addSlot(53, 42, new ItemInputSlot(WEST)) // Empty Bucket tilePos .addSlot(99, 33, new ItemOutputSlot(DOWN)) //Main Output .addSlot(117, 15, new ItemOutputSlot(NORTH)) //RNG #1 Slot .addSlot(135, 33, new ItemOutputSlot(SOUTH)) //RNG #2 Slot @@ -76,30 +76,30 @@ public class VEContainers { public static final VEContainerFactory COMBUSTION_GENERATOR_FACTORY = new VEContainerFactoryBuilder() .create(COMBUSTION_GENERATOR_CONTAINER, COMBUSTION_GENERATOR_BLOCK) - .addSlot(38, 18,new BucketInputSlot(UP,0)) // Oxidizer input tilePos - .addSlot(38, 49,new BucketOutputSlot(DOWN)) // Extract fluid from oxidizer tilePos - .addSlot(138, 18,new BucketInputSlot(NORTH,1)) // Fuel input tilePos - .addSlot(138, 49,new BucketOutputSlot(SOUTH)) // Extract fluid from fuel output + .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Oxidizer input tilePos + .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from oxidizer tilePos + .addSlot(138, 18, new BucketInputSlot(NORTH, 1)) // Fuel input tilePos + .addSlot(138, 49, new BucketOutputSlot(SOUTH)) // Extract fluid from fuel output .build(); public static final VEContainerFactory COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() .create(COMPRESSOR_CONTAINER, COMPRESSOR_BLOCK) - .addSlot(80, 13,new ItemInputSlot(UP)) - .addSlot(80, 58,new ItemOutputSlot(DOWN)) //Main Output + .addSlot(80, 13, new ItemInputSlot(UP)) + .addSlot(80, 58, new ItemOutputSlot(DOWN)) //Main Output .addUpgradeSlot(154, -14) //Upgrade tilePos .build(); public static final VEContainerFactory CRUSHER_FACTORY = new VEContainerFactoryBuilder() .create(CRUSHER_CONTAINER, CRUSHER_BLOCK) - .addSlot(80, 13,new ItemInputSlot(UP)) // Input Slot + .addSlot(80, 13, new ItemInputSlot(UP)) // Input Slot .addSlot(71, 58, new ItemOutputSlot(DOWN)) //Main Output - .addSlot(89,58,new ItemOutputSlot(NORTH)) // RNG slot + .addSlot(89, 58, new ItemOutputSlot(NORTH)) // RNG slot .addUpgradeSlot(154, -14) //Upgrade tilePos .build(); public static final VEContainerFactory DIMENSIONAL_LASER_FACTORY = new VEContainerFactoryBuilder() .create(DIMENSIONAL_LASER_CONTAINER, DIMENSIONAL_LASER_BLOCK) - .addSlot(138, 18,new BucketInputSlot(UP,0)) // Bucket top tilePos + .addSlot(138, 18, new BucketInputSlot(UP, 0)) // Bucket top tilePos .addSlot(138, 49, new BucketOutputSlot(DOWN)) // Bucket bottom tilePos .addSlot(38, 33, new ItemInputSlot(NORTH)) // RFID chip tilePos .addUpgradeSlot(130, -14) // Upgrade tilePos @@ -107,27 +107,27 @@ public class VEContainers { public static final VEContainerFactory DISTILLATION_UNIT_FACTORY = new VEContainerFactoryBuilder() .create(DISTILLATION_UNIT_CONTAINER, DISTILLATION_UNIT_BLOCK) - .addSlot(38, 18,new BucketInputSlot(UP,0)) // Fluid input tilePos + .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Fluid input tilePos .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from input - .addSlot(96, 11, new BucketInputSlot(UP,1)) // Top tilePos for first output + .addSlot(96, 11, new BucketInputSlot(UP, 1)) // Top tilePos for first output .addSlot(96, 42, new BucketOutputSlot(DOWN)) // Bottom tilePos for first output - .addSlot(137, 11,new BucketInputSlot(UP,2)) // Top tilePos for from second output + .addSlot(137, 11, new BucketInputSlot(UP, 2)) // Top tilePos for from second output .addSlot(137, 42, new BucketOutputSlot(DOWN)) // Bottom tilePos for second output - .addSlot(122, 64,new ItemOutputSlot(DOWN)) // Item Output Slot + .addSlot(122, 64, new ItemOutputSlot(DOWN)) // Item Output Slot .addUpgradeSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory ELECTRIC_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(ELECTRIC_FURNACE_CONTAINER, ELECTRIC_FURNACE_BLOCK) - .addSlot(53, 33,new ItemInputSlot(UP)) // Furnace Input Slot + .addSlot(53, 33, new ItemInputSlot(UP)) // Furnace Input Slot .addSlot(116, 33, new ItemOutputSlot(DOWN)) // Furnace Output Slot .addUpgradeSlot(154, -14)// Upgrade Slot .build(); public static final VEContainerFactory ELECTROLYZER_FACTORY = new VEContainerFactoryBuilder() .create(ELECTROLYZER_CONTAINER, ELECTROLYZER_BLOCK) - .addSlot(71, 13,new ItemInputSlot(UP)) - .addSlot(89, 13,new ItemInputSlot(WEST)) // Empty Bucket tilePos + .addSlot(71, 13, new ItemInputSlot(UP)) + .addSlot(89, 13, new ItemInputSlot(WEST)) // Empty Bucket tilePos .addSlot(53, 57, new ItemOutputSlot(DOWN)) //Main Output .addSlot(71, 57, new ItemOutputSlot(NORTH)) //RNG #1 Slot .addSlot(89, 57, new ItemOutputSlot(SOUTH)) //RNG #2 Slot @@ -137,39 +137,39 @@ public class VEContainers { public static final VEContainerFactory FLUID_ELECTROLYZER_FACTORY = new VEContainerFactoryBuilder() .create(FLUID_ELECTROLYZER_CONTAINER, FLUID_ELECTROLYZER_BLOCK) - .addSlot(38, 18,new BucketInputSlot(UP,0)) // Top input bucket - .addSlot(38, 49,new BucketOutputSlot(DOWN)) // Bottom input bucket - .addSlot(96, 18,new BucketInputSlot(EAST,1)) // Top output0 bucket - .addSlot(96, 49,new BucketOutputSlot(WEST)) // Bottom output0 bucket - .addSlot(137, 18,new BucketInputSlot(NORTH,2)) // Top output1 bucket - .addSlot(137, 49,new BucketOutputSlot(SOUTH)) // Bottom output1 bucket + .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Top input bucket + .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Bottom input bucket + .addSlot(96, 18, new BucketInputSlot(EAST, 1)) // Top output0 bucket + .addSlot(96, 49, new BucketOutputSlot(WEST)) // Bottom output0 bucket + .addSlot(137, 18, new BucketInputSlot(NORTH, 2)) // Top output1 bucket + .addSlot(137, 49, new BucketOutputSlot(SOUTH)) // Bottom output1 bucket .addUpgradeSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory FLUID_MIXER_FACTORY = new VEContainerFactoryBuilder() .create(FLUID_MIXER_CONTAINER, FLUID_MIXER_BLOCK) - .addSlot(38, 18,new BucketInputSlot(UP,0)) // Top input0 bucket - .addSlot(38, 49,new BucketOutputSlot(DOWN)) // Bottom input0 bucket - .addSlot(86, 18,new BucketInputSlot(EAST,1)) // Top input1 bucket - .addSlot(86, 49,new BucketOutputSlot(WEST)) // Bottom input1 bucket - .addSlot(136, 18,new BucketInputSlot(NORTH,2)) // Top output0 bucket - .addSlot(136, 49,new BucketOutputSlot(SOUTH)) // Bottom output0 bucket + .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Top input0 bucket + .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Bottom input0 bucket + .addSlot(86, 18, new BucketInputSlot(EAST, 1)) // Top input1 bucket + .addSlot(86, 49, new BucketOutputSlot(WEST)) // Bottom input1 bucket + .addSlot(136, 18, new BucketInputSlot(NORTH, 2)) // Top output0 bucket + .addSlot(136, 49, new BucketOutputSlot(SOUTH)) // Bottom output0 bucket .addUpgradeSlot(130, -14) // Upgrade tilePos .build(); public static final VEContainerFactory GAS_FIRED_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(GAS_FIRED_FURNACE_CONTAINER, GAS_FIRED_FURNACE_BLOCK) - .addSlot(8, 18,new BucketInputSlot(UP,0)) // Fluid input tilePos - .addSlot(8, 49,new BucketOutputSlot(DOWN)) // Extract fluid from input - .addSlot(53, 33,new ItemInputSlot(EAST)) // Item input tilePos - .addSlot(116, 33,new ItemOutputSlot(WEST)) // Item output tilePos + .addSlot(8, 18, new BucketInputSlot(UP, 0)) // Fluid input tilePos + .addSlot(8, 49, new BucketOutputSlot(DOWN)) // Extract fluid from input + .addSlot(53, 33, new ItemInputSlot(EAST)) // Item input tilePos + .addSlot(116, 33, new ItemOutputSlot(WEST)) // Item output tilePos .addUpgradeSlot(154, -14) // Upgrade tilePos .build(); public static final VEContainerFactory HYDROPONIC_INCUBATOR_FACTORY = new VEContainerFactoryBuilder() .create(HYDROPONIC_INCUBATOR_CONTAINER, HYDROPONIC_INCUBATOR_BLOCK) - .addSlot(38, 18, new BucketInputSlot(UP,0)) // Bucket top tilePos - .addSlot(38, 49,new BucketOutputSlot(DOWN)) // Bucket bottom tilePos + .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Bucket top tilePos + .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Bucket bottom tilePos .addSlot(83, 34, new ItemInputSlot(NORTH)) // Primary input .addSlot(123, 8, new ItemOutputSlot(NORTH)) // Primary output .addSlot(123, 26, new ItemOutputSlot(NORTH)) // RNG0 output @@ -180,7 +180,7 @@ public class VEContainers { public static final VEContainerFactory IMPLOSION_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() .create(IMPLOSION_COMPRESSOR_CONTAINER, IMPLOSION_COMPRESSOR_BLOCK) - .addSlot(53, 23,new ItemInputSlot(UP)) // Main input + .addSlot(53, 23, new ItemInputSlot(UP)) // Main input .addSlot(53, 41, new ItemInputSlot(EAST)) // Gunpowder tilePos .addSlot(116, 33, new ItemOutputSlot(DOWN)) //Main Output .addUpgradeSlot(154, -14) //Upgrade tilePos @@ -188,7 +188,7 @@ public class VEContainers { public static final VEContainerFactory PRIMITIVE_BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(PRIMITIVE_BLAST_FURNACE_CONTAINER, PRIMITIVE_BLAST_FURNACE_BLOCK) - .addSlot(53, 33,new ItemInputSlot(UP)) + .addSlot(53, 33, new ItemInputSlot(UP)) .addSlot(116, 33, new ItemOutputSlot(DOWN)) .addUpgradeSlot(154, -14) .build(); @@ -204,16 +204,16 @@ public class VEContainers { public static final VEContainerFactory PUMP_FACTORY = new VEContainerFactoryBuilder() .create(PUMP_CONTAINER, PUMP_BLOCK) - .addSlot(70, 18,new BucketInputSlot(UP, 0)) // Pump bucket input tilePos + .addSlot(70, 18, new BucketInputSlot(UP, 0)) // Pump bucket input tilePos .addSlot(70, 49, new BucketOutputSlot(DOWN)) // Pump bucket output tilePos .build(); public static final VEContainerFactory SAWMILL_FACTORY = new VEContainerFactoryBuilder() .create(SAWMILL_CONTAINER, SAWMILL_BLOCK) - .addSlot(44, 32,new ItemInputSlot(UP)) // Log input tilePos - .addSlot(80, 24,new ItemOutputSlot(DOWN)) // Plank Output + .addSlot(44, 32, new ItemInputSlot(UP)) // Log input tilePos + .addSlot(80, 24, new ItemOutputSlot(DOWN)) // Plank Output .addSlot(80, 42, new ItemOutputSlot(NORTH)) // Secondary Output - .addSlot(115, 18, new BucketInputSlot(SOUTH,0)) // Bucket Input + .addSlot(115, 18, new BucketInputSlot(SOUTH, 0)) // Bucket Input .addSlot(115, 49, new BucketOutputSlot(EAST)) // Bucket Output .addUpgradeSlot(154, -14) // Upgrade Slot .build(); @@ -224,14 +224,14 @@ public class VEContainers { public static final VEContainerFactory STIRLING_GENERATOR_FACTORY = new VEContainerFactoryBuilder() .create(STIRLING_GENERATOR_CONTAINER, STIRLING_GENERATOR_BLOCK) - .addSlot(80, 35,new ItemInputSlot(UP)) + .addSlot(80, 35, new ItemInputSlot(UP)) .build(); // TOOLING STATION UNUSED public static final VEContainerFactory TOOLING_STATION_FACTORY = new VEContainerFactoryBuilder() .create(TOOLING_STATION_CONTAINER, TOOLING_STATION_BLOCK) - .addSlot(38, 18,new BucketInputSlot(UP,0)) // Fluid input tilePos - .addSlot(38, 49,new BucketOutputSlot(DOWN)) // Extract fluid from input + .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Fluid input tilePos + .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from input .addSlot(86, 32, new ItemInputSlot(NORTH)) // Main Tool tilePos .addSlot(134, 18, new ItemInputSlot(SOUTH)) // Bit Slot .addSlot(134, 49, new ItemInputSlot(EAST)) // Base Slot diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/AluminumTankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/AluminumTankContainer.java index 6cb3cc5d6..d18444288 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/AluminumTankContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/AluminumTankContainer.java @@ -6,9 +6,9 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.level.Level; -public class AluminumTankContainer extends TankContainer{ +public class AluminumTankContainer extends TankContainer { public AluminumTankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(id, world, pos, inventory, player, VEBlocks.ALUMINUM_TANK_CONTAINER.get(),VEBlocks.ALUMINUM_TANK_BLOCK.get()); + super(id, world, pos, inventory, player, VEBlocks.ALUMINUM_TANK_CONTAINER.get(), VEBlocks.ALUMINUM_TANK_BLOCK.get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/EighzoTankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/EighzoTankContainer.java index c72b8a2d7..c42c7655a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/EighzoTankContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/EighzoTankContainer.java @@ -9,7 +9,7 @@ public class EighzoTankContainer extends TankContainer { public EighzoTankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(id, world, pos, inventory, player, VEBlocks.EIGHZO_TANK_CONTAINER.get(),VEBlocks.EIGHZO_TANK_BLOCK.get()); + super(id, world, pos, inventory, player, VEBlocks.EIGHZO_TANK_CONTAINER.get(), VEBlocks.EIGHZO_TANK_BLOCK.get()); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NetheriteTankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NetheriteTankContainer.java index 20e0b9951..385a1bbf3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NetheriteTankContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NetheriteTankContainer.java @@ -9,6 +9,6 @@ public class NetheriteTankContainer extends TankContainer { public NetheriteTankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(id, world, pos, inventory, player, VEBlocks.NETHERITE_TANK_CONTAINER.get(),VEBlocks.NETHERITE_TANK_BLOCK.get()); + super(id, world, pos, inventory, player, VEBlocks.NETHERITE_TANK_CONTAINER.get(), VEBlocks.NETHERITE_TANK_BLOCK.get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NighaliteTankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NighaliteTankContainer.java index 14fc5baef..f8b855a86 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NighaliteTankContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NighaliteTankContainer.java @@ -9,6 +9,6 @@ public class NighaliteTankContainer extends TankContainer { public NighaliteTankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(id, world, pos, inventory, player, VEBlocks.NIGHALITE_TANK_CONTAINER.get(),VEBlocks.NIGHALITE_TANK_BLOCK.get()); + super(id, world, pos, inventory, player, VEBlocks.NIGHALITE_TANK_CONTAINER.get(), VEBlocks.NIGHALITE_TANK_BLOCK.get()); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/SolariumTankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/SolariumTankContainer.java index b4e4aac22..2e7966c45 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/SolariumTankContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/SolariumTankContainer.java @@ -9,6 +9,6 @@ public class SolariumTankContainer extends TankContainer { public SolariumTankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(id, world, pos, inventory, player, VEBlocks.SOLARIUM_TANK_CONTAINER.get(),VEBlocks.SOLARIUM_TANK_BLOCK.get()); + super(id, world, pos, inventory, player, VEBlocks.SOLARIUM_TANK_CONTAINER.get(), VEBlocks.SOLARIUM_TANK_BLOCK.get()); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java index e24a063f7..e24fb7089 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java @@ -20,8 +20,8 @@ public class TankContainer extends VEContainer { //private Player playerEntity; private static final int NUMBER_OF_SLOTS = 2; - public TankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player, MenuType menuType, Block block){ - super(menuType,id,world,pos,inventory,player,block); + public TankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player, MenuType menuType, Block block) { + super(menuType, id, world, pos, inventory, player, block); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TitaniumTankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TitaniumTankContainer.java index 9da351c69..bdad15b3f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TitaniumTankContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TitaniumTankContainer.java @@ -9,6 +9,6 @@ public class TitaniumTankContainer extends TankContainer { public TitaniumTankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(id, world, pos, inventory, player, VEBlocks.TITANIUM_TANK_CONTAINER.get(),VEBlocks.TITANIUM_TANK_BLOCK.get()); + super(id, world, pos, inventory, player, VEBlocks.TITANIUM_TANK_CONTAINER.get(), VEBlocks.TITANIUM_TANK_BLOCK.get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/CompressorInputSlot.java b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/CompressorInputSlot.java index f05e4a472..7a79b208f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/CompressorInputSlot.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/CompressorInputSlot.java @@ -6,6 +6,7 @@ public class CompressorInputSlot extends VEInsertSlot { public Level world; + public CompressorInputSlot(IItemHandler itemHandler, int index, int xPos, int yPos, Level world) { super(itemHandler, index, xPos, yPos); this.world = world; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/CrusherInputSlot.java b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/CrusherInputSlot.java index a85d7a328..2b732e872 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/CrusherInputSlot.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/CrusherInputSlot.java @@ -6,8 +6,9 @@ public class CrusherInputSlot extends VEInsertSlot { public Level world; - public CrusherInputSlot(IItemHandler itemHandler, int index, int xPos, int yPos, Level world){ - super(itemHandler,index,xPos,yPos); + + public CrusherInputSlot(IItemHandler itemHandler, int index, int xPos, int yPos, Level world) { + super(itemHandler, index, xPos, yPos); this.world = world; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/ElectrolyzerInputSlot.java b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/ElectrolyzerInputSlot.java index e64f82ee7..d11d25614 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/ElectrolyzerInputSlot.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/ElectrolyzerInputSlot.java @@ -6,8 +6,9 @@ public class ElectrolyzerInputSlot extends VEInsertSlot { public Level world; - public ElectrolyzerInputSlot(IItemHandler itemHandler, int index, int xPos, int yPos, Level world){ - super(itemHandler,index,xPos,yPos); + + public ElectrolyzerInputSlot(IItemHandler itemHandler, int index, int xPos, int yPos, Level world) { + super(itemHandler, index, xPos, yPos); this.world = world; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/PrimitiveBlastFurnaceSlots/PrimitiveBlastFurnaceInsertSlot.java b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/PrimitiveBlastFurnaceSlots/PrimitiveBlastFurnaceInsertSlot.java index 747300150..bb11bd977 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/PrimitiveBlastFurnaceSlots/PrimitiveBlastFurnaceInsertSlot.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/PrimitiveBlastFurnaceSlots/PrimitiveBlastFurnaceInsertSlot.java @@ -4,11 +4,11 @@ import net.minecraft.world.level.Level; import net.minecraftforge.items.IItemHandler; -public class PrimitiveBlastFurnaceInsertSlot extends VEInsertSlot -{ +public class PrimitiveBlastFurnaceInsertSlot extends VEInsertSlot { Level world; - public PrimitiveBlastFurnaceInsertSlot(IItemHandler itemHandler, int index, int xPos, int yPos, Level world){ - super(itemHandler,index,xPos,yPos); + + public PrimitiveBlastFurnaceInsertSlot(IItemHandler itemHandler, int index, int xPos, int yPos, Level world) { + super(itemHandler, index, xPos, yPos); this.world = world; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/PrimitiveBlastFurnaceSlots/PrimitiveBlastFurnaceOutputSlot.java b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/PrimitiveBlastFurnaceSlots/PrimitiveBlastFurnaceOutputSlot.java index 53b3bdc34..9259cec48 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/PrimitiveBlastFurnaceSlots/PrimitiveBlastFurnaceOutputSlot.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/PrimitiveBlastFurnaceSlots/PrimitiveBlastFurnaceOutputSlot.java @@ -4,7 +4,7 @@ import net.minecraftforge.items.IItemHandler; public class PrimitiveBlastFurnaceOutputSlot extends VEOutputSlot { - public PrimitiveBlastFurnaceOutputSlot(IItemHandler itemHandler, int index, int xPos, int yPos){ + public PrimitiveBlastFurnaceOutputSlot(IItemHandler itemHandler, int index, int xPos, int yPos) { super(itemHandler, index, xPos, yPos); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/StirlingGeneratorInputSlot.java b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/StirlingGeneratorInputSlot.java index 0d7618e08..f7d139dae 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/StirlingGeneratorInputSlot.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/TileEntitySlots/StirlingGeneratorInputSlot.java @@ -6,7 +6,8 @@ public class StirlingGeneratorInputSlot extends VEInsertSlot { public Level world; - public StirlingGeneratorInputSlot(IItemHandler itemHandler, int index, int xPos, int yPos, Level world){ + + public StirlingGeneratorInputSlot(IItemHandler itemHandler, int index, int xPos, int yPos, Level world) { super(itemHandler, index, xPos, yPos); this.world = world; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEBucketSlot.java b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEBucketSlot.java index 7c6e1b02e..8914e50a1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEBucketSlot.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEBucketSlot.java @@ -10,7 +10,7 @@ public VEBucketSlot(IItemHandler itemHandler, int index, int xPos, int yPos) { } @Override - public boolean mayPlace(ItemStack stack){ + public boolean mayPlace(ItemStack stack) { return stack.getItem() instanceof BucketItem; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEInsertSlot.java b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEInsertSlot.java index 5d53604b0..0926e7c8e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEInsertSlot.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEInsertSlot.java @@ -9,14 +9,14 @@ public class VEInsertSlot extends SlotItemHandler { - public VEInsertSlot(IItemHandler itemHandler, int index, int xPos, int yPos){ + public VEInsertSlot(IItemHandler itemHandler, int index, int xPos, int yPos) { super(itemHandler, index, xPos, yPos); } public > boolean checkRecipe(VERecipe veRecipe, ItemStack stack) { if (veRecipe == null) return false; - for (ItemStack testStack : veRecipe.getIngredient(0).getItems()){ - if(stack.getItem() == testStack.getItem()){ + for (ItemStack testStack : veRecipe.getIngredient(0).getItems()) { + if (stack.getItem() == testStack.getItem()) { return true; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEOutputSlot.java b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEOutputSlot.java index c16b03b5e..2a7e866af 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEOutputSlot.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEOutputSlot.java @@ -19,7 +19,7 @@ public VEOutputSlot(IItemHandler itemHandler, int index, int xPos, int yPos) { */ @Override // mayPlace, as in, you may place it if it's valid. (MCP: isItemValid) - public boolean mayPlace(@Nullable ItemStack stack){ + public boolean mayPlace(@Nullable ItemStack stack) { return false; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java index 53efeae9f..185a43e0d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java @@ -20,24 +20,24 @@ public class AirCompressorScreen extends VEContainerScreen { private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/air_compressor_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public AirCompressorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + public AirCompressorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack, mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); // Buttons go here - renderIOMenu(tileEntity, 64 + (this.width/2), this.topPos + 4); + renderIOMenu(tileEntity, 64 + (this.width / 2), this.topPos + 4); } @@ -51,7 +51,7 @@ protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mo } @Override - protected void renderSlotAndTankLabels(GuiGraphics matrixStack,int mouseX, int mouseY){ + protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Tank TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 93, 18, WHITE_TEXT_STYLE); @@ -62,10 +62,10 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack,int mouseX, int m @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.AIR_COMPRESSOR_MAX_POWER.get()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.AIR_COMPRESSOR_MAX_POWER.get()), mouseX, mouseY); } - if (isHovering(93, 18, 12, 50, mouseX, mouseY)){ // Oxidizer Tank + if (isHovering(93, 18, 12, 50, mouseX, mouseY)) { // Oxidizer Tank String name = tileEntity.getFluidStackFromTank(0).getTranslationKey(); int amount = tileEntity.getFluidStackFromTank(0).getAmount(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); @@ -82,7 +82,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit( this.GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); + matrixStack.blit(this.GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); if (tileEntity != null) { int power = menu.powerScreen(49); @@ -94,15 +94,16 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(this.GUI,i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); + matrixStack.blit(this.GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); - } catch (Exception e){ } + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); + } catch (Exception e) { + } // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); drawIOSideHelper(); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java index 98cd43cd3..cb214f222 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java @@ -26,37 +26,37 @@ public class BatteryBoxScreen extends VEContainerScreen { private final BatteryBoxTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/battery_box_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public BatteryBoxScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public BatteryBoxScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = (BatteryBoxTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - protected void init(){ + protected void init() { super.init(); // Buttons - addRenderableWidget(new ioMenuButton(64 + (this.width/2), this.topPos +4, buttons ->{ + addRenderableWidget(new ioMenuButton(64 + (this.width / 2), this.topPos + 4, buttons -> { })); // Top row - addRenderableWidget(new SlotBoolButton(tileEntity.getSlotManagers().get(0), (this.width/2)-198, this.topPos, button->{ + addRenderableWidget(new SlotBoolButton(tileEntity.getSlotManagers().get(0), (this.width / 2) - 198, this.topPos, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.getSlotManagers().get(0), (this.width/2)-184, this.topPos, button ->{ + addRenderableWidget(new SlotDirectionButton(tileEntity.getSlotManagers().get(0), (this.width / 2) - 184, this.topPos, button -> { // Do nothing })); // Bottom Row - addRenderableWidget(new SlotBoolButton(tileEntity.getSlotManagers().get(8), (this.width/2)-198, this.topPos+20, button ->{ + addRenderableWidget(new SlotBoolButton(tileEntity.getSlotManagers().get(8), (this.width / 2) - 198, this.topPos + 20, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.getSlotManagers().get(8), (this.width/2)-184, this.topPos+20, button ->{ + addRenderableWidget(new SlotDirectionButton(tileEntity.getSlotManagers().get(8), (this.width / 2) - 184, this.topPos + 20, button -> { // Do nothing })); @@ -64,77 +64,84 @@ protected void init(){ VEBatterySwitchManager[] switchManagers = this.tileEntity.getSwitchManagers(); VEPowerIOManager vePowerIOManager = this.tileEntity.getPowerIOManager(); // Slot arrows - addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[0],(this.width/2)-54,topPos + 34, 0, button -> { })); - addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[1],(this.width/2)-36,topPos + 34, 1, button -> { })); - addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[2],(this.width/2)-18,topPos + 34, 2, button -> { })); - addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[3],(this.width/2), topPos + 34, 3, button -> { })); - addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[4],(this.width/2)+18,topPos + 34, 4, button -> { })); - addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[5],(this.width/2)+36,topPos + 34, 5, button -> { })); + addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[0], (this.width / 2) - 54, topPos + 34, 0, button -> { + })); + addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[1], (this.width / 2) - 36, topPos + 34, 1, button -> { + })); + addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[2], (this.width / 2) - 18, topPos + 34, 2, button -> { + })); + addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[3], (this.width / 2), topPos + 34, 3, button -> { + })); + addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[4], (this.width / 2) + 18, topPos + 34, 4, button -> { + })); + addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[5], (this.width / 2) + 36, topPos + 34, 5, button -> { + })); // Send Out Power Button - addRenderableWidget(new BatteryBoxSendOutPowerButton(vePowerIOManager,(this.width/2)-79,topPos + 3, tileEntity,button -> { })); + addRenderableWidget(new BatteryBoxSendOutPowerButton(vePowerIOManager, (this.width / 2) - 79, topPos + 3, tileEntity, button -> { + })); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("battery_box"), 34, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack,this.font, TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("battery_box"), 34, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Top Row - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 35, 17, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 53, 17, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 71, 17, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 89, 17, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 107, 17, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 125, 17, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 35, 17, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 53, 17, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 71, 17, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 89, 17, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 107, 17, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 125, 17, WHITE_TEXT_STYLE); // Bottom Row - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 35, 54, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 53, 54, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 71, 54, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 89, 54, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 107, 54, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 125, 54, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 35, 54, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 53, 54, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 71, 54, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 89, 54, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 107, 54, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 125, 54, WHITE_TEXT_STYLE); } @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.BATTERY_BOX_MAX_POWER.get()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.BATTERY_BOX_MAX_POWER.get()), mouseX, mouseY); } - if (isHovering(10,4,15,10, mouseX, mouseY)){ - if(tileEntity.getPowerIOManager().isFlipped()) { - matrixStack.renderTooltip(this.font,TextUtil.translateString("text.voluminousenergy.battery_box.sending_out_power"), mouseX, mouseY); + if (isHovering(10, 4, 15, 10, mouseX, mouseY)) { + if (tileEntity.getPowerIOManager().isFlipped()) { + matrixStack.renderTooltip(this.font, TextUtil.translateString("text.voluminousenergy.battery_box.sending_out_power"), mouseX, mouseY); } else { matrixStack.renderTooltip(this.font, TextUtil.translateString("text.voluminousenergy.battery_box.receiving_power"), mouseX, mouseY); } } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(this.GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ + matrixStack.blit(this.GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { int power = menu.powerScreen(49); /*Note for this.blit below: @@ -146,28 +153,28 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ //this.blit(matrixStack,i+81,j+31,176,0,progress,17); - matrixStack.blit(this.GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(this.GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); for (VEBatterySwitchManager switchManager : tileEntity.getSwitchManagers()) { - updateSlotPairButton(switchManager.isFlipped(),switchManager.getSlot()); + updateSlotPairButton(switchManager.isFlipped(), switchManager.getSlot()); } updateSendOutPowerButton(tileEntity.getPowerIOManager().isFlipped()); } } - public void updateSlotPairButton(boolean status, int id){ - for(Renderable widget : this.renderables){ - if(widget instanceof BatteryBoxSlotPairButton batteryBoxSlotPairButton){ - if(batteryBoxSlotPairButton.getId() == id){ + public void updateSlotPairButton(boolean status, int id) { + for (Renderable widget : this.renderables) { + if (widget instanceof BatteryBoxSlotPairButton batteryBoxSlotPairButton) { + if (batteryBoxSlotPairButton.getId() == id) { batteryBoxSlotPairButton.setStatus(status); } } } } - public void updateSendOutPowerButton(boolean status){ - for(Renderable widget : this.renderables){ - if(widget instanceof BatteryBoxSendOutPowerButton batteryBoxSendOutPowerButton){ + public void updateSendOutPowerButton(boolean status) { + for (Renderable widget : this.renderables) { + if (widget instanceof BatteryBoxSendOutPowerButton batteryBoxSendOutPowerButton) { batteryBoxSendOutPowerButton.setStatus(status); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java index 2c6a8e3cf..f34d5a971 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java @@ -25,24 +25,24 @@ public class BlastFurnaceScreen extends VEContainerScreen { private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); private static final ResourceLocation MULTIBLOCK_WARN = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/multiblock_invalid_warning.png"); - public BlastFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + public BlastFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); - renderIOMenu(this.tileEntity,64 + (this.width/2),this.topPos +4); + renderIOMenu(this.tileEntity, 64 + (this.width / 2), this.topPos + 4); } @Override @@ -50,14 +50,14 @@ protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mo MultiBlockRecipeProcessor processor = (MultiBlockRecipeProcessor) tileEntity.getRecipeProcessor(); - if (processor.isMultiBlockValid(tileEntity)){ - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("blast_furnace"), 8, 6, WHITE_TEXT_STYLE); + if (processor.isMultiBlockValid(tileEntity)) { + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("blast_furnace"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.temperature").getString() + ": " + tileEntity.getData("temperature_kelvin") + " K (" + - tileEntity.getData("temperature_celsius") + " \u00B0C) "), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + tileEntity.getData("temperature_celsius") + " \u00B0C) "), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,Component.nullToEmpty(tileEntity.getData("temperature_fahrenheit") + " \u00B0F"), 101, (this.imageHeight - 103), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, Component.nullToEmpty(tileEntity.getData("temperature_fahrenheit") + " \u00B0F"), 101, (this.imageHeight - 103), WHITE_TEXT_STYLE); } super.renderLabels(matrixStack, mouseX, mouseY); @@ -66,11 +66,11 @@ protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mo @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 38, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 38, 49, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 80, 25, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 80, 43, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 134, 34, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 38, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 38, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 80, 25, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 80, 43, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 134, 34, WHITE_TEXT_STYLE); // Tanks TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); @@ -78,20 +78,20 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { - if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.BLAST_FURNACE_MAX_POWER.get()), mouseX, mouseY); + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { + if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.BLAST_FURNACE_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - if (isHovering(61, 18, 12, 50, mouseX, mouseY)){ // Input Tank + if (isHovering(61, 18, 12, 50, mouseX, mouseY)) { // Input Tank int amount = tileEntity.getFluidStackFromTank(0).getAmount(); String name = tileEntity.getFluidStackFromTank(0).getTranslationKey(); - matrixStack.renderTooltip(this.font,TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -105,14 +105,14 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(this.GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null && tileEntity.getRecipeProcessor() instanceof MultiBlockRecipeProcessor multiBlockRecipeProcessor && multiBlockRecipeProcessor.isMultiBlockValid(tileEntity)){ + matrixStack.blit(this.GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null && tileEntity.getRecipeProcessor() instanceof MultiBlockRecipeProcessor multiBlockRecipeProcessor && multiBlockRecipeProcessor.isMultiBlockValid(tileEntity)) { int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); @@ -124,21 +124,21 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(this.GUI,i+109, j+32, 176, 0, progress, 17); - matrixStack.blit(this.GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(this.GUI, i + 109, j + 32, 176, 0, progress, 17); + matrixStack.blit(this.GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); drawIOSideHelper(); // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+129, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } else { RenderSystem.setShaderTexture(0, MULTIBLOCK_WARN); - matrixStack.blit(MULTIBLOCK_WARN, i, j, 0, 0, 174,82); + matrixStack.blit(MULTIBLOCK_WARN, i, j, 0, 0, 174, 82); TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock_warn"), i + 48, j + 14, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock.blast_furnace.requirements"), i + 8, j + 32, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock.needed_behind"), i+8, j+48, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock.blast_furnace.requirements"), i + 8, j + 32, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock.needed_behind"), i + 8, j + 48, WHITE_TEXT_STYLE); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java index eef833b16..843f01a9c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java @@ -21,53 +21,53 @@ public class CentrifugalSeparatorScreen extends VEContainerScreen { private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/centrifugal_separator_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public CentrifugalSeparatorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public CentrifugalSeparatorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); - renderIOMenu(this.tileEntity,64 + (this.width/2), this.topPos +4); + renderIOMenu(this.tileEntity, 64 + (this.width / 2), this.topPos + 4); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("centrifugal_separator"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("centrifugal_separator"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 53, 24, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 53, 42, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 99, 33, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 117, 15, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 135, 33, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("5")), 117, 51, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 53, 24, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 53, 42, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 99, 33, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 117, 15, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 135, 33, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("5")), 117, 51, WHITE_TEXT_STYLE); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.CENTRIFUGAL_SEPARATOR_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -81,14 +81,14 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(this.GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ + matrixStack.blit(this.GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); /*Note for this.blit below: @@ -99,12 +99,12 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(this.GUI,i+81,j+31,176,0,progress,17); - matrixStack.blit(this.GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(this.GUI, i + 81, j + 31, 176, 0, progress, 17); + matrixStack.blit(this.GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); } // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java index e81d5143e..84578a9ec 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java @@ -22,50 +22,50 @@ public class CompressorScreen extends VEContainerScreen { private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/compressor_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public CompressorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public CompressorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - protected void init(){ + protected void init() { super.init(); // Buttons - renderIOMenu(this.tileEntity,64 + (this.width/2), this.topPos +4); + renderIOMenu(this.tileEntity, 64 + (this.width / 2), this.topPos + 4); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("compressor"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("compressor"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 80, 13, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 80, 58, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 80, 13, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 80, 58, WHITE_TEXT_STYLE); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.COMPRESSOR_MAX_POWER.get()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.COMPRESSOR_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -79,14 +79,14 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { int progress = tileEntity.progressProcessingCounterPX(24); int power = menu.powerScreen(49); @@ -98,13 +98,13 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i+79, j+31, 176, 0, 17, progress); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(GUI, i + 79, j + 31, 176, 0, 17, progress); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); } // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java index c2c9e5695..aeb937842 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java @@ -21,10 +21,10 @@ public class CrusherScreen extends VEContainerScreen { private final VETileEntity tileEntity; private final static ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/crushergui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public CrusherScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public CrusherScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -32,41 +32,40 @@ public CrusherScreen(VEContainer screenContainer, Inventory inv, Component title @Override protected void init() { super.init(); - renderIOMenu(this.tileEntity,64 + (this.width/2), this.topPos + 4); + renderIOMenu(this.tileEntity, 64 + (this.width / 2), this.topPos + 4); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("crusher"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("crusher"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 80, 13, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 71, 58, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 89, 58, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 80, 13, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 71, 58, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 89, 58, WHITE_TEXT_STYLE); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.CRUSHER_MAX_POWER.get()), mouseX, mouseY); - } - else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.CRUSHER_MAX_POWER.get()), mouseX, mouseY); + } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -80,14 +79,14 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { int progress = tileEntity.progressProcessingCounterPX(24); int power = menu.powerScreen(49); @@ -99,13 +98,13 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i+79, j+31, 176, 0, 17, progress); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(GUI, i + 79, j + 31, 176, 0, 17, progress); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); } // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } public static ResourceLocation getGUI() { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java index 281eae554..80d649390 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java @@ -3,13 +3,15 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.DimensionalLaserTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.processor.DimensionalLaserRecipeProcessor; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotBoolButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotDirectionButton; import com.veteam.voluminousenergy.tools.buttons.tanks.TankBoolButton; import com.veteam.voluminousenergy.tools.buttons.tanks.TankDirectionButton; +import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.GameRenderer; @@ -25,7 +27,7 @@ import java.util.List; public class DimensionalLaserScreen extends VEContainerScreen { - private final DimensionalLaserTile tileEntity; + private final VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/dimensional_laser_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); private static final ResourceLocation MULTIBLOCK_WARN = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/multiblock_invalid_warning.png"); @@ -33,7 +35,7 @@ public class DimensionalLaserScreen extends VEContainerScreen { public DimensionalLaserScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (DimensionalLaserTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -52,30 +54,32 @@ protected void init() { })); + List slotManagers = tileEntity.getSlotManagers(); + // Bucket Top - addRenderableWidget(new SlotBoolButton(tileEntity.bucketTopSm, (this.width / 2) - 198, this.topPos, button -> { + addRenderableWidget(new SlotBoolButton(slotManagers.get(0), (this.width / 2) - 198, this.topPos, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.bucketTopSm, (this.width / 2) - 184, this.topPos, button -> { + addRenderableWidget(new SlotDirectionButton(slotManagers.get(0), (this.width / 2) - 184, this.topPos, button -> { // Do nothing })); // Bucket Bottom - addRenderableWidget(new SlotBoolButton(tileEntity.bucketBottomSm, (this.width / 2) - 198, this.topPos + 20, button -> { + addRenderableWidget(new SlotBoolButton(slotManagers.get(1), (this.width / 2) - 198, this.topPos + 20, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.bucketBottomSm, (this.width / 2) - 184, this.topPos + 20, button -> { + addRenderableWidget(new SlotDirectionButton(slotManagers.get(1), (this.width / 2) - 184, this.topPos + 20, button -> { // Do nothing })); // RFID tilePos - addRenderableWidget(new SlotBoolButton(tileEntity.RFIDsm, (this.width / 2) - 198, this.topPos + 40, button -> { + addRenderableWidget(new SlotBoolButton(slotManagers.get(2), (this.width / 2) - 198, this.topPos + 40, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.RFIDsm, (this.width / 2) - 184, this.topPos + 40, button -> { + addRenderableWidget(new SlotDirectionButton(slotManagers.get(2), (this.width / 2) - 184, this.topPos + 40, button -> { // Do nothing })); @@ -91,28 +95,31 @@ protected void init() { @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - if (tileEntity.getMultiblockValidity()) { - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("dimensional_laser"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); + + DimensionalLaserRecipeProcessor processor = (DimensionalLaserRecipeProcessor) tileEntity.getRecipeProcessor(); + + if (processor.isMultiBlockValid(tileEntity)) { + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("dimensional_laser"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); } - super.renderLabels(matrixStack, mouseX, mouseY); + super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 138, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 138, 49, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 38, 33, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 138, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 138, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 38, 33, WHITE_TEXT_STYLE); // Tanks - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 119, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 119, 18, WHITE_TEXT_STYLE); } @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), tileEntity.getEnergy().getMaxEnergyStored()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), tileEntity.getEnergy().getMaxEnergyStored()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -144,7 +151,8 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); - if (tileEntity != null && tileEntity.getMultiblockValidity()) { + DimensionalLaserRecipeProcessor processor = (DimensionalLaserRecipeProcessor) tileEntity.getRecipeProcessor(); + if (processor.isMultiBlockValid(tileEntity)) { int progress = tileEntity.progressProcessingCounterPX(17); // 17 vertical, 15 horz for Dimensional Laser int power = menu.powerScreen(49); @@ -167,19 +175,19 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } else { RenderSystem.setShaderTexture(0, MULTIBLOCK_WARN); - matrixStack.blit(MULTIBLOCK_WARN, i, j, 0, 0, 174,82); - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock_warn"), i + 48, j + 14, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock.dimensional_laser.requirements"), i + 8, j + 32, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock.needed_below"), i+8, j+48, WHITE_TEXT_STYLE); + matrixStack.blit(MULTIBLOCK_WARN, i, j, 0, 0, 174, 82); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock_warn"), i + 48, j + 14, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock.dimensional_laser.requirements"), i + 8, j + 32, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock.needed_below"), i + 8, j + 48, WHITE_TEXT_STYLE); } } - private FluidTank getTank(){ + private FluidTank getTank() { return this.tileEntity.getRelationalTanks().get(0).getTank(); } - private FluidStack getFluidStackFromTank(){ + private FluidStack getFluidStackFromTank() { return this.getTank().getFluid(); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java index bfb766715..289ce7d80 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java @@ -24,23 +24,23 @@ public class DistillationUnitScreen extends VEContainerScreen { private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/distillation_unit_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); private static final ResourceLocation MULTIBLOCK_WARN = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/multiblock_invalid_warning.png"); - - public DistillationUnitScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public DistillationUnitScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); // Buttons renderIOMenu(this.tileEntity); @@ -49,57 +49,57 @@ protected void init(){ @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { MultiBlockRecipeProcessor processor = (MultiBlockRecipeProcessor) tileEntity.getRecipeProcessor(); - if (processor.isMultiBlockValid(tileEntity)){ - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("distillation_unit"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + if (processor.isMultiBlockValid(tileEntity)) { + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("distillation_unit"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); } - super.renderLabels(matrixStack, mouseX, mouseY); + super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 38, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 38, 49, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 96, 11, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 96, 42, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 137, 11, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("5")), 137, 42, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("6")), 122, 64, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 38, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 38, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 96, 11, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 96, 42, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 137, 11, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("5")), 137, 42, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("6")), 122, 64, WHITE_TEXT_STYLE); // Tanks - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("1")), 119, 11, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("2")), 157, 11, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("1")), 119, 11, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("2")), 157, 11, WHITE_TEXT_STYLE); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { - if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.DISTILLATION_UNIT_MAX_POWER.get()), mouseX, mouseY); + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { + if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.DISTILLATION_UNIT_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - if (isHovering(61, 18, 12, 50, mouseX, mouseY)){ // Input Tank + if (isHovering(61, 18, 12, 50, mouseX, mouseY)) { // Input Tank int amount = tileEntity.getFluidStackFromTank(0).getAmount(); String name = tileEntity.getFluidStackFromTank(0).getTranslationKey(); - matrixStack.renderTooltip(this.font,TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - if (isHovering(119, 11, 12, 50, mouseX, mouseY)){ // First Output Tank + if (isHovering(119, 11, 12, 50, mouseX, mouseY)) { // First Output Tank int amount = tileEntity.getFluidStackFromTank(1).getAmount(); String name = tileEntity.getFluidStackFromTank(1).getTranslationKey(); - matrixStack.renderTooltip(this.font,TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - if (isHovering(157, 11, 12, 50, mouseX, mouseY)){ // Second Output Tank + if (isHovering(157, 11, 12, 50, mouseX, mouseY)) { // Second Output Tank int amount = tileEntity.getFluidStackFromTank(2).getAmount(); String name = tileEntity.getFluidStackFromTank(2).getTranslationKey(); - matrixStack.renderTooltip(this.font,TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -113,15 +113,15 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); MultiBlockRecipeProcessor processor = (MultiBlockRecipeProcessor) tileEntity.getRecipeProcessor(); - if(tileEntity != null && processor.isMultiBlockValid(tileEntity)){ + if (tileEntity != null && processor.isMultiBlockValid(tileEntity)) { int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); @@ -133,28 +133,30 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i+81, j+31, 176, 0, progress, 17); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(GUI, i + 81, j + 31, 176, 0, progress, 17); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(1),tileEntity.getTankCapacity(), i + 119, j + 11, 0, 12, 50); - } catch (Exception e){ } + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(1), tileEntity.getTankCapacity(), i + 119, j + 11, 0, 12, 50); + } catch (Exception e) { + } - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(2),tileEntity.getTankCapacity(), i + 157, j + 11, 0, 12, 50); - } catch (Exception e){ } + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(2), tileEntity.getTankCapacity(), i + 157, j + 11, 0, 12, 50); + } catch (Exception e) { + } drawIOSideHelper(); // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+129, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } else { RenderSystem.setShaderTexture(0, MULTIBLOCK_WARN); - matrixStack.blit(MULTIBLOCK_WARN, i, j, 0, 0, 174,82); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("text.voluminousenergy.multiblock_warn"), i + 48, j + 14, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("text.voluminousenergy.multiblock.distillation_unit.requirements"), i + 8, j + 32, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("text.voluminousenergy.multiblock.needed_behind"), i+8, j+48, WHITE_TEXT_STYLE); + matrixStack.blit(MULTIBLOCK_WARN, i, j, 0, 0, 174, 82); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock_warn"), i + 48, j + 14, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock.distillation_unit.requirements"), i + 8, j + 32, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("text.voluminousenergy.multiblock.needed_behind"), i + 8, j + 48, WHITE_TEXT_STYLE); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java index aa3028cea..dbb30c1f5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java @@ -21,54 +21,54 @@ public class ElectrolyzerScreen extends VEContainerScreen { private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/electrolyzer_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public ElectrolyzerScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public ElectrolyzerScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); - renderIOMenu(this.tileEntity,64 + (this.width/2), this.topPos +4); + renderIOMenu(this.tileEntity, 64 + (this.width / 2), this.topPos + 4); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("electrolyzer"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("electrolyzer"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 71, 13, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 89, 13, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 53, 57, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 71, 57, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 89, 57, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("5")), 107, 57, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 71, 13, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 89, 13, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 53, 57, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 71, 57, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 89, 57, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("5")), 107, 57, WHITE_TEXT_STYLE); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.ELECTROLYZER_MAX_POWER.get()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.ELECTROLYZER_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -82,14 +82,14 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { int progress = tileEntity.progressProcessingCounterPX(24); int power = menu.powerScreen(49); /*Note for this.blit below: @@ -100,12 +100,12 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i+79, j+31, 176, 0, 17, progress); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(GUI, i + 79, j + 31, 176, 0, 17, progress); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); } // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java index b4cb267bf..affa6f69d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java @@ -24,21 +24,21 @@ public class FluidElectrolyzerScreen extends VEContainerScreen { private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public FluidElectrolyzerScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + public FluidElectrolyzerScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); // Buttons renderIOMenu(this.tileEntity); @@ -46,55 +46,55 @@ protected void init(){ @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("fluid_electrolyzer"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("fluid_electrolyzer"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 38, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 38, 49, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 96, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 96, 49, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 137, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("5")), 137, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 38, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 38, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 96, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 96, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 137, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("5")), 137, 49, WHITE_TEXT_STYLE); // Tanks - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("1")), 119, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("2")), 157, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("1")), 119, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("2")), 157, 18, WHITE_TEXT_STYLE); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { - if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.FLUID_ELECTROLYZER_MAX_POWER.get()), mouseX, mouseY); + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { + if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.FLUID_ELECTROLYZER_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - if (isHovering(61, 18, 12, 50, mouseX, mouseY)){ // Input Tank + if (isHovering(61, 18, 12, 50, mouseX, mouseY)) { // Input Tank int amount = tileEntity.getFluidStackFromTank(0).getAmount(); String name = tileEntity.getFluidStackFromTank(0).getTranslationKey(); - matrixStack.renderTooltip(this.font,TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - if (isHovering(119, 18, 12, 50, mouseX, mouseY)){ // First Output Tank + if (isHovering(119, 18, 12, 50, mouseX, mouseY)) { // First Output Tank int amount = tileEntity.getFluidStackFromTank(1).getAmount(); String name = tileEntity.getFluidStackFromTank(1).getTranslationKey(); - matrixStack.renderTooltip(this.font,TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - if (isHovering(157, 18, 12, 50, mouseX, mouseY)){ // Second Output Tank + if (isHovering(157, 18, 12, 50, mouseX, mouseY)) { // Second Output Tank int amount = tileEntity.getFluidStackFromTank(2).getAmount(); String name = tileEntity.getFluidStackFromTank(2).getTranslationKey(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -108,14 +108,14 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); @@ -127,22 +127,24 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i+81, j+31, 176, 0, progress, 17); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(GUI, i + 81, j + 31, 176, 0, progress, 17); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(1),tileEntity.getTankCapacity(), i + 119, j + 18, 0, 12, 50); - } catch (Exception e){ } + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(1), tileEntity.getTankCapacity(), i + 119, j + 18, 0, 12, 50); + } catch (Exception e) { + } - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(2),tileEntity.getTankCapacity(), i + 157, j + 18, 0, 12, 50); - } catch (Exception e){ } + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(2), tileEntity.getTankCapacity(), i + 157, j + 18, 0, 12, 50); + } catch (Exception e) { + } drawIOSideHelper(); // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+129, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java index 606a83885..a8eac6a2d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java @@ -25,21 +25,21 @@ public class FluidMixerScreen extends VEContainerScreen { private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public FluidMixerScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + public FluidMixerScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); // Buttons super.renderIOMenu(this.tileEntity); @@ -47,56 +47,56 @@ protected void init(){ @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("fluid_mixer"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("+"), 78, 34, GREY_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("fluid_mixer"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("+"), 78, 34, GREY_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageWidth - 96 - 8), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 38, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 38, 49, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 86, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 86, 49, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 136, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("5")), 136, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 38, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 38, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 86, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 86, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 136, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("5")), 136, 49, WHITE_TEXT_STYLE); // Tanks - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("1")), 109, 18, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("2")), 159, 18, WHITE_TEXT_STYLE); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { - if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.FLUID_MIXER_MAX_POWER.get()), mouseX, mouseY); + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { + if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.FLUID_MIXER_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - if (isHovering(61, 18, 12, 50, mouseX, mouseY)){ // First Input Tank + if (isHovering(61, 18, 12, 50, mouseX, mouseY)) { // First Input Tank int amount = tileEntity.getFluidStackFromTank(0).getAmount(); String name = tileEntity.getFluidStackFromTank(0).getTranslationKey(); - matrixStack.renderTooltip(this.font,TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - if (isHovering(109, 18, 12, 50, mouseX, mouseY)){ // Second input Tank + if (isHovering(109, 18, 12, 50, mouseX, mouseY)) { // Second input Tank int amount = tileEntity.getFluidStackFromTank(1).getAmount(); String name = tileEntity.getFluidStackFromTank(1).getTranslationKey(); - matrixStack.renderTooltip(this.font,TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - if (isHovering(159, 18, 12, 50, mouseX, mouseY)){ // Second Output Tank + if (isHovering(159, 18, 12, 50, mouseX, mouseY)) { // Second Output Tank int amount = tileEntity.getFluidStackFromTank(2).getAmount(); String name = tileEntity.getFluidStackFromTank(2).getTranslationKey(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -110,14 +110,14 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); @@ -129,22 +129,24 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i+127, j+31, 176, 0, progress, 17); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(GUI, i + 127, j + 31, 176, 0, progress, 17); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(1),tileEntity.getTankCapacity(), i + 109, j + 18, 0, 12, 50); - } catch (Exception e){ } + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(1), tileEntity.getTankCapacity(), i + 109, j + 18, 0, 12, 50); + } catch (Exception e) { + } - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(2),tileEntity.getTankCapacity(), i + 159, j + 18, 0, 12, 50); - } catch (Exception e){ } + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(2), tileEntity.getTankCapacity(), i + 159, j + 18, 0, 12, 50); + } catch (Exception e) { + } drawIOSideHelper(); // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+129, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java index 698028418..e193daa33 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java @@ -19,60 +19,60 @@ public class GasFiredFurnaceScreen extends VEContainerScreen { private GasFiredFurnaceTile tileEntity; - private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID,"textures/gui/gas_fired_furnace_gui.png"); + private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/gas_fired_furnace_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public GasFiredFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public GasFiredFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = (GasFiredFurnaceTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); - renderIOMenu(this.tileEntity,64 + (this.width/2), this.topPos +4); + renderIOMenu(this.tileEntity, 64 + (this.width / 2), this.topPos + 4); } @Override - protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY){ - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("gas_fired_furnace"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("gas_fired_furnace"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 8, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 8, 49, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 53, 33, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 116, 33, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 8, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 8, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 53, 33, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 116, 33, WHITE_TEXT_STYLE); // Tanks - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 31, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 31, 18, WHITE_TEXT_STYLE); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX,int mouseY){ - if(isHovering(31,18,12,49,mouseX,mouseY)){ + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { + if (isHovering(31, 18, 12, 49, mouseX, mouseY)) { int amount = tileEntity.getFluidFromTank().getAmount(); String name = tileEntity.getFluidFromTank().getTranslationKey(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); - } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getFuelTooltipArea(),mouseX,mouseY)){ + } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getFuelTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, getFuelTooltips(), mouseX, mouseY); - } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getCounterTooltipArea(),mouseX,mouseY)){ + } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getCounterTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, getCounterTooltips(), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX,mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getFuelTooltipArea() { @@ -96,15 +96,15 @@ public List getCounterTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks,int mouseX,int mouseY){ + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); - int i=(this.width-this.imageWidth)/2; - int j=(this.height-this.imageHeight)/2; - matrixStack.blit(GUI,i,j,0,0,this.imageWidth,this.imageHeight); + int i = (this.width - this.imageWidth) / 2; + int j = (this.height - this.imageHeight) / 2; + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); final int flameHeight = 14; - if(tileEntity!=null){ + if (tileEntity != null) { int progress = tileEntity.progressProcessingCounterPX(9); int fuelProgress = tileEntity.progressFuelCounterPX(flameHeight); @@ -116,14 +116,14 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks,int mouseX,in p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i+81,j+31,176,0,progress,17); - matrixStack.blit(GUI,i+54,j+(54 + (flameHeight - fuelProgress)),176,24 + (flameHeight - fuelProgress),flameHeight,fuelProgress); + matrixStack.blit(GUI, i + 81, j + 31, 176, 0, progress, 17); + matrixStack.blit(GUI, i + 54, j + (54 + (flameHeight - fuelProgress)), 176, 24 + (flameHeight - fuelProgress), flameHeight, fuelProgress); - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidFromTank(),tileEntity.getTankCapacity(),i+31,j+18,0,12,50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidFromTank(), tileEntity.getTankCapacity(), i + 31, j + 18, 0, 12, 50); drawIOSideHelper(); } RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java index 49987006b..c846dd41d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java @@ -24,24 +24,24 @@ public class HydroponicIncubatorScreen extends VEContainerScreen { private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public HydroponicIncubatorScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + public HydroponicIncubatorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); - renderIOMenu(this.tileEntity,64 + (this.width/2), this.topPos + 4); + renderIOMenu(this.tileEntity, 64 + (this.width / 2), this.topPos + 4); } @Override @@ -68,19 +68,19 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { - if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.HYDROPONIC_INCUBATOR_MAX_POWER.get()), mouseX, mouseY); + if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.HYDROPONIC_INCUBATOR_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - if (isHovering(61, 18, 12, 50, mouseX, mouseY)){ // Input Tank + if (isHovering(61, 18, 12, 50, mouseX, mouseY)) { // Input Tank int amount = tileEntity.getFluidStackFromTank(0).getAmount(); String name = tileEntity.getFluidStackFromTank(0).getTranslationKey(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -94,14 +94,14 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); @@ -113,18 +113,19 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i+109, j+32, 176, 0, progress, 17); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(GUI, i + 109, j + 32, 176, 0, progress, 17); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(1),tileEntity.getTankCapacity(), i + 157, j + 18, 0, 12, 50); - } catch (Exception e){ } + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(1), tileEntity.getTankCapacity(), i + 157, j + 18, 0, 12, 50); + } catch (Exception e) { + } drawIOSideHelper(); // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java index a2ef12c91..ea0692917 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java @@ -17,15 +17,14 @@ import net.minecraft.world.entity.player.Inventory; import org.jetbrains.annotations.NotNull; -import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class PrimitiveBlastFurnaceScreen extends VEContainerScreen { private VETileEntity tileEntity; - private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID,"textures/gui/primitiveblastgui.png"); + private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/primitiveblastgui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - + public PrimitiveBlastFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); @@ -36,55 +35,55 @@ public PrimitiveBlastFurnaceScreen(VEContainer screenContainer, Inventory inv, C @Override public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX, mouseY, partialTicks); - this.renderTooltip(matrixStack,mouseX, mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); // Buttons - addRenderableWidget(new ioMenuButton(64 + (this.width/2), this.topPos +4, buttons ->{ + addRenderableWidget(new ioMenuButton(64 + (this.width / 2), this.topPos + 4, buttons -> { })); List managers = tileEntity.getSlotManagers(); // Input - addRenderableWidget(new SlotBoolButton(managers.get(0), (this.width/2)-198, this.topPos, button->{ + addRenderableWidget(new SlotBoolButton(managers.get(0), (this.width / 2) - 198, this.topPos, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(managers.get(0), (this.width/2)-184, this.topPos, button ->{ + addRenderableWidget(new SlotDirectionButton(managers.get(0), (this.width / 2) - 184, this.topPos, button -> { // Do nothing })); // Output - addRenderableWidget(new SlotBoolButton(managers.get(1), (this.width/2)-198, this.topPos+20, button ->{ + addRenderableWidget(new SlotBoolButton(managers.get(1), (this.width / 2) - 198, this.topPos + 20, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(managers.get(1), (this.width/2)-184, this.topPos+20, button ->{ + addRenderableWidget(new SlotDirectionButton(managers.get(1), (this.width / 2) - 184, this.topPos + 20, button -> { // Do nothing })); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("primitiveblastfurnace"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("primitiveblastfurnace"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 53, 33, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 116, 33, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 53, 33, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 116, 33, WHITE_TEXT_STYLE); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX,int mouseY){ + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } @@ -93,11 +92,11 @@ protected void renderTooltip(GuiGraphics matrixStack,int mouseX,int mouseY){ // renderTooltip(matrixStack, Component.nullToEmpty("Percent complete: " + tileEntity.progressCounterPercent() + "%, Ticks Left: " + tileEntity.getCounter()), mouseX, mouseY); // } - super.renderTooltip(matrixStack,mouseX,mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { - return new Rect2i(78,32,19,17); + return new Rect2i(78, 32, 19, 17); } public List getTooltips() { @@ -107,14 +106,14 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { int progress = tileEntity.progressProcessingCounterPX(24); /*Note for this.blit below: x = starting x for blit on screen @@ -124,13 +123,13 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, uHeight = width of the x for the blit to be drawn (make variable for progress illusion on the x) vHeight = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i+78, j+32, 176, 0, progress, 17); + matrixStack.blit(GUI, i + 78, j + 32, 176, 0, progress, 17); //this.blit(i,j,180,1,progress,15); drawIOSideHelper(); } // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java index dde278bc3..9d43dd195 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java @@ -26,23 +26,23 @@ public PrimitiveSolarPanelScreen(VEContainer container, Inventory inv, Component } @Override - public void render(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override protected void renderTooltip(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.PRIMITIVE_SOLAR_PANEL_MAX_POWER.get()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.PRIMITIVE_SOLAR_PANEL_MAX_POWER.get()), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY){ - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("primitive_solar_panel"), 8, 6, WHITE_TEXT_STYLE); + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("primitive_solar_panel"), 8, 6, WHITE_TEXT_STYLE); if (tileEntity.getLevel().isDay()) TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergy().getProduction() + " FE/t"), 90, 32, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); @@ -50,22 +50,23 @@ protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mo } @Override - protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) {} + protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY){ + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { //RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); // Actual Gui + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); // Actual Gui if (tileEntity != null) { int power = menu.powerScreen(49); //int progress = tileEntity.progressCounterPX(14); //this.blit(matrixStack,i + 81, j + (55 + (14-progress)), 176, (14-progress), 14, progress); // 55 = full, 55+14 = end - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 14 + (49-power), 12, power); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 14 + (49 - power), 12, power); } } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java index db516c029..c6c3b62d6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java @@ -25,7 +25,7 @@ public class PrimitiveStirlingGeneratorScreen extends VEContainerScreen{ + addRenderableWidget(new ioMenuButton(64 + (this.width / 2), this.topPos + 4, buttons -> { })); // Input tilePos - addRenderableWidget(new SlotBoolButton(tileEntity.getSlotManagers().get(0), (this.width/2)-198, this.topPos, button->{ + addRenderableWidget(new SlotBoolButton(tileEntity.getSlotManagers().get(0), (this.width / 2) - 198, this.topPos, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.getSlotManagers().get(0), (this.width/2)-184, this.topPos, button ->{ + addRenderableWidget(new SlotDirectionButton(tileEntity.getSlotManagers().get(0), (this.width / 2) - 184, this.topPos, button -> { // Do nothing })); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), tileEntity.getEnergy().getMaxEnergyStored()), mouseX, mouseY); - } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)){ + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), tileEntity.getEnergy().getMaxEnergyStored()), mouseX, mouseY); + } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, getTooltips(), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -80,12 +80,12 @@ public List getTooltips() { } @Override - protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY){ - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("primitivestirlinggenerator"), 8, 6, WHITE_TEXT_STYLE); + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("primitivestirlinggenerator"), 8, 6, WHITE_TEXT_STYLE); int generationRate = tileEntity.getEnergy().getProduction(); - TextUtil.renderCenteredShadowedText(matrixStack,Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + generationRate + " FE/t"), 90, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + generationRate + " FE/t"), 90, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @@ -93,22 +93,22 @@ protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mo @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 80, 35, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 80, 35, WHITE_TEXT_STYLE); } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY){ + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); // Actual Gui + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); // Actual Gui if (tileEntity != null) { int power = menu.powerScreen(49); int progress = tileEntity.progressBurnCounterPX(14); - matrixStack.blit(GUI,i + 81, j + (55 + (14-progress)), 176, (14-progress), 14, progress); // 55 = full, 55+14 = end - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 14 + (49-power), 12, power); + matrixStack.blit(GUI, i + 81, j + (55 + (14 - progress)), 176, (14 - progress), 14, progress); // 55 = full, 55+14 = end + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 14 + (49 - power), 12, power); RenderSystem.setShaderTexture(0, GUI_TOOLS); drawIOSideHelper(); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java index 55dff14c7..a47be4f53 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java @@ -22,26 +22,26 @@ public class PumpScreen extends VEContainerScreen { private PumpTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/air_compressor_gui.png"); - - public PumpScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public PumpScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = (PumpTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); // Buttons - addRenderableWidget(new ioMenuButton(64 + (this.width/2),this.topPos + 4 , buttons -> { + addRenderableWidget(new ioMenuButton(64 + (this.width / 2), this.topPos + 4, buttons -> { })); int increase = 0; @@ -59,43 +59,43 @@ protected void init(){ @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("pump"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("pump"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Tank - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 93, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 93, 18, WHITE_TEXT_STYLE); // Slots handled by super super.renderSlotAndTankLabels(matrixStack, mouseX, mouseY); } @Override - protected void renderTooltip(GuiGraphics matrixStack,int mouseX, int mouseY) { + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.PUMP_MAX_POWER.get()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.PUMP_MAX_POWER.get()), mouseX, mouseY); } - if (isHovering(93, 18, 12, 50, mouseX, mouseY)){ // Oxidizer Tank + if (isHovering(93, 18, 12, 50, mouseX, mouseY)) { // Oxidizer Tank String name = tileEntity.getAirTankFluid().getTranslationKey(); int amount = tileEntity.getAirTankFluid().getAmount(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); if (tileEntity != null) { int power = menu.powerScreen(49); @@ -107,11 +107,12 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getAirTankFluid(),tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); - } catch (Exception e){ } + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getAirTankFluid(), tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); + } catch (Exception e) { + } drawIOSideHelper(); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java index 0717285f6..d9389e934 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java @@ -22,65 +22,65 @@ public class SawmillScreen extends VEContainerScreen { private SawmillTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/sawmill_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public SawmillScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public SawmillScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = (SawmillTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); - renderIOMenu(this.tileEntity,64 + (this.width/2), this.topPos + 4); + renderIOMenu(this.tileEntity, 64 + (this.width / 2), this.topPos + 4); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateVEBlock("sawmill"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("sawmill"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 44, 32, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 80, 24, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 80, 42, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 115, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 115, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 44, 32, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 80, 24, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 80, 42, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 115, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 115, 49, WHITE_TEXT_STYLE); // Tanks - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 138, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 138, 18, WHITE_TEXT_STYLE); } @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { - if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.SAWMILL_MAX_POWER.get()), mouseX, mouseY); + if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.SAWMILL_MAX_POWER.get()), mouseX, mouseY); } - if (isHovering(138, 18, 12, 50, mouseX, mouseY)){ // Output Tank + if (isHovering(138, 18, 12, 50, mouseX, mouseY)) { // Output Tank int amount = tileEntity.getFluidStackFromTank(0).getAmount(); String name = tileEntity.getFluidStackFromTank(0).getTranslationKey(); - matrixStack.renderTooltip(this.font,TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { // Progress tooltip matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -94,14 +94,14 @@ public List getTooltips() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); @@ -113,15 +113,15 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - matrixStack.blit(GUI,i+67, j+31, 176, 0, progress, 17); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + matrixStack.blit(GUI, i + 67, j + 31, 176, 0, progress, 17); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 138, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 138, j + 18, 0, 12, 50); drawIOSideHelper(); // Upgrade tilePos RenderSystem.setShaderTexture(0, GUI_TOOLS); - matrixStack.blit(GUI_TOOLS,i+153, j-16,0,0,18,18); + matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java index af3b73a56..8929f13b6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java @@ -19,29 +19,30 @@ public class SolarPanelScreen extends VEContainerScreen { private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/solar_panel_gui.png"); private final VETileEntity tileEntity; - public SolarPanelScreen(VEContainer container, Inventory inv, Component name) { + public SolarPanelScreen(VEContainer container, Inventory inv, Component name) { super(container, inv, name); tileEntity = container.getTileEntity(); container.setScreen(this); } @Override - public void render(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override protected void renderTooltip(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), /*temp modified*/Config.SOLAR_PANEL_MAX_POWER.get()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), /*temp modified*/Config.SOLAR_PANEL_MAX_POWER.get()), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } + @Override - protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY){ - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("solar_panel"), 8, 6, WHITE_TEXT_STYLE); + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("solar_panel"), 8, 6, WHITE_TEXT_STYLE); if (tileEntity.getLevel().isDay()) TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergy().getProduction() + " FE/t"), 90, 32, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); @@ -49,18 +50,20 @@ protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mo } @Override - protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) {} + protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { + } + @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY){ + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); // Actual Gui + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); // Actual Gui if (tileEntity != null) { int power = menu.powerScreen(49); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 14 + (49-power), 12, power); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 14 + (49 - power), 12, power); } } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java index 48f6c5f73..6c4a4b2c4 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java @@ -25,7 +25,7 @@ public class StirlingGeneratorScreen extends VEContainerScreen { private final VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/stirling_generator.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - + public StirlingGeneratorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); @@ -62,20 +62,20 @@ protected void init() { protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("stirling_generator"), 8, 6, WHITE_TEXT_STYLE); TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergy().getProduction() + " FE/t"), 90, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 80, 35, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 80, 35, WHITE_TEXT_STYLE); } @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.STIRLING_GENERATOR_MAX_POWER.get()), mouseX, mouseY); + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), Config.STIRLING_GENERATOR_MAX_POWER.get()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, this.getTooltips(), mouseX, mouseY); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java index e50d81446..0db9632ae 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java @@ -18,60 +18,60 @@ public class ToolingStationScreen extends VEContainerScreen { private ToolingStationTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/tooling_station_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public ToolingStationScreen(VEContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public ToolingStationScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = (ToolingStationTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); - renderIOMenu(this.tileEntity,64 + (this.width/2), this.topPos + 4); + renderIOMenu(this.tileEntity, 64 + (this.width / 2), this.topPos + 4); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("tooling_station"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 38, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 38, 49, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 86, 32, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 134, 18, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 134, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 38, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 38, 49, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("2")), 86, 32, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("3")), 134, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("4")), 134, 49, WHITE_TEXT_STYLE); // Tanks - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 61, 18, WHITE_TEXT_STYLE); } @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { - if (isHovering(11, 16, 12, 49, mouseX, mouseY)){ - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), tileEntity.getEnergy().getMaxEnergyStored()), mouseX, mouseY); + if (isHovering(11, 16, 12, 49, mouseX, mouseY)) { + matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(tileEntity.getEnergy(), tileEntity.getEnergy().getMaxEnergyStored()), mouseX, mouseY); } - if (isHovering(61, 18, 12, 50, mouseX, mouseY)){ // Input Tank + if (isHovering(61, 18, 12, 50, mouseX, mouseY)) { // Input Tank int amount = tileEntity.getFluidStackFromTank(0).getAmount(); String name = tileEntity.getFluidStackFromTank(0).getTranslationKey(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -79,14 +79,14 @@ public Rect2i getTooltipArea() { } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); int i = (this.width - this.imageWidth) / 2; int j = (this.height - this.imageHeight) / 2; - matrixStack.blit(GUI,i, j, 0, 0, this.imageWidth, this.imageHeight); - if(tileEntity != null){ + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { boolean lightArrow = tileEntity.hasValidRecipe(); int power = menu.powerScreen(49); @@ -98,10 +98,10 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, p_blit_5_ = width of the x for the blit to be drawn (make variable for progress illusion on the x) p_blit_6_ = width of the y for the blit to be drawn (make variable for progress illusion of the y) */ - if (lightArrow) matrixStack.blit(GUI,i+109, j+18, 188, 0, 22, 47); - matrixStack.blit(GUI,i + 11, j + (16 + (49-power)), 176, 24 + (49-power), 12, power); + if (lightArrow) matrixStack.blit(GUI, i + 109, j + 18, 188, 0, 22, 47); + matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getFluidStackFromTank(0),tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); /*try{ VERender.renderGuiTank(tileEntity.getFluidStackFromTank(1),tileEntity.getTankCapacity(), i + 157, j + 18, 0, 12, 50); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java index 62372a416..fd3483805 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/VEContainerScreen.java @@ -57,7 +57,7 @@ protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mo public void renderIOMenu(VETileEntity tileEntity, int menuButtonX, int menuButtonY) { // Buttons - addRenderableWidget(new ioMenuButton(menuButtonX,menuButtonY , buttons -> { + addRenderableWidget(new ioMenuButton(menuButtonX, menuButtonY, buttons -> { })); @@ -113,19 +113,19 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int } /* GuiGraphics matrixStack, int i, int j, int mouseX, int mouseY, float partialTicks old arguments in case you want them back*/ - public void drawIOSideHelper(){ + public void drawIOSideHelper() { - for(Renderable Renderable : this.renderables){ - if (Renderable instanceof ioMenuButton){ + for (Renderable Renderable : this.renderables) { + if (Renderable instanceof ioMenuButton) { if (((ioMenuButton) Renderable).shouldIOBeOpen()) { // This means IO Should be open - this.renderables.forEach(button ->{ - if (button instanceof VEIOButton){ + this.renderables.forEach(button -> { + if (button instanceof VEIOButton) { ((VEIOButton) button).toggleRender(true); } }); } else { - this.renderables.forEach(button ->{ - if(button instanceof VEIOButton){ + this.renderables.forEach(button -> { + if (button instanceof VEIOButton) { ((VEIOButton) button).toggleRender(false); } }); @@ -134,17 +134,17 @@ public void drawIOSideHelper(){ } } - public void updateButtonDirection(int direction, int slotId){ - for(Renderable Renderable: this.renderables){ - if(Renderable instanceof SlotDirectionButton && ((SlotDirectionButton) Renderable).getAssociatedSlotId() == slotId ){ + public void updateButtonDirection(int direction, int slotId) { + for (Renderable Renderable : this.renderables) { + if (Renderable instanceof SlotDirectionButton && ((SlotDirectionButton) Renderable).getAssociatedSlotId() == slotId) { ((SlotDirectionButton) Renderable).setDirectionFromInt(direction); } } } - public void updateBooleanButton(boolean status, int slotId){ - for(Renderable Renderable: this.renderables){ - if(Renderable instanceof SlotBoolButton && ((SlotBoolButton) Renderable).getAssociatedSlotId() == slotId){ + public void updateBooleanButton(boolean status, int slotId) { + for (Renderable Renderable : this.renderables) { + if (Renderable instanceof SlotBoolButton && ((SlotBoolButton) Renderable).getAssociatedSlotId() == slotId) { ((SlotBoolButton) Renderable).toggleRender(true); ((SlotBoolButton) Renderable).setStatus(status); ((SlotBoolButton) Renderable).toggleRender(false); @@ -152,17 +152,17 @@ public void updateBooleanButton(boolean status, int slotId){ } } - public void updateTankDirection(int direction, int id){ - for(Renderable Renderable: this.renderables){ - if(Renderable instanceof TankDirectionButton && ((TankDirectionButton) Renderable).getId() == id ){ + public void updateTankDirection(int direction, int id) { + for (Renderable Renderable : this.renderables) { + if (Renderable instanceof TankDirectionButton && ((TankDirectionButton) Renderable).getId() == id) { ((TankDirectionButton) Renderable).setDirectionFromInt(direction); } } } - public void updateTankStatus(boolean status, int id){ - for(Renderable Renderable: this.renderables){ - if(Renderable instanceof TankBoolButton && ((TankBoolButton) Renderable).getId() == id){ + public void updateTankStatus(boolean status, int id) { + for (Renderable Renderable : this.renderables) { + if (Renderable instanceof TankBoolButton && ((TankBoolButton) Renderable).getId() == id) { ((TankBoolButton) Renderable).toggleRender(true); ((TankBoolButton) Renderable).setStatus(status); ((TankBoolButton) Renderable).toggleRender(false); @@ -171,7 +171,7 @@ public void updateTankStatus(boolean status, int id){ } @Deprecated - public void informTileOfIOButton(boolean connection){ + public void informTileOfIOButton(boolean connection) { UUID uuid = Minecraft.getInstance().player.getUUID(); VENetwork.channel.send(new UuidPacket(uuid, connection), PacketDistributor.SERVER.noArg()); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/EighzoTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/EighzoTankScreen.java index 22fb37918..f69bc1efe 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/EighzoTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/EighzoTankScreen.java @@ -14,7 +14,7 @@ public EighzoTankScreen(TankContainer screenContainer, Inventory inv, Component @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("eighzo_tank"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("eighzo_tank"), 8, 6, WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NetheriteTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NetheriteTankScreen.java index c6eadebcd..02f7a0298 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NetheriteTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NetheriteTankScreen.java @@ -14,7 +14,7 @@ public NetheriteTankScreen(TankContainer screenContainer, Inventory inv, Compone @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("netherite_tank"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("netherite_tank"), 8, 6, WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NighaliteTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NighaliteTankScreen.java index 51e45c387..8ce4ef146 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NighaliteTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NighaliteTankScreen.java @@ -14,7 +14,7 @@ public NighaliteTankScreen(TankContainer screenContainer, Inventory inv, Compone @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("nighalite_tank"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("nighalite_tank"), 8, 6, WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/SolariumTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/SolariumTankScreen.java index 405415ae5..cd58bd317 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/SolariumTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/SolariumTankScreen.java @@ -14,7 +14,7 @@ public SolariumTankScreen(TankContainer screenContainer, Inventory inv, Componen @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("solarium_tank"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("solarium_tank"), 8, 6, WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TankScreen.java index 723fe0586..1af90626a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TankScreen.java @@ -29,57 +29,57 @@ public class TankScreen extends VEContainerScreen { private TankTile tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/tank_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - - public TankScreen(TankContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); + + public TankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); tileEntity = (TankTile) screenContainer.getTileEntity(); screenContainer.setScreen(this); } @Override - public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks){ + public void render(GuiGraphics matrixStack, int mouseX, int mouseY, float partialTicks) { this.renderBackground(matrixStack, mouseX, mouseY, partialTicks); - super.render(matrixStack,mouseX,mouseY,partialTicks); - this.renderTooltip(matrixStack,mouseX,mouseY); + super.render(matrixStack, mouseX, mouseY, partialTicks); + this.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void init(){ + protected void init() { super.init(); - renderIOMenu(tileEntity,64 + (this.width/2), this.topPos + 4); + renderIOMenu(tileEntity, 64 + (this.width / 2), this.topPos + 4); } @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font,TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } @Override protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Slots - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 70, 19, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 70, 50, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 70, 19, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 70, 50, WHITE_TEXT_STYLE); // Tank - TextUtil.renderShadowedText(matrixStack, this.font,(TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 93, 18, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.tank_short").copy().append("0")), 93, 18, WHITE_TEXT_STYLE); } @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { - if (isHovering(93, 18, 12, 50, mouseX, mouseY)){ + if (isHovering(93, 18, 12, 50, mouseX, mouseY)) { int amount = tileEntity.getTank().getTank().getFluid().getAmount(); String name = tileEntity.getTank().getTank().getFluid().getTranslationKey(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, int mouseY) { + protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int mouseY) { RenderSystem.setShader(GameRenderer::getPositionTexShader); RenderSystem.setShaderColor(1F, 1F, 1F, 1F); RenderSystem.setShaderTexture(0, this.GUI); @@ -89,9 +89,10 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); if (tileEntity != null) { // Tank render - try{ - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(),tileEntity.getTank().getTank(),tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); - } catch (Exception e){ } + try { + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getTank().getTank(), tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); + } catch (Exception e) { + } // IO Rendering RenderSystem.setShaderTexture(0, GUI_TOOLS); @@ -110,17 +111,17 @@ protected void renderBg(GuiGraphics matrixStack,float partialTicks, int mouseX, } } - public void updateButtonDirection(int direction, int slotId){ - for(Renderable Renderable: this.renderables){ - if(Renderable instanceof SlotDirectionButton && ((SlotDirectionButton) Renderable).getAssociatedSlotId() == slotId ){ + public void updateButtonDirection(int direction, int slotId) { + for (Renderable Renderable : this.renderables) { + if (Renderable instanceof SlotDirectionButton && ((SlotDirectionButton) Renderable).getAssociatedSlotId() == slotId) { ((SlotDirectionButton) Renderable).setDirectionFromInt(direction); } } } - public void updateBooleanButton(boolean status, int slotId){ - for(Renderable Renderable: this.renderables){ - if(Renderable instanceof SlotBoolButton && ((SlotBoolButton) Renderable).getAssociatedSlotId() == slotId){ + public void updateBooleanButton(boolean status, int slotId) { + for (Renderable Renderable : this.renderables) { + if (Renderable instanceof SlotBoolButton && ((SlotBoolButton) Renderable).getAssociatedSlotId() == slotId) { //VoluminousEnergy.LOGGER.debug("About to update the status of the Status/boolean Button."); ((SlotBoolButton) Renderable).toggleRender(true); ((SlotBoolButton) Renderable).setStatus(status); @@ -129,17 +130,17 @@ public void updateBooleanButton(boolean status, int slotId){ } } - public void updateTankDirection(int direction, int id){ - for(Renderable Renderable: this.renderables){ - if(Renderable instanceof TankDirectionButton && ((TankDirectionButton) Renderable).getId() == id ){ + public void updateTankDirection(int direction, int id) { + for (Renderable Renderable : this.renderables) { + if (Renderable instanceof TankDirectionButton && ((TankDirectionButton) Renderable).getId() == id) { ((TankDirectionButton) Renderable).setDirectionFromInt(direction); } } } - public void updateTankStatus(boolean status, int id){ - for(Renderable Renderable: this.renderables){ - if(Renderable instanceof TankBoolButton && ((TankBoolButton) Renderable).getId() == id){ + public void updateTankStatus(boolean status, int id) { + for (Renderable Renderable : this.renderables) { + if (Renderable instanceof TankBoolButton && ((TankBoolButton) Renderable).getId() == id) { //VoluminousEnergy.LOGGER.debug("About to update the status of the Status/boolean Button."); ((TankBoolButton) Renderable).toggleRender(true); ((TankBoolButton) Renderable).setStatus(status); @@ -148,9 +149,9 @@ public void updateTankStatus(boolean status, int id){ } } - public void informTileOfIOButton(boolean connection){ + public void informTileOfIOButton(boolean connection) { UUID uuid = Minecraft.getInstance().player.getUUID(); - if(uuid != null){ + if (uuid != null) { VENetwork.channel.send(new UuidPacket(uuid, connection), PacketDistributor.SERVER.noArg()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TitaniumTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TitaniumTankScreen.java index 06b7fca3a..3ad66a9a5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TitaniumTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TitaniumTankScreen.java @@ -14,7 +14,7 @@ public TitaniumTankScreen(TankContainer screenContainer, Inventory inv, Componen @Override protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("titanium_tank"), 8, 6, WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("titanium_tank"), 8, 6, WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java index 3e360f52c..abda287ea 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java @@ -26,7 +26,7 @@ import java.util.ArrayList; import java.util.List; -public class BatteryBoxTile extends VETileEntity { +public class BatteryBoxTile extends VETileEntity { private final int POWER_MAX_TX = Config.BATTERY_BOX_TRANSFER.get(); private final int MAX_POWER = Config.BATTERY_BOX_MAX_POWER.get(); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java index 88b261136..fe5967a01 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java @@ -3,6 +3,7 @@ import com.veteam.voluminousenergy.achievements.triggers.VECriteriaTriggers; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; +import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.items.tools.RFIDChip; import com.veteam.voluminousenergy.persistence.ChunkFluid; @@ -44,7 +45,7 @@ public class DimensionalLaserTile extends VEMultiBlockTileEntity { - public VESlotManager bucketTopSm = new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT,1,0); + public VESlotManager bucketTopSm = new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0); public VESlotManager bucketBottomSm = new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT); public VESlotManager RFIDsm = new VESlotManager(2, Direction.NORTH, true, SlotType.OUTPUT); @@ -54,7 +55,7 @@ public class DimensionalLaserTile extends VEMultiBlockTileEntity { add(RFIDsm); }}; - VERelationalTank outputTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0,0, TankType.OUTPUT, "outputTank:output_tank_gui"); + VERelationalTank outputTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.OUTPUT, "outputTank:output_tank_gui"); List fluidManagers = new ArrayList<>() {{ add(outputTank); @@ -75,7 +76,7 @@ public DimensionalLaserTile(BlockPos pos, BlockState state) { this.RFIDsm.addAllowedItem(VEItems.RFID_CHIP.get()); } - public ItemStackHandler inventory = new VEItemStackHandler(this,4); + public ItemStackHandler inventory = new VEItemStackHandler(this, 4); @Override public void tick() { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java index dda676319..eef4796d4 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java @@ -126,9 +126,9 @@ public void validateRecipe() { var furnaceRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(furnaceInput.copy()), level).orElse(null); var blastingRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(furnaceInput.copy()), level).orElse(null); - if(furnaceRecipeNew != null) furnaceRecipe = furnaceRecipeNew.value(); + if (furnaceRecipeNew != null) furnaceRecipe = furnaceRecipeNew.value(); else furnaceRecipe = null; - if(blastingRecipeNew != null) blastingRecipe = blastingRecipeNew.value(); + if (blastingRecipeNew != null) blastingRecipe = blastingRecipeNew.value(); else blastingRecipe = null; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java index ceadabdf4..4fbb738a6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java @@ -54,7 +54,7 @@ public class GasFiredFurnaceTile extends VETileEntity { add(new VESlotManager(3, Direction.WEST, true, SlotType.OUTPUT)); }}; - VERelationalTank fuelTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0,0, TankType.INPUT, "fuel_tank:fuel_tank_gui"); + VERelationalTank fuelTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.INPUT, "fuel_tank:fuel_tank_gui"); List fluidManagers = new ArrayList<>() {{ add(fuelTank); @@ -167,9 +167,9 @@ public void validateRecipe() { ItemStack furnaceInput = slotManagers.get(2).getItem(this.inventory); var furnaceRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(furnaceInput.copy()), level).orElse(null); var blastingRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(furnaceInput.copy()), level).orElse(null); - if(furnaceRecipeNew != null) furnaceRecipe = furnaceRecipeNew.value(); + if (furnaceRecipeNew != null) furnaceRecipe = furnaceRecipeNew.value(); else furnaceRecipe = null; - if(blastingRecipeNew != null) blastingRecipe = blastingRecipeNew.value(); + if (blastingRecipeNew != null) blastingRecipe = blastingRecipeNew.value(); else blastingRecipe = null; fuelRecipe = (CombustionGeneratorRecipe) RecipeCache.getFluidRecipeFromCache(level, CombustionGeneratorRecipe.RECIPE_TYPE, Collections.singletonList(fuelTank.getTank().getFluid()), new ArrayList<>()); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java index 9dad2ef26..7003955e8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java @@ -37,12 +37,12 @@ import java.util.Collections; import java.util.List; -public class PumpTile extends VETileEntity { +public class PumpTile extends VETileEntity { private final LazyOptional handler = LazyOptional.of(() -> this.inventory); private final LazyOptional fluid = LazyOptional.of(this::createFluid); public List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0,Direction.UP,true, SlotType.FLUID_INPUT,1,0)); + add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); }}; @@ -54,27 +54,27 @@ public class PumpTile extends VETileEntity { private int lY = 0; private int lZ = 0; - private final VERelationalTank fluidTank = new VERelationalTank(new FluidTank(tankCapacity), 0, TankType.OUTPUT,"tank:tank_gui"); + private final VERelationalTank fluidTank = new VERelationalTank(new FluidTank(tankCapacity), 0, TankType.OUTPUT, "tank:tank_gui"); private Fluid pumpingFluid = Fluids.EMPTY; private final ItemStackHandler inventory = this.createHandler(); public PumpTile(BlockPos pos, BlockState state) { - super(VEBlocks.PUMP_TILE.get(), pos, state,null); + super(VEBlocks.PUMP_TILE.get(), pos, state, null); fluidTank.setAllowAny(true); fluidTank.setIgnoreDirection(true); } @Override - public void tick(){ + public void tick() { updateClients(); processFluidIO(); handler.ifPresent(h -> { - if (fluidTank.getTank() != null && (fluidTank.getTank().getFluidAmount() + 1000) <= tankCapacity && this.getCapability(ForgeCapabilities.ENERGY).map(IEnergyStorage::getEnergyStored).orElse(0) > 0){ - for(int i = 0; i < 50; i++) { - if(fluidPumpMethod()) break; + if (fluidTank.getTank() != null && (fluidTank.getTank().getFluidAmount() + 1000) <= tankCapacity && this.getCapability(ForgeCapabilities.ENERGY).map(IEnergyStorage::getEnergyStored).orElse(0) > 0) { + for (int i = 0; i < 50; i++) { + if (fluidPumpMethod()) break; } setChanged(); - if(++sound_tick == 19) { + if (++sound_tick == 19) { sound_tick = 0; if (Config.PLAY_MACHINE_SOUNDS.get()) { level.playSound(null, this.getBlockPos(), VESounds.AIR_COMPRESSOR, SoundSource.BLOCKS, 1.0F, 1.0F); @@ -218,11 +218,11 @@ public ItemStackHandler getInventoryHandler() { return slotManagers; } - public FluidStack getAirTankFluid(){ + public FluidStack getAirTankFluid() { return this.fluidTank.getTank().getFluid(); } - public int getTankCapacity(){ + public int getTankCapacity() { return tankCapacity; } @@ -237,41 +237,41 @@ public boolean fluidPumpMethod() { lY = -1; lZ = -22; - try{ + try { this.pumpingFluid = this.level.getBlockState(this.getBlockPos().offset(0, -1, 0)).getFluidState().getType(); initDone = true; - } catch (Exception e){ + } catch (Exception e) { return false; } } - if (this.pumpingFluid == Fluids.EMPTY || this.pumpingFluid.isSame(Fluids.EMPTY) || this.pumpingFluid == null){ // Sanity check to prevent mass destruction + if (this.pumpingFluid == Fluids.EMPTY || this.pumpingFluid.isSame(Fluids.EMPTY) || this.pumpingFluid == null) { // Sanity check to prevent mass destruction initDone = false; return false; } - if (lX < 22){ + if (lX < 22) { lX++; - if(this.pumpingFluid.isSame(this.level.getBlockState(this.getBlockPos().offset(lX,lY,lZ)).getFluidState().getType())){ - this.level.setBlockAndUpdate(this.getBlockPos().offset(lX,lY,lZ),Blocks.AIR.defaultBlockState()); // setBlockAndUpdate is the replacement for setBlockState in MCP mappings. This is obvious because of the flag of 3. + if (this.pumpingFluid.isSame(this.level.getBlockState(this.getBlockPos().offset(lX, lY, lZ)).getFluidState().getType())) { + this.level.setBlockAndUpdate(this.getBlockPos().offset(lX, lY, lZ), Blocks.AIR.defaultBlockState()); // setBlockAndUpdate is the replacement for setBlockState in MCP mappings. This is obvious because of the flag of 3. addFluidToTank(); return true; } - } else if (lZ < 22){ + } else if (lZ < 22) { lZ++; lX = -22; - if(this.pumpingFluid.isSame(this.level.getBlockState(this.getBlockPos().offset(lX,lY,lZ)).getFluidState().getType())){ - this.level.setBlockAndUpdate(this.getBlockPos().offset(lX,lY,lZ),Blocks.AIR.defaultBlockState()); + if (this.pumpingFluid.isSame(this.level.getBlockState(this.getBlockPos().offset(lX, lY, lZ)).getFluidState().getType())) { + this.level.setBlockAndUpdate(this.getBlockPos().offset(lX, lY, lZ), Blocks.AIR.defaultBlockState()); addFluidToTank(); return true; } - } else if (this.getBlockPos().offset(0, lY, 0).getY() > -63){ + } else if (this.getBlockPos().offset(0, lY, 0).getY() > -63) { lY--; lX = -22; lZ = -22; - if(this.pumpingFluid.isSame(this.level.getBlockState(this.getBlockPos().offset(lX,lY,lZ)).getFluidState().getType())){ - this.level.setBlockAndUpdate(this.getBlockPos().offset(lX,lY,lZ),Blocks.AIR.defaultBlockState()); + if (this.pumpingFluid.isSame(this.level.getBlockState(this.getBlockPos().offset(lX, lY, lZ)).getFluidState().getType())) { + this.level.setBlockAndUpdate(this.getBlockPos().offset(lX, lY, lZ), Blocks.AIR.defaultBlockState()); addFluidToTank(); return true; } @@ -279,7 +279,7 @@ public boolean fluidPumpMethod() { return false; } - public VERelationalTank getTank(){ + public VERelationalTank getTank() { return this.fluidTank; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java index a360de959..f402d174a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java @@ -43,10 +43,10 @@ public class SawmillTile extends VETileEntity { // add(new VESlotManager(0,0, Direction.UP, true, SlotType.INPUT)); // add(new VESlotManager(1,0, Direction.DOWN, true,SlotType.OUTPUT)); // add(new VESlotManager(2,1, Direction.NORTH, true,SlotType.OUTPUT)); - add(new VESlotManager(3, Direction.SOUTH,true,SlotType.FLUID_INPUT,4,0)); - add(new VESlotManager(4, Direction.EAST,true,SlotType.FLUID_OUTPUT)); + add(new VESlotManager(3, Direction.SOUTH, true, SlotType.FLUID_INPUT, 4, 0)); + add(new VESlotManager(4, Direction.EAST, true, SlotType.FLUID_OUTPUT)); }}; - VERelationalTank outputTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY),0,0, TankType.OUTPUT, "outputTank:output_tank_gui"); + VERelationalTank outputTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.OUTPUT, "outputTank:output_tank_gui"); private final FluidStack configuredFluidForNoRecipe = new FluidStack(Objects.requireNonNull(ForgeRegistries.FLUIDS.getValue(new ResourceLocation(Config.SAWMILL_FLUID_LOCATION.get()))), Config.SAWMILL_FLUID_AMOUNT.get()); List fluidManagers = new ArrayList<>() {{ @@ -84,24 +84,24 @@ public void tick() { //ItemStack secondOutput = inventory.getStackInSlot(2).copy(); // Second output // Resolve recipes: - if (!logInput.isEmpty()){ + if (!logInput.isEmpty()) { ItemStack plankOutputStack; ItemStack secondOutputStack; if ((recipe == null && Config.SAWMILL_ALLOW_NON_SAWMILL_RECIPE_LOGS_TO_BE_SAWED.get()) - || (recipe != null && recipe.isLogRecipe() && Config.SAWMILL_ALLOW_NON_SAWMILL_RECIPE_LOGS_TO_BE_SAWED.get())){ // Recipe is null, use alternative method if allowed, or dummy recipe + || (recipe != null && recipe.isLogRecipe() && Config.SAWMILL_ALLOW_NON_SAWMILL_RECIPE_LOGS_TO_BE_SAWED.get())) { // Recipe is null, use alternative method if allowed, or dummy recipe plankOutputStack = RecipeUtil.getPlankFromLogParallel(level, logInput.copy()); //RecipeUtil.getPlankFromLogParallel(level, logInput.copy()); secondOutputStack = new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Config.SAWMILL_SECOND_OUTPUT_RESOURCE_LOCATION.get())), Config.SAWMILL_SECOND_OUTPUT_COUNT.get()); - if (plankOutputStack != null){ // Valid Item! + if (plankOutputStack != null) { // Valid Item! if (this.configuredFluidForNoRecipe != null && (outputTank.getTank().getFluidAmount() + Config.SAWMILL_FLUID_AMOUNT.get()) <= DEFAULT_TANK_CAPACITY && (inventory.getStackInSlot(1).isEmpty() || inventory.getStackInSlot(1).getItem() == plankOutputStack.getItem()) && (inventory.getStackInSlot(2).isEmpty() || inventory.getStackInSlot(2).getItem() == secondOutputStack.getItem()) && (inventory.getStackInSlot(1).getCount() + Config.SAWMILL_PRIMARY_OUTPUT_COUNT.get()) <= 64 - && (inventory.getStackInSlot(2).getCount() + Config.SAWMILL_SECOND_OUTPUT_COUNT.get()) <= 64){ + && (inventory.getStackInSlot(2).getCount() + Config.SAWMILL_SECOND_OUTPUT_COUNT.get()) <= 64) { - if (outputTank.getTank().getFluid().isFluidEqual(this.configuredFluidForNoRecipe.copy()) || outputTank.getTank().getFluid().isEmpty()){ + if (outputTank.getTank().getFluid().isFluidEqual(this.configuredFluidForNoRecipe.copy()) || outputTank.getTank().getFluid().isEmpty()) { plankOutputStack.setCount(Config.SAWMILL_PRIMARY_OUTPUT_COUNT.get()); coreTickProcessing(null, logInput, @@ -119,7 +119,7 @@ public void tick() { counter = 0; } - } else if (recipe != null && !recipe.isLogRecipe()){ // Using Recipe + } else if (recipe != null && !recipe.isLogRecipe()) { // Using Recipe plankOutputStack = recipe.getResult(0).copy(); secondOutputStack = recipe.getResult(1).copy(); FluidStack outputFluid = recipe.getOutputFluid(0).copy(); @@ -128,8 +128,8 @@ public void tick() { && (inventory.getStackInSlot(1).isEmpty() || inventory.getStackInSlot(1).getItem() == plankOutputStack.getItem()) && (inventory.getStackInSlot(2).isEmpty() || inventory.getStackInSlot(2).getItem() == secondOutputStack.getItem()) && (inventory.getStackInSlot(1).getCount() + recipe.getResult(0).getCount()) <= 64 - && (inventory.getStackInSlot(2).getCount() + recipe.getResult(1).getCount()) <= 64){ - if (outputTank.getTank().getFluid().isFluidEqual(outputFluid.copy()) || outputTank.getTank().getFluid().isEmpty()){ + && (inventory.getStackInSlot(2).getCount() + recipe.getResult(1).getCount()) <= 64) { + if (outputTank.getTank().getFluid().isFluidEqual(outputFluid.copy()) || outputTank.getTank().getFluid().isEmpty()) { coreTickProcessing(recipe, logInput, plankOutputStack, secondOutputStack, outputFluid); } else { counter = 0; @@ -163,11 +163,11 @@ protected void onContentsChanged(int slot) { @Override public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if (slot == 0 || slot == 1 || slot == 2){ + if (slot == 0 || slot == 1 || slot == 2) { return true; } else if (slot == 3 || slot == 4) { return stack.getItem() instanceof BucketItem; - } else if (slot == 5){ + } else if (slot == 5) { return TagUtil.isTaggedMachineUpgradeItem(stack); // this is the upgrade tilePos } return true; @@ -176,7 +176,7 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { @Nonnull @Override public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { //ALSO DO THIS PER SLOT BASIS TO SAVE DEBUG HOURS!!! - if(!isItemValid(slot,stack)) return stack; + if (!isItemValid(slot, stack)) return stack; return super.insertItem(slot, stack, simulate); } }; @@ -186,39 +186,39 @@ private void coreTickProcessing(@Nullable VEFluidSawmillRecipe VEFluidSawmillRec ItemStack logInput, ItemStack resolvedPlankOutput, ItemStack secondItemOutput, - FluidStack fluidOutput){ - if (canConsumeEnergy()){ - if (counter == 1){ + FluidStack fluidOutput) { + if (canConsumeEnergy()) { + if (counter == 1) { // Core processing occurs here inventory.extractItem(0, (VEFluidSawmillRecipe != null ? VEFluidSawmillRecipe.getIngredient(0).getItems()[0].getCount() : Config.SAWMILL_LOG_CONSUMPTION_RATE.get()), false); // Extract log // Plank output ItemStack currentPlankStack = inventory.getStackInSlot(1); - if (currentPlankStack.getItem() != resolvedPlankOutput.getItem() || currentPlankStack.getItem() == Items.AIR){ - if (currentPlankStack.getItem() == Items.AIR){ + if (currentPlankStack.getItem() != resolvedPlankOutput.getItem() || currentPlankStack.getItem() == Items.AIR) { + if (currentPlankStack.getItem() == Items.AIR) { currentPlankStack.setCount(1); } inventory.insertItem(1, resolvedPlankOutput.copy(), false); } else { // Assuming the recipe output item is already in the output tilePos - // currentPlankStack.setCount(.getCount()); // Simply change the item to equal the output amount - inventory.insertItem(1, resolvedPlankOutput.copy(),false); // Place the new output item on top of the old one + // currentPlankStack.setCount(.getCount()); // Simply change the item to equal the output amount + inventory.insertItem(1, resolvedPlankOutput.copy(), false); // Place the new output item on top of the old one } // Second output ItemStack currentSecondOutput = inventory.getStackInSlot(2); - if (currentSecondOutput.getItem() != secondItemOutput.getItem() || currentSecondOutput.getItem() == Items.AIR){ - if (currentSecondOutput.getItem() == Items.AIR){ + if (currentSecondOutput.getItem() != secondItemOutput.getItem() || currentSecondOutput.getItem() == Items.AIR) { + if (currentSecondOutput.getItem() == Items.AIR) { currentSecondOutput.setCount(1); } inventory.insertItem(2, secondItemOutput.copy(), false); } else { // Assuming the recipe output item is already in the output tilePos //currentSecondOutput.setCount(secondItemOutput.getCount()); // Simply change the item to equal the output amount - inventory.insertItem(2, secondItemOutput.copy(),false); // Place the new output item on top of the old one + inventory.insertItem(2, secondItemOutput.copy(), false); // Place the new output item on top of the old one } // Output Tank - if (outputTank.getTank().getFluid().getRawFluid() != fluidOutput.getRawFluid()){ + if (outputTank.getTank().getFluid().getRawFluid() != fluidOutput.getRawFluid()) { outputTank.getTank().setFluid(fluidOutput.copy()); } else { outputTank.getTank().fill(fluidOutput.copy(), IFluidHandler.FluidAction.EXECUTE); @@ -227,10 +227,10 @@ private void coreTickProcessing(@Nullable VEFluidSawmillRecipe VEFluidSawmillRec counter--; consumeEnergy(); this.setChanged(); - } else if (counter > 0){ + } else if (counter > 0) { counter--; consumeEnergy(); - if(++sound_tick == 19) { + if (++sound_tick == 19) { sound_tick = 0; if (Config.PLAY_MACHINE_SOUNDS.get()) { level.playSound(null, this.getBlockPos(), VESounds.GENERAL_MACHINE_NOISE, SoundSource.BLOCKS, 1.0F, 1.0F); @@ -238,8 +238,8 @@ private void coreTickProcessing(@Nullable VEFluidSawmillRecipe VEFluidSawmillRec } } else { counter = VEFluidSawmillRecipe != null - ? this.calculateCounter(VEFluidSawmillRecipe.getProcessTime(), inventory.getStackInSlot(this.energy.getUpgradeSlotId()).copy()) // Sawmill recipe not null - : this.calculateCounter(Config.SAWMILL_PROCESSING_TIME.get(), inventory.getStackInSlot(this.energy.getUpgradeSlotId()).copy());// Use default values when null + ? this.calculateCounter(VEFluidSawmillRecipe.getProcessTime(), inventory.getStackInSlot(this.energy.getUpgradeSlotId()).copy()) // Sawmill recipe not null + : this.calculateCounter(Config.SAWMILL_PROCESSING_TIME.get(), inventory.getStackInSlot(this.energy.getUpgradeSlotId()).copy());// Use default values when null length = counter; } } @@ -251,8 +251,8 @@ public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventor return VEContainers.SAWMILL_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); } - public FluidStack getFluidStackFromTank(int num){ - if (num == 0){ + public FluidStack getFluidStackFromTank(int num) { + if (num == 0) { return outputTank.getTank().getFluid(); } return FluidStack.EMPTY; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java index 7107fc6a0..1229b9761 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java @@ -38,7 +38,7 @@ import static com.veteam.voluminousenergy.items.tools.multitool.CombustionMultitool.isCombustibleFuel; -public class ToolingStationTile extends VETileEntity { +public class ToolingStationTile extends VETileEntity { // Slot Managers List slotManagers = new ArrayList<>() {{ diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index 91219fef1..1d79f20ed 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -4,10 +4,8 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidInputTank; import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidOutputTank; -import com.veteam.voluminousenergy.recipe.processor.AirCompressorProcessor; -import com.veteam.voluminousenergy.recipe.processor.DefaultProcessor; -import com.veteam.voluminousenergy.recipe.processor.GeneratorProcessor; -import com.veteam.voluminousenergy.recipe.processor.MultiBlockRecipeProcessor; +import com.veteam.voluminousenergy.blocks.tiles.handlers.DimensionalLaserInventoryValidator; +import com.veteam.voluminousenergy.recipe.processor.*; import com.veteam.voluminousenergy.tools.Config; import static com.veteam.voluminousenergy.recipe.VERecipes.VERecipeTypes.*; @@ -17,7 +15,7 @@ public class VETileEntities { static final int DEFAULT_TANK_CAPACITY = 4000; public static final VETileEntityFactory AIR_COMPRESSOR_FACTORY = - new VETileEntityFactory(VEBlocks.AIR_COMPRESSOR_TILE,VEContainers.AIR_COMPRESSOR_FACTORY) + new VETileEntityFactory(VEBlocks.AIR_COMPRESSOR_TILE, VEContainers.AIR_COMPRESSOR_FACTORY) .addEnergyStorageWithConsumption( Config.AIR_COMPRESSOR_MAX_POWER.get(), Config.AIR_COMPRESSOR_TRANSFER.get(), @@ -33,7 +31,7 @@ public class VETileEntities { Config.AQUEOULIZER_MAX_POWER.get(), Config.AQUEOULIZER_TRANSFER.get(), Config.AQUEOULIZER_POWER_USAGE.get()) - .withTanks(new FluidInputTank(0, DEFAULT_TANK_CAPACITY), + .addTanks(new FluidInputTank(0, DEFAULT_TANK_CAPACITY), new FluidOutputTank(0, DEFAULT_TANK_CAPACITY)) .countable() .makesSound() @@ -54,8 +52,8 @@ public class VETileEntities { Config.BLAST_FURNACE_MAX_POWER.get(), Config.BLAST_FURNACE_TRANSFER.get(), Config.BLAST_FURNACE_POWER_USAGE.get()) - .withTanks( - new FluidInputTank(0,DEFAULT_TANK_CAPACITY) + .addTanks( + new FluidInputTank(0, DEFAULT_TANK_CAPACITY) ) .countable() .withDataFlag("temperature_kelvin") @@ -71,7 +69,7 @@ public class VETileEntities { Config.CENTRIFUGAL_AGITATOR_MAX_POWER.get(), Config.CENTRIFUGAL_AGITATOR_TRANSFER.get(), Config.CENTRIFUGAL_AGITATOR_POWER_USAGE.get()) - .withTanks( + .addTanks( new FluidInputTank(0, DEFAULT_TANK_CAPACITY), new FluidOutputTank(0, DEFAULT_TANK_CAPACITY), new FluidOutputTank(1, DEFAULT_TANK_CAPACITY) @@ -98,7 +96,7 @@ public class VETileEntities { .addEnergyStorage( Config.COMBUSTION_GENERATOR_MAX_POWER.get(), Config.COMBUSTION_GENERATOR_SEND.get()) - .withTanks( + .addTanks( new FluidInputTank(0, DEFAULT_TANK_CAPACITY), new FluidInputTank(1, DEFAULT_TANK_CAPACITY)) .countable() @@ -129,24 +127,22 @@ public class VETileEntities { .withRecipe(CRUSHING) .withCustomRecipeProcessing(new DefaultProcessor()); - - // TODO needs some custom processing public static final VETileEntityFactory DIMENSIONAL_LASER_FACTORY = new VETileEntityFactory(VEBlocks.DIMENSIONAL_LASER_TILE, VEContainers.DIMENSIONAL_LASER_FACTORY) .addEnergyStorageWithConsumption( Config.DIMENSIONAL_LASER_MAX_POWER.get(), Config.DIMENSIONAL_LASER_TRANSFER.get(), Config.DIMENSIONAL_LASER_POWER_USAGE.get()) - .withTanks( + .addTanks( new FluidOutputTank(0, DEFAULT_TANK_CAPACITY) ) .countable() .makesSound() - .withDataFlag("fully_built") .withDataFlag("build_tick") - .withDataFlag("first_stage_built") .withRecipe(DIMENSIONAL_LASING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withInfiniteRender() + .withCustomInventoryValidator(new DimensionalLaserInventoryValidator()) + .withCustomRecipeProcessing(new DimensionalLaserRecipeProcessor(VEBlocks.SOLARIUM_MACHINE_CASING_BLOCK)); public static final VETileEntityFactory DISTILLATION_UNIT_FACTORY = new VETileEntityFactory(VEBlocks.DISTILLATION_UNIT_TILE, VEContainers.DISTILLATION_UNIT_FACTORY) @@ -154,7 +150,7 @@ public class VETileEntities { Config.DISTILLATION_UNIT_MAX_POWER.get(), Config.DISTILLATION_UNIT_TRANSFER.get(), Config.DIMENSIONAL_LASER_POWER_USAGE.get()) - .withTanks( + .addTanks( new FluidInputTank(0, DEFAULT_TANK_CAPACITY), new FluidOutputTank(0, DEFAULT_TANK_CAPACITY), new FluidOutputTank(1, DEFAULT_TANK_CAPACITY) @@ -203,7 +199,7 @@ public class VETileEntities { Config.FLUID_MIXER_TRANSFER.get(), Config.FLUID_MIXER_POWER_USAGE.get() ) - .withTanks( + .addTanks( new FluidInputTank(0, DEFAULT_TANK_CAPACITY), new FluidInputTank(1, DEFAULT_TANK_CAPACITY), new FluidOutputTank(0, DEFAULT_TANK_CAPACITY) @@ -215,9 +211,9 @@ public class VETileEntities { // TODO needs a furnace processor public static final VETileEntityFactory GAS_FIRED_FURNACE = - new VETileEntityFactory(VEBlocks.GAS_FIRED_FURNACE_TILE,VEContainers.GAS_FIRED_FURNACE_FACTORY) - .withTanks( - new FluidInputTank(0,DEFAULT_TANK_CAPACITY) + new VETileEntityFactory(VEBlocks.GAS_FIRED_FURNACE_TILE, VEContainers.GAS_FIRED_FURNACE_FACTORY) + .addTanks( + new FluidInputTank(0, DEFAULT_TANK_CAPACITY) ) .countable() .makesSound() @@ -230,7 +226,7 @@ public class VETileEntities { Config.HYDROPONIC_INCUBATOR_TRANSFER.get(), Config.HYDROPONIC_INCUBATOR_POWER_USAGE.get() ) - .withTanks( + .addTanks( new FluidInputTank(0, DEFAULT_TANK_CAPACITY) ) .countable() @@ -254,12 +250,12 @@ public class VETileEntities { new VETileEntityFactory(VEBlocks.PRIMITIVE_BLAST_FURNACE_TILE, VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY) .countable() .makesSound() - .withRecipe(INDUSTRIAL_BLASTING) + .withRecipe(PRIMITIVE_BLAST_FURNACING) .withCustomRecipeProcessing(new DefaultProcessor()); // TODO needs custom processor public static final VETileEntityFactory PRIMITIVE_SOLAR_PANEL_FACTORY = - new VETileEntityFactory(VEBlocks.PRIMITIVE_SOLAR_PANEL_TILE,VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY) + new VETileEntityFactory(VEBlocks.PRIMITIVE_SOLAR_PANEL_TILE, VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY) .addEnergyStorage( Config.PRIMITIVE_SOLAR_PANEL_MAX_POWER.get(), Config.PRIMITIVE_SOLAR_PANEL_SEND.get() @@ -269,7 +265,7 @@ public class VETileEntities { // TODO needs a custom processor public static final VETileEntityFactory SOLAR_PANEL_FACTORY = - new VETileEntityFactory(VEBlocks.SOLAR_PANEL_TILE,VEContainers.SOLAR_PANEL_FACTORY) + new VETileEntityFactory(VEBlocks.SOLAR_PANEL_TILE, VEContainers.SOLAR_PANEL_FACTORY) .addEnergyStorage( Config.SOLAR_PANEL_MAX_POWER.get(), Config.SOLAR_PANEL_SEND.get() @@ -290,18 +286,18 @@ public class VETileEntities { // TODO make a custom processor public static final VETileEntityFactory PUMP_FACTORY = - new VETileEntityFactory(VEBlocks.PUMP_TILE,VEContainers.PUMP_FACTORY) + new VETileEntityFactory(VEBlocks.PUMP_TILE, VEContainers.PUMP_FACTORY) .addEnergyStorage( Config.PUMP_MAX_POWER.get(), Config.PUMP_TRANSFER.get() ) - .withTanks(new FluidOutputTank(0,DEFAULT_TANK_CAPACITY)) + .addTanks(new FluidOutputTank(0, DEFAULT_TANK_CAPACITY)) .countable() .makesSound(); // TODO make a custom processor public static final VETileEntityFactory SAWMILL_FACTORY = - new VETileEntityFactory(VEBlocks.SAWMILL_TILE,VEContainers.SAWMILL_FACTORY) + new VETileEntityFactory(VEBlocks.SAWMILL_TILE, VEContainers.SAWMILL_FACTORY) .addEnergyStorage( Config.SAWMILL_MAX_POWER.get(), Config.SAWMILL_TRANSFER.get() @@ -312,18 +308,19 @@ public class VETileEntities { .withCustomRecipeProcessing(new DefaultProcessor()); public static final VETileEntityFactory STIRLING_GENERATOR_FACTORY = - new VETileEntityFactory(VEBlocks.STIRLING_GENERATOR_TILE,VEContainers.STIRLING_GENERATOR_FACTORY) + new VETileEntityFactory(VEBlocks.STIRLING_GENERATOR_TILE, VEContainers.STIRLING_GENERATOR_FACTORY) .addEnergyStorage( Config.STIRLING_GENERATOR_MAX_POWER.get(), Config.STIRLING_GENERATOR_SEND.get() ) .sendsOutPower() + .countable() .withRecipe(STIRLING) .withCustomRecipeProcessing(new GeneratorProcessor()); // TODO needs a custom processor public static final VETileEntityFactory TOOLING_STATION_FACTORY = - new VETileEntityFactory(VEBlocks.TOOLING_STATION_TILE,VEContainers.TOOLING_STATION_FACTORY) + new VETileEntityFactory(VEBlocks.TOOLING_STATION_TILE, VEContainers.TOOLING_STATION_FACTORY) .withRecipe(TOOLING) .withCustomRecipeProcessing(new DefaultProcessor()); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 376fbbd35..79e33a65d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -1,5 +1,6 @@ package com.veteam.voluminousenergy.blocks.tiles; +import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.items.upgrades.MysteriousMultiplier; import com.veteam.voluminousenergy.recipe.VERecipe; @@ -57,7 +58,7 @@ public abstract class VETileEntity extends BlockEntity implements MenuProvider { final List tanks = new ArrayList<>(); final List managers = new ArrayList<>(); - final HashMap dataMap = new HashMap<>(); + final HashMap dataMap = new HashMap<>(); AbstractRecipeProcessor recipeProcessor; boolean sendsOutPower; @@ -185,14 +186,14 @@ public void tick() { processFluidIO(); updateClients(); - if(this.recipeProcessor != null) { - if(this.isRecipeDirty) { + if (this.recipeProcessor != null) { + if (this.isRecipeDirty) { recipeProcessor.validateRecipe(this); this.isRecipeDirty = false; } recipeProcessor.processRecipe(this); } - if(this.sendsOutPower) sendOutPower(); + if (this.sendsOutPower) sendOutPower(); } /** @@ -290,10 +291,10 @@ public void load(CompoundTag tag) { if (handler != null) { handler.deserializeNBT(inv); } - if(energy != null) energy.deserializeNBT(tag); + if (energy != null) energy.deserializeNBT(tag); - for(var entry : dataMap.entrySet()) { - dataMap.put(entry.getKey(),tag.getInt(entry.getKey())); + for (var entry : dataMap.entrySet()) { + dataMap.put(entry.getKey(), tag.getInt(entry.getKey())); } for (VESlotManager manager : getSlotManagers()) { @@ -329,8 +330,8 @@ public void saveAdditional(@NotNull CompoundTag tag) { manager.write(tag); } - for(var entry : dataMap.entrySet()) { - tag.putInt(entry.getKey(),entry.getValue()); + for (var entry : dataMap.entrySet()) { + tag.putInt(entry.getKey(), entry.getValue()); } for (VERelationalTank relationalTank : getRelationalTanks()) { @@ -377,8 +378,8 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate } public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxReceive) { - if(tileEntity instanceof VETileEntity tile && tile.energy != null) { - return tile.energy.receiveEnergy(maxReceive,false); + if (tileEntity instanceof VETileEntity tile && tile.energy != null) { + return tile.energy.receiveEnergy(maxReceive, false); } return 0; } @@ -449,8 +450,8 @@ public LazyOptional getCapability(@Nonnull Capability cap, @Nullable D * Throws an error if missing the power consumeEnergy IMPL */ public void consumeEnergy() { - if(this.energy == null) return; - energy.consumeEnergy(this.consumptionMultiplier(energy.getConsumption(),energy.getUpgradeSlotId())); + if (this.energy == null) return; + energy.consumeEnergy(this.consumptionMultiplier(energy.getConsumption(), energy.getUpgradeSlotId())); } /** @@ -511,7 +512,7 @@ public boolean canConsumeEnergy() { } public @Nonnull ItemStack getStackInSlot(int slot) { - return this.getSlotManagers().get(slot).getItem(this.inventory); + return this.inventory.getStackInSlot(slot); } /** @@ -531,7 +532,8 @@ public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) { public int progressBurnCounterPX(int px) { int counter = dataMap.get("counter"); int length = dataMap.get("length"); - if (counter != 0 && length != 0) return (px * (((counter * 100) / length))) / 100;; + if (counter != 0 && length != 0) return (px * (((counter * 100) / length))) / 100; + ; return 0; } @@ -621,11 +623,11 @@ public boolean isRecipeDirty() { } public int getData(String key) { - return this.dataMap.getOrDefault(key,-1); + return this.dataMap.getOrDefault(key, -1); } public void setData(String key, int value) { - this.dataMap.put(key,value); + this.dataMap.put(key, value); } public void setRecipeDirty(boolean dirty) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java index 551c2568f..49243a4ef 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java @@ -1,6 +1,8 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory; +import com.veteam.voluminousenergy.blocks.tiles.handlers.AbstractItemStackValidator; +import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.processor.AbstractRecipeProcessor; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; @@ -16,6 +18,8 @@ import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.AABB; +import net.minecraft.world.phys.shapes.VoxelShape; import net.minecraftforge.fluids.capability.templates.FluidTank; import net.minecraftforge.registries.RegistryObject; import org.jetbrains.annotations.NotNull; @@ -32,8 +36,10 @@ public class VETileEntityFactory { private final RegistryObject> tileRegistry; private final VEContainerFactory containerFactory; private VEEnergyStorage storage; + private boolean infiniteRender = false; + private AbstractItemStackValidator validator = null; - private final HashMap dataMap = new HashMap<>(); + private final HashMap dataMap = new HashMap<>(); private AbstractRecipeProcessor processor; private boolean sendsOutPower = false; @@ -54,7 +60,25 @@ public AbstractContainerMenu createMenu(int id, @NotNull Inventory playerInvento this.markRecipeDirty(); return containerFactory.create(id, level, worldPosition, playerInventory, player); } + + @Override + public AABB getRenderBoundingBox() { + if (infiniteRender) { + return INFINITE_EXTENT_AABB; + } else { + AABB cbb = null; + try { + VoxelShape collisionShape = state.getCollisionShape(this.getLevel(), pos); + if (!collisionShape.isEmpty()) + cbb = collisionShape.bounds().move(pos); + } catch (Exception e) { + cbb = AABB.encapsulatingFullBlocks(pos.offset(-1, 0, -1), pos.offset(1, 1, 1)); + } + return cbb; + } + } }; + // Add our tanks and slots AtomicInteger index = new AtomicInteger(); newTile.addSlots(containerFactory.getTileSlotsAsManagers()); @@ -64,7 +88,8 @@ public AbstractContainerMenu createMenu(int id, @NotNull Inventory playerInvento newTile.dataMap.putAll(dataMap); // Set energy before the tilePos count otherwise we'll run into issues with the data tilePos - newTile.energy = storage.copy(); + if (storage != null) + newTile.energy = storage.copy(); //set processor newTile.recipeProcessor = processor; @@ -74,8 +99,14 @@ public AbstractContainerMenu createMenu(int id, @NotNull Inventory playerInvento // build out the inventory int inventorySize = containerFactory.getNumberOfSlots(); - storage.setUpgradeSlotId(containerFactory.upgradeSlotId()); - newTile.inventory = new VEItemStackHandler(newTile,inventorySize,storage.getUpgradeSlotId()); + if (storage == null) { + newTile.inventory = new VEItemStackHandler(newTile, inventorySize, -1); + } else { + storage.setUpgradeSlotId(containerFactory.upgradeSlotId()); + newTile.inventory = new VEItemStackHandler(newTile, inventorySize, storage.getUpgradeSlotId()); + } + + newTile.inventory.setValidator(validator); return newTile; } @@ -97,43 +128,34 @@ public VETileEntityFactory addEnergyStorage(int maxPower, int transferRate) { return this; } - public VETileEntityFactory addUpgradeSlot(int upgradeSlotId) { - - if (storage == null) - throw new IllegalStateException("Attempted to add upgrade tilePos without first adding energy storage!"); - - storage.setUpgradeSlotId(upgradeSlotId); - return this; - } - public VETileEntityFactory countable() { - this.dataMap.put("counter",0); - this.dataMap.put("length",0); + this.dataMap.put("counter", 0); + this.dataMap.put("length", 0); return this; } public VETileEntityFactory isMultiBlock() { - this.dataMap.put("multiblock_complete",0); + this.dataMap.put("multiblock_complete", 0); return this; } public VETileEntityFactory withDataFlag(String flag) { - this.dataMap.put(flag,0); + this.dataMap.put(flag, 0); return this; } public VETileEntityFactory includeSoundTick() { - this.dataMap.put("sound_tick",0); + this.dataMap.put("sound_tick", 0); return this; } - public VETileEntityFactory withTanks(TileTank... tanks) { + public VETileEntityFactory addTanks(TileTank... tanks) { this.tanks = List.of(tanks); return this; } public VETileEntityFactory makesSound() { - this.dataMap.put("sound_tick",0); + this.dataMap.put("sound_tick", 0); return this; } @@ -147,6 +169,16 @@ public VETileEntityFactory sendsOutPower() { return this; } + public VETileEntityFactory withInfiniteRender() { + infiniteRender = true; + return this; + } + + public VETileEntityFactory withCustomInventoryValidator(AbstractItemStackValidator validator) { + this.validator = validator; + return this; + } + public record ItemInputSlot(Direction direction) implements TileSlot { @Override public VESlotManager asManager(int id) { @@ -168,7 +200,7 @@ public VESlotManager asManager(int id) { } } - public record BucketInputSlot(Direction direction,int tankId) implements TileSlot { + public record BucketInputSlot(Direction direction, int tankId) implements TileSlot { @Override public VESlotManager asManager(int id) { return new VESlotManager(id, direction, true, SlotType.FLUID_INPUT, id + 1, tankId); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/AbstractItemStackValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/AbstractItemStackValidator.java new file mode 100644 index 000000000..259a4d23d --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/AbstractItemStackValidator.java @@ -0,0 +1,9 @@ +package com.veteam.voluminousenergy.blocks.tiles.handlers; + +import net.minecraft.world.item.ItemStack; + +public interface AbstractItemStackValidator { + + boolean isItemValid(int slot, ItemStack itemStack); + +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/DimensionalLaserInventoryValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/DimensionalLaserInventoryValidator.java new file mode 100644 index 000000000..2fee1baf1 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/DimensionalLaserInventoryValidator.java @@ -0,0 +1,26 @@ +package com.veteam.voluminousenergy.blocks.tiles.handlers; + +import com.veteam.voluminousenergy.items.tools.RFIDChip; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.world.item.BucketItem; +import net.minecraft.world.item.ItemStack; + +public class DimensionalLaserInventoryValidator implements AbstractItemStackValidator { + + @Override + public boolean isItemValid(int slot, ItemStack stack) { + if (slot == 2) { + if (!(stack.getItem() instanceof RFIDChip)) { + return false; + } + CompoundTag tag = stack.getOrCreateTag(); + if (!tag.contains("ve_x")) return false; + } + if (slot == 0 || slot == 1) { + if (!(stack.getItem() instanceof BucketItem)) { + return false; + } + } + return true; + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/VEItemStackHandler.java similarity index 79% rename from src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java rename to src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/VEItemStackHandler.java index 24f600904..572ce85a8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VEItemStackHandler.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/VEItemStackHandler.java @@ -1,6 +1,6 @@ -package com.veteam.voluminousenergy.blocks.tiles; +package com.veteam.voluminousenergy.blocks.tiles.handlers; -import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.SlotType; @@ -20,25 +20,30 @@ public class VEItemStackHandler extends ItemStackHandler { private final VETileEntity tileEntity; private final int upgradeSlotLocation; + private AbstractItemStackValidator validator; - public VEItemStackHandler(VETileEntity tileEntity,int slots) { + public VEItemStackHandler(VETileEntity tileEntity, int slots) { super(slots); this.tileEntity = tileEntity; upgradeSlotLocation = -1; } - public VEItemStackHandler(VETileEntity tileEntity,int slots,int upgradeSlotLocation) { + public VEItemStackHandler(VETileEntity tileEntity, int slots, int upgradeSlotLocation) { super(slots); this.tileEntity = tileEntity; this.upgradeSlotLocation = upgradeSlotLocation; } + public void setValidator(AbstractItemStackValidator validator) { + this.validator = validator; + } + @Override protected void onContentsChanged(int slot) { tileEntity.setChanged(); List managers = tileEntity.getSlotManagers(); - if(slot == upgradeSlotLocation) tileEntity.markRecipeDirty(); + if (slot == upgradeSlotLocation) tileEntity.markRecipeDirty(); else if (slot < managers.size()) { SlotType slotType = tileEntity.getSlotManagers().get(slot).getSlotType(); if (slotType == SlotType.INPUT) { @@ -51,12 +56,16 @@ else if (slot < managers.size()) { @Override public boolean isItemValid(int slot, @Nonnull ItemStack stack) { + // For simple custom validation. + if (validator != null) { + return validator.isItemValid(slot, stack); + } if (slot == upgradeSlotLocation) return TagUtil.isTaggedMachineUpgradeItem(stack); VESlotManager manager = tileEntity.getSlotManagers().get(slot); if (manager.getSlotType() == SlotType.FLUID_INPUT && stack.getItem() instanceof BucketItem bucketItem) { if (bucketItem.getFluid() == Fluids.EMPTY) return true; VERelationalTank tank = tileEntity.getRelationalTanks().get(manager.getTankId()); - if(tank.getTankType() == TankType.OUTPUT) { + if (tank.getTankType() == TankType.OUTPUT) { return bucketItem.getFluid().isSame(Fluids.EMPTY); } for (VERecipe recipe : tileEntity.getPotentialRecipes()) { @@ -66,7 +75,7 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { } } else if (manager.getSlotType() == SlotType.INPUT || manager.getSlotType() == SlotType.OUTPUT) { for (VERecipe recipe : tileEntity.getPotentialRecipes()) { - if(recipe.getParser().canInsertItem(slot,stack)) { + if (recipe.getParser().canInsertItem(slot, stack)) { return true; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/AluminumTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/AluminumTankTile.java index 34a011466..596b4104c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/AluminumTankTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/AluminumTankTile.java @@ -20,6 +20,6 @@ public AluminumTankTile(BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return new AluminumTankContainer(i,level,this.worldPosition,playerInventory,player); + return new AluminumTankContainer(i, level, this.worldPosition, playerInventory, player); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/EighzoTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/EighzoTankTile.java index d6b00bd0e..55ae5a3a8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/EighzoTankTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/EighzoTankTile.java @@ -20,6 +20,6 @@ public EighzoTankTile(BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return new EighzoTankContainer(i,level,this.worldPosition,playerInventory,player); + return new EighzoTankContainer(i, level, this.worldPosition, playerInventory, player); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NetheriteTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NetheriteTankTile.java index 41a8503c6..f94908827 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NetheriteTankTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NetheriteTankTile.java @@ -20,6 +20,6 @@ public NetheriteTankTile(BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return new NetheriteTankContainer(i,level,this.worldPosition,playerInventory,player); + return new NetheriteTankContainer(i, level, this.worldPosition, playerInventory, player); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NighaliteTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NighaliteTankTile.java index 2bbfdb628..95f37aae6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NighaliteTankTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NighaliteTankTile.java @@ -20,6 +20,6 @@ public NighaliteTankTile(BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return new NighaliteTankContainer(i,level,this.worldPosition,playerInventory,player); + return new NighaliteTankContainer(i, level, this.worldPosition, playerInventory, player); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/SolariumTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/SolariumTankTile.java index b07754ff3..990145643 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/SolariumTankTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/SolariumTankTile.java @@ -20,6 +20,6 @@ public SolariumTankTile(BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return new SolariumTankContainer(i,level,this.worldPosition,playerInventory,player); + return new SolariumTankContainer(i, level, this.worldPosition, playerInventory, player); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java index 8564218b6..e9ca4726f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java @@ -120,7 +120,7 @@ public boolean isItemValid(int slot, @Nonnull ItemStack stack) { //IS ITEM VALID @Nonnull @Override public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if(!isItemValid(slot,stack)) return stack; + if (!isItemValid(slot, stack)) return stack; return super.insertItem(slot, stack, simulate); } }; @@ -155,13 +155,14 @@ public int getTankCapacity() { } private LazyOptional multiFluidSlotWrapperLazyOptional = null; + @NotNull @Override public LazyOptional getCapability(@NotNull Capability cap, @Nullable Direction side) { - if(cap == ForgeCapabilities.FLUID_HANDLER) { - if(multiFluidSlotWrapperLazyOptional == null) { - multiFluidSlotWrapperLazyOptional = LazyOptional.of(() -> new MultiFluidSlotWrapper(getRelationalTanks(),this)); + if (cap == ForgeCapabilities.FLUID_HANDLER) { + if (multiFluidSlotWrapperLazyOptional == null) { + multiFluidSlotWrapperLazyOptional = LazyOptional.of(() -> new MultiFluidSlotWrapper(getRelationalTanks(), this)); } return multiFluidSlotWrapperLazyOptional.cast(); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TitaniumTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TitaniumTankTile.java index 104692bf6..4390f99a8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TitaniumTankTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TitaniumTankTile.java @@ -20,6 +20,6 @@ public TitaniumTankTile(BlockPos pos, BlockState state) { @Nullable @Override public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return new TitaniumTankContainer(i,level,this.worldPosition,playerInventory,player); + return new TitaniumTankContainer(i, level, this.worldPosition, playerInventory, player); } } diff --git a/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java b/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java index 6c9e5bd17..cb6779f5d 100644 --- a/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java +++ b/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java @@ -4,7 +4,6 @@ import com.mojang.blaze3d.vertex.VertexConsumer; import com.mojang.math.Axis; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.tiles.DimensionalLaserTile; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.sounds.VESounds; import net.minecraft.client.Minecraft; @@ -22,13 +21,10 @@ import net.minecraft.world.phys.Vec3; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import org.checkerframework.checker.nullness.qual.NonNull; import org.jetbrains.annotations.NotNull; import org.joml.Matrix3f; import org.joml.Matrix4f; -import javax.annotation.Nonnull; - @OnlyIn(Dist.CLIENT) public class LaserBlockEntityRenderer implements BlockEntityRenderer { @@ -52,14 +48,17 @@ public void render(VETileEntity dimensionalLaserTile, float f1, @NotNull PoseSta public void renderBeaconBeam(VETileEntity tile, PoseStack poseStack, MultiBufferSource multiBufferSource, float p_112188_, long gameTime, int totalHeight, int beaconListSize, float[] beaconColor, int height) { int buildTick = tile.getData("build_tick"); - boolean fullyBuilt = tile.getData("fully_built") == 1; - boolean firstStageBuilt = tile.getData("first_stage_built") == 1; + boolean fullyBuilt = buildTick == 1000; + boolean firstStageBuilt = buildTick >= 400; + + if (firstStageBuilt) buildTick -= 400; height += 2; - if (!fullyBuilt) { + if (!firstStageBuilt) { height = 1; - } else if (buildTick < 5) { + } + if (buildTick == 0) { SoundManager manager = Minecraft.getInstance().getSoundManager(); manager.stop(VESounds.ENERGY_BEAM_ACTIVATE.getLocation(), SoundSource.BLOCKS); } @@ -130,6 +129,16 @@ public void renderBeaconBeam(VETileEntity tile, PoseStack poseStack, MultiBuffer poseStack.popPose(); } + @Override + public boolean shouldRenderOffScreen(@NotNull VETileEntity veTileEntity) { + return true; + } + + @Override + public boolean shouldRender(@NotNull VETileEntity veTileEntity, @NotNull Vec3 vec3) { + return true; + } + private static final int[][] arrayMap = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java index b7c9d82f7..a608a98a7 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java @@ -184,11 +184,11 @@ public void registerGuiHandlers(IGuiHandlerRegistration registration) { @Override public void registerRecipeTransferHandlers(IRecipeTransferRegistration registration) { registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.CRUSHER_CONTAINER.get(), CrushingCategory.RECIPE_TYPE, 0, 1, VEContainers.CRUSHER_FACTORY.getNumberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.ELECTROLYZER_CONTAINER.get(), ElectrolyzingCategory.RECIPE_TYPE, 0, 2, VEContainers.ELECTROLYZER_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.ELECTROLYZER_CONTAINER.get(), ElectrolyzingCategory.RECIPE_TYPE, 0, 2, VEContainers.ELECTROLYZER_FACTORY.getNumberOfSlots(), 36); registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.COMPRESSOR_CONTAINER.get(), CompressingCategory.RECIPE_TYPE, 0, 1, VEContainers.COMPRESSOR_FACTORY.getNumberOfSlots(), 36); registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.PRIMITIVE_STIRLING_GENERATOR_CONTAINER.get(), StirlingCategory.RECIPE_TYPE, 0, 1, VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY.getNumberOfSlots(), 36); registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.STIRLING_GENERATOR_CONTAINER.get(), StirlingCategory.RECIPE_TYPE, 0, 1, VEContainers.STIRLING_GENERATOR_FACTORY.getNumberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.AQUEOULIZER_CONTAINER.get(), AqueoulizingCategory.RECIPE_TYPE, 3, 2, VEContainers.AQUEOULIZER_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.AQUEOULIZER_CONTAINER.get(), AqueoulizingCategory.RECIPE_TYPE, 3, 2, VEContainers.AQUEOULIZER_FACTORY.getNumberOfSlots(), 36); registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.CENTRIFUGAL_SEPARATOR_CONTAINER.get(), CentrifugalSeparationCategory.RECIPE_TYPE, 0, 2, VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY.getNumberOfSlots(), 36); registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.IMPLOSION_COMPRESSOR_CONTAINER.get(), ImplosionCompressionCategory.RECIPE_TYPE, 0, 2, VEContainers.IMPLOSION_COMPRESSOR_FACTORY.getNumberOfSlots(), 36); registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.BLAST_FURNACE_CONTAINER.get(), IndustrialBlastingCategory.RECIPE_TYPE, 2, 3, VEContainers.BLAST_FURNACE_FACTORY.getNumberOfSlots(), 36); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/AqueoulizingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/AqueoulizingCategory.java index 1c0a91bb9..1724f2108 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/AqueoulizingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/AqueoulizingCategory.java @@ -37,19 +37,19 @@ public class AqueoulizingCategory implements IRecipeCategory private final IDrawable emptyArrow; public static final RecipeType RECIPE_TYPE = new RecipeType<>(VoluminousEnergyPlugin.AQUEOULIZING_UID, AqueoulizerRecipe.class); - public AqueoulizingCategory(IGuiHelper guiHelper){ + public AqueoulizingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 90, 40).build(); icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.AQUEOULIZER_BLOCK.get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); - emptyArrow = guiHelper.drawableBuilder(GUI,199,0,23,17) + emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17) .buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -70,19 +70,18 @@ public AqueoulizingCategory(IGuiHelper guiHelper){ @Override public void draw(AqueoulizerRecipe recipe, @NotNull IRecipeSlotsView recipeSlotsView, @NotNull GuiGraphics matrixStack, double mouseX, double mouseY) { - arrow.draw(matrixStack,48, 12); - emptyArrow.draw(matrixStack,48,12); - slotDrawable.draw(matrixStack,2,10); - slotDrawable.draw(matrixStack,24,10); - slotDrawable.draw(matrixStack,72,10); - - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("mB:"), 2, 32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(recipe.getFluidIngredientAmount(0) + ""), 24, 32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(recipe.getOutputFluids().get(0).getAmount() + ""), 72, 32, VEContainerScreen.GREY_TEXT_STYLE); + arrow.draw(matrixStack, 48, 12); + emptyArrow.draw(matrixStack, 48, 12); + slotDrawable.draw(matrixStack, 2, 10); + slotDrawable.draw(matrixStack, 24, 10); + slotDrawable.draw(matrixStack, 72, 10); + + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("mB:"), 2, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(recipe.getFluidIngredientAmount(0) + ""), 24, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(recipe.getOutputFluids().get(0).getAmount() + ""), 72, 32, VEContainerScreen.GREY_TEXT_STYLE); } - // NOTE: Needs to be recipe specific; refactoring of setIngredients, which is no longer used public void ingredientHandler(AqueoulizerRecipe recipe, IIngredientAcceptor itemInputAcceptor, diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalAgitationCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalAgitationCategory.java index e953baf3f..6b609e1a5 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalAgitationCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalAgitationCategory.java @@ -36,18 +36,18 @@ public class CentrifugalAgitationCategory implements IRecipeCategory 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 90, 40).build(); icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); - emptyArrow = guiHelper.drawableBuilder(GUI,199,0,23,17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); + emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -68,16 +68,16 @@ public CentrifugalAgitationCategory(IGuiHelper guiHelper){ @Override public void draw(CentrifugalAgitatorRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics matrixStack, double mouseX, double mouseY) { - arrow.draw(matrixStack,24, 12); - emptyArrow.draw(matrixStack,24,12); - slotDrawable.draw(matrixStack,2,10); - slotDrawable.draw(matrixStack,48,10); - slotDrawable.draw(matrixStack,72,10); - - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("mB:"), -20, 32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(recipe.getFluidIngredientAmount(0) + ""), 2, 32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(recipe.getOutputFluids().get(0).getAmount() + ""), 48, 32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(recipe.getOutputFluids().get(1).getAmount() + ""), 72, 32, VEContainerScreen.GREY_TEXT_STYLE); + arrow.draw(matrixStack, 24, 12); + emptyArrow.draw(matrixStack, 24, 12); + slotDrawable.draw(matrixStack, 2, 10); + slotDrawable.draw(matrixStack, 48, 10); + slotDrawable.draw(matrixStack, 72, 10); + + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("mB:"), -20, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(recipe.getFluidIngredientAmount(0) + ""), 2, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(recipe.getOutputFluids().get(0).getAmount() + ""), 48, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(recipe.getOutputFluids().get(1).getAmount() + ""), 72, 32, VEContainerScreen.GREY_TEXT_STYLE); } public void ingredientHandler(CentrifugalAgitatorRecipe recipe, diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalSeparationCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalSeparationCategory.java index de3f38e55..09fbc409f 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalSeparationCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalSeparationCategory.java @@ -38,19 +38,19 @@ public class CentrifugalSeparationCategory implements IRecipeCategory 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 52, 5, 120, 78).build(); icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); - emptyArrow = guiHelper.drawableBuilder(GUI,199,0,23,17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); + emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -71,43 +71,43 @@ public CentrifugalSeparationCategory(IGuiHelper guiHelper){ @Override public void draw(CentrifugalSeparatorRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics matrixStack, double mouseX, double mouseY) { - arrow.draw(matrixStack,25, 30); - emptyArrow.draw(matrixStack,25,30); - slotDrawable.draw(matrixStack,5,20); // Input - slotDrawable.draw(matrixStack,5,38); // Bucket - slotDrawable.draw(matrixStack,49,2); // First Output - slotDrawable.draw(matrixStack,49,20); // First RNG - slotDrawable.draw(matrixStack,49,38); // Second RNG - slotDrawable.draw(matrixStack,49,56); // Third RNG - - if (recipe.getResult(1) != null && recipe.getResult(1).getItem() != Items.AIR){ - int chance = (int)(recipe.getOutputChance(1) * 100); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(chance + "%"), 74, 26, VEContainerScreen.GREY_TEXT_STYLE); + arrow.draw(matrixStack, 25, 30); + emptyArrow.draw(matrixStack, 25, 30); + slotDrawable.draw(matrixStack, 5, 20); // Input + slotDrawable.draw(matrixStack, 5, 38); // Bucket + slotDrawable.draw(matrixStack, 49, 2); // First Output + slotDrawable.draw(matrixStack, 49, 20); // First RNG + slotDrawable.draw(matrixStack, 49, 38); // Second RNG + slotDrawable.draw(matrixStack, 49, 56); // Third RNG + + if (recipe.getResult(1) != null && recipe.getResult(1).getItem() != Items.AIR) { + int chance = (int) (recipe.getOutputChance(1) * 100); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(chance + "%"), 74, 26, VEContainerScreen.GREY_TEXT_STYLE); } - if (recipe.getResult(2) != null && recipe.getResult(2).getItem() != Items.AIR){ - int chance = (int)(recipe.getOutputChance(2) * 100); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(chance + "%"), 74, 44, VEContainerScreen.GREY_TEXT_STYLE); + if (recipe.getResult(2) != null && recipe.getResult(2).getItem() != Items.AIR) { + int chance = (int) (recipe.getOutputChance(2) * 100); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(chance + "%"), 74, 44, VEContainerScreen.GREY_TEXT_STYLE); } - if (recipe.getResult(3) != null && recipe.getResult(3).getItem() != Items.AIR){ - int chance = (int)(recipe.getOutputChance(3) * 100); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(chance + "%"), 74, 62, VEContainerScreen.GREY_TEXT_STYLE); + if (recipe.getResult(3) != null && recipe.getResult(3).getItem() != Items.AIR) { + int chance = (int) (recipe.getOutputChance(3) * 100); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(chance + "%"), 74, 62, VEContainerScreen.GREY_TEXT_STYLE); } } public void ingredientHandler(CentrifugalSeparatorRecipe recipe, - IIngredientAcceptor itemInputAcceptor, - IIngredientAcceptor bucketInputAcceptor, - IIngredientAcceptor primaryOutputAcceptor, - IIngredientAcceptor rng0OutputAcceptor, - IIngredientAcceptor rng1OutputAcceptor, - IIngredientAcceptor rng2OutputAcceptor) { + IIngredientAcceptor itemInputAcceptor, + IIngredientAcceptor bucketInputAcceptor, + IIngredientAcceptor primaryOutputAcceptor, + IIngredientAcceptor rng0OutputAcceptor, + IIngredientAcceptor rng1OutputAcceptor, + IIngredientAcceptor rng2OutputAcceptor) { // Input ArrayList inputStacks = new ArrayList<>(); - for (ItemStack itemStack : recipe.getIngredient(0).getItems()){ + for (ItemStack itemStack : recipe.getIngredient(0).getItems()) { itemStack.setCount(recipe.getIngredientCount(0)); inputStacks.add(itemStack); } @@ -115,12 +115,11 @@ public void ingredientHandler(CentrifugalSeparatorRecipe recipe, itemInputAcceptor.addIngredients(VanillaTypes.ITEM_STACK, inputStacks); - - if (!recipe.getIngredient(1).isEmpty()){ + if (!recipe.getIngredient(1).isEmpty()) { ItemStack[] buckets = recipe.getIngredient(1).getItems(); bucketInputAcceptor.addIngredients(VanillaTypes.ITEM_STACK, Arrays.stream(buckets).toList()); } else { - bucketInputAcceptor.addIngredients(VanillaTypes.ITEM_STACK, Collections.singletonList(new ItemStack(Items.AIR,1))); + bucketInputAcceptor.addIngredients(VanillaTypes.ITEM_STACK, Collections.singletonList(new ItemStack(Items.AIR, 1))); } // Output --> ItemStacks here are not guaranteed to have correct amount; must do so manually @@ -144,11 +143,11 @@ public void ingredientHandler(CentrifugalSeparatorRecipe recipe, @Override public void setRecipe(IRecipeLayoutBuilder recipeLayout, CentrifugalSeparatorRecipe recipe, IFocusGroup focusGroup) { // Inputs - IRecipeSlotBuilder itemInput = recipeLayout.addSlot(RecipeIngredientRole.INPUT,6,21); - IRecipeSlotBuilder bucketInput = recipeLayout.addSlot(RecipeIngredientRole.INPUT,6, 39); + IRecipeSlotBuilder itemInput = recipeLayout.addSlot(RecipeIngredientRole.INPUT, 6, 21); + IRecipeSlotBuilder bucketInput = recipeLayout.addSlot(RecipeIngredientRole.INPUT, 6, 39); // Outputs - IRecipeSlotBuilder firstOutput = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 50,3); + IRecipeSlotBuilder firstOutput = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 50, 3); IRecipeSlotBuilder secondOutput = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 50, 21); // RNG 1 IRecipeSlotBuilder thirdOutput = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 50, 39); // RNG 2 IRecipeSlotBuilder fourthOutput = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 50, 57); // RNG 3 diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java index 40d90943c..900ee6f76 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java @@ -2,11 +2,8 @@ import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.screens.VEContainerScreen; import com.veteam.voluminousenergy.compat.jei.VoluminousEnergyPlugin; import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.util.NumberUtil; import com.veteam.voluminousenergy.util.TextUtil; import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.forge.ForgeTypes; @@ -20,7 +17,6 @@ import mezz.jei.api.recipe.RecipeIngredientRole; import mezz.jei.api.recipe.RecipeType; import mezz.jei.api.recipe.category.IRecipeCategory; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; @@ -31,7 +27,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.Optional; public class CombustionCategory implements IRecipeCategory { @@ -40,7 +35,7 @@ public class CombustionCategory implements IRecipeCategory 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/combustion_generator.png"); background = guiHelper.drawableBuilder(GUI, 52, 5, 120, 64).build(); @@ -49,7 +44,7 @@ public CombustionCategory(IGuiHelper guiHelper){ } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -69,7 +64,7 @@ public CombustionCategory(IGuiHelper guiHelper){ } @Override - public void draw(CombustionGeneratorRecipe recipe, IRecipeSlotsView slotsView, @NotNull GuiGraphics matrixStack, double mouseX, double mouseY){ + public void draw(CombustionGeneratorRecipe recipe, IRecipeSlotsView slotsView, @NotNull GuiGraphics matrixStack, double mouseX, double mouseY) { // // // Volumetric Energy label // TextUtil.renderShadowedText( diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CompressingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CompressingCategory.java index 8f516661a..a5ddef813 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CompressingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CompressingCategory.java @@ -34,18 +34,18 @@ public class CompressingCategory implements IRecipeCategory { private IDrawable emptyArrow; public static final RecipeType RECIPE_TYPE = new RecipeType(VoluminousEnergyPlugin.COMPRESSING_UID, CompressorRecipe.class); - public CompressingCategory(IGuiHelper guiHelper){ + public CompressingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 70, 40).build(); icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.COMPRESSOR_BLOCK.get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); - emptyArrow = guiHelper.drawableBuilder(GUI,199,0,23,17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); + emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -66,10 +66,10 @@ public IDrawable getIcon() { @Override public void draw(CompressorRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics matrixStack, double mouseX, double mouseY) { - arrow.draw(matrixStack,24, 12); - emptyArrow.draw(matrixStack,24,12); - slotDrawable.draw(matrixStack,2,10); - slotDrawable.draw(matrixStack,48,10); + arrow.draw(matrixStack, 24, 12); + emptyArrow.draw(matrixStack, 24, 12); + slotDrawable.draw(matrixStack, 2, 10); + slotDrawable.draw(matrixStack, 48, 10); } public void ingredientHandler(CompressorRecipe recipe, @@ -78,7 +78,7 @@ public void ingredientHandler(CompressorRecipe recipe, // Input ArrayList inputStacks = new ArrayList<>(); - for (ItemStack itemStack : recipe.getIngredient(0).getItems()){ + for (ItemStack itemStack : recipe.getIngredient(0).getItems()) { itemStack.setCount(recipe.getIngredientCount(0)); inputStacks.add(itemStack); } diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CrushingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CrushingCategory.java index c4d9d021c..5841fcd91 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CrushingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CrushingCategory.java @@ -36,7 +36,7 @@ public class CrushingCategory implements IRecipeCategory { private final IDrawable arrow; public static final RecipeType RECIPE_TYPE = new RecipeType<>(VoluminousEnergyPlugin.CRUSHING_UID, CrusherRecipe.class); - public CrushingCategory(IGuiHelper guiHelper){ + public CrushingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance background = guiHelper.drawableBuilder(CrusherScreen.getGUI(), 68, 12, 40, 70).build(); icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.CRUSHER_BLOCK.get())); @@ -45,7 +45,7 @@ public CrushingCategory(IGuiHelper guiHelper){ } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -66,18 +66,18 @@ public CrushingCategory(IGuiHelper guiHelper){ @Override public void draw(CrusherRecipe recipe, @NotNull IRecipeSlotsView recipeSlotsView, @NotNull GuiGraphics matrixStack, double mouseX, double mouseY) { - arrow.draw(matrixStack,10, 19); + arrow.draw(matrixStack, 10, 19); - if (recipe.getResult(1) != null && recipe.getResult(1).getItem() != Items.AIR){ // Check RNG if it's not air - int chance = (int)(recipe.getOutputChance(1) * 100); + if (recipe.getResult(1) != null && recipe.getResult(1).getItem() != Items.AIR) { // Check RNG if it's not air + int chance = (int) (recipe.getOutputChance(1) * 100); int xPos = 20; - if (chance < 100 && chance >= 10){ + if (chance < 100 && chance >= 10) { xPos += 3; - } else if (chance < 10){ + } else if (chance < 10) { xPos += 5; } - TextUtil.renderUnshadowedText(matrixStack,Minecraft.getInstance().font, Component.nullToEmpty(chance + "%"), xPos,65, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(chance + "%"), xPos, 65, VEContainerScreen.GREY_TEXT_STYLE); } } @@ -88,7 +88,7 @@ public void ingredientHandler(CrusherRecipe recipe, IIngredientAcceptor itemRNGOutputAcceptor) { // Input ArrayList inputStacks = new ArrayList<>(); - for (ItemStack itemStack : recipe.getIngredient(0).getItems()){ + for (ItemStack itemStack : recipe.getIngredient(0).getItems()) { itemStack.setCount(recipe.getIngredientCount(0)); inputStacks.add(itemStack); } @@ -111,7 +111,7 @@ public void setRecipe(IRecipeLayoutBuilder recipeLayout, @NotNull CrusherRecipe // Output IRecipeSlotBuilder primaryItemOutput = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 3, 46); - IRecipeSlotBuilder rngItemOutput = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 21, 46); + IRecipeSlotBuilder rngItemOutput = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 21, 46); itemInput.setSlotName(TextUtil.TRANSLATED_INPUT_SLOT.getString()); primaryItemOutput.setSlotName(TextUtil.TRANSLATED_OUTPUT_SLOT.getString()); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DimensionalLasingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DimensionalLasingCategory.java index 8d04443a1..81c4a3f79 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DimensionalLasingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DimensionalLasingCategory.java @@ -43,11 +43,11 @@ public DimensionalLasingCategory(IGuiHelper guiHelper) { icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.DIMENSIONAL_LASER_BLOCK.get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(dimensionalLaserGUI, 97, 34, 15, 16).build(); - emptyArrow = guiHelper.drawableBuilder(dimensionalLaserGUI,176,0,15,17).buildAnimated(200, IDrawableAnimated.StartDirection.TOP, false); + emptyArrow = guiHelper.drawableBuilder(dimensionalLaserGUI, 176, 0, 15, 17).buildAnimated(200, IDrawableAnimated.StartDirection.TOP, false); } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -68,30 +68,30 @@ public DimensionalLasingCategory(IGuiHelper guiHelper) { @Override public void draw(DimensionalLaserRecipe recipe, @NotNull IRecipeSlotsView recipeSlotsView, @NotNull GuiGraphics matrixStack, double mouseX, double mouseY) { - arrow.draw(matrixStack,9, 4); - emptyArrow.draw(matrixStack,9,4); - slotDrawable.draw(matrixStack,8,22); + arrow.draw(matrixStack, 9, 4); + emptyArrow.draw(matrixStack, 9, 4); + slotDrawable.draw(matrixStack, 8, 22); int xPos = 36; TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("C: " - + recipe.getFluidClimateSpawn().getContinentalnessClimateParameter().getA() - + " ~ " - + recipe.getFluidClimateSpawn().getContinentalnessClimateParameter().getB() - ), xPos, -1, VEContainerScreen.GREY_TEXT_STYLE + + recipe.getFluidClimateSpawn().getContinentalnessClimateParameter().getA() + + " ~ " + + recipe.getFluidClimateSpawn().getContinentalnessClimateParameter().getB() + ), xPos, -1, VEContainerScreen.GREY_TEXT_STYLE ); TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("E: " + recipe.getFluidClimateSpawn().getErosionClimateParameter().getA() + " ~ " + recipe.getFluidClimateSpawn().getErosionClimateParameter().getB() - ), xPos, 9, VEContainerScreen.GREY_TEXT_STYLE + ), xPos, 9, VEContainerScreen.GREY_TEXT_STYLE ); TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("H: " + recipe.getFluidClimateSpawn().getHumidityClimateParameter().getA() + " ~ " + recipe.getFluidClimateSpawn().getHumidityClimateParameter().getB() - ), xPos, 19, VEContainerScreen.GREY_TEXT_STYLE + ), xPos, 19, VEContainerScreen.GREY_TEXT_STYLE ); @@ -99,7 +99,7 @@ public void draw(DimensionalLaserRecipe recipe, @NotNull IRecipeSlotsView recipe + recipe.getFluidClimateSpawn().getTemperatureClimateParameter().getA() + " ~ " + recipe.getFluidClimateSpawn().getTemperatureClimateParameter().getB() - ), xPos, 29, VEContainerScreen.GREY_TEXT_STYLE + ), xPos, 29, VEContainerScreen.GREY_TEXT_STYLE ); } diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DistillingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DistillingCategory.java index dc7561108..b11cae0a1 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DistillingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DistillingCategory.java @@ -36,18 +36,18 @@ public class DistillingCategory implements IRecipeCategory { private IDrawable emptyArrow; public static final RecipeType RECIPE_TYPE = new RecipeType(VoluminousEnergyPlugin.DISTILLING_UID, DistillationRecipe.class); - public DistillingCategory(IGuiHelper guiHelper){ + public DistillingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 42, 5, 128, 40).build(); icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.DISTILLATION_UNIT_BLOCK.get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); - emptyArrow = guiHelper.drawableBuilder(GUI,199,0,23,17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); + emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -68,18 +68,18 @@ public DistillingCategory(IGuiHelper guiHelper){ @Override public void draw(DistillationRecipe recipe, @NotNull IRecipeSlotsView recipeSlotsView, @NotNull GuiGraphics matrixStack, double mouseX, double mouseY) { - arrow.draw(matrixStack,24, 12); - emptyArrow.draw(matrixStack,24,12); - slotDrawable.draw(matrixStack,2,10); - slotDrawable.draw(matrixStack,48,10); - slotDrawable.draw(matrixStack,72,10); - slotDrawable.draw(matrixStack,96,10); - - TextUtil.renderUnshadowedText(matrixStack,Minecraft.getInstance().font, "mB:", -20,32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack,Minecraft.getInstance().font,recipe.getFluidIngredientAmount(0) + "", 2, 32,VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack,Minecraft.getInstance().font,recipe.getOutputFluid(0).getAmount() + "", 48, 32,VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack,Minecraft.getInstance().font,recipe.getOutputFluid(1).getAmount() + "", 72, 32,VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack,Minecraft.getInstance().font, (int)(recipe.getOutputChance(0)*100) + "%", 96, 32,VEContainerScreen.GREY_TEXT_STYLE); + arrow.draw(matrixStack, 24, 12); + emptyArrow.draw(matrixStack, 24, 12); + slotDrawable.draw(matrixStack, 2, 10); + slotDrawable.draw(matrixStack, 48, 10); + slotDrawable.draw(matrixStack, 72, 10); + slotDrawable.draw(matrixStack, 96, 10); + + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, "mB:", -20, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getFluidIngredientAmount(0) + "", 2, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getOutputFluid(0).getAmount() + "", 48, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getOutputFluid(1).getAmount() + "", 72, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, (int) (recipe.getOutputChance(0) * 100) + "%", 96, 32, VEContainerScreen.GREY_TEXT_STYLE); } public void ingredientHandler(DistillationRecipe recipe, @@ -97,7 +97,7 @@ public void ingredientHandler(DistillationRecipe recipe, ItemStack itemStackResult = recipe.getResult(0).copy(); itemStackResult.setCount(recipe.getResult(0).getCount()); - itemOutputAcceptor.addIngredient(VanillaTypes.ITEM_STACK,itemStackResult); + itemOutputAcceptor.addIngredient(VanillaTypes.ITEM_STACK, itemStackResult); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidElectrolyzingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidElectrolyzingCategory.java index cc9f02080..aea57c759 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidElectrolyzingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidElectrolyzingCategory.java @@ -74,10 +74,10 @@ public void draw(FluidElectrolyzerRecipe recipe, @NotNull IRecipeSlotsView recip slotDrawable.draw(matrixStack, 48, 10); slotDrawable.draw(matrixStack, 72, 10); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, "mB:", -20, 32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getFluidIngredientAmount(0) + "", 2, 32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getOutputFluid(0).getAmount() + "", 48, 32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getOutputFluid(1).getAmount() + "", 72, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, "mB:", -20, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getFluidIngredientAmount(0) + "", 2, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getOutputFluid(0).getAmount() + "", 48, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getOutputFluid(1).getAmount() + "", 72, 32, VEContainerScreen.GREY_TEXT_STYLE); } public void ingredientHandler(FluidElectrolyzerRecipe recipe, diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidMixingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidMixingCategory.java index 13f236079..8dbaead9d 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidMixingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidMixingCategory.java @@ -74,10 +74,10 @@ public void draw(FluidMixerRecipe recipe, @NotNull IRecipeSlotsView recipeSlotsV slotDrawable.draw(matrixStack, 24, 10); slotDrawable.draw(matrixStack, 72, 10); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, "mB:", -20, 32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getFluidIngredientAmount(0) + "", 2, 32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getFluidIngredientAmount(1) + "", 24, 32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getOutputFluid(0).getAmount() + "", 72, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, "mB:", -20, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getFluidIngredientAmount(0) + "", 2, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getFluidIngredientAmount(1) + "", 24, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getOutputFluid(0).getAmount() + "", 72, 32, VEContainerScreen.GREY_TEXT_STYLE); } public void ingredientHandler(FluidMixerRecipe recipe, diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/HydroponicIncubatorCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/HydroponicIncubatorCategory.java index 7f8b3e366..cbfd24f7f 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/HydroponicIncubatorCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/HydroponicIncubatorCategory.java @@ -35,20 +35,20 @@ public class HydroponicIncubatorCategory implements IRecipeCategory 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 4, 4, 156, 40).build(); icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); - emptyArrow = guiHelper.drawableBuilder(GUI,199,0,23,17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); + emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -69,37 +69,37 @@ public HydroponicIncubatorCategory(IGuiHelper guiHelper){ @Override public void draw(HydroponicIncubatorRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics matrixStack, double mouseX, double mouseY) { - arrow.draw(matrixStack,48, 12); - emptyArrow.draw(matrixStack,48,12); - slotDrawable.draw(matrixStack,2,10); - slotDrawable.draw(matrixStack,24,10); - slotDrawable.draw(matrixStack,72,10); // Primary Output - slotDrawable.draw(matrixStack,94,10); // RNG0 output - slotDrawable.draw(matrixStack,116,10); // RNG1 output - slotDrawable.draw(matrixStack,138,10); // RNG2 output - - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, "mB:", 2, 32, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getFluidIngredientAmount(0) + "", 24, 32,VEContainerScreen.GREY_TEXT_STYLE); + arrow.draw(matrixStack, 48, 12); + emptyArrow.draw(matrixStack, 48, 12); + slotDrawable.draw(matrixStack, 2, 10); + slotDrawable.draw(matrixStack, 24, 10); + slotDrawable.draw(matrixStack, 72, 10); // Primary Output + slotDrawable.draw(matrixStack, 94, 10); // RNG0 output + slotDrawable.draw(matrixStack, 116, 10); // RNG1 output + slotDrawable.draw(matrixStack, 138, 10); // RNG2 output + + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, "mB:", 2, 32, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getFluidIngredientAmount(0) + "", 24, 32, VEContainerScreen.GREY_TEXT_STYLE); if (recipe.getOutputChance(1) > 0 && recipe.getResult(1).getItem() != Items.AIR) { - int chance = (int) (recipe.getOutputChance(1)*100); + int chance = (int) (recipe.getOutputChance(1) * 100); int xPos = calculateXPos(94, chance); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, chance + "%", xPos, 32,VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, chance + "%", xPos, 32, VEContainerScreen.GREY_TEXT_STYLE); } if (recipe.getOutputChance(2) > 0 && recipe.getResult(2).getItem() != Items.AIR) { - int chance = (int) (recipe.getOutputChance(2)*100); + int chance = (int) (recipe.getOutputChance(2) * 100); int xPos = calculateXPos(116, chance); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, chance + "%", xPos, 32,VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, chance + "%", xPos, 32, VEContainerScreen.GREY_TEXT_STYLE); } if (recipe.getOutputChance(3) > 0 && recipe.getResult(3).getItem() != Items.AIR) { - int chance = (int) (recipe.getOutputChance(3)*100); + int chance = (int) (recipe.getOutputChance(3) * 100); int xPos = calculateXPos(138, chance); - TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, chance + "%", xPos, 32,VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, chance + "%", xPos, 32, VEContainerScreen.GREY_TEXT_STYLE); } } diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ImplosionCompressionCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ImplosionCompressionCategory.java index 8c0aabf20..ea7750732 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ImplosionCompressionCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ImplosionCompressionCategory.java @@ -35,18 +35,18 @@ public class ImplosionCompressionCategory implements IRecipeCategory 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 70, 40).build(); icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); - emptyArrow = guiHelper.drawableBuilder(GUI,199,0,23,17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); + emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -67,11 +67,11 @@ public IDrawable getIcon() { @Override public void draw(ImplosionCompressorRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics matrixStack, double mouseX, double mouseY) { - arrow.draw(matrixStack,24, 12); - emptyArrow.draw(matrixStack,24,12); - slotDrawable.draw(matrixStack,2,1); - slotDrawable.draw(matrixStack,2,19); - slotDrawable.draw(matrixStack,48,10); + arrow.draw(matrixStack, 24, 12); + emptyArrow.draw(matrixStack, 24, 12); + slotDrawable.draw(matrixStack, 2, 1); + slotDrawable.draw(matrixStack, 2, 19); + slotDrawable.draw(matrixStack, 48, 10); } public void ingredientHandler(ImplosionCompressorRecipe recipe, @@ -80,7 +80,7 @@ public void ingredientHandler(ImplosionCompressorRecipe recipe, IIngredientAcceptor itemOutputAcceptor) { // Input ArrayList inputStacks = new ArrayList<>(); - for (ItemStack itemStack : recipe.getIngredient(0).getItems()){ + for (ItemStack itemStack : recipe.getIngredient(0).getItems()) { itemStack.setCount(recipe.getIngredientCount(0)); inputStacks.add(itemStack); } diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/IndustrialBlastingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/IndustrialBlastingCategory.java index a9e663b40..943a70727 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/IndustrialBlastingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/IndustrialBlastingCategory.java @@ -41,18 +41,18 @@ public class IndustrialBlastingCategory implements IRecipeCategory 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 42, 5, 120, 60).build(); icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.BLAST_FURNACE_BLOCK.get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); // 176, 0, 23, 17 - emptyArrow = guiHelper.drawableBuilder(GUI,199,0,23,17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); // 199,0,23,17 + emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); // 199,0,23,17 } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -73,17 +73,17 @@ public IndustrialBlastingCategory(IGuiHelper guiHelper){ @Override public void draw(IndustrialBlastingRecipe recipe, @NotNull IRecipeSlotsView recipeSlotsView, @NotNull GuiGraphics matrixStack, double mouseX, double mouseY) { - arrow.draw(matrixStack,54, 12); // 24, 12 - emptyArrow.draw(matrixStack,54,12); // 24, 12 - slotDrawable.draw(matrixStack,30,1); // 2, 1 - slotDrawable.draw(matrixStack,30,19); // 2, 19 - slotDrawable.draw(matrixStack,78,10); // 48, 10 - slotDrawable.draw(matrixStack,5,10); + arrow.draw(matrixStack, 54, 12); // 24, 12 + emptyArrow.draw(matrixStack, 54, 12); // 24, 12 + slotDrawable.draw(matrixStack, 30, 1); // 2, 1 + slotDrawable.draw(matrixStack, 30, 19); // 2, 19 + slotDrawable.draw(matrixStack, 78, 10); // 48, 10 + slotDrawable.draw(matrixStack, 5, 10); TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getMinimumHeat() + " K (" + (recipe.getMinimumHeat() - 273) + " \u00B0C; " + - ((int) ((recipe.getMinimumHeat()-273) * 1.8)+32) + " \u00B0F)", - 1,45, VEContainerScreen.GREY_TEXT_STYLE); + ((int) ((recipe.getMinimumHeat() - 273) * 1.8) + 32) + " \u00B0F)", + 1, 45, VEContainerScreen.GREY_TEXT_STYLE); } public void ingredientHandler(IndustrialBlastingRecipe recipe, diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/PrimitiveBlastingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/PrimitiveBlastingCategory.java index b68c2a0c3..24cedda57 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/PrimitiveBlastingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/PrimitiveBlastingCategory.java @@ -35,18 +35,18 @@ public class PrimitiveBlastingCategory implements IRecipeCategory 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 70, 40).build(); icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); - emptyArrow = guiHelper.drawableBuilder(GUI,199,0,23,17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); + emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -67,10 +67,10 @@ public IDrawable getIcon() { @Override public void draw(PrimitiveBlastFurnaceRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics matrixStack, double mouseX, double mouseY) { - arrow.draw(matrixStack,24, 12); - emptyArrow.draw(matrixStack,24,12); - slotDrawable.draw(matrixStack,2,10); - slotDrawable.draw(matrixStack,48,10); + arrow.draw(matrixStack, 24, 12); + emptyArrow.draw(matrixStack, 24, 12); + slotDrawable.draw(matrixStack, 2, 10); + slotDrawable.draw(matrixStack, 48, 10); } public void ingredientHandler(PrimitiveBlastFurnaceRecipe recipe, diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/SawmillCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/SawmillCategory.java index 3cfb2befe..06530d86d 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/SawmillCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/SawmillCategory.java @@ -45,18 +45,18 @@ public class SawmillCategory implements IRecipeCategory { //protected static ArrayList> logPlankPairList = new ArrayList<>(); - public SawmillCategory(IGuiHelper guiHelper){ + public SawmillCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 86, 40).build(); icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.SAWMILL_BLOCK.get())); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); - emptyArrow = guiHelper.drawableBuilder(GUI,199,0,23,17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); + emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); slotDrawable = guiHelper.getSlotDrawable(); } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -77,12 +77,12 @@ public IDrawable getIcon() { @Override public void draw(VEFluidSawmillRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics matrixStack, double mouseX, double mouseY) { - slotDrawable.draw(matrixStack,2,10); - slotDrawable.draw(matrixStack,48,1); - slotDrawable.draw(matrixStack,48,19); - slotDrawable.draw(matrixStack,66,9); - arrow.draw(matrixStack,24, 11); - emptyArrow.draw(matrixStack,24,11); + slotDrawable.draw(matrixStack, 2, 10); + slotDrawable.draw(matrixStack, 48, 1); + slotDrawable.draw(matrixStack, 48, 19); + slotDrawable.draw(matrixStack, 66, 9); + arrow.draw(matrixStack, 24, 11); + emptyArrow.draw(matrixStack, 24, 11); } public void ingredientHandler(VEFluidSawmillRecipe recipe, @@ -90,14 +90,14 @@ public void ingredientHandler(VEFluidSawmillRecipe recipe, IIngredientAcceptor primaryItemOutputAcceptor, IIngredientAcceptor secondaryItemOutputAcceptor, IIngredientAcceptor fluidOutputAcceptor) { - if (recipe.isLogRecipe() && Config.SAWMILL_ALLOW_NON_SAWMILL_RECIPE_LOGS_TO_BE_SAWED.get()){ + if (recipe.isLogRecipe() && Config.SAWMILL_ALLOW_NON_SAWMILL_RECIPE_LOGS_TO_BE_SAWED.get()) { AtomicReference> atomicLogStacks = new AtomicReference<>(new ArrayList<>()); AtomicReference> atomicPlankStacks = new AtomicReference<>(new ArrayList<>()); // Calculate Logs and Planks based on registry ForgeRegistries.ITEMS.getValues().parallelStream().forEach(registeredItem -> { - if (RegistryLookups.lookupItem(registeredItem).getPath().contains("log")){ + if (RegistryLookups.lookupItem(registeredItem).getPath().contains("log")) { atomicLogStacks.get().add(new ItemStack(registeredItem, Config.SAWMILL_LOG_CONSUMPTION_RATE.get())); } else if (RegistryLookups.lookupItem(registeredItem).getPath().contains("plank")) { atomicPlankStacks.get().add(new ItemStack(registeredItem, Config.SAWMILL_PRIMARY_OUTPUT_COUNT.get())); @@ -110,14 +110,14 @@ public void ingredientHandler(VEFluidSawmillRecipe recipe, // Secondary Output ResourceLocation secondOutputItemResourceLocation = new ResourceLocation(Config.SAWMILL_SECOND_OUTPUT_RESOURCE_LOCATION.get()); Item secondOutput = ForgeRegistries.ITEMS.getValue(secondOutputItemResourceLocation); - if (secondOutput != null){ + if (secondOutput != null) { secondaryItemOutputAcceptor.addIngredient(VanillaTypes.ITEM_STACK, new ItemStack(secondOutput, Config.SAWMILL_SECOND_OUTPUT_COUNT.get())); } // Fluid Output ResourceLocation fluidLocation = new ResourceLocation(Config.SAWMILL_FLUID_LOCATION.get()); Fluid outputFluid = ForgeRegistries.FLUIDS.getValue(fluidLocation); - if (outputFluid != null){ + if (outputFluid != null) { fluidOutputAcceptor.addIngredient(ForgeTypes.FLUID_STACK, new FluidStack(outputFluid, Config.SAWMILL_FLUID_AMOUNT.get())); } } else if (!recipe.isLogRecipe()) { @@ -143,7 +143,7 @@ public void ingredientHandler(VEFluidSawmillRecipe recipe, public void setRecipe(IRecipeLayoutBuilder recipeLayout, VEFluidSawmillRecipe recipe, IFocusGroup focusGroup) { IRecipeSlotBuilder inputItem = recipeLayout.addSlot(RecipeIngredientRole.INPUT, 3, 11); - IRecipeSlotBuilder primaryOutputItem = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 49,2); + IRecipeSlotBuilder primaryOutputItem = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 49, 2); IRecipeSlotBuilder secondaryOutputItem = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 49, 20); IRecipeSlotBuilder fluidOutput = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 67, 10); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/StirlingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/StirlingCategory.java index 38a829355..d1f285035 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/StirlingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/StirlingCategory.java @@ -33,7 +33,7 @@ public class StirlingCategory implements IRecipeCategory 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/combustion_generator.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 40, 44).build(); @@ -42,7 +42,7 @@ public StirlingCategory(IGuiHelper guiHelper){ } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -63,10 +63,10 @@ public StirlingCategory(IGuiHelper guiHelper){ @Override public void draw(StirlingGeneratorRecipe recipe, @NotNull IRecipeSlotsView recipeSlotsView, @NotNull GuiGraphics matrixStack, double mouseX, double mouseY) { - slotDrawable.draw(matrixStack,11,0); - TextUtil.renderUnshadowedText(matrixStack,Minecraft.getInstance().font, recipe.getEnergyPerTick() + " FE/t", -1,20, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack,Minecraft.getInstance().font, recipe.getProcessTime() + " t",-1,28, VEContainerScreen.GREY_TEXT_STYLE); - TextUtil.renderUnshadowedText(matrixStack,Minecraft.getInstance().font, recipe.getProcessTime()/20 + " sec",-1,36, VEContainerScreen.GREY_TEXT_STYLE); + slotDrawable.draw(matrixStack, 11, 0); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getEnergyPerTick() + " FE/t", -1, 20, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getProcessTime() + " t", -1, 28, VEContainerScreen.GREY_TEXT_STYLE); + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, recipe.getProcessTime() / 20 + " sec", -1, 36, VEContainerScreen.GREY_TEXT_STYLE); } public void ingredientHandler(StirlingGeneratorRecipe recipe, IIngredientAcceptor itemInputAcceptor) { @@ -74,7 +74,7 @@ public void ingredientHandler(StirlingGeneratorRecipe recipe, IIngredientAccepto } @Override - public void setRecipe(IRecipeLayoutBuilder recipeLayout, @NotNull StirlingGeneratorRecipe recipe, @NotNull IFocusGroup focusGroup) { + public void setRecipe(IRecipeLayoutBuilder recipeLayout, @NotNull StirlingGeneratorRecipe recipe, @NotNull IFocusGroup focusGroup) { // Inputs IRecipeSlotBuilder itemInput = recipeLayout.addSlot(RecipeIngredientRole.INPUT, 12, 1); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ToolingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ToolingCategory.java index ab9a7b19d..f4422d25b 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ToolingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ToolingCategory.java @@ -34,7 +34,7 @@ public class ToolingCategory implements IRecipeCategory { private IDrawable arrow; public static final RecipeType RECIPE_TYPE = new RecipeType(VoluminousEnergyPlugin.TOOLING_UID, ToolingRecipe.class); - public ToolingCategory(IGuiHelper guiHelper){ + public ToolingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); ResourceLocation ToolingGUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/tooling_station_gui.png"); @@ -45,7 +45,7 @@ public ToolingCategory(IGuiHelper guiHelper){ } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -66,10 +66,10 @@ public IDrawable getIcon() { @Override public void draw(ToolingRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics matrixStack, double mouseX, double mouseY) { - slotDrawable.draw(matrixStack,2,14); // Completed Multitool - slotDrawable.draw(matrixStack,48,1); // Bit - slotDrawable.draw(matrixStack,48,29); // Base - arrow.draw(matrixStack,24, 0); + slotDrawable.draw(matrixStack, 2, 14); // Completed Multitool + slotDrawable.draw(matrixStack, 48, 1); // Bit + slotDrawable.draw(matrixStack, 48, 29); // Base + arrow.draw(matrixStack, 24, 0); } public void ingredientHandler(ToolingRecipe recipe, @@ -82,7 +82,7 @@ public void ingredientHandler(ToolingRecipe recipe, // Bases ArrayList baseStacks = new ArrayList<>(); - for (Item base : recipe.getBases()){ + for (Item base : recipe.getBases()) { baseStacks.add(new ItemStack(base)); } baseItemAcceptor.addIngredients(VanillaTypes.ITEM_STACK, baseStacks); diff --git a/src/main/java/com/veteam/voluminousenergy/datagen/MaterialConstants.java b/src/main/java/com/veteam/voluminousenergy/datagen/MaterialConstants.java index 0705d415c..801de604a 100644 --- a/src/main/java/com/veteam/voluminousenergy/datagen/MaterialConstants.java +++ b/src/main/java/com/veteam/voluminousenergy/datagen/MaterialConstants.java @@ -4,27 +4,27 @@ public class MaterialConstants { - public static void setBauxiteTier(Block bauxiteBlock){ + public static void setBauxiteTier(Block bauxiteBlock) { VETagDataGenerator.setRequiresStone(bauxiteBlock); } - public static void setCinnabarTier(Block cinnabarBlock){ + public static void setCinnabarTier(Block cinnabarBlock) { VETagDataGenerator.setRequiresIron(cinnabarBlock); } - public static void setGalenaTier(Block galenaBlock){ + public static void setGalenaTier(Block galenaBlock) { VETagDataGenerator.setRequiresIron(galenaBlock); } - public static void setRutileTier(Block rutileBlock){ + public static void setRutileTier(Block rutileBlock) { VETagDataGenerator.setRequiresDiamond(rutileBlock); } - public static void setNighaliteTier(Block nighaliteBlock){ + public static void setNighaliteTier(Block nighaliteBlock) { VETagDataGenerator.setRequiresNetherite(nighaliteBlock); } - public static void setEighzoTier(Block eighzoBlock){ + public static void setEighzoTier(Block eighzoBlock) { VETagDataGenerator.setRequiresNighalite(eighzoBlock); } } diff --git a/src/main/java/com/veteam/voluminousenergy/datagen/VEGlobalLootModifierData.java b/src/main/java/com/veteam/voluminousenergy/datagen/VEGlobalLootModifierData.java index 87b6a6937..bf7e0dcbf 100644 --- a/src/main/java/com/veteam/voluminousenergy/datagen/VEGlobalLootModifierData.java +++ b/src/main/java/com/veteam/voluminousenergy/datagen/VEGlobalLootModifierData.java @@ -64,7 +64,7 @@ private void animalFatModifierProvider(LootItemCondition lootCondition) { add(lootTableString + "pig", new AnimalFatLootModifier(new LootItemCondition[]{ lootCondition, - LootTableIdCondition.builder(new ResourceLocation("minecraft","entities/pig")).build() + LootTableIdCondition.builder(new ResourceLocation("minecraft", "entities/pig")).build() }, VEItems.ANIMAL_FAT.get(), 1, 3) ); @@ -72,7 +72,7 @@ private void animalFatModifierProvider(LootItemCondition lootCondition) { add(lootTableString + "cow", new AnimalFatLootModifier(new LootItemCondition[]{ lootCondition, - LootTableIdCondition.builder(new ResourceLocation("minecraft","entities/cow")).build() + LootTableIdCondition.builder(new ResourceLocation("minecraft", "entities/cow")).build() }, VEItems.ANIMAL_FAT.get(), 1, 2) ); @@ -80,7 +80,7 @@ private void animalFatModifierProvider(LootItemCondition lootCondition) { add(lootTableString + "mooshroom", new AnimalFatLootModifier(new LootItemCondition[]{ lootCondition, - LootTableIdCondition.builder(new ResourceLocation("minecraft","entities/mooshroom")).build() + LootTableIdCondition.builder(new ResourceLocation("minecraft", "entities/mooshroom")).build() }, VEItems.ANIMAL_FAT.get(), 1, 2) ); @@ -88,7 +88,7 @@ private void animalFatModifierProvider(LootItemCondition lootCondition) { add(lootTableString + "llama", new AnimalFatLootModifier(new LootItemCondition[]{ lootCondition, - LootTableIdCondition.builder(new ResourceLocation("minecraft","entities/llama")).build() + LootTableIdCondition.builder(new ResourceLocation("minecraft", "entities/llama")).build() }, VEItems.ANIMAL_FAT.get(), 1, 2) ); @@ -96,7 +96,7 @@ private void animalFatModifierProvider(LootItemCondition lootCondition) { add(lootTableString + "polar_bear", new AnimalFatLootModifier(new LootItemCondition[]{ lootCondition, - LootTableIdCondition.builder(new ResourceLocation("minecraft","entities/polar_bear")).build() + LootTableIdCondition.builder(new ResourceLocation("minecraft", "entities/polar_bear")).build() }, VEItems.ANIMAL_FAT.get(), 3, 6) ); @@ -104,7 +104,7 @@ private void animalFatModifierProvider(LootItemCondition lootCondition) { add(lootTableString + "panda", new AnimalFatLootModifier(new LootItemCondition[]{ lootCondition, - LootTableIdCondition.builder(new ResourceLocation("minecraft","entities/panda")).build() + LootTableIdCondition.builder(new ResourceLocation("minecraft", "entities/panda")).build() }, VEItems.ANIMAL_FAT.get(), 0, 2) ); @@ -112,7 +112,7 @@ private void animalFatModifierProvider(LootItemCondition lootCondition) { add(lootTableString + "dolphin", new AnimalFatLootModifier(new LootItemCondition[]{ lootCondition, - LootTableIdCondition.builder(new ResourceLocation("minecraft","entities/dolphin")).build() + LootTableIdCondition.builder(new ResourceLocation("minecraft", "entities/dolphin")).build() }, VEItems.ANIMAL_FAT.get(), 2, 5) ); diff --git a/src/main/java/com/veteam/voluminousenergy/datagen/VETagDataGenerator.java b/src/main/java/com/veteam/voluminousenergy/datagen/VETagDataGenerator.java index 93db06f34..9f4185e7e 100644 --- a/src/main/java/com/veteam/voluminousenergy/datagen/VETagDataGenerator.java +++ b/src/main/java/com/veteam/voluminousenergy/datagen/VETagDataGenerator.java @@ -34,7 +34,7 @@ public VETagDataGenerator(PackOutput packOutput, CompletableFuture NEEDS_WOOD_TOOL = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation("forge", "needs_wood_tool")); final TagKey NEEDS_NETHERITE_TOOL = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation("forge", "needs_netherite_tool")); @@ -59,7 +59,7 @@ protected void addTags(HolderLookup.Provider lookupProvider){ } @Deprecated - public static void addTierBasedOnInt(int tier, Block block){ + public static void addTierBasedOnInt(int tier, Block block) { switch (tier) { case 0 -> requiresWood.add(block); case 1 -> requiresStone.add(block); @@ -73,52 +73,52 @@ public static void addTierBasedOnInt(int tier, Block block){ } // Tier setter - public static void setRequiresWood(Block block){ + public static void setRequiresWood(Block block) { requiresWood.add(block); } - public static void setRequiresStone(Block block){ + public static void setRequiresStone(Block block) { requiresStone.add(block); } - public static void setRequiresIron(Block block){ + public static void setRequiresIron(Block block) { requiresIron.add(block); } - public static void setRequiresDiamond(Block block){ + public static void setRequiresDiamond(Block block) { requiresDiamond.add(block); } - public static void setRequiresNetherite(Block block){ + public static void setRequiresNetherite(Block block) { requiresNetherite.add(block); } - public static void setRequiresNighalite(Block block){ + public static void setRequiresNighalite(Block block) { requiresNighalite.add(block); } - public static void setRequiresEighzo(Block block){ + public static void setRequiresEighzo(Block block) { requiresEighzo.add(block); } - public static void setRequiresSolarium(Block block){ + public static void setRequiresSolarium(Block block) { requiresSolarium.add(block); } // Tools setter - public static void setRequiresAxe(Block block){ + public static void setRequiresAxe(Block block) { mineableWithAxe.add(block); } - public static void setRequiresPickaxe(Block block){ + public static void setRequiresPickaxe(Block block) { mineableWithPickaxe.add(block); } - public static void setRequiresHoe(Block block){ + public static void setRequiresHoe(Block block) { mineableWithHoe.add(block); } - public static void setRequiresShovel(Block block){ + public static void setRequiresShovel(Block block) { mineableWithShovel.add(block); } diff --git a/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java b/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java index 622b15625..c71e5316a 100644 --- a/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java +++ b/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java @@ -18,7 +18,7 @@ public class VEServerSideListener { @SubscribeEvent(priority = EventPriority.HIGHEST) public static void onDataPackSync(OnDatapackSyncEvent event) { // When event.getPlayer() != null it's a player joining, so we check to make sure it's a group reload - if(event.getPlayer() == null) { + if (event.getPlayer() == null) { VoluminousEnergy.LOGGER.info("Finalizing recipe cache on server reload!"); VERecipe.updateCache(); } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/Ammonia.java b/src/main/java/com/veteam/voluminousenergy/fluids/Ammonia.java index bcf9513ec..0d3ed5422 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/Ammonia.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/Ammonia.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class Ammonia { - public static final ResourceLocation AMMONIA_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/ammonia_still"); - public static final ResourceLocation AMMONIA_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/ammonia_flowing"); + public static final ResourceLocation AMMONIA_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/ammonia_still"); + public static final ResourceLocation AMMONIA_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/ammonia_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).air(); @@ -27,22 +27,22 @@ public class Ammonia { public static VEFlowingFluidBlock AMMONIA_BLOCK; public static Item AMMONIA_BUCKET; - public static FlowingFluid AmmoniaFluid(){ + public static FlowingFluid AmmoniaFluid() { AMMONIA = new VEFlowingGasFluid.Source(Ammonia.PROPERTIES, 4); return AMMONIA; } - public static FlowingFluid FlowingAmmoniaFluid(){ + public static FlowingFluid FlowingAmmoniaFluid() { FLOWING_AMMONIA = new VEFlowingGasFluid.Flowing(Ammonia.PROPERTIES, 4); return FLOWING_AMMONIA; } - public static VEFlowingFluidBlock FlowingAmmoniaBlock(){ + public static VEFlowingFluidBlock FlowingAmmoniaBlock() { AMMONIA_BLOCK = new VEFlowingFluidBlock(() -> AMMONIA, stdProp); return AMMONIA_BLOCK; } - public static Item AmmoniaBucket(){ + public static Item AmmoniaBucket() { AMMONIA_BUCKET = new BucketItem(() -> AMMONIA, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return AMMONIA_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/AmmoniumNitrateSolution.java b/src/main/java/com/veteam/voluminousenergy/fluids/AmmoniumNitrateSolution.java index 4a43ac9cc..b05513819 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/AmmoniumNitrateSolution.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/AmmoniumNitrateSolution.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class AmmoniumNitrateSolution { - public static final ResourceLocation AMMONIUM_NITRATE_SOLUTION_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/ammonium_nitrate_solution_still"); - public static final ResourceLocation AMMONIUM_NITRATE_SOLUTION_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/ammonium_nitrate_solution_flowing"); + public static final ResourceLocation AMMONIUM_NITRATE_SOLUTION_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/ammonium_nitrate_solution_still"); + public static final ResourceLocation AMMONIUM_NITRATE_SOLUTION_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/ammonium_nitrate_solution_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class AmmoniumNitrateSolution { public static VEFlowingFluidBlock AMMONIUM_NITRATE_SOLUTION_BLOCK; public static Item AMMONIUM_NITRATE_SOLUTION_BUCKET; - public static FlowingFluid AmmoniumNitrateSolutionFluid(){ + public static FlowingFluid AmmoniumNitrateSolutionFluid() { AMMONIUM_NITRATE_SOLUTION = new ForgeFlowingFluid.Source(AmmoniumNitrateSolution.PROPERTIES); return AMMONIUM_NITRATE_SOLUTION; } - public static FlowingFluid FlowingAmmoniumNitrateSolutionFluid(){ + public static FlowingFluid FlowingAmmoniumNitrateSolutionFluid() { FLOWING_AMMONIUM_NITRATE_SOLUTION = new ForgeFlowingFluid.Flowing(AmmoniumNitrateSolution.PROPERTIES); return FLOWING_AMMONIUM_NITRATE_SOLUTION; } - public static VEFlowingFluidBlock FlowingAmmoniumNitrateSolutionBlock(){ + public static VEFlowingFluidBlock FlowingAmmoniumNitrateSolutionBlock() { AMMONIUM_NITRATE_SOLUTION_BLOCK = new VEFlowingFluidBlock(() -> AMMONIUM_NITRATE_SOLUTION, stdProp); return AMMONIUM_NITRATE_SOLUTION_BLOCK; } - public static Item AmmoniumNitrateSolutionBucket(){ + public static Item AmmoniumNitrateSolutionBucket() { AMMONIUM_NITRATE_SOLUTION_BUCKET = new AmmoniumNitrateBucket(() -> AMMONIUM_NITRATE_SOLUTION, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return AMMONIUM_NITRATE_SOLUTION_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/Biofuel.java b/src/main/java/com/veteam/voluminousenergy/fluids/Biofuel.java index af5ea8efa..5df6c4a77 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/Biofuel.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/Biofuel.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class Biofuel { - public static final ResourceLocation BIOFUEL_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/biofuel_still"); - public static final ResourceLocation BIOFUEL_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/biofuel_flowing"); + public static final ResourceLocation BIOFUEL_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/biofuel_still"); + public static final ResourceLocation BIOFUEL_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/biofuel_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class Biofuel { public static VEFlowingFluidBlock BIOFUEL_BLOCK; public static Item BIOFUEL_BUCKET; - public static FlowingFluid BiofuelFluid(){ + public static FlowingFluid BiofuelFluid() { BIOFUEL = new ForgeFlowingFluid.Source(Biofuel.properties); return BIOFUEL; } - public static FlowingFluid FlowingBiofuelFluid(){ + public static FlowingFluid FlowingBiofuelFluid() { FLOWING_BIOFUEL = new ForgeFlowingFluid.Flowing(Biofuel.properties); return FLOWING_BIOFUEL; } - public static VEFlowingFluidBlock FlowingBiofuelBlock(){ + public static VEFlowingFluidBlock FlowingBiofuelBlock() { BIOFUEL_BLOCK = new VEFlowingFluidBlock(() -> BIOFUEL, stdProp); return BIOFUEL_BLOCK; } - public static Item BiofuelBucket(){ + public static Item BiofuelBucket() { BIOFUEL_BUCKET = new BucketItem(() -> BIOFUEL, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return BIOFUEL_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/CompressedAir.java b/src/main/java/com/veteam/voluminousenergy/fluids/CompressedAir.java index dd938caa6..60774dc9b 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/CompressedAir.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/CompressedAir.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class CompressedAir { - public static final ResourceLocation COMPRESSED_AIR_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/compressed_air_still"); - public static final ResourceLocation COMPRESSED_AIR_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/compressed_air_flowing"); + public static final ResourceLocation COMPRESSED_AIR_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/compressed_air_still"); + public static final ResourceLocation COMPRESSED_AIR_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/compressed_air_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,17 +27,17 @@ public class CompressedAir { public static VEFlowingFluidBlock COMPRESSED_AIR_BLOCK; public static Item COMPRESSED_AIR_BUCKET; - public static FlowingFluid CompressedAirFluid(){ + public static FlowingFluid CompressedAirFluid() { COMPRESSED_AIR = new ForgeFlowingFluid.Source(CompressedAir.properties); return COMPRESSED_AIR; } - public static FlowingFluid FlowingCompressedAirFluid(){ + public static FlowingFluid FlowingCompressedAirFluid() { FLOWING_COMPRESSED_AIR = new ForgeFlowingFluid.Flowing(CompressedAir.properties); return FLOWING_COMPRESSED_AIR; } - public static VEFlowingFluidBlock FlowingCompressedAirBlock(){ + public static VEFlowingFluidBlock FlowingCompressedAirBlock() { COMPRESSED_AIR_BLOCK = new VEFlowingFluidBlock(() -> COMPRESSED_AIR, stdProp); return COMPRESSED_AIR_BLOCK; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/CrudeOil.java b/src/main/java/com/veteam/voluminousenergy/fluids/CrudeOil.java index 3264a99dd..23d3ba023 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/CrudeOil.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/CrudeOil.java @@ -18,8 +18,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class CrudeOil { - public static final ResourceLocation CRUDE_OIL_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/crude_oil_still"); - public static final ResourceLocation CRUDE_OIL_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/crude_oil_flowing"); + public static final ResourceLocation CRUDE_OIL_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/crude_oil_still"); + public static final ResourceLocation CRUDE_OIL_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/crude_oil_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -28,22 +28,22 @@ public class CrudeOil { public static CrudeOilFlowingFluidBlock CRUDE_OIL_BLOCK; public static Item CRUDE_OIL_BUCKET; - public static FlowingFluid CrudeOilFluid(){ // Create custom source here to adjust tick rate for spread speed + public static FlowingFluid CrudeOilFluid() { // Create custom source here to adjust tick rate for spread speed CRUDE_OIL = new CrudeOilFlowingFluidSource(CrudeOil.properties); return CRUDE_OIL; } - public static FlowingFluid FlowingCrudeOilFluid(){ + public static FlowingFluid FlowingCrudeOilFluid() { FLOWING_CRUDE_OIL = new ForgeFlowingFluid.Flowing(CrudeOil.properties); return FLOWING_CRUDE_OIL; } - public static CrudeOilFlowingFluidBlock FlowingCrudeOilBlock(){ // Create a custom block here for block modifications + public static CrudeOilFlowingFluidBlock FlowingCrudeOilBlock() { // Create a custom block here for block modifications CRUDE_OIL_BLOCK = new CrudeOilFlowingFluidBlock(() -> CRUDE_OIL, stdProp); return CRUDE_OIL_BLOCK; } - public static Item CrudeOilBucket(){ + public static Item CrudeOilBucket() { CRUDE_OIL_BUCKET = new BucketItem(() -> CRUDE_OIL, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return CRUDE_OIL_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/Diesel.java b/src/main/java/com/veteam/voluminousenergy/fluids/Diesel.java index 7b654e56f..42bd97bc3 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/Diesel.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/Diesel.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class Diesel { - public static final ResourceLocation DIESEL_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/diesel_still"); - public static final ResourceLocation DIESEL_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/diesel_flowing"); + public static final ResourceLocation DIESEL_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/diesel_still"); + public static final ResourceLocation DIESEL_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/diesel_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class Diesel { public static VEFlowingFluidBlock DIESEL_BLOCK; public static Item DIESEL_BUCKET; - public static FlowingFluid DieselFluid(){ + public static FlowingFluid DieselFluid() { DIESEL = new ForgeFlowingFluid.Source(Diesel.properties); return DIESEL; } - public static FlowingFluid FlowingDieselFluid(){ + public static FlowingFluid FlowingDieselFluid() { FLOWING_DIESEL = new ForgeFlowingFluid.Flowing(Diesel.properties); return FLOWING_DIESEL; } - public static VEFlowingFluidBlock FlowingDieselBlock(){ + public static VEFlowingFluidBlock FlowingDieselBlock() { DIESEL_BLOCK = new VEFlowingFluidBlock(() -> DIESEL, stdProp); return DIESEL_BLOCK; } - public static Item DieselBucket(){ + public static Item DieselBucket() { DIESEL_BUCKET = new BucketItem(() -> DIESEL, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return DIESEL_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/DinitrogenTetroxide.java b/src/main/java/com/veteam/voluminousenergy/fluids/DinitrogenTetroxide.java index fd64d59ce..40b17e65f 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/DinitrogenTetroxide.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/DinitrogenTetroxide.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class DinitrogenTetroxide { - public static final ResourceLocation DINITROGEN_TETROXIDE_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/dinitrogen_tetroxide_still"); - public static final ResourceLocation DINITROGEN_TETROXIDE_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/dinitrogen_tetroxide_flowing"); + public static final ResourceLocation DINITROGEN_TETROXIDE_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/dinitrogen_tetroxide_still"); + public static final ResourceLocation DINITROGEN_TETROXIDE_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/dinitrogen_tetroxide_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class DinitrogenTetroxide { public static VEFlowingFluidBlock DINITROGEN_TETROXIDE_BLOCK; public static Item DINITROGEN_TETROXIDE_BUCKET; - public static FlowingFluid DinitrogenTetroxideFluid(){ + public static FlowingFluid DinitrogenTetroxideFluid() { DINITROGEN_TETROXIDE = new ForgeFlowingFluid.Source(DinitrogenTetroxide.properties); return DINITROGEN_TETROXIDE; } - public static FlowingFluid FlowingDinitrogenTetroxideFluid(){ + public static FlowingFluid FlowingDinitrogenTetroxideFluid() { FLOWING_DINITROGEN_TETROXIDE = new ForgeFlowingFluid.Flowing(DinitrogenTetroxide.properties); return FLOWING_DINITROGEN_TETROXIDE; } - public static VEFlowingFluidBlock FlowingDinitrogenTetroxideBlock(){ + public static VEFlowingFluidBlock FlowingDinitrogenTetroxideBlock() { DINITROGEN_TETROXIDE_BLOCK = new VEFlowingFluidBlock(() -> DINITROGEN_TETROXIDE, stdProp); return DINITROGEN_TETROXIDE_BLOCK; } - public static Item DinitrogenTetroxideBucket(){ + public static Item DinitrogenTetroxideBucket() { DINITROGEN_TETROXIDE_BUCKET = new BucketItem(() -> DINITROGEN_TETROXIDE, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return DINITROGEN_TETROXIDE_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/Gasoline.java b/src/main/java/com/veteam/voluminousenergy/fluids/Gasoline.java index 66023b4ca..437b702f7 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/Gasoline.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/Gasoline.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class Gasoline { - public static final ResourceLocation GASOLINE_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/gasoline_still"); - public static final ResourceLocation GASOLINE_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/gasoline_flowing"); + public static final ResourceLocation GASOLINE_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/gasoline_still"); + public static final ResourceLocation GASOLINE_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/gasoline_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class Gasoline { public static VEFlowingFluidBlock GASOLINE_BLOCK; public static Item GASOLINE_BUCKET; - public static FlowingFluid GasolineFluid(){ + public static FlowingFluid GasolineFluid() { GASOLINE = new ForgeFlowingFluid.Source(Gasoline.properties); return GASOLINE; } - public static FlowingFluid FlowingGasolineFluid(){ + public static FlowingFluid FlowingGasolineFluid() { FLOWING_GASOLINE = new ForgeFlowingFluid.Flowing(Gasoline.properties); return FLOWING_GASOLINE; } - public static VEFlowingFluidBlock FlowingGasolineBlock(){ + public static VEFlowingFluidBlock FlowingGasolineBlock() { GASOLINE_BLOCK = new VEFlowingFluidBlock(() -> GASOLINE, stdProp); return GASOLINE_BLOCK; } - public static Item GasolineBucket(){ + public static Item GasolineBucket() { GASOLINE_BUCKET = new BucketItem(() -> GASOLINE, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return GASOLINE_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/Hydrogen.java b/src/main/java/com/veteam/voluminousenergy/fluids/Hydrogen.java index e676e5dea..981ea24c2 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/Hydrogen.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/Hydrogen.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class Hydrogen { - public static final ResourceLocation HYDROGEN_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/hydrogen_still"); - public static final ResourceLocation HYDROGEN_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/hydrogen_flowing"); + public static final ResourceLocation HYDROGEN_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/hydrogen_still"); + public static final ResourceLocation HYDROGEN_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/hydrogen_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).air(); @@ -27,22 +27,22 @@ public class Hydrogen { public static VEFlowingFluidBlock HYDROGEN_BLOCK; public static Item HYDROGEN_BUCKET; - public static FlowingFluid HydrogenFluid(){ - HYDROGEN = new VEFlowingGasFluid.Source(Hydrogen.properties,4); + public static FlowingFluid HydrogenFluid() { + HYDROGEN = new VEFlowingGasFluid.Source(Hydrogen.properties, 4); return HYDROGEN; } - public static FlowingFluid FlowingHydrogenFluid(){ - FLOWING_HYDROGEN = new VEFlowingGasFluid.Flowing(Hydrogen.properties,4); + public static FlowingFluid FlowingHydrogenFluid() { + FLOWING_HYDROGEN = new VEFlowingGasFluid.Flowing(Hydrogen.properties, 4); return FLOWING_HYDROGEN; } - public static VEFlowingFluidBlock FlowingHydrogenBlock(){ + public static VEFlowingFluidBlock FlowingHydrogenBlock() { HYDROGEN_BLOCK = new VEFlowingFluidBlock(() -> HYDROGEN, stdProp); return HYDROGEN_BLOCK; } - public static Item HydrogenBucket(){ + public static Item HydrogenBucket() { HYDROGEN_BUCKET = new BucketItem(() -> HYDROGEN, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return HYDROGEN_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/LightFuel.java b/src/main/java/com/veteam/voluminousenergy/fluids/LightFuel.java index 11d732562..5b21e1281 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/LightFuel.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/LightFuel.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class LightFuel { - public static final ResourceLocation LIGHT_FUEL_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/light_fuel_still"); - public static final ResourceLocation LIGHT_FUEL_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/light_fuel_flowing"); + public static final ResourceLocation LIGHT_FUEL_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/light_fuel_still"); + public static final ResourceLocation LIGHT_FUEL_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/light_fuel_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).air(); @@ -27,22 +27,22 @@ public class LightFuel { public static VEFlowingFluidBlock LIGHT_FUEL_BLOCK; public static Item LIGHT_FUEL_BUCKET; - public static FlowingFluid LightFuelFluid(){ - LIGHT_FUEL = new VEFlowingGasFluid.Source(LightFuel.properties,4); + public static FlowingFluid LightFuelFluid() { + LIGHT_FUEL = new VEFlowingGasFluid.Source(LightFuel.properties, 4); return LIGHT_FUEL; } - public static FlowingFluid FlowingLightFuelFluid(){ - FLOWING_LIGHT_FUEL = new VEFlowingGasFluid.Flowing(LightFuel.properties,4); + public static FlowingFluid FlowingLightFuelFluid() { + FLOWING_LIGHT_FUEL = new VEFlowingGasFluid.Flowing(LightFuel.properties, 4); return FLOWING_LIGHT_FUEL; } - public static VEFlowingFluidBlock FlowingLightFuelBlock(){ + public static VEFlowingFluidBlock FlowingLightFuelBlock() { LIGHT_FUEL_BLOCK = new VEFlowingFluidBlock(() -> LIGHT_FUEL, stdProp); return LIGHT_FUEL_BLOCK; } - public static Item LightFuelBucket(){ + public static Item LightFuelBucket() { LIGHT_FUEL_BUCKET = new BucketItem(() -> LIGHT_FUEL, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return LIGHT_FUEL_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/LiquefiedCoal.java b/src/main/java/com/veteam/voluminousenergy/fluids/LiquefiedCoal.java index c3222c310..bda285e90 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/LiquefiedCoal.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/LiquefiedCoal.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class LiquefiedCoal { - public static final ResourceLocation LIQUEFIED_COAL_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/liquefied_coal_still"); - public static final ResourceLocation LIQUEFIED_COAL_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/liquefied_coal_flowing"); + public static final ResourceLocation LIQUEFIED_COAL_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/liquefied_coal_still"); + public static final ResourceLocation LIQUEFIED_COAL_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/liquefied_coal_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class LiquefiedCoal { public static VEFlowingFluidBlock LIQUEFIED_COAL_BLOCK; public static Item LIQUEFIED_COAL_BUCKET; - public static FlowingFluid LiquefiedCoalFluid(){ + public static FlowingFluid LiquefiedCoalFluid() { LIQUEFIED_COAL = new ForgeFlowingFluid.Source(LiquefiedCoal.properties); return LIQUEFIED_COAL; } - public static FlowingFluid FlowingLiquefiedCoalFluid(){ + public static FlowingFluid FlowingLiquefiedCoalFluid() { FLOWING_LIQUEFIED_COAL = new ForgeFlowingFluid.Flowing(LiquefiedCoal.properties); return FLOWING_LIQUEFIED_COAL; } - public static VEFlowingFluidBlock FlowingLiquefiedCoalBlock(){ + public static VEFlowingFluidBlock FlowingLiquefiedCoalBlock() { LIQUEFIED_COAL_BLOCK = new VEFlowingFluidBlock(() -> LIQUEFIED_COAL, stdProp); return LIQUEFIED_COAL_BLOCK; } - public static Item LiquefiedCoalBucket(){ + public static Item LiquefiedCoalBucket() { LIQUEFIED_COAL_BUCKET = new BucketItem(() -> LIQUEFIED_COAL, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return LIQUEFIED_COAL_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/LiquefiedCoke.java b/src/main/java/com/veteam/voluminousenergy/fluids/LiquefiedCoke.java index 1ea116e4d..37efc0420 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/LiquefiedCoke.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/LiquefiedCoke.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class LiquefiedCoke { - public static final ResourceLocation LIQUEFIED_COKE_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/liquefied_coke_still"); - public static final ResourceLocation LIQUEFIED_COKE_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/liquefied_coke_flowing"); + public static final ResourceLocation LIQUEFIED_COKE_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/liquefied_coke_still"); + public static final ResourceLocation LIQUEFIED_COKE_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/liquefied_coke_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class LiquefiedCoke { public static VEFlowingFluidBlock LIQUEFIED_COKE_BLOCK; public static Item LIQUEFIED_COKE_BUCKET; - public static FlowingFluid LiquefiedCokeFluid(){ + public static FlowingFluid LiquefiedCokeFluid() { LIQUEFIED_COKE = new ForgeFlowingFluid.Source(LiquefiedCoke.properties); return LIQUEFIED_COKE; } - public static FlowingFluid FlowingLiquefiedCokeFluid(){ + public static FlowingFluid FlowingLiquefiedCokeFluid() { FLOWING_LIQUEFIED_COKE = new ForgeFlowingFluid.Flowing(LiquefiedCoke.properties); return FLOWING_LIQUEFIED_COKE; } - public static VEFlowingFluidBlock FlowingLiquefiedCokeBlock(){ + public static VEFlowingFluidBlock FlowingLiquefiedCokeBlock() { LIQUEFIED_COKE_BLOCK = new VEFlowingFluidBlock(() -> LIQUEFIED_COKE, stdProp); return LIQUEFIED_COKE_BLOCK; } - public static Item LiquefiedCokeBucket(){ + public static Item LiquefiedCokeBucket() { LIQUEFIED_COKE_BUCKET = new BucketItem(() -> LIQUEFIED_COKE, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return LIQUEFIED_COKE_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/Mercury.java b/src/main/java/com/veteam/voluminousenergy/fluids/Mercury.java index 1b4bb8c41..9bd9f5c9e 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/Mercury.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/Mercury.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class Mercury { - public static final ResourceLocation MERCURY_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/mercury_still"); - public static final ResourceLocation MERCURY_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/mercury_flowing"); + public static final ResourceLocation MERCURY_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/mercury_still"); + public static final ResourceLocation MERCURY_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/mercury_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class Mercury { public static VEFlowingFluidBlock MERCURY_BLOCK; public static Item MERCURY_BUCKET; - public static FlowingFluid MercuryFluid(){ + public static FlowingFluid MercuryFluid() { MERCURY = new ForgeFlowingFluid.Source(Mercury.properties); return MERCURY; } - public static FlowingFluid FlowingMercuryFluid(){ + public static FlowingFluid FlowingMercuryFluid() { FLOWING_MERCURY = new ForgeFlowingFluid.Flowing(Mercury.properties); return FLOWING_MERCURY; } - public static VEFlowingFluidBlock FlowingMercuryBlock(){ + public static VEFlowingFluidBlock FlowingMercuryBlock() { MERCURY_BLOCK = new VEFlowingFluidBlock(() -> MERCURY, stdProp); return MERCURY_BLOCK; } - public static Item MercuryBucket(){ + public static Item MercuryBucket() { MERCURY_BUCKET = new BucketItem(() -> MERCURY, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return MERCURY_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/Naphtha.java b/src/main/java/com/veteam/voluminousenergy/fluids/Naphtha.java index e21620532..bfb673978 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/Naphtha.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/Naphtha.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class Naphtha { - public static final ResourceLocation NAPHTHA_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/naphtha_still"); - public static final ResourceLocation NAPHTHA_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/naphtha_flowing"); + public static final ResourceLocation NAPHTHA_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/naphtha_still"); + public static final ResourceLocation NAPHTHA_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/naphtha_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -28,22 +28,22 @@ public class Naphtha { public static VEFlowingFluidBlock NAPHTHA_BLOCK; public static Item NAPHTHA_BUCKET; - public static FlowingFluid NaphthaFluid(){ + public static FlowingFluid NaphthaFluid() { NAPHTHA = new ForgeFlowingFluid.Source(Naphtha.properties); return NAPHTHA; } - public static FlowingFluid FlowingNaphthaFluid(){ + public static FlowingFluid FlowingNaphthaFluid() { FLOWING_NAPHTHA = new ForgeFlowingFluid.Flowing(Naphtha.properties); return FLOWING_NAPHTHA; } - public static VEFlowingFluidBlock FlowingNaphthaBlock(){ + public static VEFlowingFluidBlock FlowingNaphthaBlock() { NAPHTHA_BLOCK = new VEFlowingFluidBlock(() -> NAPHTHA, stdProp); return NAPHTHA_BLOCK; } - public static Item NaphthaBucket(){ + public static Item NaphthaBucket() { NAPHTHA_BUCKET = new BucketItem(() -> NAPHTHA, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return NAPHTHA_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/Nitrogen.java b/src/main/java/com/veteam/voluminousenergy/fluids/Nitrogen.java index 49b503143..c1b597e59 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/Nitrogen.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/Nitrogen.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class Nitrogen { - public static final ResourceLocation NITROGEN_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/nitrogen_still"); - public static final ResourceLocation NITROGEN_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/nitrogen_flowing"); + public static final ResourceLocation NITROGEN_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/nitrogen_still"); + public static final ResourceLocation NITROGEN_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/nitrogen_flowing"); public static final int NITROGEN_FLUID_WIDTH = 4; public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -28,22 +28,22 @@ public class Nitrogen { public static VEFlowingFluidBlock NITROGEN_BLOCK; public static Item NITROGEN_BUCKET; - public static FlowingFluid NitrogenFluid(){ + public static FlowingFluid NitrogenFluid() { NITROGEN = new VEFlowingGasFluid.Source(Nitrogen.properties, NITROGEN_FLUID_WIDTH); return NITROGEN; } - public static FlowingFluid FlowingNitrogenFluid(){ + public static FlowingFluid FlowingNitrogenFluid() { FLOWING_NITROGEN = new VEFlowingGasFluid.Flowing(Nitrogen.properties, NITROGEN_FLUID_WIDTH); return FLOWING_NITROGEN; } - public static VEFlowingFluidBlock FlowingNitrogenBlock(){ + public static VEFlowingFluidBlock FlowingNitrogenBlock() { NITROGEN_BLOCK = new VEFlowingFluidBlock(() -> NITROGEN, stdProp); return NITROGEN_BLOCK; } - public static Item NitrogenBucket(){ + public static Item NitrogenBucket() { NITROGEN_BUCKET = new BucketItem(() -> NITROGEN, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return NITROGEN_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/Nitroglycerin.java b/src/main/java/com/veteam/voluminousenergy/fluids/Nitroglycerin.java index 3e0393d26..a1b0412c2 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/Nitroglycerin.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/Nitroglycerin.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class Nitroglycerin { - public static final ResourceLocation NITROGLYCERIN_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/nitroglycerin_still"); - public static final ResourceLocation NITROGLYCERIN_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/nitroglycerin_flowing"); + public static final ResourceLocation NITROGLYCERIN_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/nitroglycerin_still"); + public static final ResourceLocation NITROGLYCERIN_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/nitroglycerin_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class Nitroglycerin { public static VEFlowingFluidBlock NITROGLYCERIN_BLOCK; public static Item NITROGLYCERIN_BUCKET; - public static FlowingFluid NitroglycerinFluid(){ + public static FlowingFluid NitroglycerinFluid() { NITROGLYCERIN = new ForgeFlowingFluid.Source(Nitroglycerin.properties); return NITROGLYCERIN; } - public static FlowingFluid FlowingNitroglycerinFluid(){ + public static FlowingFluid FlowingNitroglycerinFluid() { FLOWING_NITROGLYCERIN = new ForgeFlowingFluid.Flowing(Nitroglycerin.properties); return FLOWING_NITROGLYCERIN; } - public static VEFlowingFluidBlock FlowingNitroglycerinBlock(){ + public static VEFlowingFluidBlock FlowingNitroglycerinBlock() { NITROGLYCERIN_BLOCK = new VEFlowingFluidBlock(() -> NITROGLYCERIN, stdProp); return NITROGLYCERIN_BLOCK; } - public static Item NitroglycerinBucket(){ + public static Item NitroglycerinBucket() { NITROGLYCERIN_BUCKET = new BucketItem(() -> NITROGLYCERIN, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return NITROGLYCERIN_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/Oxygen.java b/src/main/java/com/veteam/voluminousenergy/fluids/Oxygen.java index c7a125afe..28cf2a2d7 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/Oxygen.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/Oxygen.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class Oxygen { - public static final ResourceLocation OXYGEN_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/oxygen_still"); - public static final ResourceLocation OXYGEN_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/oxygen_flowing"); + public static final ResourceLocation OXYGEN_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/oxygen_still"); + public static final ResourceLocation OXYGEN_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/oxygen_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).air(); @@ -27,22 +27,22 @@ public class Oxygen { public static VEFlowingFluidBlock OXYGEN_BLOCK; public static Item OXYGEN_BUCKET; - public static FlowingFluid OxygenFluid(){ + public static FlowingFluid OxygenFluid() { OXYGEN = new VEFlowingGasFluid.Source(Oxygen.properties, 4); return OXYGEN; } - public static FlowingFluid FlowingOxygenFluid(){ + public static FlowingFluid FlowingOxygenFluid() { FLOWING_OXYGEN = new VEFlowingGasFluid.Flowing(Oxygen.properties, 4); return FLOWING_OXYGEN; } - public static VEFlowingFluidBlock FlowingOxygenBlock(){ + public static VEFlowingFluidBlock FlowingOxygenBlock() { OXYGEN_BLOCK = new VEFlowingFluidBlock(() -> OXYGEN, stdProp); return OXYGEN_BLOCK; } - public static Item OxygenBucket(){ + public static Item OxygenBucket() { OXYGEN_BUCKET = new BucketItem(() -> OXYGEN, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return OXYGEN_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/RedFumingNitricAcid.java b/src/main/java/com/veteam/voluminousenergy/fluids/RedFumingNitricAcid.java index b9c9a5807..1c2dfe3a3 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/RedFumingNitricAcid.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/RedFumingNitricAcid.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class RedFumingNitricAcid { - public static final ResourceLocation RFNA_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/rfna_still"); - public static final ResourceLocation RFNA_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/rfna_flowing"); + public static final ResourceLocation RFNA_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/rfna_still"); + public static final ResourceLocation RFNA_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/rfna_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class RedFumingNitricAcid { public static FumingAcidFlowingFluidBlock RED_FUMING_NITRIC_ACID_BLOCK; public static Item RED_FUMING_NITRIC_ACID_BUCKET; - public static FlowingFluid RedFumingNitricAcidFluid(){ + public static FlowingFluid RedFumingNitricAcidFluid() { RED_FUMING_NITRIC_ACID = new ForgeFlowingFluid.Source(RedFumingNitricAcid.properties); return RED_FUMING_NITRIC_ACID; } - public static FlowingFluid FlowingRedFumingNitricAcidFluid(){ + public static FlowingFluid FlowingRedFumingNitricAcidFluid() { FLOWING_RED_FUMING_NITRIC_ACID = new ForgeFlowingFluid.Flowing(RedFumingNitricAcid.properties); return FLOWING_RED_FUMING_NITRIC_ACID; } - public static FumingAcidFlowingFluidBlock FlowingRedFumingNitricAcidBlock(){ + public static FumingAcidFlowingFluidBlock FlowingRedFumingNitricAcidBlock() { RED_FUMING_NITRIC_ACID_BLOCK = new FumingAcidFlowingFluidBlock(() -> RED_FUMING_NITRIC_ACID, stdProp); return RED_FUMING_NITRIC_ACID_BLOCK; } - public static Item RedFumingNitricAcidBucket(){ + public static Item RedFumingNitricAcidBucket() { RED_FUMING_NITRIC_ACID_BUCKET = new BucketItem(() -> RED_FUMING_NITRIC_ACID, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return RED_FUMING_NITRIC_ACID_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/SulfuricAcid.java b/src/main/java/com/veteam/voluminousenergy/fluids/SulfuricAcid.java index 2650d4fda..6da31febd 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/SulfuricAcid.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/SulfuricAcid.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class SulfuricAcid { - public static final ResourceLocation SULFURIC_ACID_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/sulfuric_acid_still"); - public static final ResourceLocation SULFURIC_ACID_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/sulfuric_acid_flowing"); + public static final ResourceLocation SULFURIC_ACID_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/sulfuric_acid_still"); + public static final ResourceLocation SULFURIC_ACID_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/sulfuric_acid_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class SulfuricAcid { public static AcidFlowingFluidBlock SULFURIC_ACID_BLOCK; public static Item SULFURIC_ACID_BUCKET; - public static FlowingFluid SulfuricAcidFluid(){ + public static FlowingFluid SulfuricAcidFluid() { SULFURIC_ACID = new ForgeFlowingFluid.Source(SulfuricAcid.properties); return SULFURIC_ACID; } - public static FlowingFluid FlowingSulfuricAcidFluid(){ + public static FlowingFluid FlowingSulfuricAcidFluid() { FLOWING_SULFURIC_ACID = new ForgeFlowingFluid.Flowing(SulfuricAcid.properties); return FLOWING_SULFURIC_ACID; } - public static AcidFlowingFluidBlock FlowingSulfuricAcidBlock(){ + public static AcidFlowingFluidBlock FlowingSulfuricAcidBlock() { SULFURIC_ACID_BLOCK = new AcidFlowingFluidBlock(() -> SULFURIC_ACID, stdProp); return SULFURIC_ACID_BLOCK; } - public static Item SulfuricAcidBucket(){ + public static Item SulfuricAcidBucket() { SULFURIC_ACID_BUCKET = new BucketItem(() -> SULFURIC_ACID, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return SULFURIC_ACID_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/TreeSap.java b/src/main/java/com/veteam/voluminousenergy/fluids/TreeSap.java index 2ff2c6662..245ab6fad 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/TreeSap.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/TreeSap.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class TreeSap { - public static final ResourceLocation TREE_SAP_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/tree_sap_still"); - public static final ResourceLocation TREE_SAP_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/tree_sap_flowing"); + public static final ResourceLocation TREE_SAP_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/tree_sap_still"); + public static final ResourceLocation TREE_SAP_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/tree_sap_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class TreeSap { public static CrudeOilFlowingFluidBlock TREE_SAP_BLOCK; public static Item TREE_SAP_BUCKET; - public static FlowingFluid TreeSapFluid(){ + public static FlowingFluid TreeSapFluid() { TREE_SAP = new ForgeFlowingFluid.Source(TreeSap.properties); return TREE_SAP; } - public static FlowingFluid FlowingTreeSapFluid(){ + public static FlowingFluid FlowingTreeSapFluid() { FLOWING_TREE_SAP = new ForgeFlowingFluid.Flowing(TreeSap.properties); return FLOWING_TREE_SAP; } - public static CrudeOilFlowingFluidBlock FlowingTreeSapBlock(){ + public static CrudeOilFlowingFluidBlock FlowingTreeSapBlock() { TREE_SAP_BLOCK = new CrudeOilFlowingFluidBlock(() -> TREE_SAP, stdProp); return TREE_SAP_BLOCK; } - public static Item TreeSapBucket(){ + public static Item TreeSapBucket() { TREE_SAP_BUCKET = new BucketItem(() -> TREE_SAP, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return TREE_SAP_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/Treethanol.java b/src/main/java/com/veteam/voluminousenergy/fluids/Treethanol.java index a2624b96d..b5777c8b2 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/Treethanol.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/Treethanol.java @@ -17,8 +17,8 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class Treethanol { - public static final ResourceLocation TREETHANOL_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/treethanol_still"); - public static final ResourceLocation TREETHANOL_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/treethanol_flowing"); + public static final ResourceLocation TREETHANOL_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/treethanol_still"); + public static final ResourceLocation TREETHANOL_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/treethanol_flowing"); public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); @@ -27,22 +27,22 @@ public class Treethanol { public static VEFlowingFluidBlock TREETHANOL_BLOCK; public static Item TREETHANOL_BUCKET; - public static FlowingFluid TreethanolFluid(){ + public static FlowingFluid TreethanolFluid() { TREETHANOL = new ForgeFlowingFluid.Source(Treethanol.properties); return TREETHANOL; } - public static FlowingFluid FlowingTreethanolFluid(){ + public static FlowingFluid FlowingTreethanolFluid() { FLOWING_TREETHANOL = new ForgeFlowingFluid.Flowing(Treethanol.properties); return FLOWING_TREETHANOL; } - public static VEFlowingFluidBlock FlowingTreethanolBlock(){ + public static VEFlowingFluidBlock FlowingTreethanolBlock() { TREETHANOL_BLOCK = new VEFlowingFluidBlock(() -> TREETHANOL, stdProp); return TREETHANOL_BLOCK; } - public static Item TreethanolBucket(){ + public static Item TreethanolBucket() { TREETHANOL_BUCKET = new BucketItem(() -> TREETHANOL, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return TREETHANOL_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/VEFlowingGasFluid.java b/src/main/java/com/veteam/voluminousenergy/fluids/VEFlowingGasFluid.java index 1684fb028..56603d3e6 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/VEFlowingGasFluid.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/VEFlowingGasFluid.java @@ -34,7 +34,7 @@ public class VEFlowingGasFluid extends ForgeFlowingFluid { protected void rehash(int p_76102_) { } }; - object2bytelinkedopenhashmap.defaultReturnValue((byte)127); + object2bytelinkedopenhashmap.defaultReturnValue((byte) 127); return object2bytelinkedopenhashmap; }); // @@ -75,7 +75,7 @@ public Vec3 getFlow(BlockGetter getter, BlockPos pos, FluidState fluidState) { double d1 = 0.0D; BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos(); - for(Direction direction : Direction.Plane.HORIZONTAL) { + for (Direction direction : Direction.Plane.HORIZONTAL) { blockpos$mutableblockpos.setWithOffset(pos, direction); FluidState fluidstate = getter.getFluidState(blockpos$mutableblockpos); if (this.affectsFlow(fluidstate)) { @@ -97,15 +97,15 @@ public Vec3 getFlow(BlockGetter getter, BlockPos pos, FluidState fluidState) { } if (f1 != 0.0F) { - d0 += (float)direction.getStepX() * f1; - d1 += (float)direction.getStepZ() * f1; + d0 += (float) direction.getStepX() * f1; + d1 += (float) direction.getStepZ() * f1; } } } Vec3 vec3 = new Vec3(d0, 0.0D, d1); if (fluidState.getValue(FALLING)) { - for(Direction direction1 : Direction.Plane.HORIZONTAL) { + for (Direction direction1 : Direction.Plane.HORIZONTAL) { blockpos$mutableblockpos.setWithOffset(pos, direction1); if (this.isSolidFace(getter, blockpos$mutableblockpos, direction1) || this.isSolidFace(getter, blockpos$mutableblockpos.above(), direction1)) { vec3 = vec3.normalize().subtract(0.0D, -6.0D, 0.0D); @@ -126,7 +126,7 @@ protected void spread(Level level, BlockPos blockPos, FluidState fluidState) { if (!(blockPos.getY() < 320)) return; // Preliminary check if not source - if (!fluidState.isSource()){ + if (!fluidState.isSource()) { BlockState belowState = level.getBlockState(blockPos.below()); FluidState belowFluidState = level.getFluidState(blockPos.below()); @@ -145,21 +145,21 @@ protected void spread(Level level, BlockPos blockPos, FluidState fluidState) { * based on the observed behaviour I saw in testing? Even though I would imagine * a source block should be one that can be picked up with a bucket * (technically, I believe that's considered a liquid block). - ***/ - if (fluidStateNorth.is(this) && fluidStateNorth.isSource()){ + ***/ + if (fluidStateNorth.is(this) && fluidStateNorth.isSource()) { return; - } else if (fluidStateSouth.is(this) && fluidStateSouth.isSource()){ + } else if (fluidStateSouth.is(this) && fluidStateSouth.isSource()) { return; - } else if (fluidStateEast.is(this) && fluidStateEast.isSource()){ + } else if (fluidStateEast.is(this) && fluidStateEast.isSource()) { return; - } else if (fluidStateWest.is(this) && fluidStateWest.isSource()){ + } else if (fluidStateWest.is(this) && fluidStateWest.isSource()) { return; } // Find directly North, South, East, West - for (Direction direction : Direction.Plane.HORIZONTAL){ + for (Direction direction : Direction.Plane.HORIZONTAL) { if (foundSource) break; - for (int i = 1; i <= this.flowWidth; i++){ + for (int i = 1; i <= this.flowWidth; i++) { BlockPos dirPos = blockPos.relative(direction, i); dirPos = dirPos.below(); FluidState foundFluidState = level.getFluidState(dirPos); @@ -169,24 +169,24 @@ protected void spread(Level level, BlockPos blockPos, FluidState fluidState) { break; }*/ - if (!foundFluidState.isEmpty() && foundFluidState.is(this)){ + if (!foundFluidState.isEmpty() && foundFluidState.is(this)) { foundSource = true; break; // Next else if will only fire at the very bottom of the gas pillar - } else if (!(belowState.getBlock() instanceof BucketPickup) && !(belowState.getBlock() instanceof LiquidBlock) && !(belowState.isAir()) && !(belowState.getFluidState() == this.defaultFluidState())){ + } else if (!(belowState.getBlock() instanceof BucketPickup) && !(belowState.getBlock() instanceof LiquidBlock) && !(belowState.isAir()) && !(belowState.getFluidState() == this.defaultFluidState())) { // Plus shaped check BlockPos xPlusOne = blockPos.offset(1, 0, 0); BlockPos xMinusOne = blockPos.offset(-1, 0, 0); - BlockPos zPlusOne = blockPos.offset(0,0,1); - BlockPos zMinusOne = blockPos.offset(0,0,-1); + BlockPos zPlusOne = blockPos.offset(0, 0, 1); + BlockPos zMinusOne = blockPos.offset(0, 0, -1); FluidState fluidStateXP1 = level.getFluidState(xPlusOne); FluidState fluidStateXM1 = level.getFluidState(xMinusOne); FluidState fluidStateZP1 = level.getFluidState(zPlusOne); FluidState fluidStateZM1 = level.getFluidState(zMinusOne); - if ( (fluidStateXP1.getType().isSame(this.getSource()) || fluidStateXP1.getType().isSame(this.getFlowing())) + if ((fluidStateXP1.getType().isSame(this.getSource()) || fluidStateXP1.getType().isSame(this.getFlowing())) || (fluidStateXM1.getType().isSame(this.getSource()) || fluidStateXM1.getType().isSame(this.getFlowing())) || (fluidStateZP1.getType().isSame(this.getSource()) || fluidStateZP1.getType().isSame(this.getFlowing())) || (fluidStateZM1.getType().isSame(this.getSource()) || fluidStateZM1.getType().isSame(this.getFlowing())) @@ -204,7 +204,7 @@ protected void spread(Level level, BlockPos blockPos, FluidState fluidState) { // End of find directly NSEW - if (!foundSource){ + if (!foundSource) { level.setBlock(blockPos, Blocks.AIR.defaultBlockState(), 3); } } @@ -239,7 +239,7 @@ private void spreadToSides(Level level, BlockPos pos, FluidState fluidState, Blo if (i > 0) { Map map = this.getSpread(level, pos, blockState); - for(Map.Entry entry : map.entrySet()) { + for (Map.Entry entry : map.entrySet()) { Direction direction = entry.getKey(); FluidState fluidstate = entry.getValue(); BlockPos blockpos = pos.relative(direction); @@ -255,7 +255,7 @@ private void spreadToSides(Level level, BlockPos pos, FluidState fluidState, Blo private int sourceNeighborCount(LevelReader levelReader, BlockPos pos) { int i = 0; - for(Direction direction : Direction.Plane.HORIZONTAL) { + for (Direction direction : Direction.Plane.HORIZONTAL) { BlockPos blockpos = pos.relative(direction); FluidState fluidstate = levelReader.getFluidState(blockpos); if (this.isSourceBlockOfThisType(fluidstate)) { @@ -274,7 +274,7 @@ private boolean isWaterHole(BlockGetter getter, Fluid fluid, BlockPos pos0, Bloc if (!this.canPassThroughWall(Direction.UP, getter, pos0, blockState0, pos1, blockState1)) { return false; } else { - return blockState1.getFluidState().getType().isSame(this) || this.canHoldFluid(null,getter, pos1, blockState1, fluid); + return blockState1.getFluidState().getType().isSame(this) || this.canHoldFluid(null, getter, pos1, blockState1, fluid); } } @@ -305,7 +305,7 @@ private boolean canPassThroughWall(Direction p_76062_, BlockGetter p_76063_, Blo object2bytelinkedopenhashmap.removeLastByte(); } - object2bytelinkedopenhashmap.putAndMoveToFirst(block$blockstatepairkey, (byte)(flag ? 1 : 0)); + object2bytelinkedopenhashmap.putAndMoveToFirst(block$blockstatepairkey, (byte) (flag ? 1 : 0)); } return flag; @@ -315,7 +315,7 @@ private boolean canPassThroughWall(Direction p_76062_, BlockGetter p_76063_, Blo private boolean canHoldFluid(Player player, BlockGetter getter, BlockPos pos, BlockState blockState, Fluid fluid) { Block block = blockState.getBlock(); if (block instanceof LiquidBlockContainer) { - return ((LiquidBlockContainer)block).canPlaceLiquid(player, getter, pos, blockState, fluid); + return ((LiquidBlockContainer) block).canPlaceLiquid(player, getter, pos, blockState, fluid); } else if (!(block instanceof DoorBlock) && !blockState.is(BlockTags.SIGNS) && !blockState.is(Blocks.LADDER) && !blockState.is(Blocks.SUGAR_CANE) && !blockState.is(Blocks.BUBBLE_COLUMN)) { if (!blockState.is(Blocks.NETHER_PORTAL) && !blockState.is(Blocks.END_PORTAL) && !blockState.is(Blocks.END_GATEWAY) && !blockState.is(Blocks.STRUCTURE_VOID)) { return !blockState.blocksMotion(); @@ -332,7 +332,7 @@ private boolean canHoldFluid(Player player, BlockGetter getter, BlockPos pos, Bl protected void spreadTo(LevelAccessor accessor, BlockPos pos, BlockState blockStateInQuestion, Direction p_76008_, FluidState fluidState) { if (blockStateInQuestion.getBlock() instanceof LiquidBlockContainer) { //System.out.println("spreadTo: instanceof LiquidBlockContainer for pos: " + pos.getX() + " " + pos.getY() + " " + pos.getZ()); - ((LiquidBlockContainer)blockStateInQuestion.getBlock()).placeLiquid(accessor, pos, blockStateInQuestion, fluidState); + ((LiquidBlockContainer) blockStateInQuestion.getBlock()).placeLiquid(accessor, pos, blockStateInQuestion, fluidState); } else { //System.out.println("spreadTo: else hit "); diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/VEFluidType.java b/src/main/java/com/veteam/voluminousenergy/fluids/VEFluidType.java index f80266936..42ca9dd68 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/VEFluidType.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/VEFluidType.java @@ -17,8 +17,8 @@ public class VEFluidType extends FluidType { /** * Default constructor. * - * @param properties the general properties of the fluid type - * @param stillTexture is the still texture for the fluid + * @param properties the general properties of the fluid type + * @param stillTexture is the still texture for the fluid * @param flowingTexture is the flowing texture for the fluid */ public VEFluidType(Properties properties, ResourceLocation stillTexture, ResourceLocation flowingTexture) { @@ -30,8 +30,8 @@ public VEFluidType(Properties properties, ResourceLocation stillTexture, Resourc /** * Default constructor. * - * @param properties the general properties of the fluid type - * @param stillTexture is the still texture for the fluid + * @param properties the general properties of the fluid type + * @param stillTexture is the still texture for the fluid * @param flowingTexture is the flowing texture for the fluid * @param overlayTexture is the overlay texture when an entity is in the fluid (I think) */ @@ -47,7 +47,7 @@ public void setColourTint(int colourTint) { } @Override - public void initializeClient(Consumer consumer){ + public void initializeClient(Consumer consumer) { consumer.accept(new IClientFluidTypeExtensions() { @Override public ResourceLocation getStillTexture() { diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/WhiteFumingNitricAcid.java b/src/main/java/com/veteam/voluminousenergy/fluids/WhiteFumingNitricAcid.java index e6eb1fa66..71407a8fe 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/WhiteFumingNitricAcid.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/WhiteFumingNitricAcid.java @@ -17,32 +17,33 @@ import net.minecraftforge.fluids.ForgeFlowingFluid; public class WhiteFumingNitricAcid { - public static final ResourceLocation WFNA_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/wfna_still"); - public static final ResourceLocation WFNA_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID,"block/fluids/wfna_flowing"); + public static final ResourceLocation WFNA_STILL_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/wfna_still"); + public static final ResourceLocation WFNA_FLOWING_TEXTURE = new ResourceLocation(VoluminousEnergy.MODID, "block/fluids/wfna_flowing"); - public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid();; + public static Block.Properties stdProp = Block.Properties.of().noCollission().strength(100.0F).noLootTable().replaceable().pushReaction(PushReaction.DESTROY).liquid(); + ; public static FlowingFluid WHITE_FUMING_NITRIC_ACID; public static FlowingFluid FLOWING_WHITE_FUMING_NITRIC_ACID; public static FumingAcidFlowingFluidBlock WHITE_FUMING_NITRIC_ACID_BLOCK; public static Item WHITE_FUMING_NITRIC_ACID_BUCKET; - public static FlowingFluid WhiteFumingNitricAcidFluid(){ + public static FlowingFluid WhiteFumingNitricAcidFluid() { WHITE_FUMING_NITRIC_ACID = new ForgeFlowingFluid.Source(WhiteFumingNitricAcid.properties); return WHITE_FUMING_NITRIC_ACID; } - public static FlowingFluid FlowingWhiteFumingNitricAcidFluid(){ + public static FlowingFluid FlowingWhiteFumingNitricAcidFluid() { FLOWING_WHITE_FUMING_NITRIC_ACID = new ForgeFlowingFluid.Flowing(WhiteFumingNitricAcid.properties); return FLOWING_WHITE_FUMING_NITRIC_ACID; } - public static FumingAcidFlowingFluidBlock FlowingWhiteFumingNitricAcidBlock(){ + public static FumingAcidFlowingFluidBlock FlowingWhiteFumingNitricAcidBlock() { WHITE_FUMING_NITRIC_ACID_BLOCK = new FumingAcidFlowingFluidBlock(() -> WHITE_FUMING_NITRIC_ACID, stdProp); return WHITE_FUMING_NITRIC_ACID_BLOCK; } - public static Item WhiteFumingNitricAcidBucket(){ + public static Item WhiteFumingNitricAcidBucket() { WHITE_FUMING_NITRIC_ACID_BUCKET = new BucketItem(() -> WHITE_FUMING_NITRIC_ACID, new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1)); return WHITE_FUMING_NITRIC_ACID_BUCKET; } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/AcidFlowingFluidBlock.java b/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/AcidFlowingFluidBlock.java index 0fcbcea67..5de9a6d2e 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/AcidFlowingFluidBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/AcidFlowingFluidBlock.java @@ -21,7 +21,7 @@ public AcidFlowingFluidBlock(Supplier supplier, Properti @Override public void entityInside(BlockState state, Level worldIn, BlockPos pos, Entity entityIn) { - if (!entityIn.fireImmune() && entityIn instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity)entityIn)) { + if (!entityIn.fireImmune() && entityIn instanceof LivingEntity && !EnchantmentHelper.hasFrostWalker((LivingEntity) entityIn)) { entityIn.hurt(worldIn.damageSources().inFire(), Config.ACID_DAMAGE.get().floatValue()); entityIn.setSecondsOnFire(Config.ACID_FIRE_DURATION.get()); } @@ -30,7 +30,7 @@ public void entityInside(BlockState state, Level worldIn, BlockPos pos, Entity e } @Override - public boolean isPathfindable(BlockState state, BlockGetter getter, BlockPos pos, PathComputationType pathComputationType){ + public boolean isPathfindable(BlockState state, BlockGetter getter, BlockPos pos, PathComputationType pathComputationType) { return true; } } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/CrudeOilFlowingFluidBlock.java b/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/CrudeOilFlowingFluidBlock.java index 8e4d8e99e..a52d1631b 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/CrudeOilFlowingFluidBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/CrudeOilFlowingFluidBlock.java @@ -21,7 +21,7 @@ public CrudeOilFlowingFluidBlock(Supplier supplier, Prop public void entityInside(BlockState state, Level worldIn, BlockPos pos, Entity entityIn) { if (entityIn instanceof LivingEntity) { entityIn.makeStuckInBlock(state, new Vec3(0.8F, 0.75F, 0.8F)); - } else if (entityIn instanceof ItemEntity){ + } else if (entityIn instanceof ItemEntity) { entityIn.makeStuckInBlock(state, new Vec3(0.8F, 0.75f, 0.8F)); } } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/FumingAcidFlowingFluidBlock.java b/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/FumingAcidFlowingFluidBlock.java index a92f2c995..f383b2ceb 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/FumingAcidFlowingFluidBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/FumingAcidFlowingFluidBlock.java @@ -19,7 +19,7 @@ public FumingAcidFlowingFluidBlock(Supplier supplier, Pr @OnlyIn(Dist.CLIENT) public void animateTick(BlockState stateIn, Level worldIn, BlockPos pos, RandomSource random) { if (random.nextInt(5) == 0) { - worldIn.addParticle(ParticleTypes.CAMPFIRE_COSY_SMOKE, true, (double)pos.getX() + 0.5D + random.nextDouble() / 3.0D * (double)(random.nextBoolean() ? 1 : -1), (double)pos.getY() + random.nextDouble() + random.nextDouble(), (double)pos.getZ() + 0.5D + random.nextDouble() / 3.0D * (double)(random.nextBoolean() ? 1 : -1), 0.0D, 0.07D, 0.0D); + worldIn.addParticle(ParticleTypes.CAMPFIRE_COSY_SMOKE, true, (double) pos.getX() + 0.5D + random.nextDouble() / 3.0D * (double) (random.nextBoolean() ? 1 : -1), (double) pos.getY() + random.nextDouble() + random.nextDouble(), (double) pos.getZ() + 0.5D + random.nextDouble() / 3.0D * (double) (random.nextBoolean() ? 1 : -1), 0.0D, 0.07D, 0.0D); } } } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/VEFlowingFluidBlock.java b/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/VEFlowingFluidBlock.java index 6dea8d81b..02878842f 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/VEFlowingFluidBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidBlocks/VEFlowingFluidBlock.java @@ -21,13 +21,13 @@ public VEFlowingFluidBlock(Supplier supplier, Properties @Override public void entityInside(BlockState state, Level worldIn, BlockPos pos, Entity entityIn) { - if(entityIn instanceof LivingEntity){ - if((entityIn.getY() - entityIn.yOld) > 0 && !entityIn.isCrouching()){ + if (entityIn instanceof LivingEntity) { + if ((entityIn.getY() - entityIn.yOld) > 0 && !entityIn.isCrouching()) { entityIn.makeStuckInBlock(state, new Vec3(0.9F, -0.9F, 0.9F)); } else if ((entityIn.getY() - entityIn.yOld) <= 0 || entityIn.isCrouching()) { entityIn.makeStuckInBlock(state, new Vec3(0.9F, 0.9F, 0.9F)); } - } else if (entityIn instanceof ItemEntity){ + } else if (entityIn instanceof ItemEntity) { entityIn.makeStuckInBlock(state, new Vec3(0.8F, -1, 0.8F)); } diff --git a/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidSource/CrudeOilFlowingFluidSource.java b/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidSource/CrudeOilFlowingFluidSource.java index f6d86fc96..9f3b9577f 100644 --- a/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidSource/CrudeOilFlowingFluidSource.java +++ b/src/main/java/com/veteam/voluminousenergy/fluids/flowingFluidSource/CrudeOilFlowingFluidSource.java @@ -9,5 +9,7 @@ public CrudeOilFlowingFluidSource(Properties properties) { } @Override - public int getTickDelay(LevelReader worldReader){return 20;} + public int getTickDelay(LevelReader worldReader) { + return 20; + } } diff --git a/src/main/java/com/veteam/voluminousenergy/items/AmmoniumNitrateBucket.java b/src/main/java/com/veteam/voluminousenergy/items/AmmoniumNitrateBucket.java index 0093cd9de..ccd03fb62 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/AmmoniumNitrateBucket.java +++ b/src/main/java/com/veteam/voluminousenergy/items/AmmoniumNitrateBucket.java @@ -50,7 +50,7 @@ public InteractionResult useOn(UseOnContext context) { } if (context.getPlayer() != null && !level.isClientSide) { - if (context.getPlayer().isCreative()){ + if (context.getPlayer().isCreative()) { context.getPlayer().getInventory().placeItemBackInInventory(new ItemStack(VEFluids.AMMONIUM_NITRATE_SOLUTION_BUCKET_REG.get())); } else { context.getPlayer().getInventory().placeItemBackInInventory(new ItemStack(Items.BUCKET)); @@ -79,23 +79,24 @@ public static boolean applyFert(ItemStack itemStack, Level level, BlockPos pos, if (hook != 0) return hook > 0; if (blockstate.getBlock() instanceof BonemealableBlock) { Block block = blockstate.getBlock(); - BonemealableBlock bonemealableblock = (BonemealableBlock)blockstate.getBlock(); + BonemealableBlock bonemealableblock = (BonemealableBlock) blockstate.getBlock(); if (bonemealableblock.isValidBonemealTarget(level, pos, blockstate)) { // TODO: Add more checks to ensure more powerful than bonemeal - if (level instanceof ServerLevel){ - if (block instanceof SaplingBlock){ + if (level instanceof ServerLevel) { + if (block instanceof SaplingBlock) { blockstate.setValue(BlockStateProperties.STAGE, 1); ((SaplingBlock) block).advanceTree((ServerLevel) level, pos, blockstate, level.getRandom()); try { ((SaplingBlock) block).advanceTree((ServerLevel) level, pos, blockstate, level.getRandom()); - } catch (Exception e) {} + } catch (Exception e) { + } itemStack.shrink(1); } else { if (bonemealableblock.isBonemealSuccess(level, level.random, pos, blockstate)) { - bonemealableblock.performBonemeal((ServerLevel)level, level.random, pos, blockstate); + bonemealableblock.performBonemeal((ServerLevel) level, level.random, pos, blockstate); } itemStack.shrink(1); @@ -118,11 +119,11 @@ public static boolean growWaterPlant(ItemStack itemStack, Level level, BlockPos RandomSource random = level.getRandom(); label78: - for(int i = 0; i < 128; ++i) { + for (int i = 0; i < 128; ++i) { BlockPos blockpos = pos; BlockState blockstate = Blocks.SEAGRASS.defaultBlockState(); - for(int j = 0; j < i / 16; ++j) { + for (int j = 0; j < i / 16; ++j) { blockpos = blockpos.offset(random.nextInt(3) - 1, (random.nextInt(3) - 1) * random.nextInt(3) / 2, random.nextInt(3) - 1); if (level.getBlockState(blockpos).isCollisionShapeFullBlock(level, blockpos)) { continue label78; @@ -152,7 +153,7 @@ public static boolean growWaterPlant(ItemStack itemStack, Level level, BlockPos if (blockstate.is(BlockTags.WALL_CORALS, (p_204093_) -> { return p_204093_.hasProperty(BaseCoralWallFanBlock.FACING); })) { - for(int k = 0; !blockstate.canSurvive(level, blockpos) && k < 4; ++k) { + for (int k = 0; !blockstate.canSurvive(level, blockpos) && k < 4; ++k) { blockstate = blockstate.setValue(BaseCoralWallFanBlock.FACING, Direction.Plane.HORIZONTAL.getRandomDirection(random)); } } @@ -162,7 +163,7 @@ public static boolean growWaterPlant(ItemStack itemStack, Level level, BlockPos if (blockstate1.is(Blocks.WATER) && level.getFluidState(blockpos).getAmount() == 8) { level.setBlock(blockpos, blockstate, 3); } else if (blockstate1.is(Blocks.SEAGRASS) && random.nextInt(10) == 0) { - ((BonemealableBlock)Blocks.SEAGRASS).performBonemeal((ServerLevel)level, random, blockpos, blockstate1); + ((BonemealableBlock) Blocks.SEAGRASS).performBonemeal((ServerLevel) level, random, blockpos, blockstate1); } } } diff --git a/src/main/java/com/veteam/voluminousenergy/items/Dough.java b/src/main/java/com/veteam/voluminousenergy/items/Dough.java index 19dace53b..17aa5a4da 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/Dough.java +++ b/src/main/java/com/veteam/voluminousenergy/items/Dough.java @@ -3,7 +3,7 @@ import net.minecraft.world.item.Item; public class Dough extends Item { - public Dough (){ + public Dough() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/SaltpeterChunk.java b/src/main/java/com/veteam/voluminousenergy/items/SaltpeterChunk.java index 7caad75f0..ab8eb41bb 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/SaltpeterChunk.java +++ b/src/main/java/com/veteam/voluminousenergy/items/SaltpeterChunk.java @@ -3,7 +3,7 @@ import net.minecraft.world.item.Item; public class SaltpeterChunk extends VEItem { - public SaltpeterChunk (){ + public SaltpeterChunk() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/ShreddedBiomass.java b/src/main/java/com/veteam/voluminousenergy/items/ShreddedBiomass.java index d42b3ae93..50b8c9a8b 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ShreddedBiomass.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ShreddedBiomass.java @@ -3,7 +3,7 @@ import net.minecraft.world.item.Item; public class ShreddedBiomass extends VEItem { - public ShreddedBiomass(){ + public ShreddedBiomass() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/Silicon.java b/src/main/java/com/veteam/voluminousenergy/items/Silicon.java index 3d7df0ae3..3442b2636 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/Silicon.java +++ b/src/main/java/com/veteam/voluminousenergy/items/Silicon.java @@ -3,7 +3,7 @@ import net.minecraft.world.item.Item; public class Silicon extends VEItem { - public Silicon (){ + public Silicon() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/TitaniumSawblade.java b/src/main/java/com/veteam/voluminousenergy/items/TitaniumSawblade.java index c4c77e4ae..8f1d181be 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/TitaniumSawblade.java +++ b/src/main/java/com/veteam/voluminousenergy/items/TitaniumSawblade.java @@ -3,7 +3,7 @@ import net.minecraft.world.item.Item; public class TitaniumSawblade extends VEItem { - public TitaniumSawblade (){ + public TitaniumSawblade() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java b/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java index 1eda8b2f5..c1dfe205f 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java +++ b/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java @@ -9,87 +9,87 @@ import net.minecraftforge.registries.RegistryObject; public class VEBlockItems { - public static final DeferredRegister VE_BLOCK_ITEM_REGISTRY = DeferredRegister.create(ForgeRegistries.ITEMS, VoluminousEnergy.MODID); - protected static final Item.Properties PROPERTIES = new Item.Properties(); - - //Block Items - //Tile Entities - public static RegistryObject PRIMITIVE_BLAST_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitiveblastfurnace", () -> new BlockItem(VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get(), PROPERTIES)); - public static RegistryObject PRIMITIVE_STIRLING_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitivestirlinggenerator", () -> new BlockItem(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject CRUSHER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("crusher",() -> new BlockItem(VEBlocks.CRUSHER_BLOCK.get(), PROPERTIES)); - public static RegistryObject ELECTROLYZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("electrolyzer", () -> new BlockItem(VEBlocks.ELECTROLYZER_BLOCK.get(), PROPERTIES)); - public static RegistryObject CENTRIFUGAL_AGITATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("centrifugal_agitator",() -> new BlockItem(VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("compressor",() -> new BlockItem(VEBlocks.COMPRESSOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject STIRLING_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("stirling_generator",() -> new BlockItem(VEBlocks.STIRLING_GENERATOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject COMBUSTION_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("combustion_generator",() -> new BlockItem(VEBlocks.COMBUSTION_GENERATOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject AQUEOULIZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aqueoulizer",() -> new BlockItem(VEBlocks.AQUEOULIZER_BLOCK.get(), PROPERTIES)); - public static RegistryObject AIR_COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("air_compressor",() -> new BlockItem(VEBlocks.AIR_COMPRESSOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject DISTILLATION_UNIT_ITEM = VE_BLOCK_ITEM_REGISTRY.register("distillation_unit",() -> new BlockItem(VEBlocks.DISTILLATION_UNIT_BLOCK.get(), PROPERTIES)); - public static RegistryObject PUMP_ITEM = VE_BLOCK_ITEM_REGISTRY.register("pump",() -> new BlockItem(VEBlocks.PUMP_BLOCK.get(), PROPERTIES)); - public static RegistryObject GAS_FIRED_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("gas_fired_furnace",() -> new BlockItem(VEBlocks.GAS_FIRED_FURNACE_BLOCK.get(), PROPERTIES)); - public static RegistryObject ELECTRIC_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("electric_furnace",() -> new BlockItem(VEBlocks.ELECTRIC_FURNACE_BLOCK.get(), PROPERTIES)); - public static RegistryObject BATTERY_BOX_ITEM = VE_BLOCK_ITEM_REGISTRY.register("battery_box",() -> new BlockItem(VEBlocks.BATTERY_BOX_BLOCK.get(), PROPERTIES)); - public static RegistryObject PRIMITIVE_SOLAR_PANEL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitive_solar_panel",() -> new BlockItem(VEBlocks.PRIMITIVE_SOLAR_PANEL_BLOCK.get(), PROPERTIES)); - public static RegistryObject SOLAR_PANEL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solar_panel",() -> new BlockItem(VEBlocks.SOLAR_PANEL_BLOCK.get(), PROPERTIES)); - public static RegistryObject CENTRIFUGAL_SEPARATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("centrifugal_separator",() -> new BlockItem(VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject IMPLOSION_COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("implosion_compressor",() -> new BlockItem(VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject BLAST_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("blast_furnace",() -> new BlockItem(VEBlocks.BLAST_FURNACE_BLOCK.get(), PROPERTIES)); - public static RegistryObject TOOLING_STATION_ITEM = VE_BLOCK_ITEM_REGISTRY.register("tooling_station",() -> new BlockItem(VEBlocks.TOOLING_STATION_BLOCK.get(), PROPERTIES)); - public static RegistryObject SAWMILL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("sawmill",() -> new BlockItem(VEBlocks.SAWMILL_BLOCK.get(), PROPERTIES)); - public static RegistryObject DIMENSIONAL_LASER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("dimensional_laser", () -> new BlockItem(VEBlocks.DIMENSIONAL_LASER_BLOCK.get(), PROPERTIES)); - public static RegistryObject FLUID_ELECTROLYZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("fluid_electrolyzer", () -> new BlockItem(VEBlocks.FLUID_ELECTROLYZER_BLOCK.get(), PROPERTIES)); - public static RegistryObject FLUID_MIXER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("fluid_mixer", () -> new BlockItem(VEBlocks.FLUID_MIXER_BLOCK.get(), PROPERTIES)); - public static RegistryObject HYDROPONIC_INCUBATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("hydroponic_incubator", () -> new BlockItem(VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get(), PROPERTIES)); + public static final DeferredRegister VE_BLOCK_ITEM_REGISTRY = DeferredRegister.create(ForgeRegistries.ITEMS, VoluminousEnergy.MODID); + protected static final Item.Properties PROPERTIES = new Item.Properties(); - // Tanks - public static RegistryObject ALUMINUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_tank",() -> new BlockItem(VEBlocks.ALUMINUM_TANK_BLOCK.get(), PROPERTIES)); - public static RegistryObject TITANIUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("titanium_tank",() -> new BlockItem(VEBlocks.TITANIUM_TANK_BLOCK.get(), PROPERTIES)); - public static RegistryObject NETHERITE_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("netherite_tank",() -> new BlockItem(VEBlocks.NETHERITE_TANK_BLOCK.get(), PROPERTIES)); - public static RegistryObject NIGHALITE_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("nighalite_tank",() -> new BlockItem(VEBlocks.NIGHALITE_TANK_BLOCK.get(), PROPERTIES)); - public static RegistryObject EIGHZO_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("eighzo_tank",() -> new BlockItem(VEBlocks.EIGHZO_TANK_BLOCK.get(), PROPERTIES)); - public static RegistryObject SOLARIUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_tank",() -> new BlockItem(VEBlocks.SOLARIUM_TANK_BLOCK.get(), PROPERTIES)); + //Block Items + //Tile Entities + public static RegistryObject PRIMITIVE_BLAST_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitiveblastfurnace", () -> new BlockItem(VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get(), PROPERTIES)); + public static RegistryObject PRIMITIVE_STIRLING_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitivestirlinggenerator", () -> new BlockItem(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_BLOCK.get(), PROPERTIES)); + public static RegistryObject CRUSHER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("crusher", () -> new BlockItem(VEBlocks.CRUSHER_BLOCK.get(), PROPERTIES)); + public static RegistryObject ELECTROLYZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("electrolyzer", () -> new BlockItem(VEBlocks.ELECTROLYZER_BLOCK.get(), PROPERTIES)); + public static RegistryObject CENTRIFUGAL_AGITATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("centrifugal_agitator", () -> new BlockItem(VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get(), PROPERTIES)); + public static RegistryObject COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("compressor", () -> new BlockItem(VEBlocks.COMPRESSOR_BLOCK.get(), PROPERTIES)); + public static RegistryObject STIRLING_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("stirling_generator", () -> new BlockItem(VEBlocks.STIRLING_GENERATOR_BLOCK.get(), PROPERTIES)); + public static RegistryObject COMBUSTION_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("combustion_generator", () -> new BlockItem(VEBlocks.COMBUSTION_GENERATOR_BLOCK.get(), PROPERTIES)); + public static RegistryObject AQUEOULIZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aqueoulizer", () -> new BlockItem(VEBlocks.AQUEOULIZER_BLOCK.get(), PROPERTIES)); + public static RegistryObject AIR_COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("air_compressor", () -> new BlockItem(VEBlocks.AIR_COMPRESSOR_BLOCK.get(), PROPERTIES)); + public static RegistryObject DISTILLATION_UNIT_ITEM = VE_BLOCK_ITEM_REGISTRY.register("distillation_unit", () -> new BlockItem(VEBlocks.DISTILLATION_UNIT_BLOCK.get(), PROPERTIES)); + public static RegistryObject PUMP_ITEM = VE_BLOCK_ITEM_REGISTRY.register("pump", () -> new BlockItem(VEBlocks.PUMP_BLOCK.get(), PROPERTIES)); + public static RegistryObject GAS_FIRED_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("gas_fired_furnace", () -> new BlockItem(VEBlocks.GAS_FIRED_FURNACE_BLOCK.get(), PROPERTIES)); + public static RegistryObject ELECTRIC_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("electric_furnace", () -> new BlockItem(VEBlocks.ELECTRIC_FURNACE_BLOCK.get(), PROPERTIES)); + public static RegistryObject BATTERY_BOX_ITEM = VE_BLOCK_ITEM_REGISTRY.register("battery_box", () -> new BlockItem(VEBlocks.BATTERY_BOX_BLOCK.get(), PROPERTIES)); + public static RegistryObject PRIMITIVE_SOLAR_PANEL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitive_solar_panel", () -> new BlockItem(VEBlocks.PRIMITIVE_SOLAR_PANEL_BLOCK.get(), PROPERTIES)); + public static RegistryObject SOLAR_PANEL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solar_panel", () -> new BlockItem(VEBlocks.SOLAR_PANEL_BLOCK.get(), PROPERTIES)); + public static RegistryObject CENTRIFUGAL_SEPARATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("centrifugal_separator", () -> new BlockItem(VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get(), PROPERTIES)); + public static RegistryObject IMPLOSION_COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("implosion_compressor", () -> new BlockItem(VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get(), PROPERTIES)); + public static RegistryObject BLAST_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("blast_furnace", () -> new BlockItem(VEBlocks.BLAST_FURNACE_BLOCK.get(), PROPERTIES)); + public static RegistryObject TOOLING_STATION_ITEM = VE_BLOCK_ITEM_REGISTRY.register("tooling_station", () -> new BlockItem(VEBlocks.TOOLING_STATION_BLOCK.get(), PROPERTIES)); + public static RegistryObject SAWMILL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("sawmill", () -> new BlockItem(VEBlocks.SAWMILL_BLOCK.get(), PROPERTIES)); + public static RegistryObject DIMENSIONAL_LASER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("dimensional_laser", () -> new BlockItem(VEBlocks.DIMENSIONAL_LASER_BLOCK.get(), PROPERTIES)); + public static RegistryObject FLUID_ELECTROLYZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("fluid_electrolyzer", () -> new BlockItem(VEBlocks.FLUID_ELECTROLYZER_BLOCK.get(), PROPERTIES)); + public static RegistryObject FLUID_MIXER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("fluid_mixer", () -> new BlockItem(VEBlocks.FLUID_MIXER_BLOCK.get(), PROPERTIES)); + public static RegistryObject HYDROPONIC_INCUBATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("hydroponic_incubator", () -> new BlockItem(VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get(), PROPERTIES)); - // Crops - //public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.LAND_CROP,properties).setRegistryName("land_crop")); - //@Deprecated // I think the rice registration here is deprecated, as it's now in VEItems - //public static RegistryObject RICE_CROP_ITEM = VE_BLOCK_ITEM_REGISTRY.register("rice_grain", VEItems.RICE_GRAIN.get()); + // Tanks + public static RegistryObject ALUMINUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_tank", () -> new BlockItem(VEBlocks.ALUMINUM_TANK_BLOCK.get(), PROPERTIES)); + public static RegistryObject TITANIUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("titanium_tank", () -> new BlockItem(VEBlocks.TITANIUM_TANK_BLOCK.get(), PROPERTIES)); + public static RegistryObject NETHERITE_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("netherite_tank", () -> new BlockItem(VEBlocks.NETHERITE_TANK_BLOCK.get(), PROPERTIES)); + public static RegistryObject NIGHALITE_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("nighalite_tank", () -> new BlockItem(VEBlocks.NIGHALITE_TANK_BLOCK.get(), PROPERTIES)); + public static RegistryObject EIGHZO_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("eighzo_tank", () -> new BlockItem(VEBlocks.EIGHZO_TANK_BLOCK.get(), PROPERTIES)); + public static RegistryObject SOLARIUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_tank", () -> new BlockItem(VEBlocks.SOLARIUM_TANK_BLOCK.get(), PROPERTIES)); - //True Blocks - //Ores - public static RegistryObject SALTPETER_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("saltpeterore",() -> new BlockItem(VEBlocks.SALTPETER_ORE.get(), PROPERTIES)); - public static RegistryObject BAUXITE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("bauxiteore",() -> new BlockItem(VEBlocks.BAUXITE_ORE.get(), PROPERTIES)); - public static RegistryObject CINNABAR_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("cinnabarore",() -> new BlockItem(VEBlocks.CINNABAR_ORE.get(), PROPERTIES)); - public static RegistryObject RUTILE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("rutileore",() -> new BlockItem(VEBlocks.RUTILE_ORE.get(), PROPERTIES)); - public static RegistryObject GALENA_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("galena_ore",() -> new BlockItem(VEBlocks.GALENA_ORE.get(), PROPERTIES)); - public static RegistryObject EIGHZO_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("eighzo_ore",() -> new BlockItem(VEBlocks.EIGHZO_ORE.get(), PROPERTIES)); + // Crops + //public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.LAND_CROP,properties).setRegistryName("land_crop")); + //@Deprecated // I think the rice registration here is deprecated, as it's now in VEItems + //public static RegistryObject RICE_CROP_ITEM = VE_BLOCK_ITEM_REGISTRY.register("rice_grain", VEItems.RICE_GRAIN.get()); - //Deepslate ores - public static RegistryObject DEEPSLATE_BAUXITE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_bauxite_ore",() -> new BlockItem(VEBlocks.DEEPSLATE_BAUXITE_ORE.get(), PROPERTIES)); - public static RegistryObject DEEPSLATE_CINNABAR_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_cinnabar_ore",() -> new BlockItem(VEBlocks.DEEPSLATE_CINNABAR_ORE.get(), PROPERTIES)); - public static RegistryObject DEEPSLATE_RUTILE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_rutile_ore",() -> new BlockItem(VEBlocks.DEEPSLATE_RUTILE_ORE.get(), PROPERTIES)); - public static RegistryObject DEEPSLATE_GALENA_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_galena_ore",() -> new BlockItem(VEBlocks.DEEPSLATE_GALENA_ORE.get(), PROPERTIES)); + //True Blocks + //Ores + public static RegistryObject SALTPETER_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("saltpeterore", () -> new BlockItem(VEBlocks.SALTPETER_ORE.get(), PROPERTIES)); + public static RegistryObject BAUXITE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("bauxiteore", () -> new BlockItem(VEBlocks.BAUXITE_ORE.get(), PROPERTIES)); + public static RegistryObject CINNABAR_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("cinnabarore", () -> new BlockItem(VEBlocks.CINNABAR_ORE.get(), PROPERTIES)); + public static RegistryObject RUTILE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("rutileore", () -> new BlockItem(VEBlocks.RUTILE_ORE.get(), PROPERTIES)); + public static RegistryObject GALENA_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("galena_ore", () -> new BlockItem(VEBlocks.GALENA_ORE.get(), PROPERTIES)); + public static RegistryObject EIGHZO_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("eighzo_ore", () -> new BlockItem(VEBlocks.EIGHZO_ORE.get(), PROPERTIES)); - public static RegistryObject RED_SALTPETER_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("red_saltpeter_ore",() -> new BlockItem(VEBlocks.RED_SALTPETER_ORE.get(), PROPERTIES)); + //Deepslate ores + public static RegistryObject DEEPSLATE_BAUXITE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_bauxite_ore", () -> new BlockItem(VEBlocks.DEEPSLATE_BAUXITE_ORE.get(), PROPERTIES)); + public static RegistryObject DEEPSLATE_CINNABAR_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_cinnabar_ore", () -> new BlockItem(VEBlocks.DEEPSLATE_CINNABAR_ORE.get(), PROPERTIES)); + public static RegistryObject DEEPSLATE_RUTILE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_rutile_ore", () -> new BlockItem(VEBlocks.DEEPSLATE_RUTILE_ORE.get(), PROPERTIES)); + public static RegistryObject DEEPSLATE_GALENA_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_galena_ore", () -> new BlockItem(VEBlocks.DEEPSLATE_GALENA_ORE.get(), PROPERTIES)); - //Shells - public static RegistryObject ALUMINUM_SHELL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_shell",() -> new BlockItem(VEBlocks.ALUMINUM_SHELL.get(), PROPERTIES)); - public static RegistryObject CARBON_SHIELDED_ALUMINUM_MACHINE_FRAME_ITEM = VE_BLOCK_ITEM_REGISTRY.register("carbon_shielded_aluminum_machine_frame",() -> new BlockItem(VEBlocks.CARBON_SHIELDED_ALUMINUM_MACHINE_FRAME.get(), PROPERTIES)); - public static RegistryObject ALUMINUM_MACHINE_CASING_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_machine_casing",() -> new BlockItem(VEBlocks.ALUMINUM_MACHINE_CASING_BLOCK.get(), PROPERTIES)); - public static RegistryObject TITANIUM_MACHINE_CASING_ITEM = VE_BLOCK_ITEM_REGISTRY.register("titanium_machine_casing",() -> new BlockItem(VEBlocks.TITANIUM_MACHINE_CASING_BLOCK.get(), PROPERTIES)); - public static RegistryObject SOLARIUM_MACHINE_CASING_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_machine_casing",() -> new BlockItem(VEBlocks.SOLARIUM_MACHINE_CASING_BLOCK.get(), PROPERTIES)); + public static RegistryObject RED_SALTPETER_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("red_saltpeter_ore", () -> new BlockItem(VEBlocks.RED_SALTPETER_ORE.get(), PROPERTIES)); - // Raw Material Storage Blocks - public static RegistryObject RAW_BAUXITE_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_bauxite_block",() -> new BlockItem(VEBlocks.RAW_BAUXITE_BLOCK.get(), PROPERTIES)); - public static RegistryObject RAW_CINNABAR_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_cinnabar_block",() -> new BlockItem(VEBlocks.RAW_CINNABAR_BLOCK.get(), PROPERTIES)); - public static RegistryObject RAW_EIGHZO_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_eighzo_block",() -> new BlockItem(VEBlocks.RAW_EIGHZO_BLOCK.get(), PROPERTIES)); - public static RegistryObject RAW_GALENA_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_galena_block",() -> new BlockItem(VEBlocks.RAW_GALENA_BLOCK.get(), PROPERTIES)); - public static RegistryObject RAW_RUTILE_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_rutile_block",() -> new BlockItem(VEBlocks.RAW_RUTILE_BLOCK.get(), PROPERTIES)); - //public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.RAW_BONE_BLOCK.get(), properties).setRegistryName("raw_bone_block")); + //Shells + public static RegistryObject ALUMINUM_SHELL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_shell", () -> new BlockItem(VEBlocks.ALUMINUM_SHELL.get(), PROPERTIES)); + public static RegistryObject CARBON_SHIELDED_ALUMINUM_MACHINE_FRAME_ITEM = VE_BLOCK_ITEM_REGISTRY.register("carbon_shielded_aluminum_machine_frame", () -> new BlockItem(VEBlocks.CARBON_SHIELDED_ALUMINUM_MACHINE_FRAME.get(), PROPERTIES)); + public static RegistryObject ALUMINUM_MACHINE_CASING_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_machine_casing", () -> new BlockItem(VEBlocks.ALUMINUM_MACHINE_CASING_BLOCK.get(), PROPERTIES)); + public static RegistryObject TITANIUM_MACHINE_CASING_ITEM = VE_BLOCK_ITEM_REGISTRY.register("titanium_machine_casing", () -> new BlockItem(VEBlocks.TITANIUM_MACHINE_CASING_BLOCK.get(), PROPERTIES)); + public static RegistryObject SOLARIUM_MACHINE_CASING_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_machine_casing", () -> new BlockItem(VEBlocks.SOLARIUM_MACHINE_CASING_BLOCK.get(), PROPERTIES)); - public static RegistryObject PRESSURE_LADDER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("pressure_ladder",() -> new BlockItem(VEBlocks.PRESSURE_LADDER.get(), PROPERTIES)); + // Raw Material Storage Blocks + public static RegistryObject RAW_BAUXITE_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_bauxite_block", () -> new BlockItem(VEBlocks.RAW_BAUXITE_BLOCK.get(), PROPERTIES)); + public static RegistryObject RAW_CINNABAR_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_cinnabar_block", () -> new BlockItem(VEBlocks.RAW_CINNABAR_BLOCK.get(), PROPERTIES)); + public static RegistryObject RAW_EIGHZO_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_eighzo_block", () -> new BlockItem(VEBlocks.RAW_EIGHZO_BLOCK.get(), PROPERTIES)); + public static RegistryObject RAW_GALENA_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_galena_block", () -> new BlockItem(VEBlocks.RAW_GALENA_BLOCK.get(), PROPERTIES)); + public static RegistryObject RAW_RUTILE_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_rutile_block", () -> new BlockItem(VEBlocks.RAW_RUTILE_BLOCK.get(), PROPERTIES)); + //public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.RAW_BONE_BLOCK.get(), properties).setRegistryName("raw_bone_block")); - // Material Storage Blocks - public static RegistryObject SOLARIUM_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_block",() -> new BlockItem(VEBlocks.SOLARIUM_BLOCK.get(), PROPERTIES)); + public static RegistryObject PRESSURE_LADDER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("pressure_ladder", () -> new BlockItem(VEBlocks.PRESSURE_LADDER.get(), PROPERTIES)); + + // Material Storage Blocks + public static RegistryObject SOLARIUM_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_block", () -> new BlockItem(VEBlocks.SOLARIUM_BLOCK.get(), PROPERTIES)); /*public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.ALUMINUM_BLOCK.get(),properties).setRegistryName("aluminum_block")); public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.CARBON_BLOCK.get(),properties).setRegistryName("carbon_block")); public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.EIGHZO_BLOCK.get(),properties).setRegistryName("eighzo_block")); diff --git a/src/main/java/com/veteam/voluminousenergy/items/VEItems.java b/src/main/java/com/veteam/voluminousenergy/items/VEItems.java index 40e7aca7b..c586b4bed 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/VEItems.java +++ b/src/main/java/com/veteam/voluminousenergy/items/VEItems.java @@ -40,118 +40,118 @@ public class VEItems { // Misc public static RegistryObject PETCOKE = VE_ITEM_REGISTRY.register("petcoke", Petcoke::new); - public static RegistryObject COALCOKE = VE_ITEM_REGISTRY.register("coalcoke",CoalCoke::new); - public static RegistryObject SALTPETERCHUNK = VE_ITEM_REGISTRY.register("saltpeterchunk",SaltpeterChunk::new); - public static RegistryObject SILICON = VE_ITEM_REGISTRY.register("silicon",Silicon::new); - public static RegistryObject SHREDDED_BIOMASS = VE_ITEM_REGISTRY.register("shredded_biomass",ShreddedBiomass::new); - public static RegistryObject ROSIN = VE_ITEM_REGISTRY.register("rosin",Rosin::new); + public static RegistryObject COALCOKE = VE_ITEM_REGISTRY.register("coalcoke", CoalCoke::new); + public static RegistryObject SALTPETERCHUNK = VE_ITEM_REGISTRY.register("saltpeterchunk", SaltpeterChunk::new); + public static RegistryObject SILICON = VE_ITEM_REGISTRY.register("silicon", Silicon::new); + public static RegistryObject SHREDDED_BIOMASS = VE_ITEM_REGISTRY.register("shredded_biomass", ShreddedBiomass::new); + public static RegistryObject ROSIN = VE_ITEM_REGISTRY.register("rosin", Rosin::new); public static RegistryObject ANIMAL_FAT = VE_ITEM_REGISTRY.register("animal_fat", AnimalFat::new); public static RegistryObject DOUGH = VE_ITEM_REGISTRY.register("dough", Dough::new); // Raw Ore - public static RegistryObject RAW_BAUXITE = VE_ITEM_REGISTRY.register("raw_bauxite",RawBauxite::new); - public static RegistryObject RAW_CINNABAR = VE_ITEM_REGISTRY.register("raw_cinnabar",RawCinnabar::new); - public static RegistryObject RAW_GALENA = VE_ITEM_REGISTRY.register("raw_galena",RawGalena::new); - public static RegistryObject RAW_RUTILE = VE_ITEM_REGISTRY.register("raw_rutile",RawRutile::new); - public static RegistryObject RAW_SULFUR = VE_ITEM_REGISTRY.register("raw_sulfur",RawSulfur::new); - public static RegistryObject RAW_EIGHZO = VE_ITEM_REGISTRY.register("raw_eighzo",RawEighzo::new); + public static RegistryObject RAW_BAUXITE = VE_ITEM_REGISTRY.register("raw_bauxite", RawBauxite::new); + public static RegistryObject RAW_CINNABAR = VE_ITEM_REGISTRY.register("raw_cinnabar", RawCinnabar::new); + public static RegistryObject RAW_GALENA = VE_ITEM_REGISTRY.register("raw_galena", RawGalena::new); + public static RegistryObject RAW_RUTILE = VE_ITEM_REGISTRY.register("raw_rutile", RawRutile::new); + public static RegistryObject RAW_SULFUR = VE_ITEM_REGISTRY.register("raw_sulfur", RawSulfur::new); + public static RegistryObject RAW_EIGHZO = VE_ITEM_REGISTRY.register("raw_eighzo", RawEighzo::new); //Dusts - public static RegistryObject COALDUST = VE_ITEM_REGISTRY.register("coaldust",CoalDust::new); - public static RegistryObject COKEDUST = VE_ITEM_REGISTRY.register("cokedust",CokeDust::new); - public static RegistryObject LAPISDUST = VE_ITEM_REGISTRY.register("lapisdust",LapisDust::new); - public static RegistryObject SULFURDUST = VE_ITEM_REGISTRY.register("sulfurdust",SulfurDust::new); - public static RegistryObject CARBONDUST = VE_ITEM_REGISTRY.register("carbondust",CarbonDust::new); - public static RegistryObject SALTPETERDUST = VE_ITEM_REGISTRY.register("saltpeterdust",SaltpeterDust::new); - public static RegistryObject ALUMINUM_DUST = VE_ITEM_REGISTRY.register("aluminum_dust",AluminumDust::new); - public static RegistryObject BAUXITE_DUST = VE_ITEM_REGISTRY.register("bauxite_dust",BauxiteDust::new); - public static RegistryObject CINNABAR_DUST = VE_ITEM_REGISTRY.register("cinnabar_dust",CinnabarDust::new); - public static RegistryObject IRON_DUST = VE_ITEM_REGISTRY.register("iron_dust",IronDust::new); - public static RegistryObject QUARTZ_DUST = VE_ITEM_REGISTRY.register("quartz_dust",QuartzDust::new); - public static RegistryObject SAND_DUST = VE_ITEM_REGISTRY.register("sand_dust",SandDust::new); - public static RegistryObject SOULSAND_DUST = VE_ITEM_REGISTRY.register("soulsand_dust",SoulsandDust::new); - public static RegistryObject TITANIUM_DUST = VE_ITEM_REGISTRY.register("titanium_dust",TitaniumDust::new); - public static RegistryObject RUTILE_DUST = VE_ITEM_REGISTRY.register("rutile_dust",RutileDust::new); - public static RegistryObject GALENA_DUST = VE_ITEM_REGISTRY.register("galena_dust",GalenaDust::new); - public static RegistryObject LEAD_DUST = VE_ITEM_REGISTRY.register("lead_dust",LeadDust::new); - public static RegistryObject SILVER_DUST = VE_ITEM_REGISTRY.register("silver_dust",SilverDust::new); - public static RegistryObject GOLD_DUST = VE_ITEM_REGISTRY.register("gold_dust",GoldDust::new); - public static RegistryObject PHOTOVOLTAIC_DUST = VE_ITEM_REGISTRY.register("photovoltaic_dust",PhotovoltaicDust::new); - public static RegistryObject END_STONE_DUST = VE_ITEM_REGISTRY.register("end_stone_dust",EndStoneDust::new); - public static RegistryObject BASALT_DUST = VE_ITEM_REGISTRY.register("basalt_dust",BasaltDust::new); - public static RegistryObject FLINT_DUST = VE_ITEM_REGISTRY.register("flint_dust",FlintDust::new); - public static RegistryObject NETHERRACK_DUST = VE_ITEM_REGISTRY.register("netherrack_dust",NetherrackDust::new); - public static RegistryObject NETHERITE_DUST = VE_ITEM_REGISTRY.register("netherite_dust",NetheriteDust::new); - public static RegistryObject TUNGSTEN_DUST = VE_ITEM_REGISTRY.register("tungsten_dust",TungstenDust::new); - public static RegistryObject EIGHZO_DUST = VE_ITEM_REGISTRY.register("eighzo_dust",EighzoDust::new); - public static RegistryObject SOLARIUM_DUST = VE_ITEM_REGISTRY.register("solarium_dust",SolariumDust::new); - public static RegistryObject COPPER_DUST = VE_ITEM_REGISTRY.register("copper_dust",CopperDust::new); - public static RegistryObject COPPER_CARBONATE_DUST = VE_ITEM_REGISTRY.register("copper_carbonate_dust",CopperCarbonateDust::new); - public static RegistryObject CUPRIC_OXIDE_DUST = VE_ITEM_REGISTRY.register("cupric_oxide_dust",CupricOxideDust::new); - public static RegistryObject SAW_DUST = VE_ITEM_REGISTRY.register("saw_dust",SawDust::new); - public static RegistryObject FLOUR_DUST = VE_ITEM_REGISTRY.register("flour_dust",FlourDust::new); + public static RegistryObject COALDUST = VE_ITEM_REGISTRY.register("coaldust", CoalDust::new); + public static RegistryObject COKEDUST = VE_ITEM_REGISTRY.register("cokedust", CokeDust::new); + public static RegistryObject LAPISDUST = VE_ITEM_REGISTRY.register("lapisdust", LapisDust::new); + public static RegistryObject SULFURDUST = VE_ITEM_REGISTRY.register("sulfurdust", SulfurDust::new); + public static RegistryObject CARBONDUST = VE_ITEM_REGISTRY.register("carbondust", CarbonDust::new); + public static RegistryObject SALTPETERDUST = VE_ITEM_REGISTRY.register("saltpeterdust", SaltpeterDust::new); + public static RegistryObject ALUMINUM_DUST = VE_ITEM_REGISTRY.register("aluminum_dust", AluminumDust::new); + public static RegistryObject BAUXITE_DUST = VE_ITEM_REGISTRY.register("bauxite_dust", BauxiteDust::new); + public static RegistryObject CINNABAR_DUST = VE_ITEM_REGISTRY.register("cinnabar_dust", CinnabarDust::new); + public static RegistryObject IRON_DUST = VE_ITEM_REGISTRY.register("iron_dust", IronDust::new); + public static RegistryObject QUARTZ_DUST = VE_ITEM_REGISTRY.register("quartz_dust", QuartzDust::new); + public static RegistryObject SAND_DUST = VE_ITEM_REGISTRY.register("sand_dust", SandDust::new); + public static RegistryObject SOULSAND_DUST = VE_ITEM_REGISTRY.register("soulsand_dust", SoulsandDust::new); + public static RegistryObject TITANIUM_DUST = VE_ITEM_REGISTRY.register("titanium_dust", TitaniumDust::new); + public static RegistryObject RUTILE_DUST = VE_ITEM_REGISTRY.register("rutile_dust", RutileDust::new); + public static RegistryObject GALENA_DUST = VE_ITEM_REGISTRY.register("galena_dust", GalenaDust::new); + public static RegistryObject LEAD_DUST = VE_ITEM_REGISTRY.register("lead_dust", LeadDust::new); + public static RegistryObject SILVER_DUST = VE_ITEM_REGISTRY.register("silver_dust", SilverDust::new); + public static RegistryObject GOLD_DUST = VE_ITEM_REGISTRY.register("gold_dust", GoldDust::new); + public static RegistryObject PHOTOVOLTAIC_DUST = VE_ITEM_REGISTRY.register("photovoltaic_dust", PhotovoltaicDust::new); + public static RegistryObject END_STONE_DUST = VE_ITEM_REGISTRY.register("end_stone_dust", EndStoneDust::new); + public static RegistryObject BASALT_DUST = VE_ITEM_REGISTRY.register("basalt_dust", BasaltDust::new); + public static RegistryObject FLINT_DUST = VE_ITEM_REGISTRY.register("flint_dust", FlintDust::new); + public static RegistryObject NETHERRACK_DUST = VE_ITEM_REGISTRY.register("netherrack_dust", NetherrackDust::new); + public static RegistryObject NETHERITE_DUST = VE_ITEM_REGISTRY.register("netherite_dust", NetheriteDust::new); + public static RegistryObject TUNGSTEN_DUST = VE_ITEM_REGISTRY.register("tungsten_dust", TungstenDust::new); + public static RegistryObject EIGHZO_DUST = VE_ITEM_REGISTRY.register("eighzo_dust", EighzoDust::new); + public static RegistryObject SOLARIUM_DUST = VE_ITEM_REGISTRY.register("solarium_dust", SolariumDust::new); + public static RegistryObject COPPER_DUST = VE_ITEM_REGISTRY.register("copper_dust", CopperDust::new); + public static RegistryObject COPPER_CARBONATE_DUST = VE_ITEM_REGISTRY.register("copper_carbonate_dust", CopperCarbonateDust::new); + public static RegistryObject CUPRIC_OXIDE_DUST = VE_ITEM_REGISTRY.register("cupric_oxide_dust", CupricOxideDust::new); + public static RegistryObject SAW_DUST = VE_ITEM_REGISTRY.register("saw_dust", SawDust::new); + public static RegistryObject FLOUR_DUST = VE_ITEM_REGISTRY.register("flour_dust", FlourDust::new); //Ingots and Bricks - public static RegistryObject CARBON_BRICK = VE_ITEM_REGISTRY.register("carbonbrick",CarbonBrick::new); - public static RegistryObject ALUMINUM_INGOT = VE_ITEM_REGISTRY.register("aluminum_ingot",AluminumIngot::new); - public static RegistryObject TITANIUM_INGOT = VE_ITEM_REGISTRY.register("titanium_ingot",TitaniumIngot::new); - public static RegistryObject LEAD_INGOT = VE_ITEM_REGISTRY.register("lead_ingot",LeadIngot::new); - public static RegistryObject SILVER_INGOT = VE_ITEM_REGISTRY.register("silver_ingot",SilverIngot::new); - public static RegistryObject STEEL_INGOT = VE_ITEM_REGISTRY.register("steel_ingot",SteelIngot::new); - public static RegistryObject TUNGSTEN_INGOT = VE_ITEM_REGISTRY.register("tungsten_ingot",TungstenIngot::new); - public static RegistryObject TUNGSTEN_STEEL_INGOT = VE_ITEM_REGISTRY.register("tungsten_steel_ingot",TungstenSteelIngot::new); - public static RegistryObject NIGHALITE_INGOT = VE_ITEM_REGISTRY.register("nighalite_ingot",NighaliteIngot::new); - public static RegistryObject EIGHZO_INGOT = VE_ITEM_REGISTRY.register("eighzo_ingot",EighzoIngot::new); - public static RegistryObject SOLARIUM_INGOT = VE_ITEM_REGISTRY.register("solarium_ingot",SolariumIngot::new); + public static RegistryObject CARBON_BRICK = VE_ITEM_REGISTRY.register("carbonbrick", CarbonBrick::new); + public static RegistryObject ALUMINUM_INGOT = VE_ITEM_REGISTRY.register("aluminum_ingot", AluminumIngot::new); + public static RegistryObject TITANIUM_INGOT = VE_ITEM_REGISTRY.register("titanium_ingot", TitaniumIngot::new); + public static RegistryObject LEAD_INGOT = VE_ITEM_REGISTRY.register("lead_ingot", LeadIngot::new); + public static RegistryObject SILVER_INGOT = VE_ITEM_REGISTRY.register("silver_ingot", SilverIngot::new); + public static RegistryObject STEEL_INGOT = VE_ITEM_REGISTRY.register("steel_ingot", SteelIngot::new); + public static RegistryObject TUNGSTEN_INGOT = VE_ITEM_REGISTRY.register("tungsten_ingot", TungstenIngot::new); + public static RegistryObject TUNGSTEN_STEEL_INGOT = VE_ITEM_REGISTRY.register("tungsten_steel_ingot", TungstenSteelIngot::new); + public static RegistryObject NIGHALITE_INGOT = VE_ITEM_REGISTRY.register("nighalite_ingot", NighaliteIngot::new); + public static RegistryObject EIGHZO_INGOT = VE_ITEM_REGISTRY.register("eighzo_ingot", EighzoIngot::new); + public static RegistryObject SOLARIUM_INGOT = VE_ITEM_REGISTRY.register("solarium_ingot", SolariumIngot::new); //Gears - public static RegistryObject STONE_GEAR = VE_ITEM_REGISTRY.register("stonegear",StoneGear::new); - public static RegistryObject IRON_GEAR = VE_ITEM_REGISTRY.register("irongear",IronGear::new); - public static RegistryObject CARBON_GEAR = VE_ITEM_REGISTRY.register("carbongear",CarbonGear::new); - public static RegistryObject ALUMINUM_GEAR = VE_ITEM_REGISTRY.register("aluminum_gear",AluminumGear::new); - public static RegistryObject TITANIUM_GEAR = VE_ITEM_REGISTRY.register("titanium_gear",TitaniumGear::new); - public static RegistryObject SOLARIUM_GEAR = VE_ITEM_REGISTRY.register("solarium_gear",SolariumGear::new); + public static RegistryObject STONE_GEAR = VE_ITEM_REGISTRY.register("stonegear", StoneGear::new); + public static RegistryObject IRON_GEAR = VE_ITEM_REGISTRY.register("irongear", IronGear::new); + public static RegistryObject CARBON_GEAR = VE_ITEM_REGISTRY.register("carbongear", CarbonGear::new); + public static RegistryObject ALUMINUM_GEAR = VE_ITEM_REGISTRY.register("aluminum_gear", AluminumGear::new); + public static RegistryObject TITANIUM_GEAR = VE_ITEM_REGISTRY.register("titanium_gear", TitaniumGear::new); + public static RegistryObject SOLARIUM_GEAR = VE_ITEM_REGISTRY.register("solarium_gear", SolariumGear::new); //Plates - public static RegistryObject ALUMINUM_PLATE = VE_ITEM_REGISTRY.register("aluminum_plate",AluminumPlate::new); - public static RegistryObject CARBON_PLATE = VE_ITEM_REGISTRY.register("carbon_plate",CarbonPlate::new); - public static RegistryObject TITANIUM_PLATE = VE_ITEM_REGISTRY.register("titanium_plate",TitaniumPlate::new); - public static RegistryObject SOLARIUM_PLATE = VE_ITEM_REGISTRY.register("solarium_plate",SolariumPlate::new); + public static RegistryObject ALUMINUM_PLATE = VE_ITEM_REGISTRY.register("aluminum_plate", AluminumPlate::new); + public static RegistryObject CARBON_PLATE = VE_ITEM_REGISTRY.register("carbon_plate", CarbonPlate::new); + public static RegistryObject TITANIUM_PLATE = VE_ITEM_REGISTRY.register("titanium_plate", TitaniumPlate::new); + public static RegistryObject SOLARIUM_PLATE = VE_ITEM_REGISTRY.register("solarium_plate", SolariumPlate::new); //Microchips - public static RegistryObject GOLD_MICROCHIP = VE_ITEM_REGISTRY.register("gold_microchip",GoldMicrochip::new); - public static RegistryObject SILVER_MICROCHIP = VE_ITEM_REGISTRY.register("silver_microchip",SilverMicrochip::new); + public static RegistryObject GOLD_MICROCHIP = VE_ITEM_REGISTRY.register("gold_microchip", GoldMicrochip::new); + public static RegistryObject SILVER_MICROCHIP = VE_ITEM_REGISTRY.register("silver_microchip", SilverMicrochip::new); //Upgrades - public static RegistryObject QUARTZ_MULTIPLIER = VE_ITEM_REGISTRY.register("quartz_multiplier",QuartzMultiplier::new); - public static RegistryObject MYSTERIOUS_MULTIPLIER = VE_ITEM_REGISTRY.register("mysterious_multiplier",MysteriousMultiplier::new); + public static RegistryObject QUARTZ_MULTIPLIER = VE_ITEM_REGISTRY.register("quartz_multiplier", QuartzMultiplier::new); + public static RegistryObject MYSTERIOUS_MULTIPLIER = VE_ITEM_REGISTRY.register("mysterious_multiplier", MysteriousMultiplier::new); //Batteries - public static RegistryObject MERCURY_BATTERY = VE_ITEM_REGISTRY.register("mercury_battery",MercuryBattery::new); - public static RegistryObject LEAD_ACID_BATTERY = VE_ITEM_REGISTRY.register("lead_acid_battery",LeadAcidBattery::new); - public static RegistryObject MERCURY_BATTERY_PACK = VE_ITEM_REGISTRY.register("mercury_battery_pack",MercuryBatteryPack::new); - public static RegistryObject LEAD_ACID_BATTERY_PACK = VE_ITEM_REGISTRY.register("lead_acid_battery_pack",LeadAcidBatteryPack::new); + public static RegistryObject MERCURY_BATTERY = VE_ITEM_REGISTRY.register("mercury_battery", MercuryBattery::new); + public static RegistryObject LEAD_ACID_BATTERY = VE_ITEM_REGISTRY.register("lead_acid_battery", LeadAcidBattery::new); + public static RegistryObject MERCURY_BATTERY_PACK = VE_ITEM_REGISTRY.register("mercury_battery_pack", MercuryBatteryPack::new); + public static RegistryObject LEAD_ACID_BATTERY_PACK = VE_ITEM_REGISTRY.register("lead_acid_battery_pack", LeadAcidBatteryPack::new); - public static RegistryObject TITANIUM_SAWBLADE = VE_ITEM_REGISTRY.register("titanium_sawblade",TitaniumSawblade::new); + public static RegistryObject TITANIUM_SAWBLADE = VE_ITEM_REGISTRY.register("titanium_sawblade", TitaniumSawblade::new); //Tank Frames - public static RegistryObject STANDARD_TANK_FRAME = VE_ITEM_REGISTRY.register("standard_tank_frame",StandardTankFrame::new); - public static RegistryObject ROBUST_TANK_FRAME = VE_ITEM_REGISTRY.register("robust_tank_frame",RobustTankFrame::new); - public static RegistryObject IMPECCABLE_TANK_FRAME = VE_ITEM_REGISTRY.register("impeccable_tank_frame",ImpeccableTankFrame::new); + public static RegistryObject STANDARD_TANK_FRAME = VE_ITEM_REGISTRY.register("standard_tank_frame", StandardTankFrame::new); + public static RegistryObject ROBUST_TANK_FRAME = VE_ITEM_REGISTRY.register("robust_tank_frame", RobustTankFrame::new); + public static RegistryObject IMPECCABLE_TANK_FRAME = VE_ITEM_REGISTRY.register("impeccable_tank_frame", ImpeccableTankFrame::new); //Crops - public static RegistryObject RICE_GRAIN = VE_ITEM_REGISTRY.register("rice_grain",() -> new RiceItem(new Item.Properties())); // Can refactor to call the block here or in the item's class - public static RegistryObject COOKED_RICE = VE_ITEM_REGISTRY.register("cooked_rice",() -> new Item(new Item.Properties().food(VEFoods.COOKED_RICE))); + public static RegistryObject RICE_GRAIN = VE_ITEM_REGISTRY.register("rice_grain", () -> new RiceItem(new Item.Properties())); // Can refactor to call the block here or in the item's class + public static RegistryObject COOKED_RICE = VE_ITEM_REGISTRY.register("cooked_rice", () -> new Item(new Item.Properties().food(VEFoods.COOKED_RICE))); //Scanner - public static RegistryObject FLUID_SCANNER = VE_ITEM_REGISTRY.register("fluid_scanner",FluidScanner::new); - public static RegistryObject CREATIVE_FLUID_SCANNER = VE_ITEM_REGISTRY.register("creative_fluid_scanner",CreativeFluidScanner::new); + public static RegistryObject FLUID_SCANNER = VE_ITEM_REGISTRY.register("fluid_scanner", FluidScanner::new); + public static RegistryObject CREATIVE_FLUID_SCANNER = VE_ITEM_REGISTRY.register("creative_fluid_scanner", CreativeFluidScanner::new); public static RegistryObject RFID_CHIP = VE_ITEM_REGISTRY.register("rfid_chip", RFIDChip::new); //Tiny fuels - public static RegistryObject TINY_CHARCOAL = VE_ITEM_REGISTRY.register("tiny_charcoal",TinyCharcoal::new); - public static RegistryObject TINY_COAL = VE_ITEM_REGISTRY.register("tiny_coal",TinyCoal::new); - public static RegistryObject TINY_COAL_COKE = VE_ITEM_REGISTRY.register("tiny_coal_coke",TinyCoalCoke::new); - public static RegistryObject TINY_PETCOKE = VE_ITEM_REGISTRY.register("tiny_petcoke",TinyPetcoke::new); - public static RegistryObject TINY_ROSIN = VE_ITEM_REGISTRY.register("tiny_rosin",TinyRosin::new); + public static RegistryObject TINY_CHARCOAL = VE_ITEM_REGISTRY.register("tiny_charcoal", TinyCharcoal::new); + public static RegistryObject TINY_COAL = VE_ITEM_REGISTRY.register("tiny_coal", TinyCoal::new); + public static RegistryObject TINY_COAL_COKE = VE_ITEM_REGISTRY.register("tiny_coal_coke", TinyCoalCoke::new); + public static RegistryObject TINY_PETCOKE = VE_ITEM_REGISTRY.register("tiny_petcoke", TinyPetcoke::new); + public static RegistryObject TINY_ROSIN = VE_ITEM_REGISTRY.register("tiny_rosin", TinyRosin::new); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/batteries/LeadAcidBattery.java b/src/main/java/com/veteam/voluminousenergy/items/batteries/LeadAcidBattery.java index 774600318..98ec15291 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/batteries/LeadAcidBattery.java +++ b/src/main/java/com/veteam/voluminousenergy/items/batteries/LeadAcidBattery.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.items.batteries; -public class LeadAcidBattery extends VEEnergyItem{ +public class LeadAcidBattery extends VEEnergyItem { private static final int MAX_ENERGY = 250_000; private static final int MAX_TX = 1000; diff --git a/src/main/java/com/veteam/voluminousenergy/items/batteries/MercuryBattery.java b/src/main/java/com/veteam/voluminousenergy/items/batteries/MercuryBattery.java index a3e1d50bb..2f888cb5a 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/batteries/MercuryBattery.java +++ b/src/main/java/com/veteam/voluminousenergy/items/batteries/MercuryBattery.java @@ -1,12 +1,12 @@ package com.veteam.voluminousenergy.items.batteries; -public class MercuryBattery extends VEEnergyItem{ +public class MercuryBattery extends VEEnergyItem { private static final int MAX_ENERGY = 500_000; private static final int MAX_TX = 500; public MercuryBattery() { super(new Properties() - .stacksTo(1), + .stacksTo(1), MAX_ENERGY, MAX_TX); setRegistryName("mercury_battery"); diff --git a/src/main/java/com/veteam/voluminousenergy/items/batteries/MercuryBatteryPack.java b/src/main/java/com/veteam/voluminousenergy/items/batteries/MercuryBatteryPack.java index 387058832..a05d04b57 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/batteries/MercuryBatteryPack.java +++ b/src/main/java/com/veteam/voluminousenergy/items/batteries/MercuryBatteryPack.java @@ -7,7 +7,7 @@ public class MercuryBatteryPack extends VEEnergyItem { public MercuryBatteryPack() { super(new Properties() - .stacksTo(1), + .stacksTo(1), MAX_ENERGY, MAX_TX ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/batteries/VEEnergyItem.java b/src/main/java/com/veteam/voluminousenergy/items/batteries/VEEnergyItem.java index edc23f487..66db9476c 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/batteries/VEEnergyItem.java +++ b/src/main/java/com/veteam/voluminousenergy/items/batteries/VEEnergyItem.java @@ -27,29 +27,29 @@ public class VEEnergyItem extends VEItem { private final int maxTransfer; @Deprecated - public VEEnergyItem(Properties properties, int maxEnergy, int maxTransfer){ + public VEEnergyItem(Properties properties, int maxEnergy, int maxTransfer) { super(properties); this.maxEnergy = maxEnergy; this.maxTransfer = maxTransfer; } - public static float getChargeRatio(ItemStack stack){ + public static float getChargeRatio(ItemStack stack) { LazyOptional energy = stack.getCapability(ForgeCapabilities.ENERGY); - if(energy.isPresent()){ + if (energy.isPresent()) { IEnergyStorage energyStorage = energy.orElseThrow(IllegalStateException::new); - return (float) energyStorage.getEnergyStored()/ energyStorage.getMaxEnergyStored(); + return (float) energyStorage.getEnergyStored() / energyStorage.getMaxEnergyStored(); } return 0; } @Nullable @Override - public ICapabilityProvider initCapabilities(ItemStack itemStack, @Nullable CompoundTag nbt){ + public ICapabilityProvider initCapabilities(ItemStack itemStack, @Nullable CompoundTag nbt) { return new ICapabilityProvider() { @Nonnull @Override public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { - if(cap == ForgeCapabilities.ENERGY){ + if (cap == ForgeCapabilities.ENERGY) { return LazyOptional.of(() -> new VEEnergyItemStorage(itemStack, maxEnergy, maxTransfer)).cast(); } return LazyOptional.empty(); @@ -58,11 +58,11 @@ public LazyOptional getCapability(@Nonnull Capability cap, @Nullable D } @Override - public void appendHoverText(ItemStack itemStack, @Nullable Level world, List tooltip, TooltipFlag flag){ - if(ForgeCapabilities.ENERGY == null) return; // sanity check - itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(e ->{ + public void appendHoverText(ItemStack itemStack, @Nullable Level world, List tooltip, TooltipFlag flag) { + if (ForgeCapabilities.ENERGY == null) return; // sanity check + itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(e -> { Component textComponent; - if (Config.SHORTEN_ITEM_TOOLTIP_VALUES.get()){ + if (Config.SHORTEN_ITEM_TOOLTIP_VALUES.get()) { textComponent = TextUtil.translateString("text.voluminousenergy.energy").copy().append(": " + NumberUtil.numberToString4FE(e.getEnergyStored()) + " / " + NumberUtil.numberToString4FE(e.getMaxEnergyStored())); } else { textComponent = TextUtil.translateString("text.voluminousenergy.energy").copy().append(": " + NumberUtil.formatNumber(e.getEnergyStored()) + " FE / " + NumberUtil.formatNumber(e.getMaxEnergyStored()) + " FE"); @@ -72,10 +72,12 @@ public void appendHoverText(ItemStack itemStack, @Nullable Level world, List use(Level world, Player playerEntity, InteractionHand hand){ + public InteractionResultHolder use(Level world, Player playerEntity, InteractionHand hand) { ItemStack itemStack = playerEntity.getItemInHand(hand); BlockHitResult rayTraceResult = getPlayerPOVHitResult(world, playerEntity, ClipContext.Fluid.SOURCE_ONLY); - if(rayTraceResult.getType() == HitResult.Type.MISS){ + if (rayTraceResult.getType() == HitResult.Type.MISS) { return InteractionResultHolder.pass(itemStack); } - if (rayTraceResult.getType() == HitResult.Type.BLOCK){ + if (rayTraceResult.getType() == HitResult.Type.BLOCK) { BlockPos pos = rayTraceResult.getBlockPos(); Direction dir = rayTraceResult.getDirection(); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/AluminumDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/AluminumDust.java index 74f120882..bc2eae0f2 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/AluminumDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/AluminumDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class AluminumDust extends VEItem { - public AluminumDust (){ + public AluminumDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/BasaltDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/BasaltDust.java index fd9c0d37a..68cd6f111 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/BasaltDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/BasaltDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class BasaltDust extends VEItem { - public BasaltDust(){ + public BasaltDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/BauxiteDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/BauxiteDust.java index 7d6b11b85..ab20b7abc 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/BauxiteDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/BauxiteDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class BauxiteDust extends VEItem { - public BauxiteDust (){ + public BauxiteDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/CarbonDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/CarbonDust.java index c81dc2ab5..1c0f22acb 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/CarbonDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/CarbonDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class CarbonDust extends VEItem { - public CarbonDust (){ + public CarbonDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/CinnabarDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/CinnabarDust.java index 1fd1443a8..8c7b5851a 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/CinnabarDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/CinnabarDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class CinnabarDust extends VEItem { - public CinnabarDust (){ + public CinnabarDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/CoalDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/CoalDust.java index 941428c6d..deeb06ff8 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/CoalDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/CoalDust.java @@ -4,9 +4,9 @@ import net.minecraft.world.item.Item; public class CoalDust extends VEItem { - public CoalDust (){ + public CoalDust() { super(new Item.Properties() - .stacksTo(64) + .stacksTo(64) ); setRegistryName("coaldust"); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/CokeDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/CokeDust.java index a59c36e20..481e24788 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/CokeDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/CokeDust.java @@ -4,9 +4,9 @@ import net.minecraft.world.item.Item; public class CokeDust extends VEItem { - public CokeDust (){ + public CokeDust() { super(new Item.Properties() - .stacksTo(64) + .stacksTo(64) ); setRegistryName("cokedust"); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/CopperCarbonateDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/CopperCarbonateDust.java index 6634dbe80..020192c4c 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/CopperCarbonateDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/CopperCarbonateDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class CopperCarbonateDust extends VEItem { - public CopperCarbonateDust (){ + public CopperCarbonateDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/CopperDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/CopperDust.java index d80fa4212..e0371bdaa 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/CopperDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/CopperDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class CopperDust extends VEItem { - public CopperDust (){ + public CopperDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/CupricOxideDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/CupricOxideDust.java index 5b96b7e26..e57006675 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/CupricOxideDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/CupricOxideDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class CupricOxideDust extends VEItem { - public CupricOxideDust(){ + public CupricOxideDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/EighzoDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/EighzoDust.java index 31974cfe9..0749483c2 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/EighzoDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/EighzoDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class EighzoDust extends VEItem { - public EighzoDust (){ + public EighzoDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/EndStoneDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/EndStoneDust.java index cff0fb2ea..df2c8b982 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/EndStoneDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/EndStoneDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class EndStoneDust extends VEItem { - public EndStoneDust(){ + public EndStoneDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/FlintDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/FlintDust.java index 2b6b0df12..ace489e44 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/FlintDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/FlintDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class FlintDust extends VEItem { - public FlintDust(){ + public FlintDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/FlourDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/FlourDust.java index 4d42dd85e..723f64142 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/FlourDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/FlourDust.java @@ -3,7 +3,7 @@ import net.minecraft.world.item.Item; public class FlourDust extends Item { - public FlourDust(){ + public FlourDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/GalenaDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/GalenaDust.java index c100bc03a..5fc7b5986 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/GalenaDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/GalenaDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class GalenaDust extends VEItem { - public GalenaDust (){ + public GalenaDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/GoldDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/GoldDust.java index 4c9104175..5160cd96b 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/GoldDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/GoldDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class GoldDust extends VEItem { - public GoldDust (){ + public GoldDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/IronDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/IronDust.java index 475802479..6451b4575 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/IronDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/IronDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class IronDust extends VEItem { - public IronDust (){ + public IronDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/LapisDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/LapisDust.java index 66355c58a..33f1c9d03 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/LapisDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/LapisDust.java @@ -4,9 +4,9 @@ import net.minecraft.world.item.Item; public class LapisDust extends VEItem { - public LapisDust(){ + public LapisDust() { super(new Item.Properties() - .stacksTo(64) + .stacksTo(64) ); setRegistryName("lapisdust"); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/LeadDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/LeadDust.java index 1c20473e0..78a84e159 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/LeadDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/LeadDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class LeadDust extends VEItem { - public LeadDust(){ + public LeadDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/NetheriteDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/NetheriteDust.java index a165e4a4a..710eabb71 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/NetheriteDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/NetheriteDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class NetheriteDust extends VEItem { - public NetheriteDust(){ + public NetheriteDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/NetherrackDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/NetherrackDust.java index 8023b03f5..5b7095d5e 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/NetherrackDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/NetherrackDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class NetherrackDust extends VEItem { - public NetherrackDust(){ + public NetherrackDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/PhotovoltaicDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/PhotovoltaicDust.java index 2695f22e7..e620e97f7 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/PhotovoltaicDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/PhotovoltaicDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class PhotovoltaicDust extends VEItem { - public PhotovoltaicDust(){ + public PhotovoltaicDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/QuartzDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/QuartzDust.java index 229776c31..d5d2ecf48 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/QuartzDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/QuartzDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class QuartzDust extends VEItem { - public QuartzDust (){ + public QuartzDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/RutileDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/RutileDust.java index e250a9f19..0cda749f3 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/RutileDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/RutileDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class RutileDust extends VEItem { - public RutileDust (){ + public RutileDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/SaltpeterDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/SaltpeterDust.java index 35cdbff9d..70427153e 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/SaltpeterDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/SaltpeterDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class SaltpeterDust extends VEItem { - public SaltpeterDust (){ + public SaltpeterDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/SandDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/SandDust.java index 73f4317a9..c012985ee 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/SandDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/SandDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class SandDust extends VEItem { - public SandDust (){ + public SandDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/SawDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/SawDust.java index 12f91905e..b0f4b0ef5 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/SawDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/SawDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class SawDust extends VEItem { - public SawDust (){ + public SawDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/SilverDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/SilverDust.java index 87979d19d..8373a6948 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/SilverDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/SilverDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class SilverDust extends VEItem { - public SilverDust(){ + public SilverDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/SolariumDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/SolariumDust.java index edc68dba0..6456c3a42 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/SolariumDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/SolariumDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class SolariumDust extends VEItem { - public SolariumDust (){ + public SolariumDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/SoulsandDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/SoulsandDust.java index 453c64276..ba8eacbd1 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/SoulsandDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/SoulsandDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class SoulsandDust extends VEItem { - public SoulsandDust (){ + public SoulsandDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/SulfurDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/SulfurDust.java index 6f6787f08..9b82474a7 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/SulfurDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/SulfurDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class SulfurDust extends VEItem { - public SulfurDust (){ + public SulfurDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/TitaniumDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/TitaniumDust.java index b6fd8fb6d..9a0f05a62 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/TitaniumDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/TitaniumDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class TitaniumDust extends VEItem { - public TitaniumDust (){ + public TitaniumDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/dusts/TungstenDust.java b/src/main/java/com/veteam/voluminousenergy/items/dusts/TungstenDust.java index 7648b9d21..ddea5e228 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/dusts/TungstenDust.java +++ b/src/main/java/com/veteam/voluminousenergy/items/dusts/TungstenDust.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class TungstenDust extends VEItem { - public TungstenDust (){ + public TungstenDust() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/gears/CarbonGear.java b/src/main/java/com/veteam/voluminousenergy/items/gears/CarbonGear.java index 3b671b759..6d2ff40c8 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/gears/CarbonGear.java +++ b/src/main/java/com/veteam/voluminousenergy/items/gears/CarbonGear.java @@ -6,7 +6,7 @@ public class CarbonGear extends VEItem { public CarbonGear() { super(new Item.Properties() - .stacksTo(64) + .stacksTo(64) ); setRegistryName("carbongear"); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/gears/IronGear.java b/src/main/java/com/veteam/voluminousenergy/items/gears/IronGear.java index 6469bf250..10a948e05 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/gears/IronGear.java +++ b/src/main/java/com/veteam/voluminousenergy/items/gears/IronGear.java @@ -5,9 +5,9 @@ public class IronGear extends VEItem { public IronGear() { - super(new Item.Properties() - .stacksTo(64) - ); - setRegistryName("irongear"); + super(new Item.Properties() + .stacksTo(64) + ); + setRegistryName("irongear"); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/items/gears/SolariumGear.java b/src/main/java/com/veteam/voluminousenergy/items/gears/SolariumGear.java index 78861e224..780c40133 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/gears/SolariumGear.java +++ b/src/main/java/com/veteam/voluminousenergy/items/gears/SolariumGear.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class SolariumGear extends VEItem { - public SolariumGear(){ + public SolariumGear() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/gears/StoneGear.java b/src/main/java/com/veteam/voluminousenergy/items/gears/StoneGear.java index 942a81179..f7c71af4f 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/gears/StoneGear.java +++ b/src/main/java/com/veteam/voluminousenergy/items/gears/StoneGear.java @@ -4,9 +4,9 @@ import net.minecraft.world.item.Item; public class StoneGear extends VEItem { - public StoneGear(){ + public StoneGear() { super(new Item.Properties() - .stacksTo(64) + .stacksTo(64) ); setRegistryName("stonegear"); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/ingots/AluminumIngot.java b/src/main/java/com/veteam/voluminousenergy/items/ingots/AluminumIngot.java index ddf6448d6..662969216 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ingots/AluminumIngot.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ingots/AluminumIngot.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class AluminumIngot extends VEItem { - public AluminumIngot (){ + public AluminumIngot() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/ingots/CarbonBrick.java b/src/main/java/com/veteam/voluminousenergy/items/ingots/CarbonBrick.java index c1fc30fcc..ab4097f57 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ingots/CarbonBrick.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ingots/CarbonBrick.java @@ -4,9 +4,9 @@ import net.minecraft.world.item.Item; public class CarbonBrick extends VEItem { - public CarbonBrick (){ + public CarbonBrick() { super(new Item.Properties() - .stacksTo(64) + .stacksTo(64) ); setRegistryName("carbonbrick"); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/ingots/EighzoIngot.java b/src/main/java/com/veteam/voluminousenergy/items/ingots/EighzoIngot.java index 4b8be4933..8ee88b7c6 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ingots/EighzoIngot.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ingots/EighzoIngot.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class EighzoIngot extends VEItem { - public EighzoIngot (){ + public EighzoIngot() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/ingots/LeadIngot.java b/src/main/java/com/veteam/voluminousenergy/items/ingots/LeadIngot.java index f12343214..c896d408d 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ingots/LeadIngot.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ingots/LeadIngot.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class LeadIngot extends VEItem { - public LeadIngot (){ + public LeadIngot() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/ingots/NighaliteIngot.java b/src/main/java/com/veteam/voluminousenergy/items/ingots/NighaliteIngot.java index 546750c21..943a0eca7 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ingots/NighaliteIngot.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ingots/NighaliteIngot.java @@ -3,8 +3,8 @@ import com.veteam.voluminousenergy.items.VEItem; import net.minecraft.world.item.Item; -public class NighaliteIngot extends VEItem { - public NighaliteIngot (){ +public class NighaliteIngot extends VEItem { + public NighaliteIngot() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/ingots/SilverIngot.java b/src/main/java/com/veteam/voluminousenergy/items/ingots/SilverIngot.java index 8e94a488c..f5000f07b 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ingots/SilverIngot.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ingots/SilverIngot.java @@ -5,7 +5,7 @@ import net.minecraft.world.item.Item; public class SilverIngot extends VEItem { - public SilverIngot (){ + public SilverIngot() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/ingots/SolariumIngot.java b/src/main/java/com/veteam/voluminousenergy/items/ingots/SolariumIngot.java index e450f95e5..82acf24da 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ingots/SolariumIngot.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ingots/SolariumIngot.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class SolariumIngot extends VEItem { - public SolariumIngot (){ + public SolariumIngot() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/ingots/SteelIngot.java b/src/main/java/com/veteam/voluminousenergy/items/ingots/SteelIngot.java index e01093fb0..826656bfc 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ingots/SteelIngot.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ingots/SteelIngot.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class SteelIngot extends VEItem { - public SteelIngot (){ + public SteelIngot() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/ingots/TitaniumIngot.java b/src/main/java/com/veteam/voluminousenergy/items/ingots/TitaniumIngot.java index 6dbe6bdd8..e69c52e07 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ingots/TitaniumIngot.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ingots/TitaniumIngot.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class TitaniumIngot extends VEItem { - public TitaniumIngot (){ + public TitaniumIngot() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/ingots/TungstenIngot.java b/src/main/java/com/veteam/voluminousenergy/items/ingots/TungstenIngot.java index 4d3f185b1..5b8637aaf 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ingots/TungstenIngot.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ingots/TungstenIngot.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class TungstenIngot extends VEItem { - public TungstenIngot (){ + public TungstenIngot() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/ingots/TungstenSteelIngot.java b/src/main/java/com/veteam/voluminousenergy/items/ingots/TungstenSteelIngot.java index c7e6a931f..279698fb5 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ingots/TungstenSteelIngot.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ingots/TungstenSteelIngot.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class TungstenSteelIngot extends VEItem { - public TungstenSteelIngot (){ + public TungstenSteelIngot() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/microchips/GoldMicrochip.java b/src/main/java/com/veteam/voluminousenergy/items/microchips/GoldMicrochip.java index 1ad484bf1..73cf8651e 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/microchips/GoldMicrochip.java +++ b/src/main/java/com/veteam/voluminousenergy/items/microchips/GoldMicrochip.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class GoldMicrochip extends VEItem { - public GoldMicrochip (){ + public GoldMicrochip() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/microchips/SilverMicrochip.java b/src/main/java/com/veteam/voluminousenergy/items/microchips/SilverMicrochip.java index eb037d065..f0cb39f95 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/microchips/SilverMicrochip.java +++ b/src/main/java/com/veteam/voluminousenergy/items/microchips/SilverMicrochip.java @@ -4,9 +4,9 @@ import net.minecraft.world.item.Item; public class SilverMicrochip extends VEItem { - public SilverMicrochip(){ + public SilverMicrochip() { super(new Item.Properties() - .stacksTo(64) + .stacksTo(64) ); setRegistryName("silver_microchip"); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/ores/RawBauxite.java b/src/main/java/com/veteam/voluminousenergy/items/ores/RawBauxite.java index d6a635784..fcf65a1be 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/ores/RawBauxite.java +++ b/src/main/java/com/veteam/voluminousenergy/items/ores/RawBauxite.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class RawBauxite extends VEItem { - public RawBauxite(){ + public RawBauxite() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/plates/AluminumPlate.java b/src/main/java/com/veteam/voluminousenergy/items/plates/AluminumPlate.java index c5bc6b404..23995358e 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/plates/AluminumPlate.java +++ b/src/main/java/com/veteam/voluminousenergy/items/plates/AluminumPlate.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class AluminumPlate extends VEItem { - public AluminumPlate (){ + public AluminumPlate() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/plates/CarbonPlate.java b/src/main/java/com/veteam/voluminousenergy/items/plates/CarbonPlate.java index d12d63cc4..f2c027ab7 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/plates/CarbonPlate.java +++ b/src/main/java/com/veteam/voluminousenergy/items/plates/CarbonPlate.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class CarbonPlate extends VEItem { - public CarbonPlate (){ + public CarbonPlate() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/plates/SolariumPlate.java b/src/main/java/com/veteam/voluminousenergy/items/plates/SolariumPlate.java index 8a0d2e55c..a92525e16 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/plates/SolariumPlate.java +++ b/src/main/java/com/veteam/voluminousenergy/items/plates/SolariumPlate.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class SolariumPlate extends VEItem { - public SolariumPlate (){ + public SolariumPlate() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/plates/TitaniumPlate.java b/src/main/java/com/veteam/voluminousenergy/items/plates/TitaniumPlate.java index 3e6d0c673..6a5831322 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/plates/TitaniumPlate.java +++ b/src/main/java/com/veteam/voluminousenergy/items/plates/TitaniumPlate.java @@ -4,7 +4,7 @@ import net.minecraft.world.item.Item; public class TitaniumPlate extends VEItem { - public TitaniumPlate (){ + public TitaniumPlate() { super(new Item.Properties() .stacksTo(64) ); diff --git a/src/main/java/com/veteam/voluminousenergy/items/solid_fuels/CoalCoke.java b/src/main/java/com/veteam/voluminousenergy/items/solid_fuels/CoalCoke.java index d34095648..5a8dce93f 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/solid_fuels/CoalCoke.java +++ b/src/main/java/com/veteam/voluminousenergy/items/solid_fuels/CoalCoke.java @@ -11,7 +11,7 @@ public class CoalCoke extends VEItem implements IForgeItem { public CoalCoke() { super(new Item.Properties() - .stacksTo(64) + .stacksTo(64) ); setRegistryName("coalcoke"); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/solid_fuels/Petcoke.java b/src/main/java/com/veteam/voluminousenergy/items/solid_fuels/Petcoke.java index 81dd8372a..d30085b60 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/solid_fuels/Petcoke.java +++ b/src/main/java/com/veteam/voluminousenergy/items/solid_fuels/Petcoke.java @@ -11,7 +11,7 @@ public class Petcoke extends VEItem implements IForgeItem { public Petcoke() { super(new Item.Properties() - .stacksTo(64) + .stacksTo(64) ); setRegistryName("petcoke"); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/CreativeFluidScanner.java b/src/main/java/com/veteam/voluminousenergy/items/tools/CreativeFluidScanner.java index 6c5f9711b..2806c3825 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/CreativeFluidScanner.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/CreativeFluidScanner.java @@ -96,16 +96,16 @@ public int getUseDuration(ItemStack itemStack) { 16 * (chunkAccess.getPos().x - middle + x), 320, 16 * (chunkAccess.getPos().z - middle + z)); - ArrayList> items = WorldUtil.queryForFluids(level, pos); + ArrayList> items = WorldUtil.queryForFluids(level, pos); if (items.size() > 0) { fluid = items.get(0).getA(); - if(fluid.isSame(VEFluids.CRUDE_OIL_REG.get().getFlowing())) { + if (fluid.isSame(VEFluids.CRUDE_OIL_REG.get().getFlowing())) { builder.append(" C |"); - } else if(fluid.isSame(WATER.getFlowing())) { + } else if (fluid.isSame(WATER.getFlowing())) { builder.append(" W |"); - } else if(fluid.isSame(LAVA.getFlowing())) { + } else if (fluid.isSame(LAVA.getFlowing())) { builder.append(" L |"); } else if (fluid.isSame(VEFluids.LIGHT_FUEL_REG.get().getFlowing())) { builder.append(" F |"); diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/VEAxeItem.java b/src/main/java/com/veteam/voluminousenergy/items/tools/VEAxeItem.java index 50e2582a4..f2d76352b 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/VEAxeItem.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/VEAxeItem.java @@ -22,24 +22,24 @@ public VEAxeItem(Tier p_i48530_1_, float p_i48530_2_, float p_i48530_3_, Propert } @Override - public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag){ + public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag) { ToolUtil.SolariumTooltipAppend(stack, tooltip); super.appendHoverText(stack, world, tooltip, flag); } @Override - public void setDamage(ItemStack stack, int damage){ + public void setDamage(ItemStack stack, int damage) { CompoundTag tag = stack.getTag(); - if (tag == null){ + if (tag == null) { stack.getOrCreateTag().putInt("bonus", Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get()); return; } - if (tag.getInt("bonus") > 0){ + if (tag.getInt("bonus") > 0) { int bonus = tag.getInt("bonus"); - if (bonus >= damage){ - stack.getOrCreateTag().putInt("bonus", (bonus-damage)); + if (bonus >= damage) { + stack.getOrCreateTag().putInt("bonus", (bonus - damage)); } else { int difference = damage - bonus; stack.getOrCreateTag().putInt("bonus", difference); @@ -59,10 +59,11 @@ public void inventoryTick(ItemStack stack, Level level, Entity entity, int num, if (level.canSeeSky(entity.getOnPos().above(2)) && bonus < Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get()) { float random = abs(0 + level.getRandom().nextFloat() * (0 - 1)); - if (random >= Config.SOLARIUM_SHEATH_REGENERATION_CHANCE.get().floatValue()) return; // Inversed due to returning (not executing) if condition is true + if (random >= Config.SOLARIUM_SHEATH_REGENERATION_CHANCE.get().floatValue()) + return; // Inversed due to returning (not executing) if condition is true bonus++; - stack.getTag().putInt("bonus", Math.min(bonus,Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get())); + stack.getTag().putInt("bonus", Math.min(bonus, Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get())); } } } diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/VEHoeItem.java b/src/main/java/com/veteam/voluminousenergy/items/tools/VEHoeItem.java index 735315f44..a608f78c6 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/VEHoeItem.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/VEHoeItem.java @@ -22,24 +22,24 @@ public VEHoeItem(Tier p_i231595_1_, int p_i231595_2_, float p_i231595_3_, Proper } @Override - public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag){ + public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag) { ToolUtil.SolariumTooltipAppend(stack, tooltip); super.appendHoverText(stack, world, tooltip, flag); } @Override - public void setDamage(ItemStack stack, int damage){ + public void setDamage(ItemStack stack, int damage) { CompoundTag tag = stack.getTag(); - if (tag == null){ + if (tag == null) { stack.getOrCreateTag().putInt("bonus", Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get()); return; } - if (tag.getInt("bonus") > 0){ + if (tag.getInt("bonus") > 0) { int bonus = tag.getInt("bonus"); - if (bonus >= damage){ - stack.getOrCreateTag().putInt("bonus", (bonus-damage)); + if (bonus >= damage) { + stack.getOrCreateTag().putInt("bonus", (bonus - damage)); } else { int difference = damage - bonus; stack.getOrCreateTag().putInt("bonus", difference); @@ -59,10 +59,11 @@ public void inventoryTick(ItemStack stack, Level level, Entity entity, int num, if (level.canSeeSky(entity.getOnPos().above(2)) && bonus < Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get()) { float random = abs(0 + level.getRandom().nextFloat() * (0 - 1)); - if (random >= Config.SOLARIUM_SHEATH_REGENERATION_CHANCE.get().floatValue()) return; // Inversed due to returning (not executing) if condition is true + if (random >= Config.SOLARIUM_SHEATH_REGENERATION_CHANCE.get().floatValue()) + return; // Inversed due to returning (not executing) if condition is true bonus++; - stack.getTag().putInt("bonus", Math.min(bonus,Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get())); + stack.getTag().putInt("bonus", Math.min(bonus, Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get())); } } } diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/VEPickaxeItem.java b/src/main/java/com/veteam/voluminousenergy/items/tools/VEPickaxeItem.java index 5d9aafea8..a68e01ca6 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/VEPickaxeItem.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/VEPickaxeItem.java @@ -22,24 +22,24 @@ public VEPickaxeItem(Tier p_i48478_1_, int p_i48478_2_, float p_i48478_3_, Prope } @Override - public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag){ + public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag) { ToolUtil.SolariumTooltipAppend(stack, tooltip); super.appendHoverText(stack, world, tooltip, flag); } @Override - public void setDamage(ItemStack stack, int damage){ + public void setDamage(ItemStack stack, int damage) { CompoundTag tag = stack.getTag(); - if (tag == null){ + if (tag == null) { stack.getOrCreateTag().putInt("bonus", Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get()); return; } - if (tag.getInt("bonus") > 0){ + if (tag.getInt("bonus") > 0) { int bonus = tag.getInt("bonus"); - if (bonus >= damage){ - stack.getOrCreateTag().putInt("bonus", (bonus-damage)); + if (bonus >= damage) { + stack.getOrCreateTag().putInt("bonus", (bonus - damage)); } else { int difference = damage - bonus; stack.getOrCreateTag().putInt("bonus", difference); @@ -59,10 +59,11 @@ public void inventoryTick(ItemStack stack, Level level, Entity entity, int num, if (level.canSeeSky(entity.getOnPos().above(2)) && bonus < Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get()) { float random = abs(0 + level.getRandom().nextFloat() * (0 - 1)); - if (random >= Config.SOLARIUM_SHEATH_REGENERATION_CHANCE.get().floatValue()) return; // Inversed due to returning (not executing) if condition is true + if (random >= Config.SOLARIUM_SHEATH_REGENERATION_CHANCE.get().floatValue()) + return; // Inversed due to returning (not executing) if condition is true bonus++; - stack.getTag().putInt("bonus", Math.min(bonus,Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get())); + stack.getTag().putInt("bonus", Math.min(bonus, Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get())); } } } diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/VEShovelItem.java b/src/main/java/com/veteam/voluminousenergy/items/tools/VEShovelItem.java index 930fc3ae3..ced04e976 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/VEShovelItem.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/VEShovelItem.java @@ -22,24 +22,24 @@ public VEShovelItem(Tier p_i48469_1_, float p_i48469_2_, float p_i48469_3_, Prop } @Override - public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag){ + public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag) { ToolUtil.SolariumTooltipAppend(stack, tooltip); super.appendHoverText(stack, world, tooltip, flag); } @Override - public void setDamage(ItemStack stack, int damage){ + public void setDamage(ItemStack stack, int damage) { CompoundTag tag = stack.getTag(); - if (tag == null){ + if (tag == null) { stack.getOrCreateTag().putInt("bonus", Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get()); return; } - if (tag.getInt("bonus") > 0){ + if (tag.getInt("bonus") > 0) { int bonus = tag.getInt("bonus"); - if (bonus >= damage){ - stack.getOrCreateTag().putInt("bonus", (bonus-damage)); + if (bonus >= damage) { + stack.getOrCreateTag().putInt("bonus", (bonus - damage)); } else { int difference = damage - bonus; stack.getOrCreateTag().putInt("bonus", difference); @@ -59,10 +59,11 @@ public void inventoryTick(ItemStack stack, Level level, Entity entity, int num, if (level.canSeeSky(entity.getOnPos().above(2)) && bonus < Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get()) { float random = abs(0 + level.getRandom().nextFloat() * (0 - 1)); - if (random >= Config.SOLARIUM_SHEATH_REGENERATION_CHANCE.get().floatValue()) return; // Inversed due to returning (not executing) if condition is true + if (random >= Config.SOLARIUM_SHEATH_REGENERATION_CHANCE.get().floatValue()) + return; // Inversed due to returning (not executing) if condition is true bonus++; - stack.getTag().putInt("bonus", Math.min(bonus,Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get())); + stack.getTag().putInt("bonus", Math.min(bonus, Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get())); } } } diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/VESwordItem.java b/src/main/java/com/veteam/voluminousenergy/items/tools/VESwordItem.java index d8c04ddfc..1e71a7238 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/VESwordItem.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/VESwordItem.java @@ -22,24 +22,24 @@ public VESwordItem(Tier p_i48460_1_, int p_i48460_2_, float p_i48460_3_, Propert } @Override - public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag){ + public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag) { ToolUtil.SolariumTooltipAppend(stack, tooltip); super.appendHoverText(stack, world, tooltip, flag); } @Override - public void setDamage(ItemStack stack, int damage){ + public void setDamage(ItemStack stack, int damage) { CompoundTag tag = stack.getTag(); - if (tag == null){ + if (tag == null) { stack.getOrCreateTag().putInt("bonus", Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get()); return; } - if (tag.getInt("bonus") > 0){ + if (tag.getInt("bonus") > 0) { int bonus = tag.getInt("bonus"); - if (bonus >= damage){ - stack.getOrCreateTag().putInt("bonus", (bonus-damage)); + if (bonus >= damage) { + stack.getOrCreateTag().putInt("bonus", (bonus - damage)); } else { int difference = damage - bonus; stack.getOrCreateTag().putInt("bonus", difference); @@ -59,10 +59,11 @@ public void inventoryTick(ItemStack stack, Level level, Entity entity, int num, if (level.canSeeSky(entity.getOnPos().above(2)) && bonus < Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get()) { float random = abs(0 + level.getRandom().nextFloat() * (0 - 1)); - if (random >= Config.SOLARIUM_SHEATH_REGENERATION_CHANCE.get().floatValue()) return; // Inversed due to returning (not executing) if condition is true + if (random >= Config.SOLARIUM_SHEATH_REGENERATION_CHANCE.get().floatValue()) + return; // Inversed due to returning (not executing) if condition is true bonus++; - stack.getTag().putInt("bonus", Math.min(bonus,Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get())); + stack.getTag().putInt("bonus", Math.min(bonus, Config.SOLARIUM_PROTECTIVE_SHEATH_HITS.get())); } } } diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/VETools.java b/src/main/java/com/veteam/voluminousenergy/items/tools/VETools.java index 638ed939a..bcaf6876d 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/VETools.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/VETools.java @@ -36,21 +36,21 @@ public class VETools { final static float HOE_2 = -2.0F; // Material Tiers - public static final TagKey ALUMINUM_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID,"needs_aluminum_tool")); + public static final TagKey ALUMINUM_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID, "needs_aluminum_tool")); public static final Tier ALUMINUM = TierSortingRegistry.registerTier( new ForgeTier(2, 250, 6.6F, 2.0F, 14, ALUMINUM_TIER_TAG, () -> Ingredient.of(VEItems.ALUMINUM_INGOT.get())), // Actual tier new ResourceLocation(VoluminousEnergy.MODID, "needs_aluminum_tool"), // Resource Location List.of(Tiers.IRON), // After tier List.of()); // Before tier - public static final TagKey CARBON_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID,"needs_carbon_tool")); + public static final TagKey CARBON_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID, "needs_carbon_tool")); public static final Tier CARBON = TierSortingRegistry.registerTier( new ForgeTier(1, 95, 4.0F, 0.8F, 5, CARBON_TIER_TAG, () -> Ingredient.of(VEItems.CARBON_BRICK.get())), // Actual tier new ResourceLocation(VoluminousEnergy.MODID, "needs_carbon_tool"), // Resource Location List.of(Tiers.WOOD), // After tier List.of()); // Before tier - public static final TagKey TITANIUM_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID,"needs_titanium_tool")); + public static final TagKey TITANIUM_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID, "needs_titanium_tool")); public static final Tier TITANIUM = TierSortingRegistry.registerTier( new ForgeTier(3, 2133, 8.5F, 3.5F, 15, TITANIUM_TIER_TAG, () -> Ingredient.of(VEItems.TITANIUM_INGOT.get())), // Actual tier new ResourceLocation(VoluminousEnergy.MODID, "needs_titanium_tool"), // Resource Location @@ -58,35 +58,35 @@ public class VETools { List.of()); // Before tier - public static final TagKey TUNGSTEN_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(),new ResourceLocation(VoluminousEnergy.MODID,"needs_tungsten_tool")); + public static final TagKey TUNGSTEN_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID, "needs_tungsten_tool")); public static final Tier TUNGSTEN = TierSortingRegistry.registerTier( new ForgeTier(4, 2666, 9.0F, 4.0F, 15, TUNGSTEN_TIER_TAG, () -> Ingredient.of(VEItems.TUNGSTEN_INGOT.get())), // Actual tier new ResourceLocation(VoluminousEnergy.MODID, "needs_tungsten_tool"), // Resource Location List.of(Tiers.NETHERITE), // After tier List.of()); // Before tier - public static final TagKey TUNGSTEN_STEEL_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID,"needs_tungsten_steel_tool")); + public static final TagKey TUNGSTEN_STEEL_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID, "needs_tungsten_steel_tool")); public static final Tier TUNGSTEN_STEEL = TierSortingRegistry.registerTier( new ForgeTier(5, 2933, 11.0F, 5.0F, 18, TUNGSTEN_STEEL_TIER_TAG, () -> Ingredient.of(VEItems.TUNGSTEN_STEEL_INGOT.get())), // Actual tier new ResourceLocation(VoluminousEnergy.MODID, "needs_tungsten_steel_tool"), // Resource Location List.of(Tiers.NETHERITE), // After tier List.of()); // Before tier - public static final TagKey NIGHALITE_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID,"needs_nighalite_tool")); + public static final TagKey NIGHALITE_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID, "needs_nighalite_tool")); public static final Tier NIGHALITE = TierSortingRegistry.registerTier( new ForgeTier(5, 2434, 13F, 4.6F, 18, NIGHALITE_TIER_TAG, () -> Ingredient.of(VEItems.NIGHALITE_INGOT.get())), // Actual tier new ResourceLocation(VoluminousEnergy.MODID, "needs_nighalite_tool"), // Resource Location List.of(Tiers.NETHERITE), // After tier List.of()); // Before tier - public static final TagKey EIGHZO_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID,"needs_eighzo_tool")); + public static final TagKey EIGHZO_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID, "needs_eighzo_tool")); public static final Tier EIGHZO = TierSortingRegistry.registerTier( new ForgeTier(6, 7125, 17F, 6.5F, 18, EIGHZO_TIER_TAG, () -> Ingredient.of(VEItems.EIGHZO_INGOT.get())), // Actual tier new ResourceLocation(VoluminousEnergy.MODID, "needs_eighzo_tool"), // Resource Location List.of(NIGHALITE), // After tier List.of()); // Before tier - public static final TagKey SOLARIUM_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID,"needs_solarium_tool")); + public static final TagKey SOLARIUM_TIER_TAG = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(VoluminousEnergy.MODID, "needs_solarium_tool")); public static final Tier SOLARIUM = TierSortingRegistry.registerTier( new ForgeTier(7, 17_815/*25_912*/, 20F, 8F, 22, SOLARIUM_TIER_TAG, () -> Ingredient.of(VEItems.SOLARIUM_INGOT.get())), // Actual tier new ResourceLocation(VoluminousEnergy.MODID, "needs_solarium_tool"), // Resource Location @@ -104,52 +104,52 @@ public class VETools { public static final Item.Properties SOLARIUM_PROP = (new Item.Properties()).durability(SOLARIUM.getUses()); // Swords - public static RegistryObject CARBON_SWORD = VE_TOOL_REGISTRY.register("carbon_sword",() -> new SwordItem(CARBON, SWORD_1, SWORD_2, CARBON_PROP)); - public static RegistryObject ALUMINUM_SWORD = VE_TOOL_REGISTRY.register("aluminum_sword",() -> new SwordItem(ALUMINUM, SWORD_1, SWORD_2, ALUMINUM_PROP)); - public static RegistryObject TITANIUM_SWORD = VE_TOOL_REGISTRY.register("titanium_sword",() -> new SwordItem(TITANIUM, SWORD_1, SWORD_2, TITANIUM_PROP)); - public static RegistryObject TUNGSTEN_SWORD = VE_TOOL_REGISTRY.register("tungsten_sword",() -> new SwordItem(TUNGSTEN, SWORD_1, SWORD_2, TUNGSTEN_PROP)); - public static RegistryObject TUNGSTEN_STEEL_SWORD = VE_TOOL_REGISTRY.register("tungsten_steel_sword",() -> new SwordItem(TUNGSTEN_STEEL, SWORD_1, SWORD_2, TUNGSTEN_STEEL_PROP)); - public static RegistryObject NIGHALITE_SWORD = VE_TOOL_REGISTRY.register("nighalite_sword",() -> new SwordItem(NIGHALITE, SWORD_1, SWORD_2, NIGHALITE_PROP)); - public static RegistryObject EIGHZO_SWORD = VE_TOOL_REGISTRY.register("eighzo_sword",() -> new SwordItem(EIGHZO, SWORD_1, SWORD_2, EIGHZO_PROP)); - public static RegistryObject SOLARIUM_SWORD = VE_TOOL_REGISTRY.register("solarium_sword",() -> new VESwordItem(SOLARIUM, SWORD_1, SWORD_2, SOLARIUM_PROP)); + public static RegistryObject CARBON_SWORD = VE_TOOL_REGISTRY.register("carbon_sword", () -> new SwordItem(CARBON, SWORD_1, SWORD_2, CARBON_PROP)); + public static RegistryObject ALUMINUM_SWORD = VE_TOOL_REGISTRY.register("aluminum_sword", () -> new SwordItem(ALUMINUM, SWORD_1, SWORD_2, ALUMINUM_PROP)); + public static RegistryObject TITANIUM_SWORD = VE_TOOL_REGISTRY.register("titanium_sword", () -> new SwordItem(TITANIUM, SWORD_1, SWORD_2, TITANIUM_PROP)); + public static RegistryObject TUNGSTEN_SWORD = VE_TOOL_REGISTRY.register("tungsten_sword", () -> new SwordItem(TUNGSTEN, SWORD_1, SWORD_2, TUNGSTEN_PROP)); + public static RegistryObject TUNGSTEN_STEEL_SWORD = VE_TOOL_REGISTRY.register("tungsten_steel_sword", () -> new SwordItem(TUNGSTEN_STEEL, SWORD_1, SWORD_2, TUNGSTEN_STEEL_PROP)); + public static RegistryObject NIGHALITE_SWORD = VE_TOOL_REGISTRY.register("nighalite_sword", () -> new SwordItem(NIGHALITE, SWORD_1, SWORD_2, NIGHALITE_PROP)); + public static RegistryObject EIGHZO_SWORD = VE_TOOL_REGISTRY.register("eighzo_sword", () -> new SwordItem(EIGHZO, SWORD_1, SWORD_2, EIGHZO_PROP)); + public static RegistryObject SOLARIUM_SWORD = VE_TOOL_REGISTRY.register("solarium_sword", () -> new VESwordItem(SOLARIUM, SWORD_1, SWORD_2, SOLARIUM_PROP)); // Shovels - public static RegistryObject CARBON_SHOVEL = VE_TOOL_REGISTRY.register("carbon_shovel",() -> new ShovelItem(CARBON, SHOVEL_1, SHOVEL_2, CARBON_PROP)); - public static RegistryObject ALUMINUM_SHOVEL = VE_TOOL_REGISTRY.register("aluminum_shovel",() -> new ShovelItem(ALUMINUM, SHOVEL_1, SHOVEL_2, ALUMINUM_PROP)); - public static RegistryObject TITANIUM_SHOVEL = VE_TOOL_REGISTRY.register("titanium_shovel",() -> new ShovelItem(TITANIUM, SHOVEL_1, SHOVEL_2, TITANIUM_PROP)); - public static RegistryObject TUNGSTEN_SHOVEL = VE_TOOL_REGISTRY.register("tungsten_shovel",() -> new ShovelItem(TUNGSTEN, SHOVEL_1, SHOVEL_2, TUNGSTEN_PROP)); - public static RegistryObject TUNGSTEN_STEEL_SHOVEL = VE_TOOL_REGISTRY.register("tungsten_steel_shovel",() -> new ShovelItem(TUNGSTEN_STEEL, SHOVEL_1, SHOVEL_2, TUNGSTEN_STEEL_PROP)); - public static RegistryObject NIGHALITE_SHOVEL = VE_TOOL_REGISTRY.register("nighalite_shovel",() -> new ShovelItem(NIGHALITE, SHOVEL_1, SHOVEL_2, NIGHALITE_PROP)); - public static RegistryObject EIGHZO_SHOVEL = VE_TOOL_REGISTRY.register("eighzo_shovel",() -> new ShovelItem(EIGHZO, SHOVEL_1, SHOVEL_2, EIGHZO_PROP)); - public static RegistryObject SOLARIUM_SHOVEL = VE_TOOL_REGISTRY.register("solarium_shovel",() -> new VEShovelItem(SOLARIUM, SHOVEL_1, SHOVEL_2, SOLARIUM_PROP)); + public static RegistryObject CARBON_SHOVEL = VE_TOOL_REGISTRY.register("carbon_shovel", () -> new ShovelItem(CARBON, SHOVEL_1, SHOVEL_2, CARBON_PROP)); + public static RegistryObject ALUMINUM_SHOVEL = VE_TOOL_REGISTRY.register("aluminum_shovel", () -> new ShovelItem(ALUMINUM, SHOVEL_1, SHOVEL_2, ALUMINUM_PROP)); + public static RegistryObject TITANIUM_SHOVEL = VE_TOOL_REGISTRY.register("titanium_shovel", () -> new ShovelItem(TITANIUM, SHOVEL_1, SHOVEL_2, TITANIUM_PROP)); + public static RegistryObject TUNGSTEN_SHOVEL = VE_TOOL_REGISTRY.register("tungsten_shovel", () -> new ShovelItem(TUNGSTEN, SHOVEL_1, SHOVEL_2, TUNGSTEN_PROP)); + public static RegistryObject TUNGSTEN_STEEL_SHOVEL = VE_TOOL_REGISTRY.register("tungsten_steel_shovel", () -> new ShovelItem(TUNGSTEN_STEEL, SHOVEL_1, SHOVEL_2, TUNGSTEN_STEEL_PROP)); + public static RegistryObject NIGHALITE_SHOVEL = VE_TOOL_REGISTRY.register("nighalite_shovel", () -> new ShovelItem(NIGHALITE, SHOVEL_1, SHOVEL_2, NIGHALITE_PROP)); + public static RegistryObject EIGHZO_SHOVEL = VE_TOOL_REGISTRY.register("eighzo_shovel", () -> new ShovelItem(EIGHZO, SHOVEL_1, SHOVEL_2, EIGHZO_PROP)); + public static RegistryObject SOLARIUM_SHOVEL = VE_TOOL_REGISTRY.register("solarium_shovel", () -> new VEShovelItem(SOLARIUM, SHOVEL_1, SHOVEL_2, SOLARIUM_PROP)); // Pickaxes - public static RegistryObject CARBON_PICKAXE = VE_TOOL_REGISTRY.register("carbon_pickaxe",() -> new PickaxeItem(CARBON, PICKAXE_1, PICKAXE_2, CARBON_PROP)); - public static RegistryObject ALUMINUM_PICKAXE = VE_TOOL_REGISTRY.register("aluminum_pickaxe",() -> new PickaxeItem(ALUMINUM, PICKAXE_1, PICKAXE_2, ALUMINUM_PROP)); - public static RegistryObject TITANIUM_PICKAXE = VE_TOOL_REGISTRY.register("titanium_pickaxe",() -> new PickaxeItem(TITANIUM, PICKAXE_1, PICKAXE_2, TITANIUM_PROP)); - public static RegistryObject TUNGSTEN_PICKAXE = VE_TOOL_REGISTRY.register("tungsten_pickaxe",() -> new PickaxeItem(TUNGSTEN, PICKAXE_1, PICKAXE_2, TUNGSTEN_PROP)); - public static RegistryObject TUNGSTEN_STEEL_PICKAXE = VE_TOOL_REGISTRY.register("tungsten_steel_pickaxe",() -> new PickaxeItem(TUNGSTEN_STEEL, PICKAXE_1, PICKAXE_2, TUNGSTEN_STEEL_PROP)); - public static RegistryObject NIGHALITE_PICKAXE = VE_TOOL_REGISTRY.register("nighalite_pickaxe",() -> new PickaxeItem(NIGHALITE, PICKAXE_1, PICKAXE_2, NIGHALITE_PROP)); - public static RegistryObject EIGHZO_PICKAXE = VE_TOOL_REGISTRY.register("eighzo_pickaxe",() -> new PickaxeItem(EIGHZO, PICKAXE_1, PICKAXE_2, EIGHZO_PROP)); - public static RegistryObject SOLARIUM_PICKAXE = VE_TOOL_REGISTRY.register("solarium_pickaxe",() -> new VEPickaxeItem(SOLARIUM, PICKAXE_1, PICKAXE_2, SOLARIUM_PROP)); + public static RegistryObject CARBON_PICKAXE = VE_TOOL_REGISTRY.register("carbon_pickaxe", () -> new PickaxeItem(CARBON, PICKAXE_1, PICKAXE_2, CARBON_PROP)); + public static RegistryObject ALUMINUM_PICKAXE = VE_TOOL_REGISTRY.register("aluminum_pickaxe", () -> new PickaxeItem(ALUMINUM, PICKAXE_1, PICKAXE_2, ALUMINUM_PROP)); + public static RegistryObject TITANIUM_PICKAXE = VE_TOOL_REGISTRY.register("titanium_pickaxe", () -> new PickaxeItem(TITANIUM, PICKAXE_1, PICKAXE_2, TITANIUM_PROP)); + public static RegistryObject TUNGSTEN_PICKAXE = VE_TOOL_REGISTRY.register("tungsten_pickaxe", () -> new PickaxeItem(TUNGSTEN, PICKAXE_1, PICKAXE_2, TUNGSTEN_PROP)); + public static RegistryObject TUNGSTEN_STEEL_PICKAXE = VE_TOOL_REGISTRY.register("tungsten_steel_pickaxe", () -> new PickaxeItem(TUNGSTEN_STEEL, PICKAXE_1, PICKAXE_2, TUNGSTEN_STEEL_PROP)); + public static RegistryObject NIGHALITE_PICKAXE = VE_TOOL_REGISTRY.register("nighalite_pickaxe", () -> new PickaxeItem(NIGHALITE, PICKAXE_1, PICKAXE_2, NIGHALITE_PROP)); + public static RegistryObject EIGHZO_PICKAXE = VE_TOOL_REGISTRY.register("eighzo_pickaxe", () -> new PickaxeItem(EIGHZO, PICKAXE_1, PICKAXE_2, EIGHZO_PROP)); + public static RegistryObject SOLARIUM_PICKAXE = VE_TOOL_REGISTRY.register("solarium_pickaxe", () -> new VEPickaxeItem(SOLARIUM, PICKAXE_1, PICKAXE_2, SOLARIUM_PROP)); // Axes - public static RegistryObject CARBON_AXE = VE_TOOL_REGISTRY.register("carbon_axe",() -> new AxeItem(CARBON, AXE_1, AXE_2, CARBON_PROP)); - public static RegistryObject ALUMINUM_AXE = VE_TOOL_REGISTRY.register("aluminum_axe",() -> new AxeItem(ALUMINUM, AXE_1, AXE_2, ALUMINUM_PROP)); - public static RegistryObject TITANIUM_AXE = VE_TOOL_REGISTRY.register("titanium_axe",() -> new AxeItem(TITANIUM, AXE_1, AXE_2, TITANIUM_PROP)); - public static RegistryObject TUNGSTEN_AXE = VE_TOOL_REGISTRY.register("tungsten_axe",() -> new AxeItem(TUNGSTEN, AXE_1, AXE_2, TUNGSTEN_PROP)); - public static RegistryObject TUNGSTEN_STEEL_AXE = VE_TOOL_REGISTRY.register("tungsten_steel_axe",() -> new AxeItem(TUNGSTEN_STEEL, AXE_1, AXE_2, TUNGSTEN_STEEL_PROP)); - public static RegistryObject NIGHALITE_AXE = VE_TOOL_REGISTRY.register("nighalite_axe",() -> new AxeItem(NIGHALITE, AXE_1, AXE_2, NIGHALITE_PROP)); - public static RegistryObject EIGHZO_AXE = VE_TOOL_REGISTRY.register("eighzo_axe",() -> new AxeItem(EIGHZO, AXE_1, AXE_2, EIGHZO_PROP)); - public static RegistryObject SOLARIUM_AXE = VE_TOOL_REGISTRY.register("solarium_axe",() -> new VEAxeItem(SOLARIUM, AXE_1, AXE_2, SOLARIUM_PROP)); + public static RegistryObject CARBON_AXE = VE_TOOL_REGISTRY.register("carbon_axe", () -> new AxeItem(CARBON, AXE_1, AXE_2, CARBON_PROP)); + public static RegistryObject ALUMINUM_AXE = VE_TOOL_REGISTRY.register("aluminum_axe", () -> new AxeItem(ALUMINUM, AXE_1, AXE_2, ALUMINUM_PROP)); + public static RegistryObject TITANIUM_AXE = VE_TOOL_REGISTRY.register("titanium_axe", () -> new AxeItem(TITANIUM, AXE_1, AXE_2, TITANIUM_PROP)); + public static RegistryObject TUNGSTEN_AXE = VE_TOOL_REGISTRY.register("tungsten_axe", () -> new AxeItem(TUNGSTEN, AXE_1, AXE_2, TUNGSTEN_PROP)); + public static RegistryObject TUNGSTEN_STEEL_AXE = VE_TOOL_REGISTRY.register("tungsten_steel_axe", () -> new AxeItem(TUNGSTEN_STEEL, AXE_1, AXE_2, TUNGSTEN_STEEL_PROP)); + public static RegistryObject NIGHALITE_AXE = VE_TOOL_REGISTRY.register("nighalite_axe", () -> new AxeItem(NIGHALITE, AXE_1, AXE_2, NIGHALITE_PROP)); + public static RegistryObject EIGHZO_AXE = VE_TOOL_REGISTRY.register("eighzo_axe", () -> new AxeItem(EIGHZO, AXE_1, AXE_2, EIGHZO_PROP)); + public static RegistryObject SOLARIUM_AXE = VE_TOOL_REGISTRY.register("solarium_axe", () -> new VEAxeItem(SOLARIUM, AXE_1, AXE_2, SOLARIUM_PROP)); // Hoes - public static RegistryObject CARBON_HOE = VE_TOOL_REGISTRY.register("carbon_hoe",() -> new HoeItem(CARBON, HOE_1, HOE_2, CARBON_PROP)); - public static RegistryObject ALUMINUM_HOE = VE_TOOL_REGISTRY.register("aluminum_hoe",() -> new HoeItem(ALUMINUM, HOE_1, HOE_2, ALUMINUM_PROP)); - public static RegistryObject TITANIUM_HOE = VE_TOOL_REGISTRY.register("titanium_hoe",() -> new HoeItem(TITANIUM, HOE_1, HOE_2, TITANIUM_PROP)); - public static RegistryObject TUNGSTEN_HOE = VE_TOOL_REGISTRY.register("tungsten_hoe",() -> new HoeItem(TUNGSTEN, HOE_1, HOE_2, TUNGSTEN_PROP)); - public static RegistryObject TUNGSTEN_STEEL_HOE = VE_TOOL_REGISTRY.register("tungsten_steel_hoe",() -> new HoeItem(TUNGSTEN_STEEL, HOE_1, HOE_2, TUNGSTEN_STEEL_PROP)); - public static RegistryObject NIGHALITE_HOE = VE_TOOL_REGISTRY.register("nighalite_hoe",() -> new HoeItem(NIGHALITE, HOE_1, HOE_2, NIGHALITE_PROP)); - public static RegistryObject EIGHZO_HOE = VE_TOOL_REGISTRY.register("eighzo_hoe",() -> new HoeItem(EIGHZO, HOE_1, HOE_2, EIGHZO_PROP)); - public static RegistryObject SOLARIUM_HOE = VE_TOOL_REGISTRY.register("solarium_hoe",() -> new VEHoeItem(SOLARIUM, HOE_1, HOE_2, SOLARIUM_PROP)); + public static RegistryObject CARBON_HOE = VE_TOOL_REGISTRY.register("carbon_hoe", () -> new HoeItem(CARBON, HOE_1, HOE_2, CARBON_PROP)); + public static RegistryObject ALUMINUM_HOE = VE_TOOL_REGISTRY.register("aluminum_hoe", () -> new HoeItem(ALUMINUM, HOE_1, HOE_2, ALUMINUM_PROP)); + public static RegistryObject TITANIUM_HOE = VE_TOOL_REGISTRY.register("titanium_hoe", () -> new HoeItem(TITANIUM, HOE_1, HOE_2, TITANIUM_PROP)); + public static RegistryObject TUNGSTEN_HOE = VE_TOOL_REGISTRY.register("tungsten_hoe", () -> new HoeItem(TUNGSTEN, HOE_1, HOE_2, TUNGSTEN_PROP)); + public static RegistryObject TUNGSTEN_STEEL_HOE = VE_TOOL_REGISTRY.register("tungsten_steel_hoe", () -> new HoeItem(TUNGSTEN_STEEL, HOE_1, HOE_2, TUNGSTEN_STEEL_PROP)); + public static RegistryObject NIGHALITE_HOE = VE_TOOL_REGISTRY.register("nighalite_hoe", () -> new HoeItem(NIGHALITE, HOE_1, HOE_2, NIGHALITE_PROP)); + public static RegistryObject EIGHZO_HOE = VE_TOOL_REGISTRY.register("eighzo_hoe", () -> new HoeItem(EIGHZO, HOE_1, HOE_2, EIGHZO_PROP)); + public static RegistryObject SOLARIUM_HOE = VE_TOOL_REGISTRY.register("solarium_hoe", () -> new VEHoeItem(SOLARIUM, HOE_1, HOE_2, SOLARIUM_PROP)); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java index b7a954235..66caef8fa 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/CombustionMultitool.java @@ -38,8 +38,8 @@ public CombustionMultitool(MultitoolBit bit, String registryName, Properties ite } @Override - public void appendHoverText(ItemStack itemStack, @Nullable Level world, List tooltip, TooltipFlag flag){ - if(ForgeCapabilities.FLUID_HANDLER_ITEM == null) return; // sanity check + public void appendHoverText(ItemStack itemStack, @Nullable Level world, List tooltip, TooltipFlag flag) { + if (ForgeCapabilities.FLUID_HANDLER_ITEM == null) return; // sanity check itemStack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).ifPresent(fluid -> { FluidStack fluidStack = fluid.getFluidInTank(0).copy(); tooltip.add( @@ -51,7 +51,7 @@ public void appendHoverText(ItemStack itemStack, @Nullable Level world, List { FluidStack fluidStack = fluid.getFluidInTank(0).copy(); fluidInTank.set(fluidStack.getAmount()); }); - return (int)Math.round(13 * (fluidInTank.get() / (double)this.TANK_CAPACITY)); + return (int) Math.round(13 * (fluidInTank.get() / (double) this.TANK_CAPACITY)); } @Override public int getBarColor(ItemStack itemStack) { AtomicReference ratio = new AtomicReference<>(0F); itemStack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).ifPresent(fluid -> { - ratio.set(fluid.getFluidInTank(0).getAmount() / (float)this.TANK_CAPACITY); + ratio.set(fluid.getFluidInTank(0).getAmount() / (float) this.TANK_CAPACITY); }); return Mth.hsvToRgb(ratio.get() / 3.0F, 1.0F, 1.0F); } @@ -87,7 +87,7 @@ public int getBarColor(ItemStack itemStack) { // This should initialize the FluidHandler and also allow one to get the fluidHandler from this item @Nullable @Override - public ICapabilityProvider initCapabilities(ItemStack itemStack, @Nullable CompoundTag nbt){ + public ICapabilityProvider initCapabilities(ItemStack itemStack, @Nullable CompoundTag nbt) { return new FluidHandlerItemStack(itemStack, this.TANK_CAPACITY); } @@ -97,67 +97,67 @@ public ICapabilityProvider initCapabilities(ItemStack itemStack, @Nullable Compo */ @Override - public void setDamage(ItemStack stack, int damage){ // I don't think this fires + public void setDamage(ItemStack stack, int damage) { // I don't think this fires CompoundTag tag = stack.getTag(); if (tag == null) return; int usesLeftUntilRefuel = tag.getInt("energy"); - if (usesLeftUntilRefuel < 1){ + if (usesLeftUntilRefuel < 1) { AtomicInteger volumetricEnergy = new AtomicInteger(0); stack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).ifPresent(fluid -> { FluidStack itemFluid = fluid.getFluidInTank(0).copy(); - if (!itemFluid.isEmpty() && isCombustibleFuel(itemFluid.getRawFluid())){ - if (fluid.getFluidInTank(0).getAmount() > 50){ + if (!itemFluid.isEmpty() && isCombustibleFuel(itemFluid.getRawFluid())) { + if (fluid.getFluidInTank(0).getAmount() > 50) { fluid.drain(50, IFluidHandler.FluidAction.EXECUTE); //volumetricEnergy.set(CombustionGeneratorFuelRecipe.rawFluidWithVolumetricEnergy.getOrDefault(fluid.getFluidInTank(0).getRawFluid(), 0)/50); - volumetricEnergy.set(getVolumetricEnergyFromFluid(fluid.getFluidInTank(0).getRawFluid())/50); + volumetricEnergy.set(getVolumetricEnergyFromFluid(fluid.getFluidInTank(0).getRawFluid()) / 50); } } }); - stack.getOrCreateTag().putInt("energy",volumetricEnergy.get()); // Resets the energy tag + stack.getOrCreateTag().putInt("energy", volumetricEnergy.get()); // Resets the energy tag } } @Override - public int damageItem(ItemStack stack, int amount, T entity, Consumer onBroken) { + public int damageItem(ItemStack stack, int amount, T entity, Consumer onBroken) { CompoundTag tag = stack.getTag(); - if (tag == null && stack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).isPresent()){ + if (tag == null && stack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).isPresent()) { AtomicInteger volumetricEnergy = new AtomicInteger(); stack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).ifPresent(fluid -> { FluidStack itemFluid = fluid.getFluidInTank(0).copy(); - if (isCombustibleFuel(itemFluid.getRawFluid())){ - if (fluid.getFluidInTank(0).getAmount() > 50){ + if (isCombustibleFuel(itemFluid.getRawFluid())) { + if (fluid.getFluidInTank(0).getAmount() > 50) { fluid.drain(50, IFluidHandler.FluidAction.EXECUTE); - volumetricEnergy.set(getVolumetricEnergyFromFluid(fluid.getFluidInTank(0).getRawFluid())/50); + volumetricEnergy.set(getVolumetricEnergyFromFluid(fluid.getFluidInTank(0).getRawFluid()) / 50); stack.getOrCreateTag().putInt("damage", volumetricEnergy.get()); // does nothing } } }); return -(volumetricEnergy.get()) > 0 ? -(volumetricEnergy.get()) : -1; - } else if (tag == null){ + } else if (tag == null) { return 0; // Technically this should never occur } int usesLeftUntilRefuel = tag.getInt("energy"); - if (usesLeftUntilRefuel > 1){ - stack.getTag().putInt("energy", (usesLeftUntilRefuel-amount)); + if (usesLeftUntilRefuel > 1) { + stack.getTag().putInt("energy", (usesLeftUntilRefuel - amount)); return -1; - } else if (usesLeftUntilRefuel <= 1){ + } else if (usesLeftUntilRefuel <= 1) { AtomicInteger volumetricEnergy = new AtomicInteger(0); stack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).ifPresent(fluid -> { FluidStack itemFluid = fluid.getFluidInTank(0).copy(); - if (isCombustibleFuel(itemFluid.getRawFluid())){ - if (fluid.getFluidInTank(0).getAmount() >= 50){ + if (isCombustibleFuel(itemFluid.getRawFluid())) { + if (fluid.getFluidInTank(0).getAmount() >= 50) { fluid.drain(50, IFluidHandler.FluidAction.EXECUTE); - volumetricEnergy.set(getVolumetricEnergyFromFluid(fluid.getFluidInTank(0).getRawFluid())/50); + volumetricEnergy.set(getVolumetricEnergyFromFluid(fluid.getFluidInTank(0).getRawFluid()) / 50); } } }); - stack.getOrCreateTag().putInt("energy",volumetricEnergy.get()); // THIS RESETS THE ENERGY + stack.getOrCreateTag().putInt("energy", volumetricEnergy.get()); // THIS RESETS THE ENERGY return -(volumetricEnergy.get()) > 0 ? -(volumetricEnergy.get()) : -1; // CANNOT 0 or + result will destroy item } @@ -165,21 +165,21 @@ public int damageItem(ItemStack stack, int amount, T e } @Override - public boolean isDamageable(ItemStack itemStack){ + public boolean isDamageable(ItemStack itemStack) { return true; } @Override - public void onDestroyed(ItemEntity itemEntity){ // Doesn't seem to work, but should never fire with current design + public void onDestroyed(ItemEntity itemEntity) { // Doesn't seem to work, but should never fire with current design this.onDestroyed(itemEntity.getItem()); } - public void onDestroyed(ItemStack itemStack){ // Doesn't seem to work, but should never fire with current design + public void onDestroyed(ItemStack itemStack) { // Doesn't seem to work, but should never fire with current design itemStack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).ifPresent(fluid -> { FluidStack itemFluid = fluid.getFluidInTank(0).copy(); - if (isCombustibleFuel(itemFluid.getRawFluid())){ - if (fluid.getFluidInTank(0).getAmount() > 50){ + if (isCombustibleFuel(itemFluid.getRawFluid())) { + if (fluid.getFluidInTank(0).getAmount() > 50) { fluid.drain(50, IFluidHandler.FluidAction.EXECUTE); int volumetricEnergy = getVolumetricEnergyFromFluid(fluid.getFluidInTank(0).getRawFluid()); itemFluid.getOrCreateTag().putInt("energy", volumetricEnergy); @@ -196,13 +196,13 @@ public boolean isDamaged(ItemStack stack) { @Override public float getDestroySpeed(ItemStack itemStack, BlockState blockStateToMine) { CompoundTag tag = itemStack.getTag(); - if (tag != null){ - if (tag.getInt("energy") > 1){ + if (tag != null) { + if (tag.getInt("energy") > 1) { return super.getDestroySpeed(itemStack, blockStateToMine); } else { AtomicBoolean notEmpty = new AtomicBoolean(false); itemStack.getCapability(ForgeCapabilities.FLUID_HANDLER_ITEM).ifPresent(fluid -> notEmpty.set(!fluid.getFluidInTank(0).isEmpty())); - if (notEmpty.get()){ + if (notEmpty.get()) { return super.getDestroySpeed(itemStack, blockStateToMine); } } @@ -212,15 +212,15 @@ public float getDestroySpeed(ItemStack itemStack, BlockState blockStateToMine) { private static int getVolumetricEnergyFromFluid(Fluid fluid) { - for(VERecipe recipe : VERecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE)) { - if(recipe.getFluidIngredient(0).test(fluid)) return recipe.getFluidIngredientAmount(0); + for (VERecipe recipe : VERecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE)) { + if (recipe.getFluidIngredient(0).test(fluid)) return recipe.getFluidIngredientAmount(0); } return 0; } public static boolean isCombustibleFuel(Fluid fluid) { - for(VERecipe recipe : VERecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE)) { - if(recipe.getFluidIngredient(0).test(fluid)) return true; + for (VERecipe recipe : VERecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE)) { + if (recipe.getFluidIngredient(0).test(fluid)) return true; } return false; } diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/Multitool.java b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/Multitool.java index 57c5b1248..b69391971 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/Multitool.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/Multitool.java @@ -55,12 +55,12 @@ public boolean mineBlock(ItemStack p_40998_, Level p_40999_, BlockState p_41000_ } @Nullable - public MultitoolBit getBit(){ + public MultitoolBit getBit() { return this.bit != null ? this.bit : null; } public Multimap getDefaultAttributeModifiers(EquipmentSlot equipmentSlot) { - if(this.bit != null) + if (this.bit != null) return equipmentSlot == EquipmentSlot.MAINHAND ? this.bit.getDefaultAttributeModifiers(equipmentSlot) : super.getDefaultAttributeModifiers(equipmentSlot); return super.getDefaultAttributeModifiers(equipmentSlot); } @@ -104,7 +104,7 @@ public boolean onBlockStartBreak(ItemStack itemstack, BlockPos pos, Player playe BlockPos offsetPos = pos; System.out.println("Should be activating Tree Felling"); - for (int yOffset = pos.getY(); yOffset < 320; yOffset++ ) { + for (int yOffset = pos.getY(); yOffset < 320; yOffset++) { offsetPos = offsetPos.above(); BlockState potentialStateToFell = level.getBlockState(offsetPos); @@ -150,7 +150,7 @@ public boolean canPerformAction(ItemStack stack, net.minecraftforge.common.ToolA } @Override - public boolean isCorrectToolForDrops(ItemStack stack, BlockState blockState){ + public boolean isCorrectToolForDrops(ItemStack stack, BlockState blockState) { return this.bit != null ? this.bit.isCorrectToolForDrops(blockState) : false; } @@ -166,7 +166,7 @@ public net.minecraft.world.InteractionResult interactLivingEntity(ItemStack stac java.util.Random rand = new java.util.Random(); drops.forEach(d -> { net.minecraft.world.entity.item.ItemEntity ent = entity.spawnAtLocation(d, 1.0F); - ent.setDeltaMovement(ent.getDeltaMovement().add((double)((rand.nextFloat() - rand.nextFloat()) * 0.1F), (double)(rand.nextFloat() * 0.05F), (double)((rand.nextFloat() - rand.nextFloat()) * 0.1F))); + ent.setDeltaMovement(ent.getDeltaMovement().add((double) ((rand.nextFloat() - rand.nextFloat()) * 0.1F), (double) (rand.nextFloat() * 0.05F), (double) ((rand.nextFloat() - rand.nextFloat()) * 0.1F))); }); stack.hurtAndBreak(1, playerIn, e -> e.broadcastBreakEvent(hand)); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/VEMultitools.java b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/VEMultitools.java index 0fa14a648..c6b769876 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/VEMultitools.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/VEMultitools.java @@ -55,37 +55,37 @@ public class VEMultitools { // Iron public static RegistryObject IRON_DRILL_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("iron_drill_bit", () -> new BitItem(VEMultitoolBits.IRON_DRILL_BIT, "iron_drill_bit", MULTITOOL_PROPERTIES)); - public static RegistryObject IRON_CHAIN_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("iron_chain_bit", () -> new BitItem(VEMultitoolBits.IRON_CHAIN_BIT,"iron_chain_bit", MULTITOOL_PROPERTIES)); - public static RegistryObject IRON_SCOOPER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("iron_scooper_bit", () -> new BitItem(VEMultitoolBits.IRON_SCOOPER_BIT, "iron_scooper_bit",MULTITOOL_PROPERTIES)); + public static RegistryObject IRON_CHAIN_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("iron_chain_bit", () -> new BitItem(VEMultitoolBits.IRON_CHAIN_BIT, "iron_chain_bit", MULTITOOL_PROPERTIES)); + public static RegistryObject IRON_SCOOPER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("iron_scooper_bit", () -> new BitItem(VEMultitoolBits.IRON_SCOOPER_BIT, "iron_scooper_bit", MULTITOOL_PROPERTIES)); public static RegistryObject IRON_TRIMMER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("iron_trimmer_bit", () -> new BitItem(VEMultitoolBits.IRON_TRIMMER_BIT, "iron_trimmer_bit", MULTITOOL_PROPERTIES)); // Diamond public static RegistryObject DIAMOND_DRILL_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("diamond_drill_bit", () -> new BitItem(VEMultitoolBits.DIAMOND_DRILL_BIT, "diamond_drill_bit", MULTITOOL_PROPERTIES)); - public static RegistryObject DIAMOND_CHAIN_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("diamond_chain_bit", () -> new BitItem(VEMultitoolBits.DIAMOND_CHAIN_BIT,"diamond_chain_bit", MULTITOOL_PROPERTIES)); - public static RegistryObject DIAMOND_SCOOPER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("diamond_scooper_bit", () -> new BitItem(VEMultitoolBits.DIAMOND_SCOOPER_BIT, "diamond_scooper_bit",MULTITOOL_PROPERTIES)); + public static RegistryObject DIAMOND_CHAIN_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("diamond_chain_bit", () -> new BitItem(VEMultitoolBits.DIAMOND_CHAIN_BIT, "diamond_chain_bit", MULTITOOL_PROPERTIES)); + public static RegistryObject DIAMOND_SCOOPER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("diamond_scooper_bit", () -> new BitItem(VEMultitoolBits.DIAMOND_SCOOPER_BIT, "diamond_scooper_bit", MULTITOOL_PROPERTIES)); public static RegistryObject DIAMOND_TRIMMER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("diamond_trimmer_bit", () -> new BitItem(VEMultitoolBits.DIAMOND_TRIMMER_BIT, "diamond_trimmer_bit", MULTITOOL_PROPERTIES)); // Titanium public static RegistryObject TITANIUM_DRILL_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("titanium_drill_bit", () -> new BitItem(VEMultitoolBits.TITANIUM_DRILL_BIT, "titanium_drill_bit", MULTITOOL_PROPERTIES)); - public static RegistryObject TITANIUM_CHAIN_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("titanium_chain_bit", () -> new BitItem(VEMultitoolBits.TITANIUM_CHAIN_BIT,"titanium_chain_bit", MULTITOOL_PROPERTIES)); - public static RegistryObject TITANIUM_SCOOPER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("titanium_scooper_bit", () -> new BitItem(VEMultitoolBits.TITANIUM_SCOOPER_BIT, "titanium_scooper_bit",MULTITOOL_PROPERTIES)); + public static RegistryObject TITANIUM_CHAIN_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("titanium_chain_bit", () -> new BitItem(VEMultitoolBits.TITANIUM_CHAIN_BIT, "titanium_chain_bit", MULTITOOL_PROPERTIES)); + public static RegistryObject TITANIUM_SCOOPER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("titanium_scooper_bit", () -> new BitItem(VEMultitoolBits.TITANIUM_SCOOPER_BIT, "titanium_scooper_bit", MULTITOOL_PROPERTIES)); public static RegistryObject TITANIUM_TRIMMER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("titanium_trimmer_bit", () -> new BitItem(VEMultitoolBits.TITANIUM_TRIMMER_BIT, "titanium_trimmer_bit", MULTITOOL_PROPERTIES)); // Nighalite public static RegistryObject NIGHALITE_DRILL_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("nighalite_drill_bit", () -> new BitItem(VEMultitoolBits.NIGHALITE_DRILL_BIT, "nighalite_drill_bit", MULTITOOL_PROPERTIES)); - public static RegistryObject NIGHALITE_CHAIN_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("nighalite_chain_bit", () -> new BitItem(VEMultitoolBits.NIGHALITE_CHAIN_BIT,"nighalite_chain_bit", MULTITOOL_PROPERTIES)); - public static RegistryObject NIGHALITE_SCOOPER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("nighalite_scooper_bit", () -> new BitItem(VEMultitoolBits.NIGHALITE_SCOOPER_BIT, "nighalite_scooper_bit",MULTITOOL_PROPERTIES)); + public static RegistryObject NIGHALITE_CHAIN_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("nighalite_chain_bit", () -> new BitItem(VEMultitoolBits.NIGHALITE_CHAIN_BIT, "nighalite_chain_bit", MULTITOOL_PROPERTIES)); + public static RegistryObject NIGHALITE_SCOOPER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("nighalite_scooper_bit", () -> new BitItem(VEMultitoolBits.NIGHALITE_SCOOPER_BIT, "nighalite_scooper_bit", MULTITOOL_PROPERTIES)); public static RegistryObject NIGHALITE_TRIMMER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("nighalite_trimmer_bit", () -> new BitItem(VEMultitoolBits.NIGHALITE_TRIMMER_BIT, "nighalite_trimmer_bit", MULTITOOL_PROPERTIES)); // Eighzo public static RegistryObject EIGHZO_DRILL_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("eighzo_drill_bit", () -> new BitItem(VEMultitoolBits.EIGHZO_DRILL_BIT, "eighzo_drill_bit", MULTITOOL_PROPERTIES)); - public static RegistryObject EIGHZO_CHAIN_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("eighzo_chain_bit", () -> new BitItem(VEMultitoolBits.EIGHZO_CHAIN_BIT,"eighzo_chain_bit", MULTITOOL_PROPERTIES)); - public static RegistryObject EIGHZO_SCOOPER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("eighzo_scooper_bit", () -> new BitItem(VEMultitoolBits.EIGHZO_SCOOPER_BIT, "eighzo_scooper_bit",MULTITOOL_PROPERTIES)); + public static RegistryObject EIGHZO_CHAIN_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("eighzo_chain_bit", () -> new BitItem(VEMultitoolBits.EIGHZO_CHAIN_BIT, "eighzo_chain_bit", MULTITOOL_PROPERTIES)); + public static RegistryObject EIGHZO_SCOOPER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("eighzo_scooper_bit", () -> new BitItem(VEMultitoolBits.EIGHZO_SCOOPER_BIT, "eighzo_scooper_bit", MULTITOOL_PROPERTIES)); public static RegistryObject EIGHZO_TRIMMER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("eighzo_trimmer_bit", () -> new BitItem(VEMultitoolBits.EIGHZO_TRIMMER_BIT, "eighzo_trimmer_bit", MULTITOOL_PROPERTIES)); // Solarium public static RegistryObject SOLARIUM_DRILL_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("solarium_drill_bit", () -> new BitItem(VEMultitoolBits.SOLARIUM_DRILL_BIT, "solarium_drill_bit", MULTITOOL_PROPERTIES)); - public static RegistryObject SOLARIUM_CHAIN_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("solarium_chain_bit", () -> new BitItem(VEMultitoolBits.SOLARIUM_CHAIN_BIT,"solarium_chain_bit", MULTITOOL_PROPERTIES)); - public static RegistryObject SOLARIUM_SCOOPER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("solarium_scooper_bit", () -> new BitItem(VEMultitoolBits.SOLARIUM_SCOOPER_BIT, "solarium_scooper_bit",MULTITOOL_PROPERTIES)); + public static RegistryObject SOLARIUM_CHAIN_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("solarium_chain_bit", () -> new BitItem(VEMultitoolBits.SOLARIUM_CHAIN_BIT, "solarium_chain_bit", MULTITOOL_PROPERTIES)); + public static RegistryObject SOLARIUM_SCOOPER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("solarium_scooper_bit", () -> new BitItem(VEMultitoolBits.SOLARIUM_SCOOPER_BIT, "solarium_scooper_bit", MULTITOOL_PROPERTIES)); public static RegistryObject SOLARIUM_TRIMMER_BIT = VE_MULTITOOL_ITEM_REGISTRY.register("solarium_trimmer_bit", () -> new BitItem(VEMultitoolBits.SOLARIUM_TRIMMER_BIT, "solarium_trimmer_bit", MULTITOOL_PROPERTIES)); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/bits/BitItem.java b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/bits/BitItem.java index 23a3a3a0c..4f013e8dc 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/bits/BitItem.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/bits/BitItem.java @@ -12,7 +12,7 @@ public BitItem(MultitoolBit bit, String registryName, Item.Properties itemProper setRegistryName(registryName); } - public MultitoolBit getBit(){ + public MultitoolBit getBit() { return this.multitoolBit; } diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/bits/MultitoolBit.java b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/bits/MultitoolBit.java index 8f92672db..db1d63487 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/bits/MultitoolBit.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/bits/MultitoolBit.java @@ -25,7 +25,7 @@ public class MultitoolBit { private float attackSpeed; private final Multimap defaultModifiers; - public MultitoolBit(Set action, Tier bitTier, TagKey mineableBlockTag, float destroySpeedMultiplier, float attackDamage, float attackSpeed){ + public MultitoolBit(Set action, Tier bitTier, TagKey mineableBlockTag, float destroySpeedMultiplier, float attackDamage, float attackSpeed) { this.action = action; this.tier = bitTier; this.mineableBlocks = mineableBlockTag; @@ -51,7 +51,7 @@ public float getDestroySpeed(ItemStack itemStack, BlockState blockState) { return blockState.is(this.mineableBlocks) ? this.destroySpeed : 1.0F; } - public float getAttackDamage(){ + public float getAttackDamage() { return this.attackDamage; } @@ -59,11 +59,11 @@ public Multimap getDefaultAttributeModifiers(Equip return this.defaultModifiers; } - public boolean canPerformAction(net.minecraftforge.common.ToolAction action){ + public boolean canPerformAction(net.minecraftforge.common.ToolAction action) { return this.action.contains(action); } - public boolean isCorrectToolForDrops(BlockState blockState){ + public boolean isCorrectToolForDrops(BlockState blockState) { return blockState.is(this.mineableBlocks) && net.minecraftforge.common.TierSortingRegistry.isCorrectTierForDrops(this.tier, blockState); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/bits/TrimmerBit.java b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/bits/TrimmerBit.java index 463846791..9f8d943b4 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/bits/TrimmerBit.java +++ b/src/main/java/com/veteam/voluminousenergy/items/tools/multitool/bits/TrimmerBit.java @@ -9,7 +9,7 @@ import java.util.Set; -public class TrimmerBit extends MultitoolBit{ +public class TrimmerBit extends MultitoolBit { private Tier tier; private float destroySpeedMultiplier; @@ -26,7 +26,7 @@ public float getDestroySpeed(ItemStack itemStack, BlockState blockState) { return 5.0F * destroySpeedMultiplier; } else if (blockState.is(Blocks.VINE) || blockState.is(Blocks.GLOW_LICHEN) - ){ + ) { return destroySpeedMultiplier * 2.0F; } else if (blockState.is(BlockTags.CAVE_VINES) || blockState.is(Blocks.TWISTING_VINES) @@ -46,7 +46,7 @@ public float getDestroySpeed(ItemStack itemStack, BlockState blockState) { || blockState.is(Blocks.NETHER_SPROUTS) || blockState.is(Blocks.NETHER_WART) || blockState.is(Blocks.HANGING_ROOTS) - ){ + ) { return destroySpeedMultiplier; } else { return 1.0F; @@ -56,7 +56,7 @@ public float getDestroySpeed(ItemStack itemStack, BlockState blockState) { } @Override - public boolean isCorrectToolForDrops(BlockState blockState){ + public boolean isCorrectToolForDrops(BlockState blockState) { return (blockState.is(Blocks.COBWEB) || blockState.is(Blocks.REDSTONE_WIRE) || blockState.is(Blocks.TRIPWIRE)) && net.minecraftforge.common.TierSortingRegistry.isCorrectTierForDrops(this.tier, blockState); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/upgrades/MysteriousMultiplier.java b/src/main/java/com/veteam/voluminousenergy/items/upgrades/MysteriousMultiplier.java index ca61337b5..c1b1961ed 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/upgrades/MysteriousMultiplier.java +++ b/src/main/java/com/veteam/voluminousenergy/items/upgrades/MysteriousMultiplier.java @@ -22,35 +22,35 @@ public MysteriousMultiplier() { } @Override - public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag){ - Component componentToAdd = TextUtil.translateString("text.voluminousenergy.quality").copy().append(": "); + public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip, TooltipFlag flag) { + Component componentToAdd = TextUtil.translateString("text.voluminousenergy.quality").copy().append(": "); if (stack.getTag() == null) { componentToAdd = componentToAdd.copy().append(TextUtil.translateString("text.voluminousenergy.quality.unidentified")).withStyle(ChatFormatting.BOLD); } else { float multiplier = stack.getTag().getFloat("multiplier"); - if (multiplier >= 0.65F){ + if (multiplier >= 0.65F) { componentToAdd = componentToAdd.copy().append(TextUtil.translateString("text.voluminousenergy.quality.basic")).withStyle(ChatFormatting.WHITE); - } else if (multiplier >= 0.5F){ + } else if (multiplier >= 0.5F) { componentToAdd = componentToAdd.copy().append(TextUtil.translateString("text.voluminousenergy.quality.grand")).withStyle(ChatFormatting.GREEN); - } else if (multiplier >= 0.4F){ + } else if (multiplier >= 0.4F) { componentToAdd = componentToAdd.copy().append(TextUtil.translateString("text.voluminousenergy.quality.rare")).withStyle(ChatFormatting.BLUE); - } else if (multiplier >= 0.3F){ + } else if (multiplier >= 0.3F) { componentToAdd = componentToAdd.copy().append(TextUtil.translateString("text.voluminousenergy.quality.arcane")).withStyle(ChatFormatting.LIGHT_PURPLE); - } else if (multiplier >= 0.25F){ + } else if (multiplier >= 0.25F) { componentToAdd = componentToAdd.copy().append(TextUtil.translateString("text.voluminousenergy.quality.heroic")).withStyle(ChatFormatting.YELLOW); - } else if (multiplier >= 0.2F){ + } else if (multiplier >= 0.2F) { componentToAdd = componentToAdd.copy().append(TextUtil.translateString("text.voluminousenergy.quality.unique")).withStyle(Style.EMPTY.withFont(Style.DEFAULT_FONT).withColor(0xfc6b03)); - } else if (multiplier >= 0.1F){ + } else if (multiplier >= 0.1F) { componentToAdd = componentToAdd.copy().append(TextUtil.translateString("text.voluminousenergy.quality.celestial")).withStyle(ChatFormatting.RED); - } else if (multiplier >= 0.075F){ + } else if (multiplier >= 0.075F) { componentToAdd = componentToAdd.copy().append(TextUtil.translateString("text.voluminousenergy.quality.divine")).withStyle(Style.EMPTY.withFont(Style.DEFAULT_FONT).withColor(0xcf7d5d).withBold(true)); - } else if (multiplier >= 0.05F){ + } else if (multiplier >= 0.05F) { componentToAdd = componentToAdd.copy().append(TextUtil.translateString("text.voluminousenergy.quality.epic")).withStyle(Style.EMPTY.withFont(Style.DEFAULT_FONT).withColor(0x8fa5ca).withBold(true)); - } else if (multiplier >= 0.025F){ + } else if (multiplier >= 0.025F) { componentToAdd = componentToAdd.copy().append(TextUtil.translateString("text.voluminousenergy.quality.legendary")).withStyle(Style.EMPTY.withFont(Style.DEFAULT_FONT).withColor(0xbf7900).withBold(true)); - } else if (multiplier <= 0.025F){ + } else if (multiplier <= 0.025F) { componentToAdd = componentToAdd.copy().append(TextUtil.translateString("text.voluminousenergy.quality.mythic")).withStyle(Style.EMPTY.withFont(Style.DEFAULT_FONT).withColor(0xc90b0b).withBold(true)); } else { componentToAdd = componentToAdd.copy().append("DEBUGWARN: NoneOfTheAbove: " + multiplier); @@ -62,20 +62,20 @@ public void appendHoverText(ItemStack stack, @Nullable Level world, List tooltip.copy(); - case BASIC -> tooltip.copy().append("1x ~ 0.65x") ; + case BASIC -> tooltip.copy().append("1x ~ 0.65x"); case GRAND -> tooltip.copy().append("0.65x ~ 0.5x"); - case RARE -> tooltip.copy().append("0.5x ~ 0.4x"); - case ARCANE -> tooltip.copy().append("0.4x ~ 0.3x"); - case HEROIC -> tooltip.copy().append("0.3x ~ 0.25x"); - case UNIQUE -> tooltip.copy().append("0.25x ~ 0.2x"); - case CELESTIAL -> tooltip.copy().append("0.2x ~ 0.1x"); - case DIVINE -> tooltip.copy().append("0.1x ~ 0.075x"); - case EPIC -> tooltip.copy().append("0.075x ~ 0.05x"); + case RARE -> tooltip.copy().append("0.5x ~ 0.4x"); + case ARCANE -> tooltip.copy().append("0.4x ~ 0.3x"); + case HEROIC -> tooltip.copy().append("0.3x ~ 0.25x"); + case UNIQUE -> tooltip.copy().append("0.25x ~ 0.2x"); + case CELESTIAL -> tooltip.copy().append("0.2x ~ 0.1x"); + case DIVINE -> tooltip.copy().append("0.1x ~ 0.075x"); + case EPIC -> tooltip.copy().append("0.075x ~ 0.05x"); case LEGENDARY -> tooltip.copy().append("0.05x ~ 0.025x"); case MYTHIC -> tooltip.copy().append("<0.025x"); }; @@ -85,7 +85,7 @@ public Component appendInfoForJEI(Component tooltip, ItemStack stack){ @Override public void inventoryTick(ItemStack stack, Level level, Entity entity, int num, boolean bool) { - if (stack.getTag() == null && !level.isClientSide()); + if (stack.getTag() == null && !level.isClientSide()) ; else if (level.isClientSide() || !stack.getTag().isEmpty()) return; float multiplier = level.getRandom().nextFloat() * (0.75F - 0.005F) + 0.005F; @@ -110,18 +110,29 @@ public enum QualityTier { } // Ugly, I know. You can fix this is you want - public static QualityTier getQualityTier(float multiplier){ - if (multiplier >= 0.65F){ return QualityTier.BASIC; - } else if (multiplier >= 0.5F){ return QualityTier.GRAND; - } else if (multiplier >= 0.4F){ return QualityTier.RARE; - } else if (multiplier >= 0.3F){ return QualityTier.ARCANE; - } else if (multiplier >= 0.25F){ return QualityTier.HEROIC; - } else if (multiplier >= 0.2F){ return QualityTier.UNIQUE; - } else if (multiplier >= 0.1F){ return QualityTier.CELESTIAL; - } else if (multiplier >= 0.075F){ return QualityTier.DIVINE; - } else if (multiplier >= 0.05F){ return QualityTier.EPIC; - } else if (multiplier >= 0.025F){ return QualityTier.LEGENDARY; - } else if (multiplier <= 0.025F){ return QualityTier.MYTHIC; + public static QualityTier getQualityTier(float multiplier) { + if (multiplier >= 0.65F) { + return QualityTier.BASIC; + } else if (multiplier >= 0.5F) { + return QualityTier.GRAND; + } else if (multiplier >= 0.4F) { + return QualityTier.RARE; + } else if (multiplier >= 0.3F) { + return QualityTier.ARCANE; + } else if (multiplier >= 0.25F) { + return QualityTier.HEROIC; + } else if (multiplier >= 0.2F) { + return QualityTier.UNIQUE; + } else if (multiplier >= 0.1F) { + return QualityTier.CELESTIAL; + } else if (multiplier >= 0.075F) { + return QualityTier.DIVINE; + } else if (multiplier >= 0.05F) { + return QualityTier.EPIC; + } else if (multiplier >= 0.025F) { + return QualityTier.LEGENDARY; + } else if (multiplier <= 0.025F) { + return QualityTier.MYTHIC; } return QualityTier.NULL; } @@ -140,7 +151,7 @@ public static QualityTier getQualityTier(float multiplier){ MysteriousMultiplier.QualityTier.MYTHIC ); - public static final HashMap REFERENCE_MULTIPLIER_VALUES = new HashMap<>() {{ + public static final HashMap REFERENCE_MULTIPLIER_VALUES = new HashMap<>() {{ put(QualityTier.BASIC, 0.66F); put(QualityTier.GRAND, 0.55F); put(QualityTier.RARE, 0.45F); diff --git a/src/main/java/com/veteam/voluminousenergy/loot/VELoot.java b/src/main/java/com/veteam/voluminousenergy/loot/VELoot.java index 3ef3eedfb..245f04461 100644 --- a/src/main/java/com/veteam/voluminousenergy/loot/VELoot.java +++ b/src/main/java/com/veteam/voluminousenergy/loot/VELoot.java @@ -22,7 +22,8 @@ public class VELoot { public static RegistryObject> MYSTERIOUS_MULTIPLIER_MODIFIER_CODEC = VE_LOOT_MODIFIER_REGISTRY.register( "mysterious_multiplier", MysteriousMultiplierModifier.CODEC); - private VELoot() {} + private VELoot() { + } public static final List SPAWN_MYSTERIOUS_MULTIPLIERS_IN = List.of( BuiltInLootTables.BASTION_BRIDGE, diff --git a/src/main/java/com/veteam/voluminousenergy/loot/modifiers/AnimalFatLootModifier.java b/src/main/java/com/veteam/voluminousenergy/loot/modifiers/AnimalFatLootModifier.java index dd6fc7872..e7116495f 100644 --- a/src/main/java/com/veteam/voluminousenergy/loot/modifiers/AnimalFatLootModifier.java +++ b/src/main/java/com/veteam/voluminousenergy/loot/modifiers/AnimalFatLootModifier.java @@ -64,23 +64,23 @@ public AnimalFatLootModifier(LootItemCondition[] conditionsIn, Item item, int mi } @Override - public Codec codec(){ + public Codec codec() { return CODEC.get(); } - public int getMinAmount(){ + public int getMinAmount() { return this.minAmount; } - public int getMaxAmount(){ + public int getMaxAmount() { return this.maxAmount; } - public ItemStack getItemStackAddition(){ + public ItemStack getItemStackAddition() { return this.itemAddition; } - public LootItemCondition[] getLootItemConditions(){ + public LootItemCondition[] getLootItemConditions() { return super.conditions; } } diff --git a/src/main/java/com/veteam/voluminousenergy/loot/modifiers/MysteriousMultiplierModifier.java b/src/main/java/com/veteam/voluminousenergy/loot/modifiers/MysteriousMultiplierModifier.java index ffd115537..4c469aa49 100644 --- a/src/main/java/com/veteam/voluminousenergy/loot/modifiers/MysteriousMultiplierModifier.java +++ b/src/main/java/com/veteam/voluminousenergy/loot/modifiers/MysteriousMultiplierModifier.java @@ -54,7 +54,7 @@ public Codec codec() { return CODEC.get(); } - public LootItemCondition[] getLootItemConditions(){ + public LootItemCondition[] getLootItemConditions() { return super.conditions; } diff --git a/src/main/java/com/veteam/voluminousenergy/persistence/ChunkFluid.java b/src/main/java/com/veteam/voluminousenergy/persistence/ChunkFluid.java index 9cee76ce4..ec3560a6b 100644 --- a/src/main/java/com/veteam/voluminousenergy/persistence/ChunkFluid.java +++ b/src/main/java/com/veteam/voluminousenergy/persistence/ChunkFluid.java @@ -22,7 +22,7 @@ public ChunkFluid(CompoundTag compoundTag) { SingleChunkFluid singleChunkFluid = new SingleChunkFluid( ForgeRegistries.FLUIDS.getValue(new ResourceLocation(compoundTag.getString("SCF_" + i))) - ,compoundTag.getInt("FS_" + i)); + , compoundTag.getInt("FS_" + i)); this.chunkFluidList.add(singleChunkFluid); i++; } @@ -30,8 +30,8 @@ public ChunkFluid(CompoundTag compoundTag) { public ChunkFluid(ChunkPos chunkPos, ArrayList> fluidPairs) { this.chunkPos = chunkPos; - for(var value : fluidPairs) { - this.chunkFluidList.add(new SingleChunkFluid(value.getA(),value.getB())); + for (var value : fluidPairs) { + this.chunkFluidList.add(new SingleChunkFluid(value.getA(), value.getB())); } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java index 2c78536e3..718ef0bf5 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java @@ -20,9 +20,9 @@ public class CentrifugalAgitatorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_AGITATING.get(); private final RecipeParser parser = new RecipeParser(this) - .addFluidIngredient(0,0) - .addFluidResult(1,0) - .addFluidResult(2,1); + .addFluidIngredient(0, 0) + .addFluidResult(1, 0) + .addFluidResult(2, 1); public CentrifugalAgitatorRecipe() { @@ -58,8 +58,12 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull VERecipe recipe) helper.toNetwork(buffer, recipe); } }; + @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java index 3bdc09a1f..9d314902c 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java @@ -22,19 +22,19 @@ public class CentrifugalSeparatorRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_SEPARATION.get(); private final RecipeParser parser = new RNGRecipeParser(this) - .addChancedItemResult(2,0) - .addChancedItemResult(3,1) - .addChancedItemResult(4,2) - .addChancedItemResult(5,3) - .addIngredient(0,0) - .addIngredient(1,1); + .addChancedItemResult(2, 0) + .addChancedItemResult(3, 1) + .addChancedItemResult(4, 2) + .addChancedItemResult(5, 3) + .addIngredient(0, 0) + .addIngredient(1, 1); public CentrifugalSeparatorRecipe() { } public CentrifugalSeparatorRecipe(List ingredients, List results, int processTime) { - super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); + super(ingredients, new ArrayList<>(), new ArrayList<>(), results, processTime); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { @@ -66,7 +66,9 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CentrifugalSepar @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } @Override public RecipeParser getParser() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java index 3f8b7db79..eaa96ef9c 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java @@ -19,8 +19,8 @@ public class CombustionGeneratorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FUEL_COMBUSTION.get(); private final RecipeParser parser = new RecipeParser(this) - .addFluidIngredient(0,0) - .addFluidIngredient(1,1); + .addFluidIngredient(0, 0) + .addFluidIngredient(1, 1); public CombustionGeneratorRecipe() { } @@ -55,7 +55,9 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CombustionGenera }; @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } @Override public RecipeParser getParser() { @@ -63,6 +65,8 @@ public RecipeParser getParser() { } @Override - public @NotNull RecipeType getType(){return RECIPE_TYPE;} + public @NotNull RecipeType getType() { + return RECIPE_TYPE; + } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java index 0dafa9792..fda4d4af5 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java @@ -20,14 +20,14 @@ public class CompressorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.COMPRESSING.get(); private final RecipeParser parser = new RecipeParser(this) - .addIngredient(0,0) - .addItemResult(1,0); + .addIngredient(0, 0) + .addItemResult(1, 0); public CompressorRecipe() { } public CompressorRecipe(List ingredients, List results, int processTime) { - super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); + super(ingredients, new ArrayList<>(), new ArrayList<>(), results, processTime); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java index dc3683234..9efc7335d 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java @@ -21,9 +21,9 @@ public class CrusherRecipe extends VERNGExperienceRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CRUSHING.get(); private final RecipeParser parser = new RNGRecipeParser(this) - .addChancedItemResult(2,1) - .addIngredient(4, 0) - .addItemResult(0, 1); + .addChancedItemResult(1, 0) + .addChancedItemResult(2, 1) + .addIngredient(0, 0); public CrusherRecipe() { } @@ -62,7 +62,9 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CrusherRecipe re @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } @Override public RecipeParser getParser() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java index 36baba9f2..e5d3d698e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java @@ -3,7 +3,6 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.DimensionalLaserParser; import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.ServerSideOnly; @@ -26,7 +25,6 @@ public class DimensionalLaserRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.DIMENSIONAL_LASING.get(); - private final DimensionalLaserParser parser = new DimensionalLaserParser(this); @ServerSideOnly private ClimateData climateData; @@ -77,7 +75,7 @@ public DimensionalLaserRecipe fromNetwork(@NotNull FriendlyByteBuf buffer) { recipe.setTemperatureMin(buffer.readFloat()); recipe.setTemperatureMax(buffer.readFloat()); recipe.regionFluid = buffer.readRegistryId(); - return helper.fromNetwork(recipe,buffer); + return helper.fromNetwork(recipe, buffer); } @Override @@ -102,7 +100,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull DimensionalLaser buffer.writeFloat(recipe.getTemperatureMin()); buffer.writeFloat(recipe.getTemperatureMax()); buffer.writeRegistryId(ForgeRegistries.FLUIDS, recipe.getRegionFluid()); - helper.toNetwork(buffer,recipe); + helper.toNetwork(buffer, recipe); } }; @@ -247,9 +245,12 @@ public FluidStack getOutputFluid(int slot) { return FluidStack.EMPTY; } + /* + This is null because we want it to explode if someone tries to pull a parser from here. + */ @Override public RecipeParser getParser() { - return parser; + return null; } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java index 917802948..cd39ff77d 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java @@ -21,10 +21,10 @@ public class DistillationRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.DISTILLING.get(); private final RecipeParser parser = new RNGRecipeParser(this) - .addChancedItemResult(6,0) - .addFluidIngredient(0,0) - .addFluidResult(1,0) - .addFluidResult(2,1); + .addChancedItemResult(6, 0) + .addFluidIngredient(0, 0) + .addFluidResult(1, 0) + .addFluidResult(2, 1); public DistillationRecipe() { } @@ -62,7 +62,9 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull DistillationReci }; @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } @Override public RecipeParser getParser() { @@ -70,10 +72,12 @@ public RecipeParser getParser() { } @Override - public @NotNull ItemStack getToastSymbol(){ + public @NotNull ItemStack getToastSymbol() { return new ItemStack(VEBlocks.DISTILLATION_UNIT_BLOCK.get()); } @Override - public @NotNull RecipeType getType(){return RECIPE_TYPE;} + public @NotNull RecipeType getType() { + return RECIPE_TYPE; + } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java index fb54eda57..3fce72d66 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java @@ -22,18 +22,18 @@ public class ElectrolyzerRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.ELECTROLYZING.get(); private final RecipeParser parser = new RNGRecipeParser(this) - .addChancedItemResult(2,0) - .addChancedItemResult(3,1) - .addChancedItemResult(4,2) - .addChancedItemResult(5,3) - .addIngredient(0,0) - .addIngredient(1,1); + .addChancedItemResult(2, 0) + .addChancedItemResult(3, 1) + .addChancedItemResult(4, 2) + .addChancedItemResult(5, 3) + .addIngredient(0, 0) + .addIngredient(1, 1); public ElectrolyzerRecipe() { } public ElectrolyzerRecipe(List ingredients, List results, int processTime) { - super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); + super(ingredients, new ArrayList<>(), new ArrayList<>(), results, processTime); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { @@ -62,8 +62,11 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ElectrolyzerReci helper.toNetwork(buffer, recipe); } }; + @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } @Override public RecipeParser getParser() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java index 5dee82699..0b62aaa62 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java @@ -20,9 +20,9 @@ public class FluidElectrolyzerRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FLUID_ELECTROLYZING.get(); private final RecipeParser parser = new RecipeParser(this) - .addFluidIngredient(0,0) - .addFluidResult(1,0) - .addFluidResult(2,1); + .addFluidIngredient(0, 0) + .addFluidResult(1, 0) + .addFluidResult(2, 1); public FluidElectrolyzerRecipe() { } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java index a23495964..8ee9fb81f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java @@ -20,9 +20,9 @@ public class FluidMixerRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FLUID_MIXING.get(); private final RecipeParser parser = new RecipeParser(this) - .addFluidIngredient(0,0) - .addFluidResult(1,0) - .addFluidResult(2,1); + .addFluidIngredient(0, 0) + .addFluidResult(1, 0) + .addFluidResult(2, 1); public FluidMixerRecipe() { } @@ -59,7 +59,9 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull FluidMixerRecipe }; @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } @Override public RecipeParser getParser() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java index 3aed3bc81..581766690 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java @@ -20,12 +20,12 @@ public class HydroponicIncubatorRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.HYDROPONIC_INCUBATING.get(); private final RecipeParser parser = new HydroponicParser(this) - .addChancedItemResult(2,0) - .addChancedItemResult(3,1) - .addChancedItemResult(4,2) - .addChancedItemResult(5,3) - .addChancedItemResult(6,4) - .addFluidIngredient(0,0); + .addChancedItemResult(2, 0) + .addChancedItemResult(3, 1) + .addChancedItemResult(4, 2) + .addChancedItemResult(5, 3) + .addChancedItemResult(6, 4) + .addFluidIngredient(0, 0); public HydroponicIncubatorRecipe() { } @@ -63,7 +63,9 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull HydroponicIncuba }; @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } @Override public RecipeParser getParser() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java index 9cd8e6b2a..cdcaa483e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java @@ -21,14 +21,14 @@ public class ImplosionCompressorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.IMPLOSION_COMPRESSING.get(); private final RecipeParser parser = new ImplosionCompressorParser(this) - .addIngredient(0,0) - .addItemResult(2,0); + .addIngredient(0, 0) + .addItemResult(2, 0); public ImplosionCompressorRecipe() { } public ImplosionCompressorRecipe(List ingredients, List results, int processTime) { - super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); + super(ingredients, new ArrayList<>(), new ArrayList<>(), results, processTime); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { @@ -59,7 +59,9 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ImplosionCompres }; @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } @Override public RecipeParser getParser() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java index 29d67d063..96698dce1 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java @@ -28,9 +28,9 @@ public class IndustrialBlastingRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.INDUSTRIAL_BLASTING.get(); private final RecipeParser parser = new RecipeParser(this) - .addFluidIngredient(0,0) - .addIngredient(0,0) - .addItemResult(1,0); + .addFluidIngredient(0, 0) + .addIngredient(0, 0) + .addItemResult(1, 0); private static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { @@ -71,7 +71,7 @@ public IndustrialBlastingRecipe() { } public IndustrialBlastingRecipe(List i, List oi, int processTime, int minimumHeat) { - super(i,List.of(),List.of(),oi,processTime); + super(i, List.of(), List.of(), oi, processTime); this.minimumHeat = minimumHeat; } @@ -79,6 +79,7 @@ public IndustrialBlastingRecipe(List i, List< public @NotNull RecipeType getType() { return RECIPE_TYPE; } + @Override public @NotNull RecipeSerializer getSerializer() { return SERIALIZER; @@ -100,9 +101,9 @@ public int getMinimumHeat() { public List getHotEnoughFluids() { HashSet fluidHashSet = new HashSet<>(); - if(hotEnoughFluids == null) { - for(Fluid fluid : ForgeRegistries.FLUIDS.getValues()) { - if(fluid.getFluidType().getTemperature() > minimumHeat) + if (hotEnoughFluids == null) { + for (Fluid fluid : ForgeRegistries.FLUIDS.getValues()) { + if (fluid.getFluidType().getTemperature() > minimumHeat) fluidHashSet.add(fluid); } hotEnoughFluids = fluidHashSet.stream().toList(); @@ -113,9 +114,9 @@ public List getHotEnoughFluids() { @Override public List getFluidIngredients() { List fluidStacks = new ArrayList<>(); - for(Fluid fluid : getHotEnoughFluids()) { - if(fluid.getFluidType().getTemperature() > minimumHeat) { - fluidStacks.add(new FluidStack(fluid,Config.BLAST_FURNACE_HEAT_SOURCE_CONSUMPTION.get())); + for (Fluid fluid : getHotEnoughFluids()) { + if (fluid.getFluidType().getTemperature() > minimumHeat) { + fluidStacks.add(new FluidStack(fluid, Config.BLAST_FURNACE_HEAT_SOURCE_CONSUMPTION.get())); } } FluidIngredient fluidIngredient = FluidIngredient.of(fluidStacks.stream()); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java index 51e5b97bb..3fde503ec 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java @@ -2,6 +2,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; @@ -19,17 +20,17 @@ public class PrimitiveBlastFurnaceRecipe extends VERecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.PRIMITIVE_BLAST_FURNACING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.PRIMITIVE_BLAST_FURNACING.get(); private final RecipeParser parser = new RecipeParser(this) - .addIngredient(0,0) - .addItemResult(1,0); + .addIngredient(0, 0) + .addItemResult(1, 0); public PrimitiveBlastFurnaceRecipe() { } public PrimitiveBlastFurnaceRecipe(List ingredients, List results, int processTime) { - super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); + super(ingredients, new ArrayList<>(), new ArrayList<>(), results, processTime); } public static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { @@ -58,8 +59,11 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull PrimitiveBlastFu helper.toNetwork(buffer, recipe); } }; + @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } @Override public RecipeParser getParser() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java index 578266bb0..9a6a651bd 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java @@ -19,7 +19,7 @@ public static VERecipe getFluidRecipeFromCache(Level level, RecipeType i, List oi) { - super(i,new ArrayList<>(),new ArrayList<>(), oi, 0); + super(i, new ArrayList<>(), new ArrayList<>(), oi, 0); this.bits = Lazy.of(() -> { ArrayList foundBits = new ArrayList<>(); @@ -133,7 +133,9 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ToolingRecipe re }; @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } @Override public RecipeParser getParser() { @@ -148,20 +150,20 @@ public RecipeParser getParser() { protected String tagKeyString; @Override - public @NotNull RecipeType getType(){ + public @NotNull RecipeType getType() { return RECIPE_TYPE; } @Override - public @NotNull ItemStack getToastSymbol(){ + public @NotNull ItemStack getToastSymbol() { return new ItemStack(VEBlocks.TOOLING_STATION_BLOCK.get()); } - public ArrayList getBits(){ + public ArrayList getBits() { return this.bits.get(); } - public ArrayList getBasesAndBits(){ + public ArrayList getBasesAndBits() { if (this.basesAndBits == null || this.basesAndBits.isEmpty()) { this.basesAndBits = new ArrayList<>(); this.basesAndBits.addAll(bits.get()); @@ -170,7 +172,7 @@ public ArrayList getBasesAndBits(){ return this.basesAndBits; } - public ArrayList getBases(){ + public ArrayList getBases() { return this.bases.get(); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VEEnergyRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VEEnergyRecipe.java index 861970598..f5528a6de 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEEnergyRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VEEnergyRecipe.java @@ -14,7 +14,7 @@ public VEEnergyRecipe() { } public VEEnergyRecipe(List ingredients, int processTime, int energy_per_tick) { - super(ingredients,new ArrayList<>(),new ArrayList<>(),new ArrayList<>(),processTime); + super(ingredients, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(), processTime); this.energyPerTick = energy_per_tick; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java index 61fbce2a5..8b346ab9d 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java @@ -31,7 +31,7 @@ public VEFluidSawmillRecipe() { } public VEFluidSawmillRecipe(List i, List of, List oi, int processTime, boolean isLogRecipe) { - super(i,List.of(),of,oi,processTime); + super(i, List.of(), of, oi, processTime); this.isLogRecipe = isLogRecipe; } @@ -78,7 +78,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull VEFluidSawmillRe } @Override - public @NotNull ItemStack getToastSymbol(){ + public @NotNull ItemStack getToastSymbol() { return new ItemStack(VEBlocks.SAWMILL_BLOCK.get()); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java index c01cca650..347b66fa8 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java @@ -19,7 +19,7 @@ public VERNGExperienceRecipe() { } public VERNGExperienceRecipe(List ingredients, List results, int processTime, VERecipeCodecs.VERecipeExperience experience) { - super(ingredients,new ArrayList<>(),new ArrayList<>(), results, processTime); + super(ingredients, new ArrayList<>(), new ArrayList<>(), results, processTime); this.experience = experience; this.minExp = experience.minimum(); this.maxExp = experience.maximum(); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java index 6b49e0469..79782e1ec 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java @@ -15,7 +15,7 @@ public VERNGRecipe() { } public VERNGRecipe(List i, List fi, List of, List oi, int processTime) { - super(i,fi,of,oi.stream().map(VERecipeCodecs.VEChancedItemWithCount::getAsItemStack).toList(), processTime); + super(i, fi, of, oi.stream().map(VERecipeCodecs.VEChancedItemWithCount::getAsItemStack).toList(), processTime); this.itemResultsWithChance = oi; this.rngValues = oi.stream().map(VERecipeCodecs.VEChancedItemWithCount::chance).toList(); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java index 0dcfb76e4..cfb0b6c13 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java @@ -30,8 +30,8 @@ public abstract class VERecipe implements Recipe { private List fluidIngredientList = null; public List registryFluidIngredients; public List fluidOutputList; - private static final HashMap,List> recipeCache = new HashMap<>(); - private static final HashMap,List> newCache = new HashMap<>(); + private static final HashMap, List> recipeCache = new HashMap<>(); + private static final HashMap, List> newCache = new HashMap<>(); private NonNullList ingredients = null; @@ -42,7 +42,7 @@ public VERecipe() { } - public VERecipe(List ingredients,List fluidIngredients,List fluidResults, List results, int processTime) { + public VERecipe(List ingredients, List fluidIngredients, List fluidResults, List results, int processTime) { this.results = results; registryFluidIngredients = fluidIngredients; fluidOutputList = fluidResults; @@ -51,8 +51,8 @@ public VERecipe(List ingredients,List() {{ @@ -102,6 +102,7 @@ public ItemStack getResult(int id) { /** * A variable list of results of variable length that can change depending on the recipe requirements * Should only be used in serialization + * * @return the raw results */ public List getResults() { @@ -136,7 +137,7 @@ public int getResultCount(int slot) { } public int getIngredientCount(int slot) { - if (slot >= this.getIngredients().size()){ + if (slot >= this.getIngredients().size()) { return 0; } return this.getIngredients().get(slot).getItems().length > 0 ? this.ingredients.get(slot).getItems()[0].getCount() : 0; @@ -163,9 +164,9 @@ public FluidStack getOutputFluid(int slot) { } public List getFluidIngredients() { - if(fluidIngredientList == null) { + if (fluidIngredientList == null) { List fluidIngredients = new ArrayList<>(); - for(VERecipeCodecs.RegistryFluidIngredient ingredient : registryFluidIngredients) { + for (VERecipeCodecs.RegistryFluidIngredient ingredient : registryFluidIngredients) { fluidIngredients.add(ingredient.getIngredient()); } this.fluidIngredientList = fluidIngredients; @@ -192,9 +193,9 @@ public void setFluidIngredientList(List fluidIngredientList) { @Override public @NotNull NonNullList getIngredients() { - if(ingredients == null) { + if (ingredients == null) { ingredients = NonNullList.create(); - for(VERecipeCodecs.RegistryIngredient ingredient : registryIngredients) { + for (VERecipeCodecs.RegistryIngredient ingredient : registryIngredients) { ingredients.add(ingredient.getIngredient()); } } @@ -207,7 +208,7 @@ public void setIngredients(NonNullList ingredients) { } public static List getCachedRecipes(RecipeType recipeType) { - if(!recipeCache.containsKey(recipeType)) return new ArrayList<>(); + if (!recipeCache.containsKey(recipeType)) return new ArrayList<>(); return recipeCache.get(recipeType); } @@ -219,8 +220,8 @@ public static void updateCache() { } public static void addRecipeToCacheClient(VERecipe recipe) { - if(newCache.isEmpty()) VoluminousEnergy.LOGGER.info("Building Recipe cache!"); - if(newCache.containsKey(recipe.getType())) { + if (newCache.isEmpty()) VoluminousEnergy.LOGGER.info("Building Recipe cache!"); + if (newCache.containsKey(recipe.getType())) { newCache.get(recipe.getType()).add(recipe); } else { newCache.put(recipe.getType(), new ArrayList<>() {{ @@ -229,18 +230,18 @@ public static void addRecipeToCacheClient(VERecipe recipe) { } } - public static List getPotentialRecipes(VETileEntity tile) { + public static List getPotentialRecipes(VETileEntity tile) { List recipes = new ArrayList<>(); - for(VERecipe recipe : getCachedRecipes(tile.getRecipeType())) { - if(recipe.getParser().isPartialRecipe(tile)) recipes.add(recipe); + for (VERecipe recipe : getCachedRecipes(tile.getRecipeType())) { + if (recipe.getParser().isPartialRecipe(tile)) recipes.add(recipe); } return recipes; } @Nullable - public static VERecipe getCompleteRecipe(VETileEntity tile) { - for(VERecipe recipe : getCachedRecipes(tile.getRecipeType())) { - if(recipe.getParser().isCompleteRecipe(tile)) return recipe; + public static VERecipe getCompleteRecipe(VETileEntity tile) { + for (VERecipe recipe : getCachedRecipes(tile.getRecipeType())) { + if (recipe.getParser().isCompleteRecipe(tile)) return recipe; } return null; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipeType.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipeType.java index 6d142dfb9..f2cf8cc6c 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipeType.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipeType.java @@ -7,12 +7,12 @@ public class VERecipeType> implements RecipeType { private ResourceLocation name; - public VERecipeType(ResourceLocation name){ + public VERecipeType(ResourceLocation name) { this.name = name; } @Override - public String toString(){ + public String toString() { return name.toString(); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java index 7924527f2..d95f9a183 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java @@ -12,10 +12,10 @@ public class VERecipes { public static final DeferredRegister> VE_RECIPE_SERIALIZERS_REGISTRY = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, VoluminousEnergy.MODID); - public static final class VERecipeTypes{ + public static final class VERecipeTypes { public static final DeferredRegister> VE_RECIPE_TYPES_REGISTRY = DeferredRegister.create(ForgeRegistries.RECIPE_TYPES, VoluminousEnergy.MODID); - public static final RegistryObject> PRIMITIVE_BLAST_FURNACING = + public static final RegistryObject> PRIMITIVE_BLAST_FURNACING = VE_RECIPE_TYPES_REGISTRY.register("primitive_blast_furnacing", () -> new VERecipeType<>(RecipeConstants.PRIMITIVE_BLAST_FURNACING)); public static final RegistryObject> CRUSHING = diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/DimensionalLaserParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/DimensionalLaserParser.java deleted file mode 100644 index 12d9d2184..000000000 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/DimensionalLaserParser.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.veteam.voluminousenergy.recipe.parser; - -import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.items.tools.RFIDChip; -import com.veteam.voluminousenergy.persistence.ChunkFluid; -import com.veteam.voluminousenergy.persistence.ChunkFluids; -import com.veteam.voluminousenergy.persistence.SingleChunkFluid; -import com.veteam.voluminousenergy.recipe.VERecipe; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.ChunkPos; -import net.minecraftforge.fluids.FluidStack; - -import static com.veteam.voluminousenergy.blocks.tiles.VETileEntity.DEFAULT_TANK_CAPACITY; - -public class DimensionalLaserParser extends RecipeParser { - - public DimensionalLaserParser(VERecipe recipe) { - super(recipe); - } - - @Override - public boolean isPartialRecipe(VETileEntity tile) { - return tile.getStackInSlot(0).getItem() instanceof RFIDChip; - } - - @Override - public boolean isCompleteRecipe(VETileEntity tile) { - return tile.getStackInSlot(0).getItem() instanceof RFIDChip; - } - - @Override - public boolean canCompleteRecipe(VETileEntity tile) { - - ItemStack stack = tile.getStackInSlot(0); - - if (!(stack.getItem() instanceof RFIDChip)) return false; - CompoundTag tag = stack.getOrCreateTag(); - - if (!tag.contains("ve_x")) return false; - - int x = tag.getInt("ve_x"); - int z = tag.getInt("ve_z"); - - ChunkFluid fluid = ChunkFluids.getInstance().getChunkFluid(new ChunkPos(x,z)); - - if(fluid == null) { - VoluminousEnergy.LOGGER.warn("Unable to find chunk fluid for what appears to be a scanned chunk: " + x + " | " + z); - return false; - } - - // If we ever need to validate a selected fluid we do so here. - SingleChunkFluid singleChunkFluid = fluid.getFluids().get(0); - FluidStack currentFluid = tile.getFluidStackFromTank(0); - int amount = Math.min(singleChunkFluid.getAmount(),DEFAULT_TANK_CAPACITY - currentFluid.getAmount()); - - return tile.getTank(0).testFillTank(new FluidStack(singleChunkFluid.getFluid(),amount)) > 0; - } - - @Override - public void completeRecipe(VETileEntity tile) { - - ItemStack stack = tile.getStackInSlot(0); - CompoundTag tag = stack.getOrCreateTag(); - int x = tag.getInt("ve_x"); - int z = tag.getInt("ve_z"); - - ChunkFluid fluid = ChunkFluids.getInstance().getChunkFluid(new ChunkPos(x,z)); - SingleChunkFluid singleChunkFluid = fluid.getFluids().get(0); - FluidStack currentFluid = tile.getFluidStackFromTank(0); - int insertAmount = Math.min(singleChunkFluid.getAmount(),DEFAULT_TANK_CAPACITY - currentFluid.getAmount()); - tile.getTank(0).fillTank(new FluidStack(singleChunkFluid.getFluid(),insertAmount)); - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java index f80a5b2e7..61b04f49e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.recipe.parser; -import com.veteam.voluminousenergy.blocks.tiles.VEItemStackHandler; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import net.minecraft.world.item.ItemStack; @@ -29,9 +29,9 @@ public void completeRecipe(VETileEntity tile) { VERNGRecipe rngRecipe = (VERNGRecipe) recipe; float randomness = rngRecipe.getOutputChance(pos.recipePos()); - if(randomness != 1) { + if (randomness != 1) { float random = abs(0 + randomInstance.nextFloat() * (-1)); - if(random > randomness) continue; + if (random > randomness) continue; ItemStack result = rngRecipe.getResult(pos.recipePos()); handler.insertItem(pos.tilePos(), result.copy(), false); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java index 0eb515276..31b06b24d 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java @@ -21,7 +21,7 @@ public boolean isCompleteRecipe(VETileEntity tile) { @Override public void completeRecipe(VETileEntity tile) { super.completeRecipe(tile); - tile.getInventory().extractItem(1,1,false); + tile.getInventory().extractItem(1, 1, false); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java index 5e7fe8983..b5fa3c3e1 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java @@ -1,8 +1,7 @@ package com.veteam.voluminousenergy.recipe.parser; -import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.tiles.VEItemStackHandler; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import net.minecraft.world.item.ItemStack; @@ -17,10 +16,11 @@ public class RNGRecipeParser extends RecipeParser { public RNGRecipeParser(VERecipe recipe) { super(recipe); } + List randomItemResultPositions = new ArrayList<>(); public RNGRecipeParser addChancedItemResult(int tilePos, int recipePos) { - this.randomItemResultPositions.add(new SlotAndRecipePos(tilePos,recipePos)); + this.randomItemResultPositions.add(new SlotAndRecipePos(tilePos, recipePos)); return this; } @@ -29,7 +29,7 @@ public boolean canCompleteRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : randomItemResultPositions) { ItemStack stack = tile.getStackInSlot(pos.tilePos()); ItemStack result = recipe.getResult(pos.recipePos()); - if(stack.isEmpty()) continue; + if (stack.isEmpty()) continue; if (!stack.is(result.getItem()) || result.getCount() + stack.getCount() > result.getMaxStackSize()) return false; } @@ -50,9 +50,9 @@ public void completeRecipe(VETileEntity tile) { float randomness = rngRecipe.getOutputChance(pos.recipePos()); ItemStack result = rngRecipe.getResult(pos.recipePos()); if (result == ItemStack.EMPTY) continue; - if(randomness != 1) { + if (randomness != 1) { float random = abs(0 + randomInstance.nextFloat() * (-1)); - if(random > randomness) continue; + if (random > randomness) continue; handler.insertItem(pos.tilePos(), result.copy(), false); } else { handler.insertItem(pos.tilePos(), result.copy(), false); @@ -64,7 +64,7 @@ public void completeRecipe(VETileEntity tile) { @Override public boolean canInsertItem(int slot, ItemStack stack) { - for(SlotAndRecipePos pos : randomItemResultPositions) { + for (SlotAndRecipePos pos : randomItemResultPositions) { if (pos.tilePos() == slot) { ItemStack itemStack = recipe.getResult(pos.recipePos()); return itemStack.is(stack.getItem()); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java index 174b6ec8e..add8e9f19 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.recipe.parser; -import com.veteam.voluminousenergy.blocks.tiles.VEItemStackHandler; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.util.recipe.FluidIngredient; import net.minecraft.world.item.ItemStack; @@ -12,6 +12,10 @@ import java.util.ArrayList; import java.util.List; + +/** + * A recipe parser system for taking a recipe and translating it into something more consumable + */ public class RecipeParser { List ingredientPositions = new ArrayList<>(); @@ -25,26 +29,31 @@ public RecipeParser(VERecipe recipe) { this.recipe = recipe; } - public RecipeParser addIngredient(int tilePos,int recipePos) { - this.ingredientPositions.add(new SlotAndRecipePos(tilePos,recipePos)); + public RecipeParser addIngredient(int tilePos, int recipePos) { + this.ingredientPositions.add(new SlotAndRecipePos(tilePos, recipePos)); return this; } - public RecipeParser addFluidIngredient(int tilePos,int recipePos) { - this.fluidIngredientPositions.add(new SlotAndRecipePos(tilePos,recipePos)); + public RecipeParser addFluidIngredient(int tilePos, int recipePos) { + this.fluidIngredientPositions.add(new SlotAndRecipePos(tilePos, recipePos)); return this; } - public RecipeParser addItemResult(int tilePos,int recipePos) { - this.itemResultPositions.add(new SlotAndRecipePos(tilePos,recipePos)); + public RecipeParser addItemResult(int tilePos, int recipePos) { + this.itemResultPositions.add(new SlotAndRecipePos(tilePos, recipePos)); return this; } - public RecipeParser addFluidResult(int tilePos,int recipePos) { - this.fluidResultPositions.add(new SlotAndRecipePos(tilePos,recipePos)); + public RecipeParser addFluidResult(int tilePos, int recipePos) { + this.fluidResultPositions.add(new SlotAndRecipePos(tilePos, recipePos)); return this; } + /** + * @param tile The tile entity that is being checked + * @return returns true if the recipe partially matches. + * This means that AIR and EMPTY for items and fluids respectively are ignored + */ public boolean isPartialRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : ingredientPositions) { ItemStack stackInSlot = tile.getStackInSlot(pos.tilePos); @@ -64,12 +73,17 @@ public boolean isPartialRecipe(VETileEntity tile) { return true; } + /** + * @param tile The tile to check + * @return returns true if the recipe is completed. You must validate your + * input amounts here or else risk over-insertion. + */ public boolean isCompleteRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : ingredientPositions) { ItemStack stackInSlot = tile.getStackInSlot(pos.tilePos); Ingredient ingredient = recipe.getIngredient(pos.recipePos); int amountNeeded = recipe.getIngredientCount(pos.recipePos); - if(ingredient.isEmpty()) continue; + if (ingredient.isEmpty()) continue; if (!ingredient.test(stackInSlot) || stackInSlot.getCount() < amountNeeded) return false; } @@ -77,7 +91,7 @@ public boolean isCompleteRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : fluidIngredientPositions) { FluidStack stack = tile.getFluidStackFromTank(pos.tilePos); FluidIngredient fluidIngredient = recipe.getFluidIngredient(pos.recipePos); - if(fluidIngredient.isEmpty()) continue; + if (fluidIngredient.isEmpty()) continue; int amountNeeded = fluidIngredient.getAmountNeeded(); if (!fluidIngredient.test(stack) || stack.getAmount() < amountNeeded) return false; @@ -85,25 +99,40 @@ public boolean isCompleteRecipe(VETileEntity tile) { return true; } + /** + * @param tile The tile to check + * @return returns true if the tile has enough space in the output + * to insert the finished product. Note that making this fail + * for any other reason can cause a 99% deadlock. If your tile + * is deadlocking at recipe completion this is probably why. + */ public boolean canCompleteRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : itemResultPositions) { ItemStack stack = tile.getStackInSlot(pos.tilePos); ItemStack result = recipe.getResult(pos.recipePos); - if(stack.isEmpty()) continue; + if (stack.isEmpty()) continue; if (!stack.is(result.getItem()) || result.getCount() + stack.getCount() > result.getMaxStackSize()) return false; } for (SlotAndRecipePos pos : fluidResultPositions) { FluidStack stack = tile.getFluidStackFromTank(pos.tilePos); FluidStack result = recipe.getOutputFluid(pos.recipePos); - if(stack.isEmpty()) continue; + if (stack.isEmpty()) continue; if (!stack.isFluidEqual(result) || result.getAmount() + stack.getAmount() > tile.getTankCapacity(pos.tilePos)) return false; } return true; } + /** + * This code will be called when your recipe has been validated using + * {@link #canCompleteRecipe(VETileEntity)}. Thus insuring that amounts, inputs, outputs, are all valid + * and ready to be added to / subtracted from. When called it should handle + * all the processing required. + * + * @param tile The tile to complete the recipe for + */ public void completeRecipe(VETileEntity tile) { VEItemStackHandler handler = tile.getInventory(); @@ -133,6 +162,15 @@ public void completeRecipe(VETileEntity tile) { tile.markFluidInputDirty(); } + /** + * This a copy of the ItemHandlers isItemValid. This will be called to + * validate item IO for the {@link VEItemStackHandler}. You should also + * check NBT data like in {@link com.veteam.voluminousenergy.recipe.processor.DimensionalLaserRecipeProcessor} + * + * @param slot the slot position in the tile inventory + * @param stack The stack to be inserted + * @return If the item is valid given the Parsers context + */ public boolean canInsertItem(int slot, ItemStack stack) { for (SlotAndRecipePos pos : ingredientPositions) { if (pos.tilePos == slot) { @@ -140,7 +178,7 @@ public boolean canInsertItem(int slot, ItemStack stack) { return recipeIngredient.test(stack); } } - for(SlotAndRecipePos pos : itemResultPositions) { + for (SlotAndRecipePos pos : itemResultPositions) { if (pos.tilePos == slot) { ItemStack itemStack = recipe.getResult(pos.recipePos); return itemStack.is(stack.getItem()); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java index 8a0ea1454..111af0428 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java @@ -4,8 +4,26 @@ public interface AbstractRecipeProcessor { + /** + * Handles the main processing for this tile. + * For tiles without recipes you can just use this without + * using validateRecipe as this will *always* be called + * regardless of the recipe validation state. You + * must check that {@link VETileEntity#getSelectedRecipe()} + * is not null in order to continue processing (or some other self-set + * method of validating state). + * + * @param tile The tile to process the recipe for + */ void processRecipe(VETileEntity tile); + /** + * Only called when the recipe has been marked as "dirty" + * use processRecipe for extra checks if this tile requires + * external checks that won't mark the tile as "dirty" + * + * @param tile The tile to validate the recipe for + */ void validateRecipe(VETileEntity tile); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java index 555be2ea4..e76b38094 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java @@ -45,7 +45,7 @@ public void processRecipe(VETileEntity tile) { airMultiplier++; if (Blocks.AIR == level.getBlockState(new BlockPos(x, y, z - 1)).getBlock()) airMultiplier++; - if (addAirToTank(airMultiplier,tile.getTank(0))) { + if (addAirToTank(airMultiplier, tile.getTank(0))) { tile.consumeEnergy(); if (++soundTick == 19) { soundTick = 0; @@ -53,19 +53,20 @@ public void processRecipe(VETileEntity tile) { level.playSound(null, tile.getBlockPos(), VESounds.AIR_COMPRESSOR, SoundSource.BLOCKS, 1.0F, 1.0F); } } - tile.setData("sound_tick",soundTick); + tile.setData("sound_tick", soundTick); counter = (byte) tile.calculateCounter(20, tile.getInventory().getStackInSlot(tile.getEnergy().getUpgradeSlotId())); tile.setChanged(); } } else { --counter; } - tile.setData("counter",--counter); + tile.setData("counter", --counter); } // We don't need to validate the recipe because it doesn't have one. @Override - public void validateRecipe(VETileEntity tile) {} + public void validateRecipe(VETileEntity tile) { + } public boolean addAirToTank(int multiplier, VERelationalTank tank) { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java index ae210ee53..85cda0d15 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java @@ -18,8 +18,8 @@ public void validateRecipe(VETileEntity tile) { if (tile.getPotentialRecipes().size() == 1) { VERecipe newRecipe = VERecipe.getCompleteRecipe(tile); if (newRecipe == null) { - tile.setData("counter",0); - tile.setData("length",0); + tile.setData("counter", 0); + tile.setData("length", 0); tile.setSelectedRecipe(null); return; } @@ -34,16 +34,16 @@ public void validateRecipe(VETileEntity tile) { } double ratio = (double) tile.getData("length") / (double) newLength; - tile.setData("length",newLength); + tile.setData("length", newLength); tile.setData("counter", (int) (tile.getData("counter") / ratio)); if (tile.getSelectedRecipe() != newRecipe) { tile.setSelectedRecipe(newRecipe); - tile.setData("counter",newLength); + tile.setData("counter", newLength); } } else { - tile.setData("counter",0); - tile.setData("length",0); + tile.setData("counter", 0); + tile.setData("length", 0); tile.setSelectedRecipe(null); } } @@ -59,7 +59,7 @@ public void processRecipe(VETileEntity tile) { if (counter == 1) { RecipeParser parser = recipe.getParser(); - if(!parser.canCompleteRecipe(tile)) return; + if (!parser.canCompleteRecipe(tile)) return; parser.completeRecipe(tile); tile.markRecipeDirty(); tile.markFluidInputDirty(); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java new file mode 100644 index 000000000..cc5aa23c3 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java @@ -0,0 +1,151 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.persistence.ChunkFluid; +import com.veteam.voluminousenergy.persistence.ChunkFluids; +import com.veteam.voluminousenergy.persistence.SingleChunkFluid; +import com.veteam.voluminousenergy.sounds.VESounds; +import com.veteam.voluminousenergy.tools.Config; +import net.minecraft.core.BlockPos; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.entity.EntityType; +import net.minecraft.world.entity.LightningBolt; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.ChunkPos; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.registries.RegistryObject; + +import java.util.Random; + +import static com.veteam.voluminousenergy.blocks.tiles.VETileEntity.DEFAULT_TANK_CAPACITY; + +public class DimensionalLaserRecipeProcessor extends MultiBlockRecipeProcessor { + + + public DimensionalLaserRecipeProcessor(RegistryObject block) { + super(block); + } + + @Override + public void processRecipe(VETileEntity tile) { + if (!isMultiBlockValid(tile)) return; + + int buildTick = tile.getData("build_tick"); + if (buildTick != 1000) { + + if (buildTick == 1) { + tile.getLevel().playSound(null, tile.getBlockPos(), VESounds.ENERGY_BEAM_ACTIVATE, SoundSource.BLOCKS, 1.0F, 1.0F); + } + + if (buildTick == 400) { + tile.getLevel().playSound(null, tile.getBlockPos(), VESounds.ENERGY_BEAM_FIRED, SoundSource.BLOCKS, 1.0F, 1.0F); + } + + if (buildTick >= 400) { + if ((buildTick - 400) % 12 == 0 && (new Random()).nextInt(2) == 1) { + BlockPos blockPos = tile + .getLevel().getBlockRandomPos( + tile.getBlockPos().getX(), 0, tile.getBlockPos().getZ(), 5); + + blockPos = blockPos.atY(tile.getBlockPos().getY()); + + LightningBolt lightningBolt = new LightningBolt(EntityType.LIGHTNING_BOLT, tile.getLevel()); + lightningBolt.setVisualOnly(true); + lightningBolt.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ()); + tile.getLevel().addFreshEntity(lightningBolt); + + } + } +// if (!tile.canConsumeEnergy()) { +// buildTick = 0; +// } else { +// tile.consumeEnergy(); +// } + tile.setData("build_tick", buildTick + 1); + return; + } + if (!tile.canConsumeEnergy()) return; + ItemStack stack = tile.getStackInSlot(2); + if (stack.isEmpty()) { + int counterTemp = tile.calculateCounter(Config.DIMENSIONAL_LASER_PROCESS_TIME.get(), + tile.getStackInSlot(tile.getEnergy().getUpgradeSlotId()).copy()); + int counter = counterTemp != 0 ? counterTemp : 1; + tile.setData("length", counter); + tile.setData("counter", counter); + return; + } + + CompoundTag tag = stack.getOrCreateTag(); + + int x = tag.getInt("ve_x"); + int z = tag.getInt("ve_z"); + + ChunkFluid fluid = ChunkFluids.getInstance().getChunkFluid(new ChunkPos(x, z)); + + if (fluid == null) { + VoluminousEnergy.LOGGER.error("Unable to find chunk fluid for what appears to be a scanned chunk: " + x + " | " + z); + return; + } + + // If we ever need to validate a selected fluid we do so here. + SingleChunkFluid singleChunkFluid = fluid.getFluids().get(0); + FluidStack currentFluid = tile.getFluidStackFromTank(0); + int amount = Math.min(singleChunkFluid.getAmount(), DEFAULT_TANK_CAPACITY - currentFluid.getAmount()); + + boolean canFill = tile.getTank(0).testFillTank(new FluidStack(singleChunkFluid.getFluid(), amount)) > 0; + if (!canFill) return; + + int counter = tile.getData("counter"); + + if (counter == 1) { + FluidStack fluidStack = new FluidStack(singleChunkFluid.getFluid(), amount); + tile.getTank(0).fillTank(fluidStack); + counter--; + tile.consumeEnergy(); + tile.setChanged(); + } else if (counter > 0) { + counter--; + tile.consumeEnergy(); + } else { + int counterTemp = tile.calculateCounter(Config.DIMENSIONAL_LASER_PROCESS_TIME.get(), + tile.getStackInSlot(tile.getEnergy().getUpgradeSlotId()).copy()); + counter = counterTemp != 0 ? counterTemp : 1; + tile.setData("length", counter); + } + tile.setData("counter", counter); + + } + + private int counter = 0; + private boolean lastReading = false; + + @Override + public boolean isMultiBlockValid(VETileEntity tile) { + if (counter != 0) { + counter--; + return lastReading; + } + counter = 20; + lastReading = true; + // Tweak box based on direction -- This is the search range to ensure this is a valid multiblock before operation + for (final BlockPos blockPos : BlockPos.betweenClosed( + tile.getBlockPos().offset(-1, -3, -1), + tile.getBlockPos().offset(1, -1, 1))) { + + final BlockState blockState = tile.getLevel().getBlockState(blockPos); + + if (blockState.getBlock() != getBlock()) { // Fails MultiBlock condition + lastReading = false; + } + } + return lastReading; + } + + @Override + public void validateRecipe(VETileEntity tile) { + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java index 084a951d9..c94343a0e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java @@ -1,6 +1,5 @@ package com.veteam.voluminousenergy.recipe.processor; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.recipe.VEEnergyRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; @@ -24,7 +23,6 @@ public GeneratorProcessor(boolean allowOverflow, int divisor) { } - public GeneratorProcessor() { } @@ -69,9 +67,9 @@ public void processRecipe(VETileEntity tile) { } else if (counter == 0) { if (tile.getSelectedRecipe() instanceof VEEnergyRecipe veEnergyRecipe) { RecipeParser parser = veEnergyRecipe.getParser(); - if(!parser.canCompleteRecipe(tile)) return; + if (!parser.canCompleteRecipe(tile)) return; // Check to see if the energy produced will overflow the tile - if(tile.getEnergy().isFullyCharged()) return; + if (tile.getEnergy().isFullyCharged()) return; // Since we're a generator we want to subtract the amounts at the start rather than at the end veEnergyRecipe.getParser().completeRecipe(tile); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java index 4e3889e22..44c195c2f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java @@ -9,13 +9,33 @@ public class MultiBlockRecipeProcessor extends DefaultProcessor { - private RegistryObject block; + private RegistryObject blockRegistry; + private Block block; public MultiBlockRecipeProcessor(RegistryObject block) { - this.block = block; + this.blockRegistry = block; } + @Override + public void validateRecipe(VETileEntity tile) { + super.validateRecipe(tile); + } + + @Override + public void processRecipe(VETileEntity tile) { + if (!isMultiBlockValid(tile)) return; + super.processRecipe(tile); + } + + private int counter = 0; + private boolean lastReading = false; + public boolean isMultiBlockValid(VETileEntity tile) { + if (counter != 0) { + counter--; + return lastReading; + } + counter = 20; int rawDirection = tile.getBlockState().getValue(BlockStateProperties.FACING).get2DDataValue(); int sXMultiplier = 1; @@ -30,15 +50,23 @@ public boolean isMultiBlockValid(VETileEntity tile) { int lX = sX + (lxMultiplier * 2); int lZ = sZ + (lzMultiplier * 2); + lastReading = true; // Tweak box based on direction -- This is the search range to ensure this is a valid multiblock before operation for (final BlockPos blockPos : BlockPos.betweenClosed(tile.getBlockPos().offset(sX, 0, sZ), tile.getBlockPos().offset(lX, 2, lZ))) { final BlockState blockState = tile.getLevel().getBlockState(blockPos); - if (blockState.getBlock() != block.get()) { // Fails MultiBlock condition - return false; + if (blockState.getBlock() != getBlock()) { // Fails MultiBlock condition + lastReading = false; } } - return true; + return lastReading; + } + + Block getBlock() { + if (block == null) { + block = blockRegistry.get(); + } + return block; } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/serializer/FluidSerializerHelper.java b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/FluidSerializerHelper.java index 6e639f814..21432386c 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/serializer/FluidSerializerHelper.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/FluidSerializerHelper.java @@ -88,7 +88,7 @@ public void toNetwork(FriendlyByteBuf buffer, T recipe) { if (recipe instanceof VERNGRecipe irngRecipe) { buffer.writeInt(irngRecipe.getRNGOutputs().size()); - for(float f : irngRecipe.getRNGOutputs()) { + for (float f : irngRecipe.getRNGOutputs()) { buffer.writeFloat(f); } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java index 0bddb52f5..dc602b20e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java @@ -44,10 +44,10 @@ public T fromNetwork(T recipe, FriendlyByteBuf buffer) { irngRecipe.setRNGOutputs(values); } - if(recipe instanceof VERNGExperienceRecipe iExperienceRecipe) { + if (recipe instanceof VERNGExperienceRecipe iExperienceRecipe) { int min = buffer.readInt(); int max = buffer.readInt(); - iExperienceRecipe.setExperience(min,max); + iExperienceRecipe.setExperience(min, max); } VERecipe.addRecipeToCacheClient(recipe); return recipe; @@ -68,12 +68,12 @@ public void toNetwork(FriendlyByteBuf buffer, T recipe) { if (recipe instanceof VERNGRecipe irngRecipe) { buffer.writeInt(irngRecipe.getRNGOutputs().size()); - for(float f : irngRecipe.getRNGOutputs()) { + for (float f : irngRecipe.getRNGOutputs()) { buffer.writeFloat(f); } } - if(recipe instanceof VERNGExperienceRecipe iExperienceRecipe) { + if (recipe instanceof VERNGExperienceRecipe iExperienceRecipe) { buffer.writeInt(iExperienceRecipe.getMinExp()); buffer.writeInt(iExperienceRecipe.getMaxExp()); } diff --git a/src/main/java/com/veteam/voluminousenergy/setup/ClientProxy.java b/src/main/java/com/veteam/voluminousenergy/setup/ClientProxy.java index fc42bf5ea..285300279 100644 --- a/src/main/java/com/veteam/voluminousenergy/setup/ClientProxy.java +++ b/src/main/java/com/veteam/voluminousenergy/setup/ClientProxy.java @@ -47,11 +47,12 @@ public void init() { } @Override - public Level getClientWorld() - { + public Level getClientWorld() { return Minecraft.getInstance().level; } @Override - public Player getClientPlayer() { return Minecraft.getInstance().player; } + public Player getClientPlayer() { + return Minecraft.getInstance().player; + } } diff --git a/src/main/java/com/veteam/voluminousenergy/setup/ServerProxy.java b/src/main/java/com/veteam/voluminousenergy/setup/ServerProxy.java index 8f5e23c36..1e3171436 100644 --- a/src/main/java/com/veteam/voluminousenergy/setup/ServerProxy.java +++ b/src/main/java/com/veteam/voluminousenergy/setup/ServerProxy.java @@ -15,5 +15,7 @@ public Level getClientWorld() { } @Override - public Player getClientPlayer() { throw new IllegalStateException("Only run this on the client!"); } + public Player getClientPlayer() { + throw new IllegalStateException("Only run this on the client!"); + } } diff --git a/src/main/java/com/veteam/voluminousenergy/setup/VESetup.java b/src/main/java/com/veteam/voluminousenergy/setup/VESetup.java index 4a4a2230e..1af0926a9 100644 --- a/src/main/java/com/veteam/voluminousenergy/setup/VESetup.java +++ b/src/main/java/com/veteam/voluminousenergy/setup/VESetup.java @@ -82,6 +82,7 @@ private static List assembleItemsFromDeferredRegistry(DeferredRegiste return stackStore; } - public void init(){} + public void init() { + } } diff --git a/src/main/java/com/veteam/voluminousenergy/sounds/VESounds.java b/src/main/java/com/veteam/voluminousenergy/sounds/VESounds.java index a6c410053..1736b4471 100644 --- a/src/main/java/com/veteam/voluminousenergy/sounds/VESounds.java +++ b/src/main/java/com/veteam/voluminousenergy/sounds/VESounds.java @@ -5,7 +5,7 @@ public class VESounds { - public static SoundEvent ENERGY_BEAM_ACTIVATE = SoundEvent.createVariableRangeEvent(new ResourceLocation("voluminousenergy:energy_beam_activate")); + public static SoundEvent ENERGY_BEAM_ACTIVATE = SoundEvent.createVariableRangeEvent(new ResourceLocation("voluminousenergy:energy_beam_activate")); public static SoundEvent ENERGY_BEAM_FIRED = SoundEvent.createVariableRangeEvent(new ResourceLocation("voluminousenergy:energy_beam_fired")); public static SoundEvent AIR_COMPRESSOR = SoundEvent.createVariableRangeEvent(new ResourceLocation("voluminousenergy:air_compressor_active")); public static SoundEvent AQUEOULIZER = SoundEvent.createVariableRangeEvent(new ResourceLocation("voluminousenergy:aqueoulizer_active")); diff --git a/src/main/java/com/veteam/voluminousenergy/tools/VERender.java b/src/main/java/com/veteam/voluminousenergy/tools/VERender.java index c0bf7ed7d..a952359ec 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/VERender.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/VERender.java @@ -36,17 +36,17 @@ public static void renderGuiTank(Level level, BlockPos tilePos, IFluidHandler fl public static void renderGuiTank(Level level, BlockPos tilePos, FluidStack stack, int tankCapacity, double x, double y, double zLevel, double width, double height) { // Originally Adapted from Ender IO by Silent's Mechanisms int amount; - try{ + try { if (stack.getFluid() == null || stack.isEmpty()) { return; } - } catch (Exception e){ + } catch (Exception e) { return; } - try{ + try { amount = stack.getAmount(); - } catch (Exception e){ + } catch (Exception e) { LOGGER.warn("Exception e captured: " + e); amount = 0; @@ -62,7 +62,7 @@ public static void renderGuiTank(Level level, BlockPos tilePos, FluidStack stack RenderSystem.setShaderTexture(0, InventoryMenu.BLOCK_ATLAS); int color; - if ((!Config.USE_BIOME_WATER_COLOUR.get()) || (stack.getFluid() != Fluids.WATER && stack.getFluid() != Fluids.FLOWING_WATER)){ + if ((!Config.USE_BIOME_WATER_COLOUR.get()) || (stack.getFluid() != Fluids.WATER && stack.getFluid() != Fluids.FLOWING_WATER)) { color = IClientFluidTypeExtensions.of(stack.getFluid()).getTintColor(); float r = ((color >> 16) & 0xFF) / 255f; float g = ((color >> 8) & 0xFF) / 255f; @@ -104,7 +104,7 @@ public static void renderGuiTank(Level level, BlockPos tilePos, FluidStack stack } } RenderSystem.disableBlend(); - RenderSystem.setShaderColor(1f, 1f, 1f, 1f); + RenderSystem.setShaderColor(1f, 1f, 1f, 1f); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/VEIOButton.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/VEIOButton.java index ffe74891e..66275e94b 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/VEIOButton.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/VEIOButton.java @@ -11,7 +11,7 @@ public VEIOButton(int x, int y, int width, int height, Component title, OnPress super(x, y, width, height, title, pressedAction, DEFAULT_NARRATION); } - public void toggleRender(boolean bool){ + public void toggleRender(boolean bool) { render = bool; } } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/VEPowerIOManager.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/VEPowerIOManager.java index 086f199d1..34162e8d2 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/VEPowerIOManager.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/VEPowerIOManager.java @@ -18,11 +18,11 @@ public void setFlipped(boolean flipped) { this.flipped = flipped; } - public void write(CompoundTag nbt, String prefix){ + public void write(CompoundTag nbt, String prefix) { nbt.putBoolean(prefix + "_enabled", isFlipped()); } - public void read(CompoundTag nbt, String prefix){ + public void read(CompoundTag nbt, String prefix) { setFlipped(nbt.getBoolean(prefix + "_enabled")); } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/BatteryBoxSendOutPowerButton.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/BatteryBoxSendOutPowerButton.java index cb84630fb..b21b10581 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/BatteryBoxSendOutPowerButton.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/BatteryBoxSendOutPowerButton.java @@ -18,8 +18,8 @@ public class BatteryBoxSendOutPowerButton extends VEIOButton { private final BatteryBoxTile batteryBoxTile; private boolean sendOutPower; - private int u= 0; - private int v= 166; + private int u = 0; + private int v = 166; private final VEPowerIOManager powerIOManager; public BatteryBoxSendOutPowerButton(VEPowerIOManager powerIOManager, int x, int y, BatteryBoxTile batteryBoxTile, OnPress onPress) { @@ -36,31 +36,31 @@ public BatteryBoxSendOutPowerButton(VEPowerIOManager powerIOManager, int x, int } @Override - public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3){ + public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3) { RenderSystem.setShaderTexture(0, GUI_TOOLS); - if(!isHovered) u = 96; + if (!isHovered) u = 96; else u = 112; - if(!sendOutPower) v = 178; + if (!sendOutPower) v = 178; else v = 166; matrixStack.blit(GUI_TOOLS, getX(), getY(), this.u, this.v, this.width, this.height); } - private void cycle(){ + private void cycle() { sendOutPower = !sendOutPower; powerIOManager.setFlipped(true); this.batteryBoxTile.updateSendOutPower(sendOutPower); } @Override - public void onPress(){ + public void onPress() { cycle(); VENetwork.channel.send(new BatteryBoxSendOutPowerPacket(this.sendOutPower), PacketDistributor.SERVER.noArg()); } - public void setStatus(boolean status){ + public void setStatus(boolean status) { sendOutPower = status; powerIOManager.setFlipped(sendOutPower); } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/BatteryBoxSlotPairButton.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/BatteryBoxSlotPairButton.java index b3044c054..fa7a7e931 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/BatteryBoxSlotPairButton.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/BatteryBoxSlotPairButton.java @@ -16,9 +16,9 @@ public class BatteryBoxSlotPairButton extends VEIOButton { private int id; private boolean isTopIngress; - private int u= 0; - private int v= 166; - private final VEBatterySwitchManager veBatterySwitchManager; + private int u = 0; + private int v = 166; + private final VEBatterySwitchManager veBatterySwitchManager; public BatteryBoxSlotPairButton(VEBatterySwitchManager veBatterySwitchManager, int x, int y, int id, OnPress onPress) { super(x, y, 18, 20, Component.nullToEmpty(""), button -> { @@ -35,32 +35,34 @@ public BatteryBoxSlotPairButton(VEBatterySwitchManager veBatterySwitchManager, i } @Override - public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3){ + public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3) { RenderSystem.setShaderTexture(0, GUI_TOOLS); - if(!isHovered) v = 166; + if (!isHovered) v = 166; else v = 186; - if(isTopIngress) u = 0; + if (isTopIngress) u = 0; else u = 18; matrixStack.blit(GUI_TOOLS, getX(), getY(), this.u, this.v, this.width, this.height); } - private void cycle(){isTopIngress = !isTopIngress;} + private void cycle() { + isTopIngress = !isTopIngress; + } @Override - public void onPress(){ + public void onPress() { cycle(); veBatterySwitchManager.setFlipped(isTopIngress); VENetwork.channel.send(new BatteryBoxSlotPairPacket(isTopIngress, this.id), PacketDistributor.SERVER.noArg()); } - public int getId(){ + public int getId() { return id; } - public void setStatus(boolean status){ + public void setStatus(boolean status) { isTopIngress = status; this.veBatterySwitchManager.setFlipped(status); } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/VEBatterySwitchManager.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/VEBatterySwitchManager.java index 05e149110..d4e596456 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/VEBatterySwitchManager.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/VEBatterySwitchManager.java @@ -24,11 +24,11 @@ public void setFlipped(boolean flipped) { this.flipped = flipped; } - public void write(CompoundTag nbt, String prefix){ + public void write(CompoundTag nbt, String prefix) { nbt.putBoolean(prefix + "_enabled", isFlipped()); } - public void read(CompoundTag nbt, String prefix){ + public void read(CompoundTag nbt, String prefix) { setFlipped(nbt.getBoolean(prefix + "_enabled")); int sideInt = nbt.getInt(prefix + "_direction"); } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/ioMenuButton.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/ioMenuButton.java index fa68f88d2..8a154b47f 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/ioMenuButton.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/ioMenuButton.java @@ -20,7 +20,7 @@ public class ioMenuButton extends Button { private final int x; private final int y; - public ioMenuButton(int x, int y, OnPress onPress){ + public ioMenuButton(int x, int y, OnPress onPress) { super(x, y, 20, 18, Component.nullToEmpty(""), button -> { ((ioMenuButton) button).cycleMode(); onPress.onPress(button); @@ -31,28 +31,28 @@ public ioMenuButton(int x, int y, OnPress onPress){ this.height = 18; } - private void cycleMode(){ + private void cycleMode() { cycled = !cycled; } @Override - public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3){ + public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3) { RenderSystem.setShaderTexture(0, texture); - if(!isHovered){ + if (!isHovered) { matrixStack.blit(texture, this.x, this.y, 193, 0, this.width, this.height); } else { matrixStack.blit(texture, this.x, this.y, 193, 19, this.width, this.height); } - TextUtil.renderShadowedText(matrixStack, getInstance().font, Component.nullToEmpty("IO"), (this.x)+5,(this.y)+5, Style.EMPTY.withColor(0xffffff)); + TextUtil.renderShadowedText(matrixStack, getInstance().font, Component.nullToEmpty("IO"), (this.x) + 5, (this.y) + 5, Style.EMPTY.withColor(0xffffff)); } @Override - public void onPress(){ + public void onPress() { cycleMode(); } - public boolean shouldIOBeOpen(){ + public boolean shouldIOBeOpen() { return cycled; } } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/slots/SlotBoolButton.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/slots/SlotBoolButton.java index 1abde3940..1e44ab60f 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/slots/SlotBoolButton.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/slots/SlotBoolButton.java @@ -33,33 +33,37 @@ public SlotBoolButton(VESlotManager slotManager, int x, int y, OnPress onPress) } @Override - public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3){ - if(!render) return; + public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3) { + if (!render) return; RenderSystem.setShaderTexture(0, texture); enable = slotManager.getStatus(); - if(!enable){ + if (!enable) { matrixStack.blit(texture, getX(), getY(), 213, 0, this.width, this.height); } else { matrixStack.blit(texture, getX(), getY(), 213, 15, this.width, this.height); } } - private void cycle(){ enable = !enable; } + private void cycle() { + enable = !enable; + } @Override - public void onPress(){ - if(!render) return; + public void onPress() { + if (!render) return; cycle(); VENetwork.channel.send(new BoolButtonPacket(this.status(), this.getAssociatedSlotId()), PacketDistributor.SERVER.noArg()); } - public boolean status(){ return enable; } + public boolean status() { + return enable; + } - public int getAssociatedSlotId(){ + public int getAssociatedSlotId() { return this.slotManager.getSlotNum(); } - public void setStatus(boolean status){ + public void setStatus(boolean status) { enable = status; slotManager.setStatus(status); } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/slots/SlotDirectionButton.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/slots/SlotDirectionButton.java index f89c5d8bb..c6f11017b 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/slots/SlotDirectionButton.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/slots/SlotDirectionButton.java @@ -33,7 +33,7 @@ public SlotDirectionButton(VESlotManager slotManager, int x, int y, OnPress onPr this.direction = slotManager.getDirection(); } - private void cycle(){ + private void cycle() { switch (direction) { case UP -> direction = Direction.DOWN; case DOWN -> direction = Direction.NORTH; @@ -44,43 +44,43 @@ private void cycle(){ } } - private void setDirection(Direction dir){ + private void setDirection(Direction dir) { this.direction = dir; this.slotManager.setDirection(dir); } @Override - public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3){ - if(!render) return; + public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3) { + if (!render) return; RenderSystem.setShaderTexture(0, texture); - if(!isHovered){ // x: 96 y:20 + if (!isHovered) { // x: 96 y:20 matrixStack.blit(texture, getX(), getY(), 0, 166, this.width, this.height); } else { matrixStack.blit(texture, getX(), getY(), 0, 186, this.width, this.height); } Component textComponent = TextUtil.slotNameWithDirection(slotManager.getTranslationKey(), slotManager.getDirection(), slotManager.getSlotNum()); - matrixStack.drawCenteredString(Minecraft.getInstance().font, textComponent.getString(),(getX())+48,(getY())+5,0xffffff); + matrixStack.drawCenteredString(Minecraft.getInstance().font, textComponent.getString(), (getX()) + 48, (getY()) + 5, 0xffffff); } @Override - public void onPress(){ - if(!render) return; + public void onPress() { + if (!render) return; cycle(); // this.slotManager.setDirection(direction); - VENetwork.channel.send(new DirectionButtonPacket(this.getDirection().get3DDataValue(),this.getAssociatedSlotId()), PacketDistributor.SERVER.noArg()); + VENetwork.channel.send(new DirectionButtonPacket(this.getDirection().get3DDataValue(), this.getAssociatedSlotId()), PacketDistributor.SERVER.noArg()); } - public Direction getDirection(){ + public Direction getDirection() { return direction; } - public int getAssociatedSlotId(){ + public int getAssociatedSlotId() { return this.slotManager.getSlotNum(); } - public void setDirectionFromInt(int sideInt){ + public void setDirectionFromInt(int sideInt) { setDirection(IntToDirection.IntegerToDirection(sideInt)); } } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankBoolButton.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankBoolButton.java index 112706aec..f6d21405d 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankBoolButton.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankBoolButton.java @@ -30,29 +30,33 @@ public TankBoolButton(VERelationalTank tank, int x, int y, Button.OnPress onPres } @Override - public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3){ - if(!render) return; + public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3) { + if (!render) return; RenderSystem.setShaderTexture(0, texture); enable = this.tank.getSideStatus(); - if(!enable){ + if (!enable) { matrixStack.blit(texture, getX(), getY(), 213, 0, this.width, this.height); } else { matrixStack.blit(texture, getX(), getY(), 213, 15, this.width, this.height); } } - private void cycle(){ enable = !enable; } + private void cycle() { + enable = !enable; + } @Override - public void onPress(){ - if(!render) return; + public void onPress() { + if (!render) return; cycle(); VENetwork.channel.send(new TankBoolPacket(this.status(), this.getId()), PacketDistributor.SERVER.noArg()); } - public boolean status(){ return enable; } + public boolean status() { + return enable; + } - public int getId(){ + public int getId() { return this.tank.getSlotNum(); } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankDirectionButton.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankDirectionButton.java index c442512f6..e4515f539 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankDirectionButton.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/tanks/TankDirectionButton.java @@ -33,8 +33,8 @@ public TankDirectionButton(VERelationalTank tank, int x, int y, OnPress onPress) this.direction = tank.getSideDirection(); } - private void cycle(){ - switch(direction){ + private void cycle() { + switch (direction) { case UP: direction = Direction.DOWN; break; @@ -55,17 +55,17 @@ private void cycle(){ } } - private void setDirection(Direction dir){ + private void setDirection(Direction dir) { this.direction = dir; this.tank.setSideDirection(dir); } @Override - public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3){ - if(!render) return; + public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_renderButton2, float p_renderButton3) { + if (!render) return; RenderSystem.setShaderTexture(0, texture); - if(!isHovered){ // x: 96 y:20 + if (!isHovered) { // x: 96 y:20 matrixStack.blit(texture, getX(), getY(), 0, 166, this.width, this.height); } else { matrixStack.blit(texture, getX(), getY(), 0, 186, this.width, this.height); @@ -73,25 +73,25 @@ public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_ren // Print text Component textComponent = TextUtil.slotNameWithDirection(tank.getTranslationKey(), tank.getSideDirection(), tank.getSlotNum()); - matrixStack.drawCenteredString(Minecraft.getInstance().font, textComponent.getString(),(getX())+48,(getY())+5,0xffffff); + matrixStack.drawCenteredString(Minecraft.getInstance().font, textComponent.getString(), (getX()) + 48, (getY()) + 5, 0xffffff); } @Override - public void onPress(){ - if(!render) return; + public void onPress() { + if (!render) return; cycle(); - VENetwork.channel.send(new TankDirectionPacket(this.getDirection().get3DDataValue(),this.getId()), PacketDistributor.SERVER.noArg()); + VENetwork.channel.send(new TankDirectionPacket(this.getDirection().get3DDataValue(), this.getId()), PacketDistributor.SERVER.noArg()); } - public Direction getDirection(){ + public Direction getDirection() { return direction; } - public int getId(){ + public int getId() { return this.tank.getSlotNum(); } - public void setDirectionFromInt(int sideInt){ + public void setDirectionFromInt(int sideInt) { setDirection(IntToDirection.IntegerToDirection(sideInt)); } } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyItemStorage.java b/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyItemStorage.java index e58df5f01..cddf47fd9 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyItemStorage.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyItemStorage.java @@ -12,25 +12,29 @@ public VEEnergyItemStorage(ItemStack itemStack, int capacity, int maxTransfer) { } @Override - public int receiveEnergy(int maxReceive, boolean simulate){ - if(!canReceive()) return 0; + public int receiveEnergy(int maxReceive, boolean simulate) { + if (!canReceive()) return 0; int energyStored = getEnergyStored(); int energyReceived = Math.min(capacity - energyStored, Math.min(this.maxReceive, maxReceive)); - if(!simulate) writeEnergy(energyStored + energyReceived); + if (!simulate) writeEnergy(energyStored + energyReceived); return energyReceived; } @Override - public int extractEnergy(int maxExtract, boolean simulate){ - if(!canExtract()) return 0; - int energyExtracted = Math.min(getEnergyStored(), Math.min(this.maxExtract,maxExtract)); + public int extractEnergy(int maxExtract, boolean simulate) { + if (!canExtract()) return 0; + int energyExtracted = Math.min(getEnergyStored(), Math.min(this.maxExtract, maxExtract)); VoluminousEnergy.LOGGER.debug("Extracting Energy from item. energyStored: " + getEnergyStored() + " energyExtracted: " + energyExtracted + " new total: " + (getEnergyStored() - energyExtracted) + " Max Extract: " + maxExtract); - if(!simulate) writeEnergy(getEnergyStored() - energyExtracted); + if (!simulate) writeEnergy(getEnergyStored() - energyExtracted); return energyExtracted; } @Override - public int getEnergyStored(){return this.itemStack.getOrCreateTag().getInt("energy");} + public int getEnergyStored() { + return this.itemStack.getOrCreateTag().getInt("energy"); + } - private void writeEnergy(int amount){this.itemStack.getOrCreateTag().putInt("energy",amount);} + private void writeEnergy(int amount) { + this.itemStack.getOrCreateTag().putInt("energy", amount); + } } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java b/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java index a0d757cb1..5d88e2a79 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java @@ -24,20 +24,20 @@ public VEEnergyStorage(int capacity, int maxTransfer, int production, int consum this.upgradeSlotId = upgradeSlotId; } - public void setEnergy(int energy){ + public void setEnergy(int energy) { this.energy = energy; } public void addEnergy(int energy) { this.energy += energy; - if (this.energy > capacity){ + if (this.energy > capacity) { this.energy = capacity; } } - public void consumeEnergy(int energy){ + public void consumeEnergy(int energy) { this.energy -= energy; - if (this.energy < 0){ + if (this.energy < 0) { this.energy = 0; } } @@ -51,9 +51,9 @@ public CompoundTag serializeNBT(){ public void serializeNBT(CompoundTag tag) { tag.putInt("energy", getEnergyStored()); - tag.putInt("energy_production",production); - tag.putInt("energy_consumption",consumption); - tag.putInt("upgrade_slot",upgradeSlotId); + tag.putInt("energy_production", production); + tag.putInt("energy_consumption", consumption); + tag.putInt("upgrade_slot", upgradeSlotId); } public void deserializeNBT(CompoundTag tag) { @@ -64,7 +64,7 @@ public void deserializeNBT(CompoundTag tag) { } public VEEnergyStorage copy() { - return new VEEnergyStorage(capacity,maxReceive,production,consumption,upgradeSlotId); + return new VEEnergyStorage(capacity, maxReceive, production, consumption, upgradeSlotId); } public void setMaxReceive(int amount) { @@ -108,10 +108,10 @@ public int getUpgradeSlotId() { /** * How much energy can be stored + * * @return the int value of the capacity */ - public int getCapacity() - { + public int getCapacity() { return capacity; } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/VENetwork.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/VENetwork.java index 59dc159a3..6183792f4 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/VENetwork.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/VENetwork.java @@ -14,6 +14,7 @@ public class VENetwork { public static final AttributeKey CONTEXT = AttributeKey.newInstance(CHANNEL_ID.toString()); public static SimpleChannel channel; + static { channel = ChannelBuilder.named(CHANNEL_ID) .networkProtocolVersion(1) @@ -62,11 +63,11 @@ public class VENetwork { .add(); } - private VENetwork(){ + private VENetwork() { } - public static void init(){ + public static void init() { } } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java index 37c855e37..a734d86e7 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java @@ -12,45 +12,45 @@ public class BatteryBoxSendOutPowerPacket { private boolean status; - public BatteryBoxSendOutPowerPacket(){ + public BatteryBoxSendOutPowerPacket() { // Do nothing } - public BatteryBoxSendOutPowerPacket(boolean status){ + public BatteryBoxSendOutPowerPacket(boolean status) { this.status = status; } - public static BatteryBoxSendOutPowerPacket fromBytes(FriendlyByteBuf buffer){ + public static BatteryBoxSendOutPowerPacket fromBytes(FriendlyByteBuf buffer) { BatteryBoxSendOutPowerPacket packet = new BatteryBoxSendOutPowerPacket(); packet.status = buffer.readBoolean(); return packet; } - public void toBytes(FriendlyByteBuf buffer){ + public void toBytes(FriendlyByteBuf buffer) { buffer.writeBoolean(this.status); } - public static void handle(BatteryBoxSendOutPowerPacket packet, CustomPayloadEvent.Context contextSupplier){ + public static void handle(BatteryBoxSendOutPowerPacket packet, CustomPayloadEvent.Context contextSupplier) { NetworkDirection packetDirection = contextSupplier.getDirection(); - switch (packetDirection){ + switch (packetDirection) { case PLAY_TO_CLIENT: // Packet is being sent to client AbstractContainerMenu clientContainer = Minecraft.getInstance().player.containerMenu; - contextSupplier.enqueueWork(() -> handlePacket(packet,clientContainer,false)); + contextSupplier.enqueueWork(() -> handlePacket(packet, clientContainer, false)); contextSupplier.setPacketHandled(true); break; default: AbstractContainerMenu serverContainer = (contextSupplier.getSender()).containerMenu; - contextSupplier.enqueueWork(() -> handlePacket(packet,serverContainer,true)); + contextSupplier.enqueueWork(() -> handlePacket(packet, serverContainer, true)); contextSupplier.setPacketHandled(true); } } - public static void handlePacket(BatteryBoxSendOutPowerPacket packet, AbstractContainerMenu openContainer, boolean onServer){ - if(openContainer != null){ - if(openContainer instanceof VEContainer batteryBoxContainer){ - if(onServer){ + public static void handlePacket(BatteryBoxSendOutPowerPacket packet, AbstractContainerMenu openContainer, boolean onServer) { + if (openContainer != null) { + if (openContainer instanceof VEContainer batteryBoxContainer) { + if (onServer) { BlockEntity tileEntity = batteryBoxContainer.getTileEntity(); - if(tileEntity instanceof BatteryBoxTile batteryBoxTile){ + if (tileEntity instanceof BatteryBoxTile batteryBoxTile) { batteryBoxTile.updateSendOutPower(packet.status); batteryBoxTile.setChanged(); } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java index 9218eb628..167b19282 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java @@ -13,38 +13,38 @@ public class BatteryBoxSlotPairPacket { private boolean status; private int id; - public BatteryBoxSlotPairPacket(){ + public BatteryBoxSlotPairPacket() { // Do nothing } - public BatteryBoxSlotPairPacket(boolean status, int id){ + public BatteryBoxSlotPairPacket(boolean status, int id) { this.status = status; this.id = id; } - public static BatteryBoxSlotPairPacket fromBytes(FriendlyByteBuf buffer){ + public static BatteryBoxSlotPairPacket fromBytes(FriendlyByteBuf buffer) { BatteryBoxSlotPairPacket packet = new BatteryBoxSlotPairPacket(); packet.status = buffer.readBoolean(); packet.id = buffer.readInt(); return packet; } - public void toBytes(FriendlyByteBuf buffer){ + public void toBytes(FriendlyByteBuf buffer) { buffer.writeBoolean(this.status); buffer.writeInt(this.id); } - public static void handle(BatteryBoxSlotPairPacket packet, CustomPayloadEvent.Context contextSupplier){ + public static void handle(BatteryBoxSlotPairPacket packet, CustomPayloadEvent.Context contextSupplier) { NetworkDirection packetDirection = contextSupplier.getDirection(); - switch (packetDirection){ + switch (packetDirection) { case PLAY_TO_CLIENT: // Packet is being sent to client AbstractContainerMenu clientContainer = Minecraft.getInstance().player.containerMenu; - contextSupplier.enqueueWork(() -> handlePacket(packet,clientContainer,false)); + contextSupplier.enqueueWork(() -> handlePacket(packet, clientContainer, false)); contextSupplier.setPacketHandled(true); break; default: AbstractContainerMenu serverContainer = (contextSupplier.getSender()).containerMenu; - contextSupplier.enqueueWork(() -> handlePacket(packet,serverContainer,true)); + contextSupplier.enqueueWork(() -> handlePacket(packet, serverContainer, true)); contextSupplier.setPacketHandled(true); } } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BoolButtonPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BoolButtonPacket.java index 75c333c60..f11abe016 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BoolButtonPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BoolButtonPacket.java @@ -14,59 +14,58 @@ public class BoolButtonPacket { private boolean status; private int slotId; - public BoolButtonPacket(){ + public BoolButtonPacket() { // Do nothing } - public BoolButtonPacket(boolean updatedStatus, int slot){ + public BoolButtonPacket(boolean updatedStatus, int slot) { this.status = updatedStatus; this.slotId = slot; } - public static BoolButtonPacket fromBytes(FriendlyByteBuf buffer){ + public static BoolButtonPacket fromBytes(FriendlyByteBuf buffer) { BoolButtonPacket packet = new BoolButtonPacket(); packet.status = buffer.readBoolean(); packet.slotId = buffer.readInt(); return packet; } - public void toBytes(FriendlyByteBuf buffer){ + public void toBytes(FriendlyByteBuf buffer) { buffer.writeBoolean(this.status); buffer.writeInt(this.slotId); } - public static void handle(BoolButtonPacket packet, CustomPayloadEvent.Context contextSupplier){ + public static void handle(BoolButtonPacket packet, CustomPayloadEvent.Context contextSupplier) { //VoluminousEnergy.LOGGER.debug(contextSupplier.get().getDirection()); NetworkDirection packetDirection = contextSupplier.getDirection(); - switch(packetDirection){ + switch (packetDirection) { case PLAY_TO_CLIENT: AbstractContainerMenu clientContainer = Minecraft.getInstance().player.containerMenu; - contextSupplier.enqueueWork(() -> handlePacket(packet,clientContainer,false)); + contextSupplier.enqueueWork(() -> handlePacket(packet, clientContainer, false)); contextSupplier.setPacketHandled(true); break; default: AbstractContainerMenu serverContainer = (contextSupplier.getSender()).containerMenu; - contextSupplier.enqueueWork(() -> handlePacket(packet,serverContainer,true)); + contextSupplier.enqueueWork(() -> handlePacket(packet, serverContainer, true)); contextSupplier.setPacketHandled(true); } } - public static void handlePacket(BoolButtonPacket packet, AbstractContainerMenu openContainer, boolean onServer){ - if(openContainer != null){ + public static void handlePacket(BoolButtonPacket packet, AbstractContainerMenu openContainer, boolean onServer) { + if (openContainer != null) { - if(openContainer instanceof VEContainer VEContainer){ - if(onServer){ + if (openContainer instanceof VEContainer VEContainer) { + if (onServer) { BlockEntity tileEntity = VEContainer.getTileEntity(); - if (tileEntity instanceof VETileEntity VETileEntity){ + if (tileEntity instanceof VETileEntity VETileEntity) { VETileEntity.updatePacketFromGui(packet.status, packet.slotId); VETileEntity.setChanged(); } } else { VEContainer.updateStatusButton(packet.status, packet.slotId); } - } - else { + } else { VoluminousEnergy.LOGGER.warn("BoolButtonPacket: Not a valid container."); } } else { diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/DirectionButtonPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/DirectionButtonPacket.java index 49d72a8ba..c0cfc75f4 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/DirectionButtonPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/DirectionButtonPacket.java @@ -14,50 +14,50 @@ public class DirectionButtonPacket { private int direction; private int slotId; - public DirectionButtonPacket(){ + public DirectionButtonPacket() { // Do nothing } - public DirectionButtonPacket(int updatedDirection, int slot){ + public DirectionButtonPacket(int updatedDirection, int slot) { this.direction = updatedDirection; this.slotId = slot; } - public static DirectionButtonPacket fromBytes(FriendlyByteBuf buffer){ + public static DirectionButtonPacket fromBytes(FriendlyByteBuf buffer) { DirectionButtonPacket packet = new DirectionButtonPacket(); packet.direction = buffer.readInt(); packet.slotId = buffer.readInt(); return packet; } - public void toBytes(FriendlyByteBuf buffer){ + public void toBytes(FriendlyByteBuf buffer) { buffer.writeInt(this.direction); buffer.writeInt(this.slotId); } - public static void handle(DirectionButtonPacket packet, CustomPayloadEvent.Context contextSupplier){ + public static void handle(DirectionButtonPacket packet, CustomPayloadEvent.Context contextSupplier) { NetworkDirection packetDirection = contextSupplier.getDirection(); - switch(packetDirection){ + switch (packetDirection) { case PLAY_TO_CLIENT: AbstractContainerMenu clientContainer = Minecraft.getInstance().player.containerMenu; - contextSupplier.enqueueWork(() -> handlePacket(packet,clientContainer,false)); + contextSupplier.enqueueWork(() -> handlePacket(packet, clientContainer, false)); contextSupplier.setPacketHandled(true); break; default: AbstractContainerMenu serverContainer = (contextSupplier.getSender()).containerMenu; - contextSupplier.enqueueWork(() -> handlePacket(packet,serverContainer,true)); + contextSupplier.enqueueWork(() -> handlePacket(packet, serverContainer, true)); contextSupplier.setPacketHandled(true); } } - public static void handlePacket(DirectionButtonPacket packet, AbstractContainerMenu openContainer, boolean onServer){ + public static void handlePacket(DirectionButtonPacket packet, AbstractContainerMenu openContainer, boolean onServer) { - if(openContainer != null){ - if(openContainer instanceof VEContainer VEContainer){ - if(onServer){ + if (openContainer != null) { + if (openContainer instanceof VEContainer VEContainer) { + if (onServer) { BlockEntity tileEntity = VEContainer.getTileEntity(); - if (tileEntity instanceof VETileEntity VETileEntity){ + if (tileEntity instanceof VETileEntity VETileEntity) { VETileEntity.updatePacketFromGui(packet.direction, packet.slotId); VETileEntity.setChanged(); } @@ -65,7 +65,7 @@ public static void handlePacket(DirectionButtonPacket packet, AbstractContainerM VEContainer.updateDirectionButton(packet.direction, packet.slotId); } } else { - VoluminousEnergy.LOGGER.warn("DirectionButtonPacket: Not a valid container." + openContainer.getClass().getName()); + VoluminousEnergy.LOGGER.warn("DirectionButtonPacket: Not a valid container." + openContainer.getClass().getName()); } } else { VoluminousEnergy.LOGGER.warn("DirectionButtonPacket: The container is null."); diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankBoolPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankBoolPacket.java index 292e54fcb..e52f0e700 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankBoolPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankBoolPacket.java @@ -14,47 +14,47 @@ public class TankBoolPacket { private boolean status; private int id; - public TankBoolPacket(){ + public TankBoolPacket() { // Do nothing } - public TankBoolPacket(boolean updatedStatus, int id){ + public TankBoolPacket(boolean updatedStatus, int id) { this.status = updatedStatus; this.id = id; } - public static TankBoolPacket fromBytes(FriendlyByteBuf buffer){ + public static TankBoolPacket fromBytes(FriendlyByteBuf buffer) { TankBoolPacket packet = new TankBoolPacket(); packet.status = buffer.readBoolean(); packet.id = buffer.readInt(); return packet; } - public void toBytes(FriendlyByteBuf buffer){ + public void toBytes(FriendlyByteBuf buffer) { buffer.writeBoolean(this.status); buffer.writeInt(this.id); } - public static void handle(TankBoolPacket packet, CustomPayloadEvent.Context contextSupplier){ + public static void handle(TankBoolPacket packet, CustomPayloadEvent.Context contextSupplier) { NetworkDirection packetDirection = contextSupplier.getDirection(); - switch(packetDirection){ + switch (packetDirection) { case PLAY_TO_CLIENT: AbstractContainerMenu clientContainer = Minecraft.getInstance().player.containerMenu; - contextSupplier.enqueueWork(() -> handlePacket(packet,clientContainer,false)); + contextSupplier.enqueueWork(() -> handlePacket(packet, clientContainer, false)); contextSupplier.setPacketHandled(true); break; default: AbstractContainerMenu serverContainer = (contextSupplier.getSender()).containerMenu; - contextSupplier.enqueueWork(() -> handlePacket(packet,serverContainer,true)); + contextSupplier.enqueueWork(() -> handlePacket(packet, serverContainer, true)); contextSupplier.setPacketHandled(true); } } - public static void handlePacket(TankBoolPacket packet, AbstractContainerMenu openContainer, boolean onServer){ - if(openContainer != null){ + public static void handlePacket(TankBoolPacket packet, AbstractContainerMenu openContainer, boolean onServer) { + if (openContainer != null) { - if(openContainer instanceof VEContainer VEContainer) { + if (openContainer instanceof VEContainer VEContainer) { if (onServer) { BlockEntity tileEntity = VEContainer.getTileEntity(); if (tileEntity instanceof VETileEntity VETileEntity) { diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankDirectionPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankDirectionPacket.java index a4a569fb3..cc6db42a4 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankDirectionPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/TankDirectionPacket.java @@ -14,45 +14,45 @@ public class TankDirectionPacket { private int direction; private int tankId; - public TankDirectionPacket(){ + public TankDirectionPacket() { // Do nothing } - public TankDirectionPacket(int updatedDirection, int id){ + public TankDirectionPacket(int updatedDirection, int id) { this.direction = updatedDirection; this.tankId = id; } - public static TankDirectionPacket fromBytes(FriendlyByteBuf buffer){ + public static TankDirectionPacket fromBytes(FriendlyByteBuf buffer) { TankDirectionPacket packet = new TankDirectionPacket(); packet.direction = buffer.readInt(); packet.tankId = buffer.readInt(); return packet; } - public void toBytes(FriendlyByteBuf buffer){ + public void toBytes(FriendlyByteBuf buffer) { buffer.writeInt(this.direction); buffer.writeInt(this.tankId); } - public static void handle(TankDirectionPacket packet, CustomPayloadEvent.Context contextSupplier){ + public static void handle(TankDirectionPacket packet, CustomPayloadEvent.Context contextSupplier) { NetworkDirection packetDirection = contextSupplier.getDirection(); - switch(packetDirection){ + switch (packetDirection) { case PLAY_TO_CLIENT: AbstractContainerMenu clientContainer = Minecraft.getInstance().player.containerMenu; - contextSupplier.enqueueWork(() -> handlePacket(packet,clientContainer,false)); + contextSupplier.enqueueWork(() -> handlePacket(packet, clientContainer, false)); contextSupplier.setPacketHandled(true); break; default: AbstractContainerMenu serverContainer = (contextSupplier.getSender()).containerMenu; - contextSupplier.enqueueWork(() -> handlePacket(packet,serverContainer,true)); + contextSupplier.enqueueWork(() -> handlePacket(packet, serverContainer, true)); contextSupplier.setPacketHandled(true); } } - public static void handlePacket(TankDirectionPacket packet, AbstractContainerMenu openContainer, boolean onServer){ - if(openContainer != null){ + public static void handlePacket(TankDirectionPacket packet, AbstractContainerMenu openContainer, boolean onServer) { + if (openContainer != null) { if (openContainer instanceof VEContainer VEContainer) { if (onServer) { diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/UuidPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/UuidPacket.java index 95beb8a3a..3c17ed19f 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/UuidPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/UuidPacket.java @@ -17,34 +17,34 @@ public class UuidPacket { private UUID uuid; private boolean connection; - public UuidPacket(){ + public UuidPacket() { // Do nothing } - public UuidPacket(UUID uuid, boolean connection){ + public UuidPacket(UUID uuid, boolean connection) { this.uuid = uuid; this.connection = connection; } - public static UuidPacket fromBytes(FriendlyByteBuf buffer){ + public static UuidPacket fromBytes(FriendlyByteBuf buffer) { UuidPacket packet = new UuidPacket(); packet.uuid = buffer.readUUID(); packet.connection = buffer.readBoolean(); return packet; } - public void toBytes(FriendlyByteBuf buffer){ + public void toBytes(FriendlyByteBuf buffer) { buffer.writeUUID(this.uuid); buffer.writeBoolean(this.connection); } - public static void handle(UuidPacket packet, CustomPayloadEvent.Context contextSupplier){ + public static void handle(UuidPacket packet, CustomPayloadEvent.Context contextSupplier) { AbstractContainerMenu serverContainer = (contextSupplier.getSender()).containerMenu; //contextSupplier.get().enqueueWork(() -> handlePacket(packet,serverContainer)); contextSupplier.setPacketHandled(true); } - public static void handlePacket(UuidPacket packet, AbstractContainerMenu openContainer){ + public static void handlePacket(UuidPacket packet, AbstractContainerMenu openContainer) { if (openContainer == null) return; if (openContainer instanceof VEContainer VEContainer) { VETileEntity VETileEntity = (VETileEntity) VEContainer.getTileEntity(); diff --git a/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java b/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java index 3a42da1db..789977361 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java @@ -33,12 +33,13 @@ public VESlotManager(int slotNum, Direction direction, boolean status, SlotType /** * Use this for when you have an input tilePos type - * @param slotNum The tilePos number is the index in the array of the slotManagers - * @param direction The direction it will be facing by default - * @param status The status of the IO - * @param slotType The type of tilePos + * + * @param slotNum The tilePos number is the index in the array of the slotManagers + * @param direction The direction it will be facing by default + * @param status The status of the IO + * @param slotType The type of tilePos * @param outputSlot The slotNum of the tank to which a bucket will be placed when this has processed a bucket - * @param tankId The index of the tank in the fluidManagers + * @param tankId The index of the tank in the fluidManagers */ public VESlotManager(int slotNum, Direction direction, boolean status, SlotType slotType, int outputSlot, int tankId) { this.side.set(direction); @@ -115,8 +116,8 @@ public ItemStack getItem(ItemStackHandler handler) { return handler.getStackInSlot(this.slot); } - public void setItem(ItemStack stack,ItemStackHandler handler) { - handler.setStackInSlot(this.slot,stack.copy()); + public void setItem(ItemStack stack, ItemStackHandler handler) { + handler.setStackInSlot(this.slot, stack.copy()); } public int getOutputSlotId() { diff --git a/src/main/java/com/veteam/voluminousenergy/util/IntToDirection.java b/src/main/java/com/veteam/voluminousenergy/util/IntToDirection.java index cf724d91d..a5c86f095 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/IntToDirection.java +++ b/src/main/java/com/veteam/voluminousenergy/util/IntToDirection.java @@ -9,18 +9,18 @@ private IntToDirection() { } // 3D Int value to direction object - public static Direction IntegerToDirection(int direction){ - if(direction == 0){ + public static Direction IntegerToDirection(int direction) { + if (direction == 0) { return Direction.DOWN; - } else if (direction == 1){ + } else if (direction == 1) { return Direction.UP; - } else if (direction == 2){ + } else if (direction == 2) { return Direction.NORTH; - } else if (direction == 3){ + } else if (direction == 3) { return Direction.SOUTH; - } else if (direction == 4){ + } else if (direction == 4) { return Direction.WEST; - } else if (direction == 5){ + } else if (direction == 5) { return Direction.EAST; } throw new IndexOutOfBoundsException("Directions can only be from 0 to 5. " + direction + ", was passed into IntegerToDirection instead."); diff --git a/src/main/java/com/veteam/voluminousenergy/util/MultiBlockStateMatchRuleTest.java b/src/main/java/com/veteam/voluminousenergy/util/MultiBlockStateMatchRuleTest.java index c4c801c94..84a547ad7 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/MultiBlockStateMatchRuleTest.java +++ b/src/main/java/com/veteam/voluminousenergy/util/MultiBlockStateMatchRuleTest.java @@ -14,18 +14,18 @@ public MultiBlockStateMatchRuleTest(BlockState... states) { this.stateList = states; } - public MultiBlockStateMatchRuleTest(ArrayList stateList){ + public MultiBlockStateMatchRuleTest(ArrayList stateList) { super(stateList.get(0)); this.stateList = new BlockState[stateList.size()]; - for (int i = 0; i < stateList.size(); i++){ + for (int i = 0; i < stateList.size(); i++) { this.stateList[i] = stateList.get(i); } } @Override public boolean test(BlockState blockState, RandomSource random) { - for (BlockState state : stateList){ - if (state.getBlock() == blockState.getBlock()){ + for (BlockState state : stateList) { + if (state.getBlock() == blockState.getBlock()) { return true; } } diff --git a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java index 661b3fd81..9b649db84 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java +++ b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java @@ -50,7 +50,7 @@ public int getTankCapacity(int tank) { @Override public boolean isFluidValid(int tank, @Nonnull FluidStack stack) { VERelationalTank relationalTank = tankHashMap.get(tank); - if(relationalTank.isAllowAny()) return true; + if (relationalTank.isAllowAny()) return true; for (VERecipe recipe : tileEntity.getPotentialRecipes()) { if (recipe.getFluidIngredient(relationalTank.getRecipePos()).test(stack)) { return true; @@ -62,11 +62,11 @@ public boolean isFluidValid(int tank, @Nonnull FluidStack stack) { @Override public int fill(FluidStack resource, FluidAction action) { - for(VERelationalTank tank : tanks) { - if(tank.getTankType() == TankType.OUTPUT) continue; + for (VERelationalTank tank : tanks) { + if (tank.getTankType() == TankType.OUTPUT) continue; if (isFluidValid(tank.getSlotNum(), resource) && (tank.getTank().isEmpty() || resource.isFluidEqual(tank.getTank().getFluid()))) { - if(!tank.getSideStatus() && !(tileEntity instanceof TankTile)) return 0; - if(tank.getTank().getFluid().getAmount() != tank.getTank().getCapacity()) tileEntity.markRecipeDirty(); + if (!tank.getSideStatus() && !(tileEntity instanceof TankTile)) return 0; + if (tank.getTank().getFluid().getAmount() != tank.getTank().getCapacity()) tileEntity.markRecipeDirty(); return tank.getTank().fill(resource.copy(), action); } } @@ -79,13 +79,13 @@ public FluidStack drain(FluidStack resource, FluidAction action) { if (resource.isEmpty()) { return FluidStack.EMPTY; } - for(VERelationalTank tank : tanks) { - if(!tank.getSideStatus() && !tank.isIgnoreDirection()) continue; - if(!Config.ALLOW_EXTRACTION_FROM_INPUT_TANKS.get()) { - if(tank.getTankType() != TankType.OUTPUT && tank.getTankType() != TankType.BOTH) continue; + for (VERelationalTank tank : tanks) { + if (!tank.getSideStatus() && !tank.isIgnoreDirection()) continue; + if (!Config.ALLOW_EXTRACTION_FROM_INPUT_TANKS.get()) { + if (tank.getTankType() != TankType.OUTPUT && tank.getTankType() != TankType.BOTH) continue; } if (resource.isFluidEqual(tank.getTank().getFluid())) { - if(tank.getTank().getFluid().getAmount() != tank.getTank().getCapacity()) tileEntity.markRecipeDirty(); + if (tank.getTank().getFluid().getAmount() != tank.getTank().getCapacity()) tileEntity.markRecipeDirty(); return tank.getTank().drain(resource.copy(), action); } } @@ -95,13 +95,13 @@ public FluidStack drain(FluidStack resource, FluidAction action) { @Nonnull @Override public FluidStack drain(int maxDrain, FluidAction action) { - for(VERelationalTank tank : tanks) { - if(!tank.getSideStatus() && !(tileEntity instanceof TankTile)) continue; - if(!Config.ALLOW_EXTRACTION_FROM_INPUT_TANKS.get()) { - if(tank.getTankType() != TankType.OUTPUT && tank.getTankType() != TankType.BOTH) continue; + for (VERelationalTank tank : tanks) { + if (!tank.getSideStatus() && !(tileEntity instanceof TankTile)) continue; + if (!Config.ALLOW_EXTRACTION_FROM_INPUT_TANKS.get()) { + if (tank.getTankType() != TankType.OUTPUT && tank.getTankType() != TankType.BOTH) continue; } if (tank.getTank().getFluidAmount() > 0) { - if(tank.getTank().getFluid().getAmount() != tank.getTank().getCapacity()) tileEntity.markRecipeDirty(); + if (tank.getTank().getFluid().getAmount() != tank.getTank().getCapacity()) tileEntity.markRecipeDirty(); return tank.getTank().drain(maxDrain, action); } } @@ -109,9 +109,10 @@ public FluidStack drain(int maxDrain, FluidAction action) { } public void addRelationalTank(VERelationalTank tank) { - tankHashMap.put(tank.getSlotNum(),tank); + tankHashMap.put(tank.getSlotNum(), tank); tanks.add(tank); } + public void removeRelationalTank(VERelationalTank tank) { tankHashMap.remove(tank.getSlotNum()); tanks.remove(tank); diff --git a/src/main/java/com/veteam/voluminousenergy/util/MultiSlotWrapper.java b/src/main/java/com/veteam/voluminousenergy/util/MultiSlotWrapper.java index fbad8cc35..a5a3cfa60 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/MultiSlotWrapper.java +++ b/src/main/java/com/veteam/voluminousenergy/util/MultiSlotWrapper.java @@ -11,11 +11,11 @@ public class MultiSlotWrapper implements IItemHandlerModifiable { private final IItemHandlerModifiable inventory; - HashMap managerHashMap = new HashMap<>(); + HashMap managerHashMap = new HashMap<>(); public MultiSlotWrapper(IItemHandlerModifiable inventory, List slotManager) { this.inventory = inventory; - slotManager.forEach(m -> managerHashMap.put(m.getSlotNum(),m)); + slotManager.forEach(m -> managerHashMap.put(m.getSlotNum(), m)); } @Override @@ -26,7 +26,7 @@ public int getSlots() { @Override @Nonnull public ItemStack getStackInSlot(int slot) { - if(managerHashMap.containsKey(slot)) { + if (managerHashMap.containsKey(slot)) { return inventory.getStackInSlot(slot); } return ItemStack.EMPTY; @@ -35,9 +35,9 @@ public ItemStack getStackInSlot(int slot) { @Override @Nonnull public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if(managerHashMap.containsKey(slot)) { + if (managerHashMap.containsKey(slot)) { VESlotManager manager = managerHashMap.get(slot); - if(manager.getSlotType() == SlotType.OUTPUT || !manager.getStatus()) return stack; + if (manager.getSlotType() == SlotType.OUTPUT || !manager.getStatus()) return stack; return inventory.insertItem(manager.getSlotNum(), stack, simulate); } return stack; @@ -46,9 +46,9 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate @Override @Nonnull public ItemStack extractItem(int slot, int amount, boolean simulate) { - if(managerHashMap.containsKey(slot)) { + if (managerHashMap.containsKey(slot)) { VESlotManager manager = managerHashMap.get(slot); - if(manager.getSlotType() == SlotType.INPUT || !manager.getStatus()) return ItemStack.EMPTY; + if (manager.getSlotType() == SlotType.INPUT || !manager.getStatus()) return ItemStack.EMPTY; return inventory.extractItem(managerHashMap.get(slot).getSlotNum(), amount, simulate); } return ItemStack.EMPTY; @@ -82,8 +82,9 @@ private boolean checkSlot(int localSlot) { } public void addSlotManager(VESlotManager manager) { - managerHashMap.put(manager.getSlotNum(),manager); + managerHashMap.put(manager.getSlotNum(), manager); } + public void removeSlotManager(VESlotManager manager) { managerHashMap.remove(manager.getSlotNum()); } diff --git a/src/main/java/com/veteam/voluminousenergy/util/NumberUtil.java b/src/main/java/com/veteam/voluminousenergy/util/NumberUtil.java index ba519ac48..6aae92800 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/NumberUtil.java +++ b/src/main/java/com/veteam/voluminousenergy/util/NumberUtil.java @@ -69,15 +69,15 @@ public static String numberToString4FE(double num) { } } - public static Component numberToTextComponent4FE(double num){ + public static Component numberToTextComponent4FE(double num) { return Component.nullToEmpty(numberToString4FE(num)); } - public static Component numberToTextComponent4Fluids(double num){ + public static Component numberToTextComponent4Fluids(double num) { return Component.nullToEmpty(numberToString4Fluids(num)); } - public static Component numberToTextComponent(double num){ + public static Component numberToTextComponent(double num) { return Component.nullToEmpty(numberToString(num)); } diff --git a/src/main/java/com/veteam/voluminousenergy/util/RegistryLookups.java b/src/main/java/com/veteam/voluminousenergy/util/RegistryLookups.java index 2647efb87..cd2cabc10 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/RegistryLookups.java +++ b/src/main/java/com/veteam/voluminousenergy/util/RegistryLookups.java @@ -14,42 +14,47 @@ public class RegistryLookups { // Lookup an item's ResourceLocation - public static ResourceLocation lookupItem(Item item){ + public static ResourceLocation lookupItem(Item item) { return ForgeRegistries.ITEMS.getKey(item); } - public static ResourceLocation lookupItem(ItemStack itemStack){ + public static ResourceLocation lookupItem(ItemStack itemStack) { return lookupItem(itemStack.getItem()); } // Get BlockEntityType key - /** This uses BlockEntityType.getKey instead of looking up in the Forge registry **/ - public static ResourceLocation getBlockEntityTypeKey(BlockEntityType blockEntityType){ + + /** + * This uses BlockEntityType.getKey instead of looking up in the Forge registry + **/ + public static ResourceLocation getBlockEntityTypeKey(BlockEntityType blockEntityType) { return BlockEntityType.getKey(blockEntityType); } - /** This uses BlockEntityType.getKey instead of looking up in the Forge registry **/ - public static ResourceLocation getBlockEntityTypeKey(BlockEntity blockEntity){ + /** + * This uses BlockEntityType.getKey instead of looking up in the Forge registry + **/ + public static ResourceLocation getBlockEntityTypeKey(BlockEntity blockEntity) { return getBlockEntityTypeKey(blockEntity.getType()); } - public static ResourceLocation lookupBlockEntityType(BlockEntityType blockEntityType){ + public static ResourceLocation lookupBlockEntityType(BlockEntityType blockEntityType) { return ForgeRegistries.BLOCK_ENTITY_TYPES.getKey(blockEntityType); } - public static ResourceLocation lookupBiome(Biome biome){ + public static ResourceLocation lookupBiome(Biome biome) { return ForgeRegistries.BIOMES.getKey(biome); } - public static ResourceLocation lookupBiome(Holder biomeHolder){ + public static ResourceLocation lookupBiome(Holder biomeHolder) { return lookupBiome(biomeHolder.get()); } - public static ResourceLocation lookupFluid(Fluid fluid){ + public static ResourceLocation lookupFluid(Fluid fluid) { return ForgeRegistries.FLUIDS.getKey(fluid); } - public static ResourceLocation lookupFluidType(FluidType fluidType){ + public static ResourceLocation lookupFluidType(FluidType fluidType) { return ForgeRegistries.FLUID_TYPES.get().getKey(fluidType); } } diff --git a/src/main/java/com/veteam/voluminousenergy/util/SlotType.java b/src/main/java/com/veteam/voluminousenergy/util/SlotType.java index 0a6ac2cb1..ac5d097e3 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/SlotType.java +++ b/src/main/java/com/veteam/voluminousenergy/util/SlotType.java @@ -4,12 +4,12 @@ public enum SlotType { INPUT("tilePos.voluminousenergy.input_slot"), OUTPUT("tilePos.voluminousenergy.output_slot"), UPGRADE("tilePos.voluminousenergy.upgrade_slot"), - FLUID_INPUT("tilePos.voluminousenergy.input_slot",true), - FLUID_OUTPUT("tilePos.voluminousenergy.output_slot",true); + FLUID_INPUT("tilePos.voluminousenergy.input_slot", true), + FLUID_OUTPUT("tilePos.voluminousenergy.output_slot", true); private final String translationKey; private boolean isFluidBucketIORelated = false; - private - SlotType(String translationKey) { + + private SlotType(String translationKey) { this.translationKey = translationKey; } diff --git a/src/main/java/com/veteam/voluminousenergy/util/TagUtil.java b/src/main/java/com/veteam/voluminousenergy/util/TagUtil.java index 3d391f8e1..1de5d7f9a 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/TagUtil.java +++ b/src/main/java/com/veteam/voluminousenergy/util/TagUtil.java @@ -18,7 +18,7 @@ public class TagUtil { - public static Lazy> getLazyFluids(ResourceLocation fluidTagLocation){ + public static Lazy> getLazyFluids(ResourceLocation fluidTagLocation) { TagKey tag = TagKey.create(ForgeRegistries.FLUIDS.getRegistryKey(), fluidTagLocation); return Lazy.of(() -> { HolderSet holderSet = BuiltInRegistries.FLUID.getOrCreateTag(tag); @@ -30,7 +30,7 @@ public static Lazy> getLazyFluids(ResourceLocation fluidTagLoca }); } - public static Lazy> getLazyFluidStacks(ResourceLocation fluidTagLocation, int amount){ + public static Lazy> getLazyFluidStacks(ResourceLocation fluidTagLocation, int amount) { TagKey tag = TagKey.create(ForgeRegistries.FLUIDS.getRegistryKey(), fluidTagLocation); return Lazy.of(() -> { HolderSet holderSet = BuiltInRegistries.FLUID.getOrCreateTag(tag); @@ -42,7 +42,7 @@ public static Lazy> getLazyFluidStacks(ResourceLocation fl }); } - public static Lazy getLazyFluidStack(ResourceLocation fluidTagLocation, int amount){ + public static Lazy getLazyFluidStack(ResourceLocation fluidTagLocation, int amount) { TagKey tag = TagKey.create(ForgeRegistries.FLUIDS.getRegistryKey(), fluidTagLocation); return Lazy.of(() -> { HolderSet holderSet = BuiltInRegistries.FLUID.getOrCreateTag(tag); @@ -54,20 +54,20 @@ public static Lazy getLazyFluidStack(ResourceLocation fluidTagLocati }); } - public static Lazy> getLazyItems(ResourceLocation itemTagLocation){ + public static Lazy> getLazyItems(ResourceLocation itemTagLocation) { TagKey tag = TagKey.create(ForgeRegistries.ITEMS.getRegistryKey(), itemTagLocation); return Lazy.of(() -> { - HolderSet holderSet = BuiltInRegistries.ITEM.getOrCreateTag(tag); - AtomicReference> itemSet = new AtomicReference<>(new ArrayList<>()); - holderSet.stream().forEach(itemHolder -> { - itemSet.get().add(itemHolder.value()); - }); - return itemSet.get(); + HolderSet holderSet = BuiltInRegistries.ITEM.getOrCreateTag(tag); + AtomicReference> itemSet = new AtomicReference<>(new ArrayList<>()); + holderSet.stream().forEach(itemHolder -> { + itemSet.get().add(itemHolder.value()); + }); + return itemSet.get(); }); } - public static ArrayList getFluidListFromTagResourceLocationAlternative(String fluidTagLocation){ + public static ArrayList getFluidListFromTagResourceLocationAlternative(String fluidTagLocation) { TagKey fluidTagKey = TagKey.create(ForgeRegistries.FLUIDS.getRegistryKey(), new ResourceLocation(fluidTagLocation)); ArrayList fluids = new ArrayList<>(); AtomicReference> atomicFluids = new AtomicReference<>(fluids); @@ -82,7 +82,7 @@ public static ArrayList getFluidListFromTagResourceLocationAlternative(St return fluids; } - public static ArrayList getFluidListFromTagResourceLocationAlternative(ResourceLocation fluidTagLocation){ + public static ArrayList getFluidListFromTagResourceLocationAlternative(ResourceLocation fluidTagLocation) { TagKey fluidTagKey = TagKey.create(ForgeRegistries.FLUIDS.getRegistryKey(), fluidTagLocation); ArrayList fluids = new ArrayList<>(); AtomicReference> atomicFluids = new AtomicReference<>(fluids); @@ -100,59 +100,60 @@ public static ArrayList getFluidListFromTagResourceLocationAlternative(Re // Original - public static ArrayList getFluidListFromTagResourceLocation(String fluidTagLocation){ + public static ArrayList getFluidListFromTagResourceLocation(String fluidTagLocation) { TagKey fluidTagKey = TagKey.create(ForgeRegistries.FLUIDS.getRegistryKey(), new ResourceLocation(fluidTagLocation)); ArrayList fluids = new ArrayList<>(); - for(Holder holder : BuiltInRegistries.FLUID.getTagOrEmpty(fluidTagKey)) { + for (Holder holder : BuiltInRegistries.FLUID.getTagOrEmpty(fluidTagKey)) { fluids.add(holder.value()); } return fluids; } - public static ArrayList getFluidListFromTagResourceLocation(ResourceLocation fluidTagLocation){ + public static ArrayList getFluidListFromTagResourceLocation(ResourceLocation fluidTagLocation) { TagKey fluidTagKey = TagKey.create(ForgeRegistries.FLUIDS.getRegistryKey(), fluidTagLocation); ArrayList fluids = new ArrayList<>(); - for(Holder holder : BuiltInRegistries.FLUID.getTagOrEmpty(fluidTagKey)) { + for (Holder holder : BuiltInRegistries.FLUID.getTagOrEmpty(fluidTagKey)) { fluids.add(holder.value()); } return fluids; } - public static ArrayList getItemListFromTagResourceLocation(String itemTagLocation){ + public static ArrayList getItemListFromTagResourceLocation(String itemTagLocation) { TagKey itemTagKey = TagKey.create(ForgeRegistries.ITEMS.getRegistryKey(), new ResourceLocation(itemTagLocation)); ArrayList items = new ArrayList<>(); - for(Holder holder : BuiltInRegistries.ITEM.getTagOrEmpty(itemTagKey)) { + for (Holder holder : BuiltInRegistries.ITEM.getTagOrEmpty(itemTagKey)) { items.add(holder.value()); } return items; } - public static ArrayList getItemListFromTagResourceLocation(ResourceLocation itemTagLocation){ + public static ArrayList getItemListFromTagResourceLocation(ResourceLocation itemTagLocation) { TagKey itemTagKey = TagKey.create(ForgeRegistries.ITEMS.getRegistryKey(), itemTagLocation); ArrayList items = new ArrayList<>(); - for(Holder holder : BuiltInRegistries.ITEM.getTagOrEmpty(itemTagKey)) { + for (Holder holder : BuiltInRegistries.ITEM.getTagOrEmpty(itemTagKey)) { items.add(holder.value()); } return items; } private static ArrayList cachedUpgrades; - public static ArrayList getTaggedMachineUpgradeItems(){ - if (cachedUpgrades == null || cachedUpgrades.isEmpty()){ - cachedUpgrades = getItemListFromTagResourceLocation(new ResourceLocation(VoluminousEnergy.MODID,"machine_upgrades")); + + public static ArrayList getTaggedMachineUpgradeItems() { + if (cachedUpgrades == null || cachedUpgrades.isEmpty()) { + cachedUpgrades = getItemListFromTagResourceLocation(new ResourceLocation(VoluminousEnergy.MODID, "machine_upgrades")); } return cachedUpgrades; } - public static boolean isTaggedMachineUpgradeItem(Item item){ + public static boolean isTaggedMachineUpgradeItem(Item item) { return getTaggedMachineUpgradeItems().contains(item); } - public static boolean isTaggedMachineUpgradeItem(ItemStack itemStack){ + public static boolean isTaggedMachineUpgradeItem(ItemStack itemStack) { return getTaggedMachineUpgradeItems().contains(itemStack.getItem()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/util/TankType.java b/src/main/java/com/veteam/voluminousenergy/util/TankType.java index 4c9f9c6d3..6e63c921d 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/TankType.java +++ b/src/main/java/com/veteam/voluminousenergy/util/TankType.java @@ -1,5 +1,5 @@ package com.veteam.voluminousenergy.util; public enum TankType { - OUTPUT,INPUT,BOTH + OUTPUT, INPUT, BOTH } diff --git a/src/main/java/com/veteam/voluminousenergy/util/TextUtil.java b/src/main/java/com/veteam/voluminousenergy/util/TextUtil.java index 2c3631f94..39efcf1ce 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/TextUtil.java +++ b/src/main/java/com/veteam/voluminousenergy/util/TextUtil.java @@ -27,8 +27,8 @@ public class TextUtil { public static Component TRANSLATED_OUTPUT_TANK = TextUtil.translateString("tank.voluminousenergy.output_tank"); public static Component TRANSLATED_BOTH_TANK = TextUtil.translateString("tank.voluminousenergy.both_tank"); - public static Component tankTooltip(String fluidName, int amount, int tankCapacity){ - if (Config.SHORTEN_TANK_GUI_VALUES.get()){ + public static Component tankTooltip(String fluidName, int amount, int tankCapacity) { + if (Config.SHORTEN_TANK_GUI_VALUES.get()) { return TextUtil.translateString(fluidName).copy().append(": " + NumberUtil.numberToString4Fluids(amount) + " / " + NumberUtil.numberToString4Fluids(tankCapacity)); } String stringAmount = String.valueOf(amount); @@ -45,7 +45,7 @@ public static Component tankTooltip(String fluidName, int amount, int tankCapaci return Component.translatable(fluidName).append(Component.nullToEmpty(": " + stringAmount + " mB / " + stringTankCapacity + " mB")); } - public static Component powerBarTooltip(VEEnergyStorage veEnergyStorage, int configuredMaxPower){ + public static Component powerBarTooltip(VEEnergyStorage veEnergyStorage, int configuredMaxPower) { return Config.SHORTEN_POWER_BAR_VALUES.get() ? Component.nullToEmpty( NumberUtil.numberToString4FE(veEnergyStorage.getEnergyStored()) @@ -59,41 +59,53 @@ public static Component powerBarTooltip(VEEnergyStorage veEnergyStorage, int con ); } - public static Component slotName(String slotName){ + public static Component slotName(String slotName) { return Component.translatable(slotName); } - public static Component translateDirection(Direction direction){ + public static Component translateDirection(Direction direction) { //return new TranslatableComponent("direction.voluminousenergy." + direction.name().toLowerCase()); return Component.translatable("direction.voluminousenergy." + directionToLocalDirection(direction)); } public static String directionToLocalDirection(Direction direction) { switch (direction) { - case UP -> {return "up";} - case DOWN -> {return "down";} - case NORTH -> {return "back";} - case EAST -> {return "right";} - case SOUTH -> {return "front";} - default -> {return "left";} + case UP -> { + return "up"; + } + case DOWN -> { + return "down"; + } + case NORTH -> { + return "back"; + } + case EAST -> { + return "right"; + } + case SOUTH -> { + return "front"; + } + default -> { + return "left"; + } } } - public static Component slotNameWithDirection(String slotName, Direction direction, int ordinal){ + public static Component slotNameWithDirection(String slotName, Direction direction, int ordinal) { Component translatedSlot = slotName(slotName); Component translatedDirection = translateDirection(direction); - return Component.nullToEmpty(translatedSlot.getString() + " " + ordinal + " " +translatedDirection.getString()); + return Component.nullToEmpty(translatedSlot.getString() + " " + ordinal + " " + translatedDirection.getString()); } - public static Component translateString(String toTranslate){ + public static Component translateString(String toTranslate) { return Component.translatable(toTranslate); } - public static Component translateString(ChatFormatting chatFormatting, String toTranslate){ + public static Component translateString(ChatFormatting chatFormatting, String toTranslate) { return translateString(toTranslate).copy().withStyle(chatFormatting); } - public static Component translateVEBlock(String block){ + public static Component translateVEBlock(String block) { return Component.translatable("block.voluminousenergy." + block); } @@ -118,7 +130,7 @@ public static Component fluidNameAndAmountWithUnitsAndColours(String fluidTransl + translateString + ": " + ChatFormatting.LIGHT_PURPLE - + NumberUtil.numberToString4Fluids(((float)amount / (float)Config.DIMENSIONAL_LASER_PROCESS_TIME.get())) + + NumberUtil.numberToString4Fluids(((float) amount / (float) Config.DIMENSIONAL_LASER_PROCESS_TIME.get())) + "/t" ); } else { @@ -127,7 +139,7 @@ public static Component fluidNameAndAmountWithUnitsAndColours(String fluidTransl + translateString + ": " + ChatFormatting.LIGHT_PURPLE - + NumberUtil.formatNumber(((float)amount / (float)Config.DIMENSIONAL_LASER_PROCESS_TIME.get())) + + NumberUtil.formatNumber(((float) amount / (float) Config.DIMENSIONAL_LASER_PROCESS_TIME.get())) + " mB/t" ); } @@ -138,10 +150,10 @@ public static int computeTextRenderWidth(int imageWidth, Font font, Component co } public static void renderShadowedText(GuiGraphics graphics, Font font, Component component, int x, int y, @Nullable Style styleOptional) { - veRenderGuiText(graphics, font, component, x, y, styleOptional, true); + veRenderGuiText(graphics, font, component, x, y, styleOptional, true); } - public static void renderShadowedText(GuiGraphics graphics, Font font, String string, int x, int y, @Nullable Style styleOptional){ + public static void renderShadowedText(GuiGraphics graphics, Font font, String string, int x, int y, @Nullable Style styleOptional) { renderShadowedText(graphics, font, Component.nullToEmpty(string), x, y, styleOptional); } @@ -155,15 +167,15 @@ public static void renderCenteredShadowedText(GuiGraphics graphics, Font font, S } public static void renderUnshadowedText(GuiGraphics graphics, Font font, Component component, int x, int y, @Nullable Style styleOptional) { - veRenderGuiText(graphics, font, component, x, y, styleOptional, false); + veRenderGuiText(graphics, font, component, x, y, styleOptional, false); } - public static void renderUnshadowedText(GuiGraphics graphics, Font font, String string, int x, int y, @Nullable Style styleOptional){ + public static void renderUnshadowedText(GuiGraphics graphics, Font font, String string, int x, int y, @Nullable Style styleOptional) { renderUnshadowedText(graphics, font, Component.nullToEmpty(string), x, y, styleOptional); } public static void renderCenteredUnshadowedText(GuiGraphics graphics, Font font, Component component, int x, int y, @Nullable Style styleOptional) { - renderUnshadowedText(graphics, font, component, x - font.width(component.getVisualOrderText()) / 2, y, styleOptional); + renderUnshadowedText(graphics, font, component, x - font.width(component.getVisualOrderText()) / 2, y, styleOptional); } public static void renderCenteredUnshadowedText(GuiGraphics graphics, Font font, String string, int x, int y, @Nullable Style styleOptional) { diff --git a/src/main/java/com/veteam/voluminousenergy/util/ToolUtil.java b/src/main/java/com/veteam/voluminousenergy/util/ToolUtil.java index ff9d09542..ad62b223c 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/ToolUtil.java +++ b/src/main/java/com/veteam/voluminousenergy/util/ToolUtil.java @@ -8,8 +8,8 @@ import java.util.List; public class ToolUtil { - - public static void SolariumTooltipAppend(ItemStack stack, List tooltip){ + + public static void SolariumTooltipAppend(ItemStack stack, List tooltip) { int bonus = 0; CompoundTag tag = stack.getTag(); @@ -25,5 +25,5 @@ public static void SolariumTooltipAppend(ItemStack stack, List toolti Component textComponent = Component.nullToEmpty(translatedString + ": " + bonus); tooltip.add(textComponent); } - + } diff --git a/src/main/java/com/veteam/voluminousenergy/util/WorldUtil.java b/src/main/java/com/veteam/voluminousenergy/util/WorldUtil.java index 2a3827c3d..393fc259d 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/WorldUtil.java +++ b/src/main/java/com/veteam/voluminousenergy/util/WorldUtil.java @@ -46,7 +46,7 @@ public enum ClimateParameters { TEMPERATURE } - public static HashMap sampleClimate(Level level, BlockPos pos){ + public static HashMap sampleClimate(Level level, BlockPos pos) { if (level.isClientSide) new HashMap<>(); ServerLevel serverLevel = level.getServer().getLevel(level.dimension()); @@ -62,15 +62,15 @@ public static HashMap sampleClimate(Level level, Block double humidity = noiseRouter.vegetation().compute(context); double temperature = noiseRouter.temperature().compute(context); - HashMap climateMap = new HashMap<>(); - climateMap.put(ClimateParameters.CONTINENTALNESS,continentalness); - climateMap.put(ClimateParameters.EROSION,erosion); - climateMap.put(ClimateParameters.HUMIDITY,humidity); - climateMap.put(ClimateParameters.TEMPERATURE,temperature); + HashMap climateMap = new HashMap<>(); + climateMap.put(ClimateParameters.CONTINENTALNESS, continentalness); + climateMap.put(ClimateParameters.EROSION, erosion); + climateMap.put(ClimateParameters.HUMIDITY, humidity); + climateMap.put(ClimateParameters.TEMPERATURE, temperature); return climateMap; } - public static ChunkFluid getFluidFromPosition(Level level,BlockPos pos) { + public static ChunkFluid getFluidFromPosition(Level level, BlockPos pos) { ServerLevel serverLevel = level.getServer().getLevel(level.dimension()); ArrayList> fluidsList = WorldUtil.queryForFluids(level, pos); ChunkAccess chunkAccess = level.getChunk(pos); @@ -81,25 +81,26 @@ public static ChunkFluid getFluidFromPosition(Level level,BlockPos pos) { fluidsList )); - if(!chunkFluids.hasChunkFluid(chunkFluid)) { + if (!chunkFluids.hasChunkFluid(chunkFluid)) { chunkFluids.add(chunkFluid); chunkFluids.setDirty(); DimensionDataStorage storage = serverLevel.getDataStorage(); - storage.set("chunk_fluids",chunkFluids); + storage.set("chunk_fluids", chunkFluids); storage.save(); } return chunkFluid; } - public static ArrayList> queryForFluids(Level level, BlockPos pos){ - AtomicReference>> fluidsAtLocation = new AtomicReference<>(new ArrayList<>()); + public static ArrayList> queryForFluids(Level level, BlockPos pos) { + AtomicReference>> fluidsAtLocation = new AtomicReference<>(new ArrayList<>()); - HashMap sampledClimate = sampleClimate(level, pos); - if (sampledClimate.isEmpty()) return fluidsAtLocation.get(); // Return empty as well; Likely client side if this is the case + HashMap sampledClimate = sampleClimate(level, pos); + if (sampledClimate.isEmpty()) + return fluidsAtLocation.get(); // Return empty as well; Likely client side if this is the case VERecipe.getCachedRecipes(DimensionalLaserRecipe.RECIPE_TYPE).parallelStream().forEach(recipe -> { - if (recipe instanceof DimensionalLaserRecipe dimensionalLaserRecipe){ + if (recipe instanceof DimensionalLaserRecipe dimensionalLaserRecipe) { FluidClimateSpawn spawn = dimensionalLaserRecipe.getFluidClimateSpawn(); - if (spawn.checkValidity(sampledClimate)){ // This might be unsafe, would prefer to avoid atomic as this is read-only + if (spawn.checkValidity(sampledClimate)) { // This might be unsafe, would prefer to avoid atomic as this is read-only fluidsAtLocation.get().add(new Pair<>(spawn.getFluid(), spawn.calculateDepositAmount(sampledClimate, pos, level))); } } @@ -107,17 +108,16 @@ public static ArrayList> queryForFluids(Level level, BlockPo // Add a fluid to the location if no other fluids exist. Can make this if it's only 1 add a pair - if(fluidsAtLocation.get().size() == 0 && level instanceof ServerLevel serverLevel) { + if (fluidsAtLocation.get().size() == 0 && level instanceof ServerLevel serverLevel) { Random random = new Random(randomSeedFromClimate(sampledClimate)); - if(random.nextInt(10) > 4) { + if (random.nextInt(10) > 4) { fluidsAtLocation.get().add(new Pair<>(Fluids.WATER, fallbackFluidAmount(serverLevel, Fluids.WATER, sampledClimate, pos) )); - } - else { + } else { fluidsAtLocation.get().add(new Pair<>(Fluids.LAVA, fallbackFluidAmount(serverLevel, Fluids.LAVA, sampledClimate, pos) @@ -137,7 +137,7 @@ public static int randomSeedFromClimate(HashMap sampledClimate, BlockPos pos) { + private static int fallbackFluidAmount(ServerLevel serverLevel, Fluid fluid, HashMap sampledClimate, BlockPos pos) { PerlinSimplexNoise noise = new PerlinSimplexNoise( new XoroshiroRandomSource(serverLevel.getSeed()), diff --git a/src/main/java/com/veteam/voluminousenergy/util/climate/ClimateSpawn.java b/src/main/java/com/veteam/voluminousenergy/util/climate/ClimateSpawn.java index 96f006252..b7c61248c 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/climate/ClimateSpawn.java +++ b/src/main/java/com/veteam/voluminousenergy/util/climate/ClimateSpawn.java @@ -66,7 +66,7 @@ public boolean checkValidity(HashMap sample public boolean checkValidity(double continentalness, double erosion, double humidity, double temperature) { - if (Config.PUNCH_HOLES_IN_CLIMATE_SPAWNS.get()){ + if (Config.PUNCH_HOLES_IN_CLIMATE_SPAWNS.get()) { double cumulativeClimateValue = continentalness + erosion + humidity + temperature; Random random = new Random((int) (cumulativeClimateValue * Config.CLIMATE_SPAWNS_HOLE_PUNCH_MULTIPLIER.get())); diff --git a/src/main/java/com/veteam/voluminousenergy/util/climate/FluidClimateSpawn.java b/src/main/java/com/veteam/voluminousenergy/util/climate/FluidClimateSpawn.java index a89df9d98..130328706 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/climate/FluidClimateSpawn.java +++ b/src/main/java/com/veteam/voluminousenergy/util/climate/FluidClimateSpawn.java @@ -43,7 +43,7 @@ public int getMinimumFluidAmount() { return this.minAmount; } - public int calculateDepositAmount(HashMap sampledClimate, BlockPos blockPos, Level level) { + public int calculateDepositAmount(HashMap sampledClimate, BlockPos blockPos, Level level) { return this.calculateDepositAmount( sampledClimate.get(WorldUtil.ClimateParameters.CONTINENTALNESS), sampledClimate.get(WorldUtil.ClimateParameters.EROSION), @@ -55,7 +55,7 @@ public int calculateDepositAmount(HashMap sa } // Main number cruncher - public int calculateDepositAmount(double continentalness, double erosion, double humidity, double temperature, BlockPos blockPos, Level level){ + public int calculateDepositAmount(double continentalness, double erosion, double humidity, double temperature, BlockPos blockPos, Level level) { if (!this.checkValidity(continentalness, erosion, humidity, temperature) || level.isClientSide()) return 0; int amount2Return = 0; diff --git a/src/main/java/com/veteam/voluminousenergy/util/randoms/JavaRandomSource.java b/src/main/java/com/veteam/voluminousenergy/util/randoms/JavaRandomSource.java index ba51959a1..2d6dea105 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/randoms/JavaRandomSource.java +++ b/src/main/java/com/veteam/voluminousenergy/util/randoms/JavaRandomSource.java @@ -15,7 +15,7 @@ public class JavaRandomSource implements RandomSource { private final MarsagliaPolarGaussian gaussianSource = new MarsagliaPolarGaussian(this); // WARN: not 128 bit - public JavaRandomSource(long seed){ + public JavaRandomSource(long seed) { this.randomNumberGenerator = new Random(seed); } @@ -73,7 +73,7 @@ public double nextGaussian() { public static class JavaRandomPositionalRandomFactory implements PositionalRandomFactory { private final long seed; - public JavaRandomPositionalRandomFactory(long seed){ + public JavaRandomPositionalRandomFactory(long seed) { this.seed = seed; } diff --git a/src/main/java/com/veteam/voluminousenergy/util/randoms/JavaSecureRandomSource.java b/src/main/java/com/veteam/voluminousenergy/util/randoms/JavaSecureRandomSource.java index 6a521c920..581fc47c4 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/randoms/JavaSecureRandomSource.java +++ b/src/main/java/com/veteam/voluminousenergy/util/randoms/JavaSecureRandomSource.java @@ -17,11 +17,11 @@ public class JavaSecureRandomSource implements RandomSource { private final MarsagliaPolarGaussian gaussianSource = new MarsagliaPolarGaussian(this); // WARN: not 128 bit - public JavaSecureRandomSource(byte[] seed){ + public JavaSecureRandomSource(byte[] seed) { this.randomNumberGenerator = new SecureRandom(seed); } - public JavaSecureRandomSource(long seed){ + public JavaSecureRandomSource(long seed) { this.randomNumberGenerator = new SecureRandom(longToByte(seed)); } @@ -76,7 +76,7 @@ public double nextGaussian() { return this.gaussianSource.nextGaussian(); } - public static byte[] longToByte(long seed){ + public static byte[] longToByte(long seed) { ByteBuffer buffer = ByteBuffer.allocate(Long.BYTES); buffer.putLong(seed); return buffer.array(); @@ -85,7 +85,7 @@ public static byte[] longToByte(long seed){ public static class JavaSecureRandomPositionalRandomFactory implements PositionalRandomFactory { private final long seed; - public JavaSecureRandomPositionalRandomFactory(long seed){ + public JavaSecureRandomPositionalRandomFactory(long seed) { this.seed = seed; } diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidIngredient.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidIngredient.java index edbe48356..5ee95170a 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidIngredient.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/FluidIngredient.java @@ -186,7 +186,7 @@ public static FluidIngredient of(FluidStack... p_43928_) { public static FluidIngredient of(Stream p_43922_) { return fromValues(p_43922_.filter((p_43944_) -> { return !p_43944_.isEmpty(); - }).map(m -> new FluidValue(m,m.getAmount(),m.getFluid()))); + }).map(m -> new FluidValue(m, m.getAmount(), m.getFluid()))); } public static FluidIngredient of(TagKey key, int amount) { @@ -198,7 +198,7 @@ public static FluidIngredient fromNetwork(FriendlyByteBuf byteBuf) { VEFluidIngredientSerializer serializer = VEFluidIngredientSerializer.INSTANCE; if (size == -1) return serializer.parse(byteBuf); FluidStack stack = byteBuf.readFluidStack(); - return fromValues(Stream.generate(() -> new FluidIngredient.FluidValue(stack,stack.getAmount(),stack.getFluid())).limit(size)); + return fromValues(Stream.generate(() -> new FluidIngredient.FluidValue(stack, stack.getAmount(), stack.getFluid())).limit(size)); } public static FluidIngredient fromJson(@Nullable JsonObject json) { @@ -277,10 +277,10 @@ private static Codec codec(boolean p_298496_) { }); } - public record FluidValue(FluidStack stack,int amount,Fluid fluid) implements FluidIngredient.Value { + public record FluidValue(FluidStack stack, int amount, Fluid fluid) implements FluidIngredient.Value { static FluidValue fromAmounts(Fluid fluid, int amount) { - return new FluidValue(new FluidStack(fluid,amount), amount,fluid); + return new FluidValue(new FluidStack(fluid, amount), amount, fluid); } static final Codec CODEC = RecordCodecBuilder.create((p_300421_) -> { @@ -308,11 +308,11 @@ public static FluidIngredient merge(Collection parts) { return fromValues(parts.stream().flatMap(i -> Arrays.stream(i.values))); } - public record TagValue(TagKey tag,int amount) implements FluidIngredient.Value { + public record TagValue(TagKey tag, int amount) implements FluidIngredient.Value { static final Codec CODEC = RecordCodecBuilder.create((p_300241_) -> { return p_300241_.group(TagKey.codec(Registries.FLUID).fieldOf("tag").forGetter((p_301340_) -> { - return p_301340_.tag; - }),ExtraCodecs.strictOptionalField(ExtraCodecs.POSITIVE_INT, "amount", 1).forGetter((amount) -> amount.amount) + return p_301340_.tag; + }), ExtraCodecs.strictOptionalField(ExtraCodecs.POSITIVE_INT, "amount", 1).forGetter((amount) -> amount.amount) ).apply(p_300241_, FluidIngredient.TagValue::new); }); @@ -328,12 +328,12 @@ public Collection getFluids() { List list = Lists.newArrayList(); for (Holder holder : BuiltInRegistries.FLUID.getTagOrEmpty(this.tag)) { - list.add(new FluidStack(holder.value(),this.amount)); + list.add(new FluidStack(holder.value(), this.amount)); } if (list.isEmpty()) { // TODO figure out how we produce errors - list.add(new FluidStack(Fluids.WATER,1)); + list.add(new FluidStack(Fluids.WATER, 1)); } return list; } diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeFluid.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeFluid.java index 17986b67b..8b93b787c 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeFluid.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeFluid.java @@ -33,8 +33,8 @@ public RecipeFluid(Fluid fluid, int amount) { */ public boolean isDifferent(FluidStack fluidStack) { - if(this.fluid == null) { - if(fluidStack == null) return false; + if (this.fluid == null) { + if (fluidStack == null) return false; this.fluid = fluidStack.getFluid(); this.amount = fluidStack.getAmount(); return true; diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeItem.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeItem.java index 158bbcd80..6d1bbfc8c 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeItem.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeItem.java @@ -33,8 +33,8 @@ public RecipeItem(Item fluid, int amount) { */ public boolean isDifferent(ItemStack itemStack) { - if(this.item == null) { - if(itemStack == null) return false; + if (this.item == null) { + if (itemStack == null) return false; this.item = itemStack.getItem(); this.amount = itemStack.getCount(); return true; diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeUtil.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeUtil.java index 4adead9f5..0d8d021c7 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeUtil.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeUtil.java @@ -31,10 +31,10 @@ public class RecipeUtil { - public static ToolingRecipe getToolingRecipeFromBitAndBase(Level world, ItemStack bitStack, ItemStack baseStack){ - if(baseStack.isEmpty() || bitStack.isEmpty()) return null; - for (RecipeHolder recipe : world.getRecipeManager().getRecipes()){ - if(recipe.value() instanceof ToolingRecipe toolingRecipe){ + public static ToolingRecipe getToolingRecipeFromBitAndBase(Level world, ItemStack bitStack, ItemStack baseStack) { + if (baseStack.isEmpty() || bitStack.isEmpty()) return null; + for (RecipeHolder recipe : world.getRecipeManager().getRecipes()) { + if (recipe.value() instanceof ToolingRecipe toolingRecipe) { if (toolingRecipe.getBits().contains(bitStack.getItem()) && toolingRecipe.getBases().contains(baseStack.getItem())) { return toolingRecipe; @@ -44,11 +44,11 @@ public static ToolingRecipe getToolingRecipeFromBitAndBase(Level world, ItemStac return null; } - public static ToolingRecipe getToolingRecipeFromResult(Level world, ItemStack resultStack){ - if(resultStack.isEmpty()) return null; - for (RecipeHolder recipe : world.getRecipeManager().getRecipes()){ - if(recipe.value() instanceof ToolingRecipe toolingRecipe){ - if(toolingRecipe.getResult(0).is(resultStack.getItem())){ + public static ToolingRecipe getToolingRecipeFromResult(Level world, ItemStack resultStack) { + if (resultStack.isEmpty()) return null; + for (RecipeHolder recipe : world.getRecipeManager().getRecipes()) { + if (recipe.value() instanceof ToolingRecipe toolingRecipe) { + if (toolingRecipe.getResult(0).is(resultStack.getItem())) { return toolingRecipe; } } @@ -56,40 +56,42 @@ public static ToolingRecipe getToolingRecipeFromResult(Level world, ItemStack re return null; } - private static final HashMap plankToRecipeMap = new HashMap<>(); + private static final HashMap plankToRecipeMap = new HashMap<>(); + @Nullable - public static ItemStack getPlankFromLogParallel(Level world, ItemStack logStack){ + public static ItemStack getPlankFromLogParallel(Level world, ItemStack logStack) { - if(plankToRecipeMap.isEmpty()) { + if (plankToRecipeMap.isEmpty()) { world.getRecipeManager().getRecipes().parallelStream().forEach(r -> { if (r.value() instanceof CraftingRecipe recipe) { ItemStack result = recipe.getResultItem(world.registryAccess()); - if (RegistryLookups.lookupItem(result).toString().contains("plank")){ + if (RegistryLookups.lookupItem(result).toString().contains("plank")) { recipe.getIngredients().forEach(ingredient -> { - for (ItemStack ingredientItem : ingredient.getItems()){ - plankToRecipeMap.put(ingredientItem.getItem(),result); + for (ItemStack ingredientItem : ingredient.getItems()) { + plankToRecipeMap.put(ingredientItem.getItem(), result); } }); } } }); } - if(!plankToRecipeMap.containsKey(logStack.getItem())) return null; + if (!plankToRecipeMap.containsKey(logStack.getItem())) return null; return plankToRecipeMap.get(logStack.getItem()).copy(); } // Parallel query of global recipes, will this improve performance? - public static ArrayList getLogFromPlankParallel(Level world, ItemStack plankStack){ + public static ArrayList getLogFromPlankParallel(Level world, ItemStack plankStack) { if (plankStack.isEmpty()) return null; AtomicReference> atomicItemStackArray = new AtomicReference<>(new ArrayList()); world.getRecipeManager().getRecipes().parallelStream().forEach(r -> { - if (r.value() instanceof CraftingRecipe recipe){ - if (RegistryLookups.lookupItem(recipe.getResultItem(world.registryAccess())).toString().contains("plank")){ - if (recipe.getResultItem(world.registryAccess()).is(plankStack.getItem())){ + if (r.value() instanceof CraftingRecipe recipe) { + if (RegistryLookups.lookupItem(recipe.getResultItem(world.registryAccess())).toString().contains("plank")) { + if (recipe.getResultItem(world.registryAccess()).is(plankStack.getItem())) { recipe.getIngredients().forEach(ingredient -> { - for(int i = 0; i < ingredient.getItems().length; i++) atomicItemStackArray.get().add(ingredient.getItems()[i]); + for (int i = 0; i < ingredient.getItems().length; i++) + atomicItemStackArray.get().add(ingredient.getItems()[i]); }); } } @@ -99,14 +101,14 @@ public static ArrayList getLogFromPlankParallel(Level world, ItemStac return atomicItemStackArray.get(); } - public static VEFluidSawmillRecipe getSawmillingRecipeFromLog(Level world, ItemStack logStack){ // Parallel by default + public static VEFluidSawmillRecipe getSawmillingRecipeFromLog(Level world, ItemStack logStack) { // Parallel by default if (logStack.isEmpty()) return null; AtomicReference atomicRecipe = new AtomicReference<>(null); world.getRecipeManager().getRecipes().parallelStream().forEach(recipe -> { - if(recipe.value() instanceof VEFluidSawmillRecipe VEFluidSawmillRecipe){ - if (!VEFluidSawmillRecipe.isLogRecipe()){ - for (ItemStack ingredientStack : VEFluidSawmillRecipe.getIngredient(0).getItems()){ - if (ingredientStack.getItem().equals(logStack.getItem())){ + if (recipe.value() instanceof VEFluidSawmillRecipe VEFluidSawmillRecipe) { + if (!VEFluidSawmillRecipe.isLogRecipe()) { + for (ItemStack ingredientStack : VEFluidSawmillRecipe.getIngredient(0).getItems()) { + if (ingredientStack.getItem().equals(logStack.getItem())) { atomicRecipe.set(VEFluidSawmillRecipe); break; } @@ -118,14 +120,14 @@ public static VEFluidSawmillRecipe getSawmillingRecipeFromLog(Level world, ItemS return atomicRecipe.get(); } - public static VEFluidSawmillRecipe getSawmillingRecipeFromPlank(Level world, ItemStack plankStack){ // Parallel by default + public static VEFluidSawmillRecipe getSawmillingRecipeFromPlank(Level world, ItemStack plankStack) { // Parallel by default if (plankStack.isEmpty()) return null; AtomicReference atomicRecipe = new AtomicReference<>(null); world.getRecipeManager().getRecipes().parallelStream().forEach(recipe -> { - if (recipe.value() instanceof VEFluidSawmillRecipe VEFluidSawmillRecipe){ - if (!VEFluidSawmillRecipe.isLogRecipe()){ - if (VEFluidSawmillRecipe.getResult(0).getItem().equals(plankStack.getItem())){ + if (recipe.value() instanceof VEFluidSawmillRecipe VEFluidSawmillRecipe) { + if (!VEFluidSawmillRecipe.isLogRecipe()) { + if (VEFluidSawmillRecipe.getResult(0).getItem().equals(plankStack.getItem())) { atomicRecipe.set(VEFluidSawmillRecipe); } } @@ -135,15 +137,15 @@ public static VEFluidSawmillRecipe getSawmillingRecipeFromPlank(Level world, Ite return atomicRecipe.get(); } - public static VEFluidSawmillRecipe getSawmillingRecipeFromSecondOutput(Level level, ItemStack itemStack){ + public static VEFluidSawmillRecipe getSawmillingRecipeFromSecondOutput(Level level, ItemStack itemStack) { if (itemStack.isEmpty()) return null; AtomicReference atomicRecipe = new AtomicReference<>(null); level.getRecipeManager().getRecipes().parallelStream().forEach(recipe -> { - if (recipe.value() instanceof VEFluidSawmillRecipe VEFluidSawmillRecipe){ - if (!VEFluidSawmillRecipe.isLogRecipe()){ + if (recipe.value() instanceof VEFluidSawmillRecipe VEFluidSawmillRecipe) { + if (!VEFluidSawmillRecipe.isLogRecipe()) { Item item = VEFluidSawmillRecipe.getResult(0).getItem(); - if (itemStack.getItem().equals(item)){ + if (itemStack.getItem().equals(item)) { atomicRecipe.set(VEFluidSawmillRecipe); } } @@ -151,26 +153,28 @@ public static VEFluidSawmillRecipe getSawmillingRecipeFromSecondOutput(Level lev }); return atomicRecipe.get(); } - private static final HashMap stirlingGeneratorRecipeMap = new HashMap<>(); - public static StirlingGeneratorRecipe getStirlingGeneratorRecipe(Level world, ItemStack solidFuelStack){ // Parallel by default + + private static final HashMap stirlingGeneratorRecipeMap = new HashMap<>(); + + public static StirlingGeneratorRecipe getStirlingGeneratorRecipe(Level world, ItemStack solidFuelStack) { // Parallel by default if (solidFuelStack.isEmpty()) return null; world.getRecipeManager().getRecipes().parallelStream().forEach(recipe -> { - if (recipe.value() instanceof StirlingGeneratorRecipe stirlingGeneratorRecipe){ + if (recipe.value() instanceof StirlingGeneratorRecipe stirlingGeneratorRecipe) { for (ItemStack itemStack : stirlingGeneratorRecipe.getIngredient(0).getItems()) { - if(RegistryLookups.lookupItem(itemStack.getItem()) == null) continue; - stirlingGeneratorRecipeMap.put(RegistryLookups.lookupItem(itemStack.getItem()).hashCode(),stirlingGeneratorRecipe); + if (RegistryLookups.lookupItem(itemStack.getItem()) == null) continue; + stirlingGeneratorRecipeMap.put(RegistryLookups.lookupItem(itemStack.getItem()).hashCode(), stirlingGeneratorRecipe); } } }); - if(RegistryLookups.lookupItem(solidFuelStack.getItem()) == null) return null; + if (RegistryLookups.lookupItem(solidFuelStack.getItem()) == null) return null; return stirlingGeneratorRecipeMap.get(RegistryLookups.lookupItem(solidFuelStack.getItem()).hashCode()); } - public static Lazy> createLazyAnthology(Lazy>... toAnthologize){ + public static Lazy> createLazyAnthology(Lazy>... toAnthologize) { return Lazy.of(() -> { ArrayList anthology = new ArrayList<>(); - for (Lazy> items : toAnthologize){ + for (Lazy> items : toAnthologize) { anthology.addAll(items.get()); } return anthology; @@ -178,10 +182,11 @@ public static Lazy> createLazyAnthology(Lazy>... } private static ArrayList cachedCrusherRecipes = new ArrayList<>(); - public static ArrayList getCrusherRecipes(Level level){ - if (cachedCrusherRecipes.isEmpty()){ - for (RecipeHolder recipe : level.getRecipeManager().getRecipes()){ - if (recipe.value() instanceof CrusherRecipe crusherRecipe){ + + public static ArrayList getCrusherRecipes(Level level) { + if (cachedCrusherRecipes.isEmpty()) { + for (RecipeHolder recipe : level.getRecipeManager().getRecipes()) { + if (recipe.value() instanceof CrusherRecipe crusherRecipe) { cachedCrusherRecipes.add(crusherRecipe); } } @@ -190,30 +195,31 @@ public static ArrayList getCrusherRecipes(Level level){ return cachedCrusherRecipes; } - private static final HashMap CrusherIORecipeCache = new HashMap<>(); - public static Optional getCrusherRecipeFromAnyOutputAndTryInput(Item output, Item potentiallyKnownInput, Level level){ + private static final HashMap CrusherIORecipeCache = new HashMap<>(); + + public static Optional getCrusherRecipeFromAnyOutputAndTryInput(Item output, Item potentiallyKnownInput, Level level) { int itemPairHash = new Pair<>(output, potentiallyKnownInput).hashCode(); - if (CrusherIORecipeCache.containsKey(itemPairHash)){ + if (CrusherIORecipeCache.containsKey(itemPairHash)) { return Optional.of(CrusherIORecipeCache.get(itemPairHash)); } AtomicReference> atomicSublist = new AtomicReference<>(new ArrayList<>()); getCrusherRecipes(level).forEach(recipe -> { - if (recipe.getResult(0).is(output) || recipe.getResult(1).is(output)){ + if (recipe.getResult(0).is(output) || recipe.getResult(1).is(output)) { atomicSublist.get().add(recipe); } }); // This is for more accurate recipe finding; if multiple recipes have same output, but different inputs, knowing the input we can select the correct one - if (potentiallyKnownInput != null && potentiallyKnownInput != Items.AIR && !atomicSublist.get().isEmpty()){ - for (CrusherRecipe crusherRecipe : atomicSublist.get()){ // This feeds off of the sublist; Therefore this is ONLY Crusher Recipes with this output + if (potentiallyKnownInput != null && potentiallyKnownInput != Items.AIR && !atomicSublist.get().isEmpty()) { + for (CrusherRecipe crusherRecipe : atomicSublist.get()) { // This feeds off of the sublist; Therefore this is ONLY Crusher Recipes with this output if (crusherRecipe == null) continue; - for (ItemStack ingredientStack : crusherRecipe.getIngredient(0).getItems()){ + for (ItemStack ingredientStack : crusherRecipe.getIngredient(0).getItems()) { if (ingredientStack.getItem() == potentiallyKnownInput) { CrusherIORecipeCache.put(itemPairHash, crusherRecipe); - return Optional.of(crusherRecipe); + return Optional.of(crusherRecipe); } } @@ -228,47 +234,47 @@ public static Optional getCrusherRecipeFromAnyOutputAndTryInput(I } public static FluidStack pullFluidFromJSON(String id, JsonObject json) { - ResourceLocation bucketResourceLocation = ResourceLocation.of(GsonHelper.getAsString(json.get(id).getAsJsonObject(),"fluid","minecraft:empty"),':'); - int firstAmount = GsonHelper.getAsInt(json.get(id).getAsJsonObject(),"amount",0); - return new FluidStack(Objects.requireNonNull(ForgeRegistries.FLUIDS.getValue(bucketResourceLocation)),firstAmount); + ResourceLocation bucketResourceLocation = ResourceLocation.of(GsonHelper.getAsString(json.get(id).getAsJsonObject(), "fluid", "minecraft:empty"), ':'); + int firstAmount = GsonHelper.getAsInt(json.get(id).getAsJsonObject(), "amount", 0); + return new FluidStack(Objects.requireNonNull(ForgeRegistries.FLUIDS.getValue(bucketResourceLocation)), firstAmount); } public static ItemStack pullItemFromJSON(String id, JsonObject json) { - ResourceLocation itemResourceLocation = ResourceLocation.of(GsonHelper.getAsString(json.get(id).getAsJsonObject(),"item","minecraft:empty"),':'); - int count = GsonHelper.getAsInt(json.get(id).getAsJsonObject(),"amount",1); + ResourceLocation itemResourceLocation = ResourceLocation.of(GsonHelper.getAsString(json.get(id).getAsJsonObject(), "item", "minecraft:empty"), ':'); + int count = GsonHelper.getAsInt(json.get(id).getAsJsonObject(), "amount", 1); - return new ItemStack(ForgeRegistries.ITEMS.getValue(itemResourceLocation),count); + return new ItemStack(ForgeRegistries.ITEMS.getValue(itemResourceLocation), count); } public static Ingredient modifyIngredientAmounts(Ingredient ingredient, int amounts) { - for(ItemStack stack : ingredient.getItems()) { + for (ItemStack stack : ingredient.getItems()) { stack.setCount(amounts); } return ingredient; } - public static Ingredient pullUnknownItemFromJSON(JsonObject object,int count) { + public static Ingredient pullUnknownItemFromJSON(JsonObject object, int count) { ResourceLocation location; boolean isTag = false; - if(object.has("tag")){ - location = ResourceLocation.of(GsonHelper.getAsString(object,"tag","minecraft:air"),':'); + if (object.has("tag")) { + location = ResourceLocation.of(GsonHelper.getAsString(object, "tag", "minecraft:air"), ':'); isTag = true; - } else if(object.has("item")){ - location = ResourceLocation.of(GsonHelper.getAsString(object,"item","minecraft:air"),':'); + } else if (object.has("item")) { + location = ResourceLocation.of(GsonHelper.getAsString(object, "item", "minecraft:air"), ':'); } else { throw new JsonSyntaxException("Bad recipe syntax!"); } - if(!isTag) { + if (!isTag) { Item item = ForgeRegistries.ITEMS.getValue(location); - if(item == null) { + if (item == null) { throw new IllegalStateException("Fluid does not exist for a recipe!"); } - return Ingredient.of(new ItemStack(item,count)); + return Ingredient.of(new ItemStack(item, count)); } TagKey tag = TagKey.create(ForgeRegistries.ITEMS.getRegistryKey(), location); - return RecipeUtil.modifyIngredientAmounts(Ingredient.of(tag),count); + return RecipeUtil.modifyIngredientAmounts(Ingredient.of(tag), count); } } diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/VEFluidIngredientSerializer.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/VEFluidIngredientSerializer.java index e7acf607d..25895b552 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/VEFluidIngredientSerializer.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/VEFluidIngredientSerializer.java @@ -5,18 +5,15 @@ import java.util.stream.Stream; -public class VEFluidIngredientSerializer -{ - public static final VEFluidIngredientSerializer INSTANCE = new VEFluidIngredientSerializer(); +public class VEFluidIngredientSerializer { + public static final VEFluidIngredientSerializer INSTANCE = new VEFluidIngredientSerializer(); - public FluidIngredient parse(FriendlyByteBuf buffer) - { + public FluidIngredient parse(FriendlyByteBuf buffer) { FluidStack stack = buffer.readFluidStack(); - return FluidIngredient.fromValues(Stream.generate(() -> new FluidIngredient.FluidValue(buffer.readFluidStack(),stack.getAmount(),stack.getFluid())).limit(buffer.readVarInt())); + return FluidIngredient.fromValues(Stream.generate(() -> new FluidIngredient.FluidValue(buffer.readFluidStack(), stack.getAmount(), stack.getFluid())).limit(buffer.readVarInt())); } - public void write(FriendlyByteBuf buffer, FluidIngredient ingredient) - { + public void write(FriendlyByteBuf buffer, FluidIngredient ingredient) { FluidStack[] fluids = ingredient.getFluids(); buffer.writeVarInt(fluids.length); diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/VEOutputItem.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/VEOutputItem.java index c41d05abc..a5f91da68 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/VEOutputItem.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/VEOutputItem.java @@ -6,7 +6,7 @@ public record VEOutputItem(Item item, int amount, float rng) { public ItemStack getAsItemStack() { - return new ItemStack(item,amount); + return new ItemStack(item, amount); } } diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/VERecipeCodecs.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/VERecipeCodecs.java index 0c76d6b17..ebb2d925d 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/VERecipeCodecs.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/VERecipeCodecs.java @@ -68,7 +68,9 @@ public Ingredient getIngredient() { } public static final Codec VE_OUTPUT_ITEM_CODEC = RecordCodecBuilder.create((instance) -> { - return instance.group(ITEM_NONAIR_CODEC.fieldOf("item").forGetter(ItemStack::getItem), ExtraCodecs.strictOptionalField(Codec.INT, "amount", 1).forGetter(ItemStack::getCount)).apply(instance, ItemStack::new); + return instance.group(ITEM_NONAIR_CODEC.fieldOf("item").forGetter(ItemStack::getItem), + ExtraCodecs.strictOptionalField(Codec.INT, "count", 1) + .forGetter(ItemStack::getCount)).apply(instance, ItemStack::new); }); public static final Codec VE_CHANCED_OUTPUT_ITEM_CODEC = RecordCodecBuilder.create((instance) -> instance.group( @@ -124,24 +126,27 @@ public Ingredient getIngredient() { public static final Codec VE_CLIMATE_CODEC = RecordCodecBuilder.create((instance) -> { return instance.group( - ExtraCodecs.strictOptionalField(VE_MIN_MAX_CODEC, "continentalness", new FloatPair(0,0)) + ExtraCodecs.strictOptionalField(VE_MIN_MAX_CODEC, "continentalness", new FloatPair(0, 0)) .forGetter(ClimateData::continentalness), - ExtraCodecs.strictOptionalField(VE_MIN_MAX_CODEC, "erosion", new FloatPair(0,0)) + ExtraCodecs.strictOptionalField(VE_MIN_MAX_CODEC, "erosion", new FloatPair(0, 0)) .forGetter(ClimateData::continentalness), - ExtraCodecs.strictOptionalField(VE_MIN_MAX_CODEC, "humidity", new FloatPair(0,0)) + ExtraCodecs.strictOptionalField(VE_MIN_MAX_CODEC, "humidity", new FloatPair(0, 0)) .forGetter(ClimateData::continentalness), - ExtraCodecs.strictOptionalField(VE_MIN_MAX_CODEC, "temperature", new FloatPair(0,0)) + ExtraCodecs.strictOptionalField(VE_MIN_MAX_CODEC, "temperature", new FloatPair(0, 0)) .forGetter(ClimateData::continentalness) - ).apply(instance, ClimateData::new); + ).apply(instance, ClimateData::new); }); - public record FloatPair(float min, float max) {} + public record FloatPair(float min, float max) { + } - public record IntPair(int min, int max) {} + public record IntPair(int min, int max) { + } - public record ClimateData(FloatPair continentalness,FloatPair erosion, FloatPair humidity, FloatPair temperature ) {} + public record ClimateData(FloatPair continentalness, FloatPair erosion, FloatPair humidity, FloatPair temperature) { + } - public record FluidMinMax(Fluid fluid,int min,int max) { + public record FluidMinMax(Fluid fluid, int min, int max) { } diff --git a/src/main/java/com/veteam/voluminousenergy/world/feature/GeyserFeature.java b/src/main/java/com/veteam/voluminousenergy/world/feature/GeyserFeature.java index ade02e032..e97349a4b 100644 --- a/src/main/java/com/veteam/voluminousenergy/world/feature/GeyserFeature.java +++ b/src/main/java/com/veteam/voluminousenergy/world/feature/GeyserFeature.java @@ -23,10 +23,10 @@ public GeyserFeature(Codec geyserConfiguration) { } public final ArrayList allowList = new ArrayList<>(Arrays.asList( - Blocks.SNOW,Blocks.ICE,Blocks.PACKED_ICE,Blocks.SANDSTONE,Blocks.SAND,Blocks.RED_SAND,Blocks.GRAVEL, - Blocks.WATER,Blocks.LAVA,Blocks.CLAY,Blocks.MOSS_BLOCK,Blocks.MOSS_CARPET,Blocks.FLOWERING_AZALEA, - Blocks.AZALEA,Blocks.GRASS_BLOCK,Blocks.SHORT_GRASS,Blocks.TALL_GRASS,Blocks.BIG_DRIPLEAF,Blocks.BIG_DRIPLEAF_STEM, - Blocks.SMALL_DRIPLEAF,Blocks.CAVE_VINES,Blocks.CAVE_VINES_PLANT,Blocks.SCULK,Blocks.SCULK_VEIN, + Blocks.SNOW, Blocks.ICE, Blocks.PACKED_ICE, Blocks.SANDSTONE, Blocks.SAND, Blocks.RED_SAND, Blocks.GRAVEL, + Blocks.WATER, Blocks.LAVA, Blocks.CLAY, Blocks.MOSS_BLOCK, Blocks.MOSS_CARPET, Blocks.FLOWERING_AZALEA, + Blocks.AZALEA, Blocks.GRASS_BLOCK, Blocks.SHORT_GRASS, Blocks.TALL_GRASS, Blocks.BIG_DRIPLEAF, Blocks.BIG_DRIPLEAF_STEM, + Blocks.SMALL_DRIPLEAF, Blocks.CAVE_VINES, Blocks.CAVE_VINES_PLANT, Blocks.SCULK, Blocks.SCULK_VEIN, Blocks.SCULK_CATALYST )); @@ -39,14 +39,14 @@ public boolean place(FeaturePlaceContext context) { ///int base = worldIn.getChunk(pos).getTopFilledSegment(); int base = 40; - if (base - 25 > pos.getY()){ + if (base - 25 > pos.getY()) { return false; } else if (base < pos.getY()) { return false; } - for(int i = -2; i <= 2; ++i) { - for(int j = -2; j <= 2; ++j) { + for (int i = -2; i <= 2; ++i) { + for (int j = -2; j <= 2; ++j) { if (worldIn.isEmptyBlock(pos.offset(i, -1, j)) && worldIn.isEmptyBlock(pos.offset(i, -2, j))) { return false; } @@ -54,7 +54,7 @@ public boolean place(FeaturePlaceContext context) { } // Setup Geyser top - while(worldIn.isEmptyBlock(pos) && pos.getY() > 2) { + while (worldIn.isEmptyBlock(pos) && pos.getY() > 2) { pos = pos.below(); } @@ -67,15 +67,15 @@ public boolean place(FeaturePlaceContext context) { } // Actual main Geyser Generation - for(int k = 0; k < height; ++k) { - float f = (1.0F - (float)k / (float)height) * (float)thickness; + for (int k = 0; k < height; ++k) { + float f = (1.0F - (float) k / (float) height) * (float) thickness; int l = Mth.ceil(f); - for(int i1 = -l; i1 <= l; ++i1) { - float f1 = (float)Mth.abs(i1) - 0.25F; + for (int i1 = -l; i1 <= l; ++i1) { + float f1 = (float) Mth.abs(i1) - 0.25F; - for(int j1 = -l; j1 <= l; ++j1) { - float f2 = (float)Mth.abs(j1) - 0.25F; + for (int j1 = -l; j1 <= l; ++j1) { + float f2 = (float) Mth.abs(j1) - 0.25F; if ((i1 == 0 && j1 == 0 || !(f1 * f1 + f2 * f2 > f * f)) && (i1 != -l && i1 != l && j1 != -l && j1 != l || !(rand.nextFloat() > 0.75F))) { BlockState blockstate = worldIn.getBlockState(pos.offset(i1, k, j1)); Block block = blockstate.getBlock(); @@ -87,7 +87,7 @@ public boolean place(FeaturePlaceContext context) { if (k != 0 && l > 1) { blockstate = worldIn.getBlockState(pos.offset(i1, -k, j1)); block = blockstate.getBlock(); - if (blockstate.isAir() || isDirt(blockstate) || isStone(blockstate) || allowList.contains(block) ) { + if (blockstate.isAir() || isDirt(blockstate) || isStone(blockstate) || allowList.contains(block)) { this.setBlock(worldIn, pos.offset(i1, -k, j1), fluidState.createLegacyBlock()); worldIn.scheduleTick(pos.offset(i1, -k, j1), fluidState.getType(), 0); } @@ -98,7 +98,7 @@ public boolean place(FeaturePlaceContext context) { } // Set up Geyser bottom generation - while(worldIn.isEmptyBlock(pos) && pos.getY() > 2) { + while (worldIn.isEmptyBlock(pos) && pos.getY() > 2) { pos = pos.below(); } @@ -107,15 +107,15 @@ public boolean place(FeaturePlaceContext context) { int thickness1 = 20; // Thickness // Actual Geyser Bottom Generation - for(int y = pos.getY(); y > 0; --y) { - float fy = (1.0F - (float)y / (float)height1) * (float)thickness1; + for (int y = pos.getY(); y > 0; --y) { + float fy = (1.0F - (float) y / (float) height1) * (float) thickness1; int l = Mth.ceil(fy); - for(int x = -l; x <= l; ++x) { - float fx = (float)Mth.abs(x) - 0.25F; + for (int x = -l; x <= l; ++x) { + float fx = (float) Mth.abs(x) - 0.25F; - for(int z = -l; z <= l; ++z) { - float fz = (float)Mth.abs(z) - 0.25F; + for (int z = -l; z <= l; ++z) { + float fz = (float) Mth.abs(z) - 0.25F; if ((x == 0 && z == 0 || !(fx * fx + fz * fz > fy * fy)) && (x != -l && x != l && z != -l && z != l || !(rand.nextFloat() > 0.75F))) { BlockState blockstate = worldIn.getBlockState(pos.offset(x, y, z)); Block block = blockstate.getBlock(); @@ -127,7 +127,7 @@ public boolean place(FeaturePlaceContext context) { if (y != 0 && l > 1) { blockstate = worldIn.getBlockState(pos.offset(x, -y, z)); block = blockstate.getBlock(); - if (blockstate.isAir() || isDirt(blockstate) || isStone(blockstate) || allowList.contains(block) ) { + if (blockstate.isAir() || isDirt(blockstate) || isStone(blockstate) || allowList.contains(block)) { this.setBlock(worldIn, pos.offset(x, -y, z), fluidState.createLegacyBlock()); worldIn.scheduleTick(pos.offset(x, -y, z), fluidState.getType(), 0); } diff --git a/src/main/java/com/veteam/voluminousenergy/world/feature/RiceFeature.java b/src/main/java/com/veteam/voluminousenergy/world/feature/RiceFeature.java index fcea2a2eb..e2d55d63a 100644 --- a/src/main/java/com/veteam/voluminousenergy/world/feature/RiceFeature.java +++ b/src/main/java/com/veteam/voluminousenergy/world/feature/RiceFeature.java @@ -10,7 +10,7 @@ import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.configurations.BlockStateConfiguration; -public class RiceFeature extends Feature { +public class RiceFeature extends Feature { public static RiceFeature INSTANCE = new RiceFeature(BlockStateConfiguration.CODEC); public RiceFeature(Codec codec) { @@ -22,9 +22,9 @@ public boolean place(FeaturePlaceContext context) { BlockPos pos = context.origin(); WorldGenLevel worldIn = context.level(); - if(!worldIn.canSeeSky(pos)) return false; + if (!worldIn.canSeeSky(pos)) return false; - if (worldIn.isWaterAt(pos.below()) && worldIn.getBlockState(pos).isAir()){ + if (worldIn.isWaterAt(pos.below()) && worldIn.getBlockState(pos).isAir()) { generateRice(worldIn, pos); return true; } @@ -32,7 +32,7 @@ public boolean place(FeaturePlaceContext context) { return false; } - public void generateRice(WorldGenLevel worldIn, BlockPos pos){ + public void generateRice(WorldGenLevel worldIn, BlockPos pos) { worldIn.setBlock(pos, VEBlocks.RICE_CROP.get().defaultBlockState(), 2); worldIn.setBlock( diff --git a/src/main/java/com/veteam/voluminousenergy/world/feature/SurfaceMattersLakesFeature.java b/src/main/java/com/veteam/voluminousenergy/world/feature/SurfaceMattersLakesFeature.java index 03e4c24af..c82494614 100644 --- a/src/main/java/com/veteam/voluminousenergy/world/feature/SurfaceMattersLakesFeature.java +++ b/src/main/java/com/veteam/voluminousenergy/world/feature/SurfaceMattersLakesFeature.java @@ -29,6 +29,6 @@ public boolean place(FeaturePlaceContext context) // TODO: Redo this underground evaluation //return !this.isForSurface && super.place(worldIn, generator, rand, new BlockPos(pos.getX(), rand.nextInt(48 + 32) - 32, pos.getZ()), conf); // Should place between -32 and 48 - return !this.isForSurface && super.place(worldIn, generator, rand, new BlockPos(pos.getX(), (int)(rand.nextInt(48 + 32) - 32), pos.getZ()), fluidState); + return !this.isForSurface && super.place(worldIn, generator, rand, new BlockPos(pos.getX(), (int) (rand.nextInt(48 + 32) - 32), pos.getZ()), fluidState); } } diff --git a/src/main/java/com/veteam/voluminousenergy/world/feature/VEFeatures.java b/src/main/java/com/veteam/voluminousenergy/world/feature/VEFeatures.java index cbd008763..15f4a78d3 100644 --- a/src/main/java/com/veteam/voluminousenergy/world/feature/VEFeatures.java +++ b/src/main/java/com/veteam/voluminousenergy/world/feature/VEFeatures.java @@ -12,7 +12,9 @@ public class VEFeatures { // TODO: Investigate `BlockTags.FEATURES_CANNOT_REPLAC public static final DeferredRegister> VE_FEATURE_REGISTRY = DeferredRegister.create(ForgeRegistries.FEATURES, VoluminousEnergy.MODID); // public static final DeferredRegister VE_PLACED_FEATURES = DeferredRegister.create(Registry.PLACED_FEATURE_REGISTRY, VoluminousEnergy.MODID); - /** REG OBJECTS **/ + /** + * REG OBJECTS + **/ // "High Level" Features public static RegistryObject VE_BSC_LAKE_FEATURE = VE_FEATURE_REGISTRY.register("ve_bsc_lake_feature", () -> new VELakesFeature(VELakesFeature.Configuration.CODEC)); // Lake using BlockStateConfiguration. AKA How MC used to do lakes diff --git a/src/main/java/com/veteam/voluminousenergy/world/feature/VELakesFeature.java b/src/main/java/com/veteam/voluminousenergy/world/feature/VELakesFeature.java index 8dc299c55..65b73f074 100644 --- a/src/main/java/com/veteam/voluminousenergy/world/feature/VELakesFeature.java +++ b/src/main/java/com/veteam/voluminousenergy/world/feature/VELakesFeature.java @@ -30,7 +30,7 @@ public boolean place(FeaturePlaceContext context) } protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomSource rand, BlockPos pos, FluidState fluidState) { - while(pos.getY() > 5 && worldIn.isEmptyBlock(pos)) { + while (pos.getY() > 5 && worldIn.isEmptyBlock(pos)) { pos = pos.below(); } @@ -42,7 +42,7 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS boolean[] aboolean = new boolean[2048]; int i = rand.nextInt(4) + 4; - for(int j = 0; j < i; ++j) { + for (int j = 0; j < i; ++j) { double d0 = rand.nextDouble() * 6.0D + 3.0D; double d1 = rand.nextDouble() * 4.0D + 2.0D; double d2 = rand.nextDouble() * 6.0D + 3.0D; @@ -50,12 +50,12 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS double d4 = rand.nextDouble() * (8.0D - d1 - 4.0D) + 2.0D + d1 / 2.0D; double d5 = rand.nextDouble() * (16.0D - d2 - 2.0D) + 1.0D + d2 / 2.0D; - for(int l = 1; l < 15; ++l) { - for(int i1 = 1; i1 < 15; ++i1) { - for(int j1 = 1; j1 < 7; ++j1) { - double d6 = ((double)l - d3) / (d0 / 2.0D); - double d7 = ((double)j1 - d4) / (d1 / 2.0D); - double d8 = ((double)i1 - d5) / (d2 / 2.0D); + for (int l = 1; l < 15; ++l) { + for (int i1 = 1; i1 < 15; ++i1) { + for (int j1 = 1; j1 < 7; ++j1) { + double d6 = ((double) l - d3) / (d0 / 2.0D); + double d7 = ((double) j1 - d4) / (d1 / 2.0D); + double d8 = ((double) i1 - d5) / (d2 / 2.0D); double d9 = d6 * d6 + d7 * d7 + d8 * d8; if (d9 < 1.0D) { aboolean[(l * 16 + i1) * 8 + j1] = true; @@ -65,9 +65,9 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS } } - for(int k1 = 0; k1 < 16; ++k1) { - for(int l2 = 0; l2 < 16; ++l2) { - for(int k = 0; k < 8; ++k) { + for (int k1 = 0; k1 < 16; ++k1) { + for (int l2 = 0; l2 < 16; ++l2) { + for (int k = 0; k < 8; ++k) { boolean flag = !aboolean[(k1 * 16 + l2) * 8 + k] && (k1 < 15 && aboolean[((k1 + 1) * 16 + l2) * 8 + k] || k1 > 0 && aboolean[((k1 - 1) * 16 + l2) * 8 + k] || l2 < 15 && aboolean[(k1 * 16 + l2 + 1) * 8 + k] || l2 > 0 && aboolean[(k1 * 16 + (l2 - 1)) * 8 + k] || k < 7 && aboolean[(k1 * 16 + l2) * 8 + k + 1] || k > 0 && aboolean[(k1 * 16 + l2) * 8 + (k - 1)]); if (flag) { BlockState material = worldIn.getBlockState(pos.offset(k1, k, l2)); @@ -83,9 +83,9 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS } } - for(int l1 = 0; l1 < 16; ++l1) { - for(int i3 = 0; i3 < 16; ++i3) { - for(int i4 = 0; i4 < 8; ++i4) { + for (int l1 = 0; l1 < 16; ++l1) { + for (int i3 = 0; i3 < 16; ++i3) { + for (int i4 = 0; i4 < 8; ++i4) { if (aboolean[(l1 * 16 + i3) * 8 + i4]) { worldIn.setBlock(pos.offset(l1, i4, i3), i4 >= 4 ? AIR : fluidState.createLegacyBlock(), 2); } @@ -93,9 +93,9 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS } } - for(int i2 = 0; i2 < 16; ++i2) { - for(int j3 = 0; j3 < 16; ++j3) { - for(int j4 = 4; j4 < 8; ++j4) { + for (int i2 = 0; i2 < 16; ++i2) { + for (int j3 = 0; j3 < 16; ++j3) { + for (int j4 = 4; j4 < 8; ++j4) { if (aboolean[(i2 * 16 + j3) * 8 + j4]) { BlockPos blockpos = pos.offset(i2, j4 - 1, j3); if (isDirt(worldIn.getBlockState(blockpos)) && worldIn.getBrightness(LightLayer.SKY, pos.offset(i2, j4, j3)) > 0) { @@ -112,9 +112,9 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS } // Adds stone around the perimeter - for(int j2 = 0; j2 < 16; ++j2) { - for(int k3 = 0; k3 < 16; ++k3) { - for(int k4 = 0; k4 < 8; ++k4) { + for (int j2 = 0; j2 < 16; ++j2) { + for (int k3 = 0; k3 < 16; ++k3) { + for (int k4 = 0; k4 < 8; ++k4) { boolean flag1 = !aboolean[(j2 * 16 + k3) * 8 + k4] && (j2 < 15 && aboolean[((j2 + 1) * 16 + k3) * 8 + k4] || j2 > 0 && aboolean[((j2 - 1) * 16 + k3) * 8 + k4] || k3 < 15 && aboolean[(j2 * 16 + k3 + 1) * 8 + k4] || k3 > 0 && aboolean[(j2 * 16 + (k3 - 1)) * 8 + k4] || k4 < 7 && aboolean[(j2 * 16 + k3) * 8 + k4 + 1] || k4 > 0 && aboolean[(j2 * 16 + k3) * 8 + (k4 - 1)]); if (flag1 && (k4 < 4 || rand.nextInt(2) != 0) && worldIn.getBlockState(pos.offset(j2, k4, k3)).isSolid()) { worldIn.setBlock(pos.offset(j2, k4, k3), Blocks.STONE.defaultBlockState(), 2); diff --git a/src/main/java/com/veteam/voluminousenergy/world/feature/VEOreDepositFeature.java b/src/main/java/com/veteam/voluminousenergy/world/feature/VEOreDepositFeature.java index ed816410f..3fb22641b 100644 --- a/src/main/java/com/veteam/voluminousenergy/world/feature/VEOreDepositFeature.java +++ b/src/main/java/com/veteam/voluminousenergy/world/feature/VEOreDepositFeature.java @@ -20,7 +20,7 @@ public class VEOreDepositFeature extends Feature { - public VEOreDepositFeature(Codec codec){ + public VEOreDepositFeature(Codec codec) { super(codec); } @@ -42,7 +42,7 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS boolean[] aboolean = new boolean[2048]; int i = rand.nextInt(4) + 4; - for(int j = 0; j < i; ++j) { + for (int j = 0; j < i; ++j) { double d0 = rand.nextDouble() * 6.0D + 3.0D; double d1 = rand.nextDouble() * 4.0D + 2.0D; double d2 = rand.nextDouble() * 6.0D + 3.0D; @@ -50,12 +50,12 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS double d4 = rand.nextDouble() * (8.0D - d1 - 4.0D) + 2.0D + d1 / 2.0D; double d5 = rand.nextDouble() * (16.0D - d2 - 2.0D) + 1.0D + d2 / 2.0D; - for(int l = 1; l < 15; ++l) { - for(int i1 = 1; i1 < 15; ++i1) { - for(int j1 = 1; j1 < 7; ++j1) { - double d6 = ((double)l - d3) / (d0 / 2.0D); - double d7 = ((double)j1 - d4) / (d1 / 2.0D); - double d8 = ((double)i1 - d5) / (d2 / 2.0D); + for (int l = 1; l < 15; ++l) { + for (int i1 = 1; i1 < 15; ++i1) { + for (int j1 = 1; j1 < 7; ++j1) { + double d6 = ((double) l - d3) / (d0 / 2.0D); + double d7 = ((double) j1 - d4) / (d1 / 2.0D); + double d8 = ((double) i1 - d5) / (d2 / 2.0D); double d9 = d6 * d6 + d7 * d7 + d8 * d8; if (d9 < 1.0D) { aboolean[(l * 16 + i1) * 8 + j1] = true; @@ -65,9 +65,9 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS } } - for(int k1 = 0; k1 < 16; ++k1) { - for(int l2 = 0; l2 < 16; ++l2) { - for(int k = 0; k < 8; ++k) { + for (int k1 = 0; k1 < 16; ++k1) { + for (int l2 = 0; l2 < 16; ++l2) { + for (int k = 0; k < 8; ++k) { boolean flag = !aboolean[(k1 * 16 + l2) * 8 + k] && (k1 < 15 && aboolean[((k1 + 1) * 16 + l2) * 8 + k] || k1 > 0 && aboolean[((k1 - 1) * 16 + l2) * 8 + k] || l2 < 15 && aboolean[(k1 * 16 + l2 + 1) * 8 + k] || l2 > 0 && aboolean[(k1 * 16 + (l2 - 1)) * 8 + k] || k < 7 && aboolean[(k1 * 16 + l2) * 8 + k + 1] || k > 0 && aboolean[(k1 * 16 + l2) * 8 + (k - 1)]); if (flag) { BlockState material = worldIn.getBlockState(pos.offset(k1, k, l2)); @@ -83,9 +83,9 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS } } - for(int l1 = 0; l1 < 16; ++l1) { - for(int i3 = 0; i3 < 16; ++i3) { - for(int i4 = 0; i4 < 8; ++i4) { + for (int l1 = 0; l1 < 16; ++l1) { + for (int i3 = 0; i3 < 16; ++i3) { + for (int i4 = 0; i4 < 8; ++i4) { if (aboolean[(l1 * 16 + i3) * 8 + i4]) { worldIn.setBlock(pos.offset(l1, i4, i3), rawState, 2); } @@ -93,9 +93,9 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS } } - for(int i2 = 0; i2 < 16; ++i2) { - for(int j3 = 0; j3 < 16; ++j3) { - for(int j4 = 4; j4 < 8; ++j4) { + for (int i2 = 0; i2 < 16; ++i2) { + for (int j3 = 0; j3 < 16; ++j3) { + for (int j4 = 4; j4 < 8; ++j4) { if (aboolean[(i2 * 16 + j3) * 8 + j4]) { BlockPos blockpos = pos.offset(i2, j4 - 1, j3); if (isDirt(worldIn.getBlockState(blockpos)) && worldIn.getBrightness(LightLayer.SKY, pos.offset(i2, j4, j3)) > 0) { @@ -112,9 +112,9 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS } // Adds ore around the perimeter - for(int j2 = 0; j2 < 16; ++j2) { - for(int k3 = 0; k3 < 16; ++k3) { - for(int k4 = 0; k4 < 8; ++k4) { + for (int j2 = 0; j2 < 16; ++j2) { + for (int k3 = 0; k3 < 16; ++k3) { + for (int k4 = 0; k4 < 8; ++k4) { boolean flag1 = !aboolean[(j2 * 16 + k3) * 8 + k4] && (j2 < 15 && aboolean[((j2 + 1) * 16 + k3) * 8 + k4] || j2 > 0 && aboolean[((j2 - 1) * 16 + k3) * 8 + k4] || k3 < 15 && aboolean[(j2 * 16 + k3 + 1) * 8 + k4] || k3 > 0 && aboolean[(j2 * 16 + (k3 - 1)) * 8 + k4] || k4 < 7 && aboolean[(j2 * 16 + k3) * 8 + k4 + 1] || k4 > 0 && aboolean[(j2 * 16 + k3) * 8 + (k4 - 1)]); if (flag1 && (k4 < 4 || rand.nextInt(2) != 0) && worldIn.getBlockState(pos.offset(j2, k4, k3)).isSolid()) { worldIn.setBlock(pos.offset(j2, k4, k3), oreState, 2); @@ -126,7 +126,8 @@ protected boolean place(WorldGenLevel worldIn, ChunkGenerator generator, RandomS return true; } - public static record Configuration(BlockStateProvider ore_block_state, BlockStateProvider raw_block_state) implements FeatureConfiguration { + public static record Configuration(BlockStateProvider ore_block_state, + BlockStateProvider raw_block_state) implements FeatureConfiguration { public static final Codec CODEC = RecordCodecBuilder.create((configurationInstance) -> { return configurationInstance.group(BlockStateProvider.CODEC.fieldOf("ore_block_state").forGetter(VEOreDepositFeature.Configuration::ore_block_state), BlockStateProvider.CODEC.fieldOf("raw_block_state").forGetter(VEOreDepositFeature.Configuration::raw_block_state)).apply(configurationInstance, VEOreDepositFeature.Configuration::new); }); diff --git a/src/main/java/com/veteam/voluminousenergy/world/modifiers/VEAndedMultiBiomeModifier.java b/src/main/java/com/veteam/voluminousenergy/world/modifiers/VEAndedMultiBiomeModifier.java index 35bfa30e5..714c01528 100644 --- a/src/main/java/com/veteam/voluminousenergy/world/modifiers/VEAndedMultiBiomeModifier.java +++ b/src/main/java/com/veteam/voluminousenergy/world/modifiers/VEAndedMultiBiomeModifier.java @@ -30,7 +30,7 @@ public class VEAndedMultiBiomeModifier implements BiomeModifier { private String whitelistedBiome; private String blacklistedBiome; - private Holder> feature; + private Holder> feature; private boolean isTriangualar; private int count; private int bottomAnchor; @@ -41,7 +41,7 @@ public class VEAndedMultiBiomeModifier implements BiomeModifier { public VEAndedMultiBiomeModifier( String whitelistedBiome, String blacklistedBiome, - Holder> feature, + Holder> feature, boolean isTriangualar, int count, int bottomAnchor, @@ -67,32 +67,33 @@ public void modify(Holder biome, Phase phase, ModifiableBiomeInfo.BiomeIn if (blacklistedBiomeKeycache.get().isEmpty()) blacklistCacheBuilder(); // Sizes should be identical when filtering, if so, all the tags needed are present - if (biome.getTagKeys().filter(b -> whitelistedBiomeKeycache.get().contains(b)).count() != whitelistedBiomeKeycache.get().size()) return; + if (biome.getTagKeys().filter(b -> whitelistedBiomeKeycache.get().contains(b)).count() != whitelistedBiomeKeycache.get().size()) + return; // If any match, return, as a blacklisted tag has been hit if (biome.getTagKeys().anyMatch(b -> blacklistedBiomeKeycache.get().contains(b))) return; - if (Config.WORLD_GEN_LOGGING.get()){ + if (Config.WORLD_GEN_LOGGING.get()) { VoluminousEnergy.LOGGER.info("Voluminous Energy has received a successful biome modify event. "); VoluminousEnergy.LOGGER.info("Biome is: " + RegistryLookups.lookupBiome(biome.value())); VoluminousEnergy.LOGGER.info("Biome Keys of biome in question: "); - biome.getTagKeys().forEach(key -> System.out.print(key.toString() + ", ")); + biome.getTagKeys().forEach(key -> System.out.print(key.toString() + ", ")); VoluminousEnergy.LOGGER.info("\nWhitelisted Keys for this AND rule: "); whitelistedBiomeKeycache.get().forEach(key -> System.out.print(key.toString() + ", ")); System.out.println(); } - List> oreConfiguration = feature.get().getFeatures().toList(); + List> oreConfiguration = feature.get().getFeatures().toList(); Holder modifiedFeature; - if (isTriangualar){ - modifiedFeature = Holder.direct(new PlacedFeature(Holder.direct(oreConfiguration.get(0)),List.of( + if (isTriangualar) { + modifiedFeature = Holder.direct(new PlacedFeature(Holder.direct(oreConfiguration.get(0)), List.of( HeightRangePlacement.triangle(VerticalAnchor.absolute(bottomAnchor), VerticalAnchor.absolute(topAnchor)), CountPlacement.of(count), RarityFilter.onAverageOnceEvery(rarity), InSquarePlacement.spread() ))); } else { - modifiedFeature = Holder.direct(new PlacedFeature(Holder.direct(oreConfiguration.get(0)),List.of( + modifiedFeature = Holder.direct(new PlacedFeature(Holder.direct(oreConfiguration.get(0)), List.of( HeightRangePlacement.uniform(VerticalAnchor.absolute(bottomAnchor), VerticalAnchor.absolute(topAnchor)), CountPlacement.of(count), RarityFilter.onAverageOnceEvery(rarity), @@ -101,7 +102,6 @@ public void modify(Holder biome, Phase phase, ModifiableBiomeInfo.BiomeIn } - // System.out.println("\nChecking if features are unique. Start with modified: "); // modifiedFeature.get().placement().forEach(rule -> System.out.print(rule.toString() + ", ")); // System.out.println("\n"); @@ -112,8 +112,8 @@ public void modify(Holder biome, Phase phase, ModifiableBiomeInfo.BiomeIn builder.getGenerationSettings().addFeature(getGenerationStepDecoration(), modifiedFeature); } - public void whitelistCacheBuilder(){ - if (whitelistedBiome.contains(",")){ + public void whitelistCacheBuilder() { + if (whitelistedBiome.contains(",")) { Arrays.stream(whitelistedBiome.split(",")).sequential().forEach(greenBiome -> { TagKey biomeTag = TagKey.create(ForgeRegistries.BIOMES.getRegistryKey(), new ResourceLocation(greenBiome)); whitelistedBiomeKeycache.get().add(biomeTag); @@ -124,13 +124,13 @@ public void whitelistCacheBuilder(){ } } - public void blacklistCacheBuilder(){ - if (blacklistedBiome.contains(",")){ + public void blacklistCacheBuilder() { + if (blacklistedBiome.contains(",")) { Arrays.stream(blacklistedBiome.split(",")).sequential().forEach(redBiome -> { TagKey biomeTag = TagKey.create(ForgeRegistries.BIOMES.getRegistryKey(), new ResourceLocation(redBiome)); blacklistedBiomeKeycache.get().add(biomeTag); }); - } else if (!blacklistedBiome.isEmpty()){ + } else if (!blacklistedBiome.isEmpty()) { TagKey biomeTagKey = TagKey.create(ForgeRegistries.BIOMES.getRegistryKey(), new ResourceLocation(blacklistedBiome)); blacklistedBiomeKeycache.get().add(biomeTagKey); } @@ -144,7 +144,7 @@ public String getBlacklistedBiome() { return blacklistedBiome; } - public Holder> getFeature() { + public Holder> getFeature() { return feature; } diff --git a/src/main/java/com/veteam/voluminousenergy/world/modifiers/VEOreBiomeModifier.java b/src/main/java/com/veteam/voluminousenergy/world/modifiers/VEOreBiomeModifier.java index d97426b14..6fdf66c20 100644 --- a/src/main/java/com/veteam/voluminousenergy/world/modifiers/VEOreBiomeModifier.java +++ b/src/main/java/com/veteam/voluminousenergy/world/modifiers/VEOreBiomeModifier.java @@ -17,7 +17,7 @@ public record VEOreBiomeModifier(HolderSet biomes, Holder public void modify(Holder biome, Phase phase, ModifiableBiomeInfo.BiomeInfo.Builder builder) { if (phase != Phase.ADD) return; - if (Config.WORLD_GEN_LOGGING.get()){ + if (Config.WORLD_GEN_LOGGING.get()) { System.out.println("DEBUG: " + RegistryLookups.lookupBiome(biome) + " ACTIVE KEYS:\n" + biome.getTagKeys().toString()); } diff --git a/src/main/java/com/veteam/voluminousenergy/world/ores/VEOreGeneration.java b/src/main/java/com/veteam/voluminousenergy/world/ores/VEOreGeneration.java index bd08f0271..6cbdab8ab 100644 --- a/src/main/java/com/veteam/voluminousenergy/world/ores/VEOreGeneration.java +++ b/src/main/java/com/veteam/voluminousenergy/world/ores/VEOreGeneration.java @@ -64,7 +64,7 @@ public static final class ReplacementRules { // These are rule tests to see if t // WARN: Not tag based public static final RuleTest TERRACOTTA = new MultiBlockStateMatchRuleTest(Blocks.TERRACOTTA.defaultBlockState(), Blocks.WHITE_TERRACOTTA.defaultBlockState(), Blocks.ORANGE_TERRACOTTA.defaultBlockState(), Blocks.MAGENTA_TERRACOTTA.defaultBlockState(), Blocks.LIGHT_BLUE_TERRACOTTA.defaultBlockState(), Blocks.YELLOW_TERRACOTTA.defaultBlockState(), Blocks.LIME_TERRACOTTA.defaultBlockState(), Blocks.PINK_TERRACOTTA.defaultBlockState(), Blocks.GRAY_TERRACOTTA.defaultBlockState(), Blocks.LIGHT_GRAY_TERRACOTTA.defaultBlockState(), Blocks.CYAN_TERRACOTTA.defaultBlockState(), Blocks.PURPLE_TERRACOTTA.defaultBlockState(), Blocks.BLUE_TERRACOTTA.defaultBlockState(), Blocks.BROWN_TERRACOTTA.defaultBlockState(), Blocks.GREEN_TERRACOTTA.defaultBlockState(), Blocks.RED_TERRACOTTA.defaultBlockState(), Blocks.BLACK_TERRACOTTA.defaultBlockState()); - public static RuleTest createRuleFromTag(String blockTagLocation){ + public static RuleTest createRuleFromTag(String blockTagLocation) { TagKey blockTag = TagKey.create(ForgeRegistries.BLOCKS.getRegistryKey(), new ResourceLocation(blockTagLocation)); return new TagMatchTest(blockTag); } diff --git a/src/main/java/com/veteam/voluminousenergy/world/ores/VEOres.java b/src/main/java/com/veteam/voluminousenergy/world/ores/VEOres.java index 2eef24778..546e84e32 100644 --- a/src/main/java/com/veteam/voluminousenergy/world/ores/VEOres.java +++ b/src/main/java/com/veteam/voluminousenergy/world/ores/VEOres.java @@ -78,8 +78,9 @@ public class VEOres { // return PlacementUtils.register(registryName, Holder.direct(feature), placementModifiers); // } - public static class NoPlacement extends PlacementFilter{ - public NoPlacement(){} + public static class NoPlacement extends PlacementFilter { + public NoPlacement() { + } @Override protected boolean shouldPlace(PlacementContext p_226382_, RandomSource p_226383_, BlockPos p_226384_) { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index e429154a6..5f54971af 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -1,55 +1,54 @@ - -modLoader="javafml" #mandatory +modLoader = "javafml" #mandatory # A version range to match for said mod loader - for regular FML @Mod it will be the forge version -loaderVersion="[48,)" #mandatory (48 is forge 1.20.2) +loaderVersion = "[48,)" #mandatory (48 is forge 1.20.2) # License is manditory starting in 1.16 -license="GPLv3" +license = "GPLv3" # A URL to refer people to when problems occur with this mod -issueTrackerURL="https://github.com/MikeTheShadow/VoluminousEnergy/issues" #optional +issueTrackerURL = "https://github.com/MikeTheShadow/VoluminousEnergy/issues" #optional # A list of mods - how many allowed here is determined by the individual mod loader [[mods]] #mandatory # The modid of the mod -modId="voluminousenergy" #mandatory +modId = "voluminousenergy" #mandatory # The version number of the mod - there's a few well known ${} variables useable here or just hardcode it -version="1.20.2-Experimental" #mandatory - # A display name for the mod -displayName="Voluminous Energy" #mandatory +version = "1.20.2-Experimental" #mandatory +# A display name for the mod +displayName = "Voluminous Energy" #mandatory # A URL to query for updates for this mod. See the JSON update specification #updateJSONURL="https://github.com/MikeTheShadow/VoluminousEnergy" #optional # A URL for the "homepage" for this mod, displayed in the mod UI -displayURL="https://github.com/MikeTheShadow/VoluminousEnergy" #optional +displayURL = "https://github.com/MikeTheShadow/VoluminousEnergy" #optional # A file name (in the root of the mod JAR) containing a logo for display -logoFile="examplemod.png" #optional +logoFile = "examplemod.png" #optional # A text field displayed in the mod UI -credits=" " #optional +credits = " " #optional # A text field displayed in the mod UI -authors="Eelt, MikeTheShadow" #optional +authors = "Eelt, MikeTheShadow" #optional # The description text for the mod (multi line!) (#mandatory) -description='''Voluminous Energy - A Tech mod focused on resource processing and energy... Or processing resources into more energy?!''' +description = '''Voluminous Energy - A Tech mod focused on resource processing and energy... Or processing resources into more energy?!''' # A dependency - use the . to indicate dependency for a specific modid. Dependencies are optional. [[dependencies.voluminousenergy]] #optional - # the modid of the dependency - modId="forge" #mandatory - # Does this dependency have to exist - if not, ordering below must be specified - mandatory=true #mandatory - # The version range of the dependency - versionRange="[48.0.23,)" #mandatory - # An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory - ordering="NONE" - # Side this dependency is applied on - BOTH, CLIENT or SERVER - side="BOTH" +# the modid of the dependency +modId = "forge" #mandatory +# Does this dependency have to exist - if not, ordering below must be specified +mandatory = true #mandatory +# The version range of the dependency +versionRange = "[48.0.23,)" #mandatory +# An ordering relationship for the dependency - BEFORE or AFTER required if the relationship is not mandatory +ordering = "NONE" +# Side this dependency is applied on - BOTH, CLIENT or SERVER +side = "BOTH" # Here's another dependency [[dependencies.voluminousenergy]] - modId="minecraft" - mandatory=true - versionRange="[1.20.2,1.21)" - ordering="NONE" - side="BOTH" +modId = "minecraft" +mandatory = true +versionRange = "[1.20.2,1.21)" +ordering = "NONE" +side = "BOTH" [[dependencies.voluminousenergy]] - modId="jei" - mandatory=false - versionRange="[16,)" - ordering="NONE" - side="CLIENT" \ No newline at end of file +modId = "jei" +mandatory = false +versionRange = "[16,)" +ordering = "NONE" +side = "CLIENT" \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/air_compressor.json b/src/main/resources/assets/voluminousenergy/blockstates/air_compressor.json index 11e45c22d..7a3956bb9 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/air_compressor.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/air_compressor.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/air_compressor" }, - "facing=south": { "model": "voluminousenergy:block/air_compressor", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/air_compressor", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/air_compressor", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/air_compressor" + }, + "facing=south": { + "model": "voluminousenergy:block/air_compressor", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/air_compressor", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/air_compressor", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/aluminum_machine_casing.json b/src/main/resources/assets/voluminousenergy/blockstates/aluminum_machine_casing.json index e58906818..07fb0a19e 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/aluminum_machine_casing.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/aluminum_machine_casing.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/aluminum_machine_casing"} + "": { + "model": "voluminousenergy:block/aluminum_machine_casing" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/aluminum_shell.json b/src/main/resources/assets/voluminousenergy/blockstates/aluminum_shell.json index 68fe1817c..ac3babd95 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/aluminum_shell.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/aluminum_shell.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/aluminum_shell"} + "": { + "model": "voluminousenergy:block/aluminum_shell" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/aluminum_tank.json b/src/main/resources/assets/voluminousenergy/blockstates/aluminum_tank.json index 8c57aae26..b7dc4ccdd 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/aluminum_tank.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/aluminum_tank.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/aluminum_tank" }, - "facing=south": { "model": "voluminousenergy:block/aluminum_tank", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/aluminum_tank", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/aluminum_tank", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/aluminum_tank" + }, + "facing=south": { + "model": "voluminousenergy:block/aluminum_tank", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/aluminum_tank", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/aluminum_tank", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/aqueoulizer.json b/src/main/resources/assets/voluminousenergy/blockstates/aqueoulizer.json index cdcf3ed85..c1d36c0f1 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/aqueoulizer.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/aqueoulizer.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/aqueoulizer" }, - "facing=south": { "model": "voluminousenergy:block/aqueoulizer", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/aqueoulizer", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/aqueoulizer", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/aqueoulizer" + }, + "facing=south": { + "model": "voluminousenergy:block/aqueoulizer", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/aqueoulizer", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/aqueoulizer", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/battery_box.json b/src/main/resources/assets/voluminousenergy/blockstates/battery_box.json index c97e8404c..ff98a8817 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/battery_box.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/battery_box.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/battery_box" }, - "facing=south": { "model": "voluminousenergy:block/battery_box", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/battery_box", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/battery_box", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/battery_box" + }, + "facing=south": { + "model": "voluminousenergy:block/battery_box", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/battery_box", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/battery_box", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/bauxiteore.json b/src/main/resources/assets/voluminousenergy/blockstates/bauxiteore.json index a24e15b6b..7ce1bc0e8 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/bauxiteore.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/bauxiteore.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/bauxiteore"} + "": { + "model": "voluminousenergy:block/bauxiteore" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/blast_furnace.json b/src/main/resources/assets/voluminousenergy/blockstates/blast_furnace.json index c2703d8ef..2c35d4478 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/blast_furnace.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/blast_furnace.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/blast_furnace" }, - "facing=south": { "model": "voluminousenergy:block/blast_furnace", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/blast_furnace", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/blast_furnace", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/blast_furnace" + }, + "facing=south": { + "model": "voluminousenergy:block/blast_furnace", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/blast_furnace", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/blast_furnace", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/carbon_shielded_aluminum_machine_frame.json b/src/main/resources/assets/voluminousenergy/blockstates/carbon_shielded_aluminum_machine_frame.json index 36454b812..2fa27eaa5 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/carbon_shielded_aluminum_machine_frame.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/carbon_shielded_aluminum_machine_frame.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/carbon_shielded_aluminum_machine_frame"} + "": { + "model": "voluminousenergy:block/carbon_shielded_aluminum_machine_frame" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/centrifugal_agitator.json b/src/main/resources/assets/voluminousenergy/blockstates/centrifugal_agitator.json index 7a58314d9..874d47672 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/centrifugal_agitator.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/centrifugal_agitator.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/centrifugal_agitator" }, - "facing=south": { "model": "voluminousenergy:block/centrifugal_agitator", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/centrifugal_agitator", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/centrifugal_agitator", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/centrifugal_agitator" + }, + "facing=south": { + "model": "voluminousenergy:block/centrifugal_agitator", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/centrifugal_agitator", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/centrifugal_agitator", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/centrifugal_separator.json b/src/main/resources/assets/voluminousenergy/blockstates/centrifugal_separator.json index a02d9a128..920b0b953 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/centrifugal_separator.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/centrifugal_separator.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/centrifugal_separator" }, - "facing=south": { "model": "voluminousenergy:block/centrifugal_separator", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/centrifugal_separator", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/centrifugal_separator", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/centrifugal_separator" + }, + "facing=south": { + "model": "voluminousenergy:block/centrifugal_separator", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/centrifugal_separator", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/centrifugal_separator", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/cinnabarore.json b/src/main/resources/assets/voluminousenergy/blockstates/cinnabarore.json index aeae8e033..d70e931c6 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/cinnabarore.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/cinnabarore.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/cinnabarore"} + "": { + "model": "voluminousenergy:block/cinnabarore" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/combustion_generator.json b/src/main/resources/assets/voluminousenergy/blockstates/combustion_generator.json index 6a7d75024..8c675b12b 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/combustion_generator.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/combustion_generator.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/combustion_generator" }, - "facing=south": { "model": "voluminousenergy:block/combustion_generator", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/combustion_generator", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/combustion_generator", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/combustion_generator" + }, + "facing=south": { + "model": "voluminousenergy:block/combustion_generator", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/combustion_generator", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/combustion_generator", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/compressor.json b/src/main/resources/assets/voluminousenergy/blockstates/compressor.json index 7ff0bfdd1..11297705c 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/compressor.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/compressor.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/compressor" }, - "facing=south": { "model": "voluminousenergy:block/compressor", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/compressor", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/compressor", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/compressor" + }, + "facing=south": { + "model": "voluminousenergy:block/compressor", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/compressor", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/compressor", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/crusher.json b/src/main/resources/assets/voluminousenergy/blockstates/crusher.json index 377db8df2..cbe19c6be 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/crusher.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/crusher.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/crusher" }, - "facing=south": { "model": "voluminousenergy:block/crusher", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/crusher", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/crusher", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/crusher" + }, + "facing=south": { + "model": "voluminousenergy:block/crusher", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/crusher", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/crusher", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/deepslate_bauxite_ore.json b/src/main/resources/assets/voluminousenergy/blockstates/deepslate_bauxite_ore.json index 5cd944b51..ac623941f 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/deepslate_bauxite_ore.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/deepslate_bauxite_ore.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/deepslate_bauxite_ore"} + "": { + "model": "voluminousenergy:block/deepslate_bauxite_ore" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/deepslate_cinnabar_ore.json b/src/main/resources/assets/voluminousenergy/blockstates/deepslate_cinnabar_ore.json index 5bed208d4..75c47ce4d 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/deepslate_cinnabar_ore.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/deepslate_cinnabar_ore.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/deepslate_cinnabar_ore"} + "": { + "model": "voluminousenergy:block/deepslate_cinnabar_ore" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/deepslate_galena_ore.json b/src/main/resources/assets/voluminousenergy/blockstates/deepslate_galena_ore.json index d2510a59f..d541f88f3 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/deepslate_galena_ore.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/deepslate_galena_ore.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/deepslate_galena_ore"} + "": { + "model": "voluminousenergy:block/deepslate_galena_ore" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/deepslate_rutile_ore.json b/src/main/resources/assets/voluminousenergy/blockstates/deepslate_rutile_ore.json index 265cb1d9a..1e5299c25 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/deepslate_rutile_ore.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/deepslate_rutile_ore.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/deepslate_rutile_ore"} + "": { + "model": "voluminousenergy:block/deepslate_rutile_ore" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/distillation_unit.json b/src/main/resources/assets/voluminousenergy/blockstates/distillation_unit.json index 5d095953c..252c7c445 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/distillation_unit.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/distillation_unit.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/distillation_unit" }, - "facing=south": { "model": "voluminousenergy:block/distillation_unit", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/distillation_unit", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/distillation_unit", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/distillation_unit" + }, + "facing=south": { + "model": "voluminousenergy:block/distillation_unit", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/distillation_unit", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/distillation_unit", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/eighzo_ore.json b/src/main/resources/assets/voluminousenergy/blockstates/eighzo_ore.json index add4975f0..3c3b9a95e 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/eighzo_ore.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/eighzo_ore.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/eighzo_ore"} + "": { + "model": "voluminousenergy:block/eighzo_ore" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/eighzo_tank.json b/src/main/resources/assets/voluminousenergy/blockstates/eighzo_tank.json index 54f3bfdea..31ea01ed7 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/eighzo_tank.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/eighzo_tank.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/eighzo_tank" }, - "facing=south": { "model": "voluminousenergy:block/eighzo_tank", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/eighzo_tank", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/eighzo_tank", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/eighzo_tank" + }, + "facing=south": { + "model": "voluminousenergy:block/eighzo_tank", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/eighzo_tank", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/eighzo_tank", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/electric_furnace.json b/src/main/resources/assets/voluminousenergy/blockstates/electric_furnace.json index 283bb9cc1..ff4b1e596 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/electric_furnace.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/electric_furnace.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/electric_furnace" }, - "facing=south": { "model": "voluminousenergy:block/electric_furnace", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/electric_furnace", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/electric_furnace", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/electric_furnace" + }, + "facing=south": { + "model": "voluminousenergy:block/electric_furnace", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/electric_furnace", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/electric_furnace", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/electrolyzer.json b/src/main/resources/assets/voluminousenergy/blockstates/electrolyzer.json index 5619d5806..3b71bc7c9 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/electrolyzer.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/electrolyzer.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/electrolyzer" }, - "facing=south": { "model": "voluminousenergy:block/electrolyzer", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/electrolyzer", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/electrolyzer", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/electrolyzer" + }, + "facing=south": { + "model": "voluminousenergy:block/electrolyzer", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/electrolyzer", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/electrolyzer", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/fluid_electrolyzer.json b/src/main/resources/assets/voluminousenergy/blockstates/fluid_electrolyzer.json index bd66d5231..6315d7107 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/fluid_electrolyzer.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/fluid_electrolyzer.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/fluid_electrolyzer" }, - "facing=south": { "model": "voluminousenergy:block/fluid_electrolyzer", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/fluid_electrolyzer", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/fluid_electrolyzer", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/fluid_electrolyzer" + }, + "facing=south": { + "model": "voluminousenergy:block/fluid_electrolyzer", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/fluid_electrolyzer", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/fluid_electrolyzer", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/fluid_mixer.json b/src/main/resources/assets/voluminousenergy/blockstates/fluid_mixer.json index 9c820a69b..bfb482ce4 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/fluid_mixer.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/fluid_mixer.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/fluid_mixer" }, - "facing=south": { "model": "voluminousenergy:block/fluid_mixer", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/fluid_mixer", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/fluid_mixer", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/fluid_mixer" + }, + "facing=south": { + "model": "voluminousenergy:block/fluid_mixer", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/fluid_mixer", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/fluid_mixer", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/galena_ore.json b/src/main/resources/assets/voluminousenergy/blockstates/galena_ore.json index 551a4c8c4..8788dcb49 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/galena_ore.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/galena_ore.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/galena_ore"} + "": { + "model": "voluminousenergy:block/galena_ore" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/gas_fired_furnace.json b/src/main/resources/assets/voluminousenergy/blockstates/gas_fired_furnace.json index 7c8c2806e..06712e3c8 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/gas_fired_furnace.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/gas_fired_furnace.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/gas_fired_furnace" }, - "facing=south": { "model": "voluminousenergy:block/gas_fired_furnace", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/gas_fired_furnace", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/gas_fired_furnace", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/gas_fired_furnace" + }, + "facing=south": { + "model": "voluminousenergy:block/gas_fired_furnace", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/gas_fired_furnace", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/gas_fired_furnace", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/hydroponic_incubator.json b/src/main/resources/assets/voluminousenergy/blockstates/hydroponic_incubator.json index 2b5c5cfff..caaf8c512 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/hydroponic_incubator.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/hydroponic_incubator.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/hydroponic_incubator" }, - "facing=south": { "model": "voluminousenergy:block/hydroponic_incubator", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/hydroponic_incubator", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/hydroponic_incubator", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/hydroponic_incubator" + }, + "facing=south": { + "model": "voluminousenergy:block/hydroponic_incubator", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/hydroponic_incubator", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/hydroponic_incubator", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/implosion_compressor.json b/src/main/resources/assets/voluminousenergy/blockstates/implosion_compressor.json index 5eac404bd..7929637ff 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/implosion_compressor.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/implosion_compressor.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/implosion_compressor" }, - "facing=south": { "model": "voluminousenergy:block/implosion_compressor", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/implosion_compressor", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/implosion_compressor", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/implosion_compressor" + }, + "facing=south": { + "model": "voluminousenergy:block/implosion_compressor", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/implosion_compressor", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/implosion_compressor", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/netherite_tank.json b/src/main/resources/assets/voluminousenergy/blockstates/netherite_tank.json index b9de000ea..9a9a85d67 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/netherite_tank.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/netherite_tank.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/netherite_tank" }, - "facing=south": { "model": "voluminousenergy:block/netherite_tank", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/netherite_tank", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/netherite_tank", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/netherite_tank" + }, + "facing=south": { + "model": "voluminousenergy:block/netherite_tank", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/netherite_tank", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/netherite_tank", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/nighalite_tank.json b/src/main/resources/assets/voluminousenergy/blockstates/nighalite_tank.json index 87adbc012..7cad30140 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/nighalite_tank.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/nighalite_tank.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/nighalite_tank" }, - "facing=south": { "model": "voluminousenergy:block/nighalite_tank", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/nighalite_tank", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/nighalite_tank", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/nighalite_tank" + }, + "facing=south": { + "model": "voluminousenergy:block/nighalite_tank", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/nighalite_tank", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/nighalite_tank", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/primitive_solar_panel.json b/src/main/resources/assets/voluminousenergy/blockstates/primitive_solar_panel.json index cb569221d..e4fe2fb67 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/primitive_solar_panel.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/primitive_solar_panel.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/primitive_solar_panel" }, - "facing=south": { "model": "voluminousenergy:block/primitive_solar_panel", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/primitive_solar_panel", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/primitive_solar_panel", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/primitive_solar_panel" + }, + "facing=south": { + "model": "voluminousenergy:block/primitive_solar_panel", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/primitive_solar_panel", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/primitive_solar_panel", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/primitiveblastfurnace.json b/src/main/resources/assets/voluminousenergy/blockstates/primitiveblastfurnace.json index 8b99e08dd..17e982af9 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/primitiveblastfurnace.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/primitiveblastfurnace.json @@ -1,12 +1,34 @@ { "variants": { - "facing=north,lit=false": { "model": "voluminousenergy:block/primitiveblastfurnace" }, - "facing=south,lit=false": { "model": "voluminousenergy:block/primitiveblastfurnace", "y": 180 }, - "facing=west,lit=false": { "model": "voluminousenergy:block/primitiveblastfurnace", "y": 270 }, - "facing=east,lit=false": { "model": "voluminousenergy:block/primitiveblastfurnace", "y": 90 }, - "facing=north,lit=true": { "model": "voluminousenergy:block/on/primitiveblastfurnace" }, - "facing=south,lit=true": { "model": "voluminousenergy:block/on/primitiveblastfurnace", "y": 180 }, - "facing=west,lit=true": { "model": "voluminousenergy:block/on/primitiveblastfurnace", "y": 270 }, - "facing=east,lit=true": { "model": "voluminousenergy:block/on/primitiveblastfurnace", "y": 90 } + "facing=north,lit=false": { + "model": "voluminousenergy:block/primitiveblastfurnace" + }, + "facing=south,lit=false": { + "model": "voluminousenergy:block/primitiveblastfurnace", + "y": 180 + }, + "facing=west,lit=false": { + "model": "voluminousenergy:block/primitiveblastfurnace", + "y": 270 + }, + "facing=east,lit=false": { + "model": "voluminousenergy:block/primitiveblastfurnace", + "y": 90 + }, + "facing=north,lit=true": { + "model": "voluminousenergy:block/on/primitiveblastfurnace" + }, + "facing=south,lit=true": { + "model": "voluminousenergy:block/on/primitiveblastfurnace", + "y": 180 + }, + "facing=west,lit=true": { + "model": "voluminousenergy:block/on/primitiveblastfurnace", + "y": 270 + }, + "facing=east,lit=true": { + "model": "voluminousenergy:block/on/primitiveblastfurnace", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/primitivestirlinggenerator.json b/src/main/resources/assets/voluminousenergy/blockstates/primitivestirlinggenerator.json index 0862fa602..baf7338e4 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/primitivestirlinggenerator.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/primitivestirlinggenerator.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/primitivestirlinggenerator" }, - "facing=south": { "model": "voluminousenergy:block/primitivestirlinggenerator", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/primitivestirlinggenerator", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/primitivestirlinggenerator", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/primitivestirlinggenerator" + }, + "facing=south": { + "model": "voluminousenergy:block/primitivestirlinggenerator", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/primitivestirlinggenerator", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/primitivestirlinggenerator", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/pump.json b/src/main/resources/assets/voluminousenergy/blockstates/pump.json index 0da9d1f53..60fe4de8b 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/pump.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/pump.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/pump" }, - "facing=south": { "model": "voluminousenergy:block/pump", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/pump", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/pump", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/pump" + }, + "facing=south": { + "model": "voluminousenergy:block/pump", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/pump", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/pump", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/raw_bauxite_block.json b/src/main/resources/assets/voluminousenergy/blockstates/raw_bauxite_block.json index b8fadcbb6..0212ebc5a 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/raw_bauxite_block.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/raw_bauxite_block.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/raw_bauxite_block"} + "": { + "model": "voluminousenergy:block/raw_bauxite_block" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/raw_cinnabar_block.json b/src/main/resources/assets/voluminousenergy/blockstates/raw_cinnabar_block.json index 35d2a0d46..3c502079d 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/raw_cinnabar_block.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/raw_cinnabar_block.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/raw_cinnabar_block"} + "": { + "model": "voluminousenergy:block/raw_cinnabar_block" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/raw_eighzo_block.json b/src/main/resources/assets/voluminousenergy/blockstates/raw_eighzo_block.json index 0d3684aec..88c347276 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/raw_eighzo_block.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/raw_eighzo_block.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/raw_eighzo_block"} + "": { + "model": "voluminousenergy:block/raw_eighzo_block" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/raw_galena_block.json b/src/main/resources/assets/voluminousenergy/blockstates/raw_galena_block.json index ed72f46f6..932298bab 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/raw_galena_block.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/raw_galena_block.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/raw_galena_block"} + "": { + "model": "voluminousenergy:block/raw_galena_block" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/raw_rutile_block.json b/src/main/resources/assets/voluminousenergy/blockstates/raw_rutile_block.json index b6bcb63f3..171cb37b2 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/raw_rutile_block.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/raw_rutile_block.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/raw_rutile_block"} + "": { + "model": "voluminousenergy:block/raw_rutile_block" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/red_saltpeter_ore.json b/src/main/resources/assets/voluminousenergy/blockstates/red_saltpeter_ore.json index b91befe13..8c4f73104 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/red_saltpeter_ore.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/red_saltpeter_ore.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/red_saltpeter_ore"} + "": { + "model": "voluminousenergy:block/red_saltpeter_ore" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/rutileore.json b/src/main/resources/assets/voluminousenergy/blockstates/rutileore.json index b946d36e1..d7b24c2bd 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/rutileore.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/rutileore.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/rutileore"} + "": { + "model": "voluminousenergy:block/rutileore" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/saltpeterore.json b/src/main/resources/assets/voluminousenergy/blockstates/saltpeterore.json index f527af4c1..c9e71c1f3 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/saltpeterore.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/saltpeterore.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/saltpeterore"} + "": { + "model": "voluminousenergy:block/saltpeterore" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/solar_panel.json b/src/main/resources/assets/voluminousenergy/blockstates/solar_panel.json index e88244eee..a8d9923ee 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/solar_panel.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/solar_panel.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/solar_panel" }, - "facing=south": { "model": "voluminousenergy:block/solar_panel", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/solar_panel", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/solar_panel", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/solar_panel" + }, + "facing=south": { + "model": "voluminousenergy:block/solar_panel", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/solar_panel", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/solar_panel", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/solarium_block.json b/src/main/resources/assets/voluminousenergy/blockstates/solarium_block.json index ac67fc256..ace494d86 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/solarium_block.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/solarium_block.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/solarium_block"} + "": { + "model": "voluminousenergy:block/solarium_block" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/solarium_machine_casing.json b/src/main/resources/assets/voluminousenergy/blockstates/solarium_machine_casing.json index 04a0539df..b602a1278 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/solarium_machine_casing.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/solarium_machine_casing.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/solarium_machine_casing"} + "": { + "model": "voluminousenergy:block/solarium_machine_casing" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/solarium_tank.json b/src/main/resources/assets/voluminousenergy/blockstates/solarium_tank.json index 8dad51e2b..bb08f0764 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/solarium_tank.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/solarium_tank.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/solarium_tank" }, - "facing=south": { "model": "voluminousenergy:block/solarium_tank", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/solarium_tank", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/solarium_tank", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/solarium_tank" + }, + "facing=south": { + "model": "voluminousenergy:block/solarium_tank", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/solarium_tank", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/solarium_tank", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/stirling_generator.json b/src/main/resources/assets/voluminousenergy/blockstates/stirling_generator.json index 3ff3944a1..413a85d43 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/stirling_generator.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/stirling_generator.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/stirling_generator" }, - "facing=south": { "model": "voluminousenergy:block/stirling_generator", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/stirling_generator", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/stirling_generator", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/stirling_generator" + }, + "facing=south": { + "model": "voluminousenergy:block/stirling_generator", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/stirling_generator", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/stirling_generator", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/titanium_machine_casing.json b/src/main/resources/assets/voluminousenergy/blockstates/titanium_machine_casing.json index 9f87aa2ac..ccb87ec32 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/titanium_machine_casing.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/titanium_machine_casing.json @@ -1,5 +1,7 @@ { "variants": { - "": {"model": "voluminousenergy:block/titanium_machine_casing"} + "": { + "model": "voluminousenergy:block/titanium_machine_casing" + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/titanium_tank.json b/src/main/resources/assets/voluminousenergy/blockstates/titanium_tank.json index a7c9ff1fb..1de8df87a 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/titanium_tank.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/titanium_tank.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/titanium_tank" }, - "facing=south": { "model": "voluminousenergy:block/titanium_tank", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/titanium_tank", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/titanium_tank", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/titanium_tank" + }, + "facing=south": { + "model": "voluminousenergy:block/titanium_tank", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/titanium_tank", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/titanium_tank", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/blockstates/tooling_station.json b/src/main/resources/assets/voluminousenergy/blockstates/tooling_station.json index 0145ba73f..57cff479b 100644 --- a/src/main/resources/assets/voluminousenergy/blockstates/tooling_station.json +++ b/src/main/resources/assets/voluminousenergy/blockstates/tooling_station.json @@ -1,8 +1,19 @@ { "variants": { - "facing=north": { "model": "voluminousenergy:block/tooling_station" }, - "facing=south": { "model": "voluminousenergy:block/tooling_station", "y": 180 }, - "facing=west": { "model": "voluminousenergy:block/tooling_station", "y": 270 }, - "facing=east": { "model": "voluminousenergy:block/tooling_station", "y": 90 } + "facing=north": { + "model": "voluminousenergy:block/tooling_station" + }, + "facing=south": { + "model": "voluminousenergy:block/tooling_station", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/tooling_station", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/tooling_station", + "y": 90 + } } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/lang/en_us.json b/src/main/resources/assets/voluminousenergy/lang/en_us.json index ce233ace7..8694aebbb 100644 --- a/src/main/resources/assets/voluminousenergy/lang/en_us.json +++ b/src/main/resources/assets/voluminousenergy/lang/en_us.json @@ -1,484 +1,467 @@ { - "_comment": "Text", - "text.voluminousenergy.multiblock_warn": "Multiblock Invalid", - "text.voluminousenergy.multiblock.needed_behind": "BEHIND the Machine is needed", - "text.voluminousenergy.multiblock.needed_below": "BELOW the Machine is needed", - "text.voluminousenergy.multiblock.distillation_unit.requirements": "3x3x3 Aluminum Machine Casing", - "text.voluminousenergy.multiblock.blast_furnace.requirements": "3x3x3 Titanium Machine Casing", - "text.voluminousenergy.multiblock.dimensional_laser.requirements": "3x3x3 Solarium Machine Casing", - "text.voluminousenergy.temperature": "Temperature", - "text.voluminousenergy.protective_sheath": "Protective Sheath", - "text.voluminousenergy.generating": "Generating", - "text.voluminousenergy.percent_complete": "Percent Complete", - "text.voluminousenergy.percent_burned": "Percent Burned", - "text.voluminousenergy.ticks_left": "Ticks Left", - "text.voluminousenergy.battery_box.sending_out_power": "Sending out stored energy onto the FE grid", - "text.voluminousenergy.battery_box.receiving_power": "Receiving energy from the FE grid", - "text.voluminousenergy.energy": "Energy", - "text.voluminousenergy.chunk": "Chunk", - "text.voluminousenergy.found_fluid": "Found fluid", - "text.voluminousenergy.fluid_scanner.needs_empty_rfid": "You need an empty RFID chip in order to be able to save fluid data!", - "text.voluminousenergy.fluid_scanner.scanning": "Scanning", - "text.voluminousenergy.rfid.inventory_full": "Cannot write to RFID chip; inventory is full!", - "text.voluminousenergy.rfid.write_success": "Successfully written chunk data to an RFID chip!", - "text.voluminousenergy.rfid.chunk_data_error": "ERROR: Chunk data is null / not saved!", - "text.voluminousenergy.rfid.chunk_not_scanned": "Chunk must be scanned before writing!", - "_comment": "Translators: Quality tiers are translated from Korean to English. For the original, see either ko_kr.json or https://archeage.xlgames.com/wikis/%EC%95%84%EC%9D%B4%ED%85%9C%20%EB%93%B1%EA%B8%89#h2-1", - "text.voluminousenergy.quality": "Quality", - "text.voluminousenergy.quality.unidentified": "Unidentified", - "text.voluminousenergy.quality.basic": "Basic", - "text.voluminousenergy.quality.grand": "Grand", - "text.voluminousenergy.quality.rare": "Rare", - "text.voluminousenergy.quality.arcane": "Arcane", - "text.voluminousenergy.quality.heroic": "Heroic", - "text.voluminousenergy.quality.unique": "Unique", - "text.voluminousenergy.quality.celestial": "Celestial", - "text.voluminousenergy.quality.divine": "Divine", - "text.voluminousenergy.quality.epic": "Epic", - "text.voluminousenergy.quality.legendary": "Legendary", - "text.voluminousenergy.quality.mythic": "Mythic", - - "_comment": "Directions", - "direction.voluminousenergy.up": "Up", - "direction.voluminousenergy.down": "Down", - "direction.voluminousenergy.north": "North", - "direction.voluminousenergy.south": "South", - "direction.voluminousenergy.east": "East", - "direction.voluminousenergy.west": "West", - "direction.voluminousenergy.left": "Left", - "direction.voluminousenergy.right": "Right", - "direction.voluminousenergy.front": "Front", - "direction.voluminousenergy.back": "Back", - - "_comment": "Slot Names", - "slot.voluminousenergy.rng_slot": "RNG Slot", - "slot.voluminousenergy.input_slot": "Slot", - "slot.voluminousenergy.output_slot": "Slot", - "slot.voluminousenergy.upgrade_slot": "Slot", - "slot.voluminousenergy.bucket_slot": "Bucket Slot", - - "_comment": "Tank Names", - "tank.voluminousenergy.input_tank": "Tank", - "tank.voluminousenergy.output_tank": "Tank", - "tank.voluminousenergy.both_tank" : "Tank", - "tank.voluminousenergy.invalid": "INVALID", - "tank.voluminousenergy.null": "NULL", - - "_comment": "IO Menu Labels (shorts)", - "gui.voluminousenergy.slot_short": "S", - "gui.voluminousenergy.tank_short": "T", - - "_comment": "Blocks", - "block.voluminousenergy.primitiveblastfurnace": "Primitive Blast Furnace", - "block.voluminousenergy.primitivestirlinggenerator": "Primitive Stirling Generator", - "block.voluminousenergy.saltpeterore": "Saltpeter Ore", - "block.voluminousenergy.bauxiteore": "Bauxite Ore", - "block.voluminousenergy.cinnabarore": "Cinnabar Ore", - "block.voluminousenergy.rutileore": "Rutile Ore", - "block.voluminousenergy.crusher": "Crusher", - "block.voluminousenergy.galena_ore": "Galena Ore", - "block.voluminousenergy.deepslate_bauxite_ore": "Deepslate Bauxite Ore", - "block.voluminousenergy.deepslate_cinnabar_ore": "Deepslate Cinnabar Ore", - "block.voluminousenergy.deepslate_galena_ore": "Deepslate Galena Ore", - "block.voluminousenergy.deepslate_rutile_ore": "Deepslate Rutile Ore", - "block.voluminousenergy.red_saltpeter_ore": "Saltpeter Ore", - "block.voluminousenergy.electrolyzer": "Electrolyzer", - "block.voluminousenergy.centrifugal_agitator": "Centrifugal Agitator", - "block.voluminousenergy.aluminum_shell": "Aluminum Shell", - "block.voluminousenergy.compressor": "Compressor", - "block.voluminousenergy.stirling_generator": "Stirling Generator", - "block.voluminousenergy.combustion_generator": "Combustion Generator", - "block.voluminousenergy.aqueoulizer": "Aqueoulizer", - "block.voluminousenergy.carbon_shielded_aluminum_machine_frame": "Carbon Shielded Aluminum Machine Frame", - "block.voluminousenergy.air_compressor": "Air Compressor", - "block.voluminousenergy.distillation_unit": "Distillation Unit", - "block.voluminousenergy.aluminum_machine_casing": "Aluminum Machine Casing", - "block.voluminousenergy.titanium_machine_casing": "Titanium Machine Casing", - "block.voluminousenergy.pump": "Pump", - "block.voluminousenergy.gas_fired_furnace": "Gas Furnace", - "block.voluminousenergy.electric_furnace": "Electric Furnace", - "block.voluminousenergy.battery_box": "Battery Box", - "block.voluminousenergy.primitive_solar_panel": "Primitive Solar Panel", - "block.voluminousenergy.solar_panel": "Solar Panel", - "block.voluminousenergy.centrifugal_separator": "Centrifugal Separator", - "block.voluminousenergy.implosion_compressor": "Implosion Compressor", - "block.voluminousenergy.blast_furnace": "Blast Furnace", - "block.voluminousenergy.rice_crop": "Rice", - "block.voluminousenergy.solarium_block": "Block of Solarium", - "block.voluminousenergy.eighzo_ore": "Eighzo Ore", - "block.voluminousenergy.raw_bauxite_block": "Raw Bauxite Block", - "block.voluminousenergy.raw_cinnabar_block": "Raw Cinnabar Block", - "block.voluminousenergy.raw_eighzo_block": "Raw Eighzo Block", - "block.voluminousenergy.raw_galena_block": "Raw Galena Block", - "block.voluminousenergy.raw_rutile_block": "Raw Rutile Block", - "block.voluminousenergy.tooling_station": "Tooling Station", - "block.voluminousenergy.sawmill": "Sawmill", - "block.voluminousenergy.pressure_ladder": "Pressure Ladder", - "block.voluminousenergy.aluminum_tank": "Aluminum Tank", - "block.voluminousenergy.titanium_tank": "Titanium Tank", - "block.voluminousenergy.netherite_tank": "Netherite Tank", - "block.voluminousenergy.nighalite_tank": "Nighalite Tank", - "block.voluminousenergy.eighzo_tank": "Eighzo Tank", - "block.voluminousenergy.solarium_tank": "Solarium Tank", - "block.voluminousenergy.dimensional_laser" : "Dimensional laser", - "block.voluminousenergy.fluid_electrolyzer": "Fluid Electrolyzer", - "block.voluminousenergy.fluid_mixer": "Fluid Mixer", - "block.voluminousenergy.hydroponic_incubator": "Hydroponic Incubator", - "block.voluminousenergy.solarium_machine_casing": "Solarium Machine Casing", - - "_comment": "Creative Tabs", - "tab.voluminousenergy.voluminousenergy": "Voluminous Energy", - - "_comment": "Fluids", - "fluid.voluminousenergy.crude_oil": "Crude Oil", - "fluid.voluminousenergy.biofuel": "Biofuel", - "fluid.voluminousenergy.compressed_air": "Compressed Air", - "fluid.voluminousenergy.diesel": "Diesel", - "fluid.voluminousenergy.dinitrogen_tetroxide": "Dinitrogen Tetroxide", - "fluid.voluminousenergy.gasoline": "Gasoline", - "fluid.voluminousenergy.nitroglycerin": "Nitroglycerin", - "fluid.voluminousenergy.light_fuel": "Light Fuels", - "fluid.voluminousenergy.liquefied_coal": "Liquefied Coal", - "fluid.voluminousenergy.liquefied_coke": "Liquefied Coke", - "fluid.voluminousenergy.mercury": "Mercury", - "fluid.voluminousenergy.naphtha": "Naphtha", - "fluid.voluminousenergy.nitrogen": "Nitrogen", - "fluid.voluminousenergy.oxygen": "Oxygen", - "fluid.voluminousenergy.red_fuming_nitric_acid": "Red Fuming Nitric Acid", - "fluid.voluminousenergy.white_fuming_nitric_acid": "White Fuming Nitric Acid", - "fluid.voluminousenergy.sulfuric_acid": "Sulfuric Acid", - "fluid.voluminousenergy.tree_sap": "Tree Sap", - "fluid.voluminousenergy.treethanol": "Treethanol", - "fluid.voluminousenergy.hydrogen": "Hydrogen", - "fluid.voluminousenergy.ammonia": "Ammonia", - "fluid.voluminousenergy.ammonium_nitrate_solution": "Ammonium Nitrate Solution", - - "_comment": "Fluid Types", - "fluid_type.voluminousenergy.crude_oil": "Crude Oil", - "fluid_type.voluminousenergy.biofuel": "Biofuel", - "fluid_type.voluminousenergy.compressed_air": "Compressed Air", - "fluid_type.voluminousenergy.diesel": "Diesel", - "fluid_type.voluminousenergy.dinitrogen_tetroxide": "Dinitrogen Tetroxide", - "fluid_type.voluminousenergy.gasoline": "Gasoline", - "fluid_type.voluminousenergy.nitroglycerin": "Nitroglycerin", - "fluid_type.voluminousenergy.light_fuel": "Light Fuels", - "fluid_type.voluminousenergy.liquefied_coal": "Liquefied Coal", - "fluid_type.voluminousenergy.liquefied_coke": "Liquefied Coke", - "fluid_type.voluminousenergy.mercury": "Mercury", - "fluid_type.voluminousenergy.naphtha": "Naphtha", - "fluid_type.voluminousenergy.nitrogen": "Nitrogen", - "fluid_type.voluminousenergy.oxygen": "Oxygen", - "fluid_type.voluminousenergy.red_fuming_nitric_acid": "Red Fuming Nitric Acid", - "fluid_type.voluminousenergy.white_fuming_nitric_acid": "White Fuming Nitric Acid", - "fluid_type.voluminousenergy.sulfuric_acid": "Sulfuric Acid", - "fluid_type.voluminousenergy.tree_sap": "Tree Sap", - "fluid_type.voluminousenergy.treethanol": "Treethanol", - "fluid_type.voluminousenergy.hydrogen": "Hydrogen", - "fluid_type.voluminousenergy.ammonia": "Ammonia", - "fluid_type.voluminousenergy.ammonium_nitrate_solution": "Ammonium Nitrate Solution", - - "_comment": "Fluid Blocks", - "block.voluminousenergy.crude_oil": "Crude Oil", - "block.voluminousenergy.biofuel": "Biofuel", - "block.voluminousenergy.compressed_air": "Compressed Air", - "block.voluminousenergy.diesel": "Diesel", - "block.voluminousenergy.dinitrogen_tetroxide": "Dinitrogen Tetroxide", - "block.voluminousenergy.gasoline": "Gasoline", - "block.voluminousenergy.nitroglycerin": "Nitroglycerin", - "block.voluminousenergy.light_fuel": "Light Fuels", - "block.voluminousenergy.liquefied_coal": "Liquefied Coal", - "block.voluminousenergy.liquefied_coke": "Liquefied Coke", - "block.voluminousenergy.mercury": "Mercury", - "block.voluminousenergy.naphtha": "Naphtha", - "block.voluminousenergy.nitrogen": "Nitrogen", - "block.voluminousenergy.oxygen": "Oxygen", - "block.voluminousenergy.red_fuming_nitric_acid": "Red Fuming Nitric Acid", - "block.voluminousenergy.white_fuming_nitric_acid": "White Fuming Nitric Acid", - "block.voluminousenergy.sulfuric_acid": "Sulfuric Acid", - "block.voluminousenergy.tree_sap": "Tree Sap", - "block.voluminousenergy.treethanol": "Treethanol", - "block.voluminousenergy.hydrogen": "Hydrogen", - "block.voluminousenergy.ammonia": "Ammonia", - "block.voluminousenergy.ammonium_nitrate_solution": "Ammonium Nitrate Solution", - - "_comment": "Items", - "item.voluminousenergy.petcoke": "Petcoke", - "item.voluminousenergy.coalcoke": "Coal Coke", - "item.voluminousenergy.coaldust": "Coal Dust", - "item.voluminousenergy.cokedust": "Coke Dust", - "item.voluminousenergy.lapisdust": "Lapis Dust", - "item.voluminousenergy.sulfurdust": "Sulfur Dust", - "item.voluminousenergy.carbondust": "Carbon Dust", - "item.voluminousenergy.saltpeterdust": "Saltpeter Dust", - "item.voluminousenergy.saltpeterchunk": "Saltpeter Chunk", - "item.voluminousenergy.carbonbrick": "Carbon Brick", - "item.voluminousenergy.stonegear": "Stone Gear", - "item.voluminousenergy.irongear": "Iron Gear", - "item.voluminousenergy.carbongear": "Carbon Gear", - "item.voluminousenergy.aluminum_dust": "Aluminum Dust", - "item.voluminousenergy.bauxite_dust": "Bauxite Dust", - "item.voluminousenergy.cinnabar_dust": "Cinnabar Dust", - "item.voluminousenergy.iron_dust": "Iron Dust", - "item.voluminousenergy.quartz_dust": "Quartz Dust", - "item.voluminousenergy.sand_dust": "Sand Dust", - "item.voluminousenergy.soulsand_dust": "Soulsand Dust", - "item.voluminousenergy.titanium_dust": "Titanium Dust", - "item.voluminousenergy.aluminum_ingot": "Aluminum Ingot", - "item.voluminousenergy.titanium_ingot": "Titanium Ingot", - "item.voluminousenergy.aluminum_gear": "Aluminum Gear", - "item.voluminousenergy.titanium_gear": "Titanium Gear", - "item.voluminousenergy.silicon": "Silicon", - "item.voluminousenergy.gold_microchip": "Golden Microchip", - "item.voluminousenergy.rutile_dust": "Rutile Dust", - "item.voluminousenergy.galena_dust": "Galena Dust", - "item.voluminousenergy.lead_dust": "Lead Dust", - "item.voluminousenergy.silver_dust": "Silver Dust", - "item.voluminousenergy.crude_oil_bucket": "Crude Oil Bucket", - "item.voluminousenergy.oxygen_bucket": "Oxygen Bucket", - "item.voluminousenergy.naphtha_bucket": "Naphtha Bucket", - "item.voluminousenergy.red_fuming_nitric_acid_bucket": "Red Fuming Nitric Acid Bucket", - "item.voluminousenergy.white_fuming_nitric_acid_bucket": "White Fuming Nitric Acid Bucket", - "item.voluminousenergy.mercury_bucket": "Mercury Bucket", - "item.voluminousenergy.sulfuric_acid_bucket": "Sulfuric Acid Bucket", - "item.voluminousenergy.silver_ingot": "Silver Ingot", - "item.voluminousenergy.lead_ingot": "Lead Ingot", - "item.voluminousenergy.gold_dust": "Gold Dust", - "item.voluminousenergy.dinitrogen_tetroxide_bucket": "Dinitrogen Tetroxide Bucket", - "item.voluminousenergy.aluminum_plate": "Aluminum Plate", - "item.voluminousenergy.carbon_plate": "Carbon Plate", - "item.voluminousenergy.compressed_air_bucket": "Compressed Air Bucket", - "item.voluminousenergy.nitrogen_bucket": "Nitrogen Bucket", - "item.voluminousenergy.biofuel_bucket": "Biofuel Bucket", - "item.voluminousenergy.diesel_bucket": "Diesel Bucket", - "item.voluminousenergy.gasoline_bucket": "Gasoline Bucket", - "item.voluminousenergy.nitroglycerin_bucket": "Nitroglycerin Bucket", - "item.voluminousenergy.light_fuel_bucket": "Light Fuels Bucket", - "item.voluminousenergy.liquefied_coal_bucket": "Liquefied Coal Bucket", - "item.voluminousenergy.liquefied_coke_bucket": "Liquefied Coke Bucket", - "item.voluminousenergy.shredded_biomass": "Shredded Biomass", - "item.voluminousenergy.silver_microchip": "Silver Microchip", - "item.voluminousenergy.titanium_plate": "Titanium Plate", - "item.voluminousenergy.quartz_multiplier": "Quartz Multiplier", - "item.voluminousenergy.mercury_battery": "Mercury Battery", - "item.voluminousenergy.lead_acid_battery": "Lead-Acid Battery", - "item.voluminousenergy.photovoltaic_dust": "Photovoltaic Dust", - "item.voluminousenergy.end_stone_dust": "End Stone Dust", - "item.voluminousenergy.basalt_dust": "Basalt Dust", - "item.voluminousenergy.flint_dust": "Flint Dust", - "item.voluminousenergy.netherrack_dust": "Netherrack Dust", - "item.voluminousenergy.raw_bauxite": "Raw Bauxite", - "item.voluminousenergy.raw_cinnabar": "Raw Cinnabar", - "item.voluminousenergy.raw_galena": "Raw Galena", - "item.voluminousenergy.raw_rutile": "Raw Rutile", - "item.voluminousenergy.raw_sulfur": "Raw Sulfur", - "item.voluminousenergy.netherite_dust": "Netherite Dust", - "item.voluminousenergy.tungsten_dust": "Tungsten Dust", - "item.voluminousenergy.tungsten_ingot": "Tungsten Ingot", - "item.voluminousenergy.steel_dust": "Steel Dust", - "item.voluminousenergy.steel_ingot": "Steel Ingot", - "item.voluminousenergy.tungsten_steel_ingot": "Tungsten Steel Ingot", - "item.voluminousenergy.raw_eighzo": "Raw Eighzo", - "item.voluminousenergy.eighzo_dust": "Eighzo Dust", - "item.voluminousenergy.eighzo_ingot": "Eighzo Ingot", - "item.voluminousenergy.solarium_dust": "Solarium Dust", - "item.voluminousenergy.solarium_ingot": "Solarium Ingot", - "item.voluminousenergy.solarium_gear": "Solarium Gear", - "item.voluminousenergy.solarium_plate": "Solarium Plate", - "item.voluminousenergy.nighalite_ingot": "Nighalite Ingot", - "item.voluminousenergy.cooked_rice": "Cooked Rice", - "item.voluminousenergy.aluminum_pickaxe": "Aluminum Pickaxe", - "item.voluminousenergy.aluminum_axe": "Aluminum Axe", - "item.voluminousenergy.aluminum_sword": "Aluminum Sword", - "item.voluminousenergy.aluminum_hoe": "Aluminum Hoe", - "item.voluminousenergy.aluminum_shovel": "Aluminum Shovel", - "item.voluminousenergy.carbon_pickaxe": "Carbon Pickaxe", - "item.voluminousenergy.carbon_axe": "Carbon Axe", - "item.voluminousenergy.carbon_sword": "Carbon Sword", - "item.voluminousenergy.carbon_hoe": "Carbon Hoe", - "item.voluminousenergy.carbon_shovel": "Carbon Shovel", - "item.voluminousenergy.titanium_pickaxe": "Titanium Pickaxe", - "item.voluminousenergy.titanium_axe": "Titanium Axe", - "item.voluminousenergy.titanium_sword": "Titanium Sword", - "item.voluminousenergy.titanium_hoe": "Titanium Hoe", - "item.voluminousenergy.titanium_shovel": "Titanium Shovel", - "item.voluminousenergy.tungsten_pickaxe": "Tungsten Pickaxe", - "item.voluminousenergy.tungsten_axe": "Tungsten Axe", - "item.voluminousenergy.tungsten_sword": "Tungsten Sword", - "item.voluminousenergy.tungsten_hoe": "Tungsten Hoe", - "item.voluminousenergy.tungsten_shovel": "Tungsten Shovel", - "item.voluminousenergy.tungsten_steel_pickaxe": "Tungsten Steel Pickaxe", - "item.voluminousenergy.tungsten_steel_axe": "Tungsten Steel Axe", - "item.voluminousenergy.tungsten_steel_sword": "Tungsten Steel Sword", - "item.voluminousenergy.tungsten_steel_hoe": "Tungsten Steel Hoe", - "item.voluminousenergy.tungsten_steel_shovel": "Tungsten Steel Shovel", - "item.voluminousenergy.nighalite_pickaxe": "Nighalite Pickaxe", - "item.voluminousenergy.nighalite_axe": "Nighalite Axe", - "item.voluminousenergy.nighalite_sword": "Nighalite Sword", - "item.voluminousenergy.nighalite_hoe": "Nighalite Hoe", - "item.voluminousenergy.nighalite_shovel": "Nighalite Shovel", - "item.voluminousenergy.eighzo_pickaxe": "Eighzo Pickaxe", - "item.voluminousenergy.eighzo_axe": "Eighzo Axe", - "item.voluminousenergy.eighzo_sword": "Eighzo Sword", - "item.voluminousenergy.eighzo_hoe": "Eighzo Hoe", - "item.voluminousenergy.eighzo_shovel": "Eighzo Shovel", - "item.voluminousenergy.solarium_pickaxe": "Solarium Pickaxe", - "item.voluminousenergy.solarium_axe": "Solarium Axe", - "item.voluminousenergy.solarium_sword": "Solarium Sword", - "item.voluminousenergy.solarium_hoe": "Solarium Hoe", - "item.voluminousenergy.solarium_shovel": "Solarium Shovel", - "item.voluminousenergy.copper_dust": "Copper Dust", - "item.voluminousenergy.cupric_oxide_dust": "Cupric Oxide Dust", - "item.voluminousenergy.copper_carbonate_dust": "Copper Carbonate Dust", - "item.voluminousenergy.titanium_sawblade": "Titanium Sawblade", - "item.voluminousenergy.saw_dust": "Saw Dust", - "item.voluminousenergy.rosin": "Rosin", - "item.voluminousenergy.tree_sap_bucket": "Tree Sap Bucket", - "item.voluminousenergy.treethanol_bucket": "Treethanol Bucket", - "item.voluminousenergy.standard_tank_frame": "Standard Tank Frame", - "item.voluminousenergy.robust_tank_frame": "Robust Tank Frame", - "item.voluminousenergy.impeccable_tank_frame": "Impeccable Tank Frame", - "item.voluminousenergy.tiny_charcoal": "Tiny Charcoal", - "item.voluminousenergy.tiny_coal": "Tiny Coal", - "item.voluminousenergy.tiny_coal_coke": "Tiny Coal Coke", - "item.voluminousenergy.tiny_petcoke": "Tiny Petcoke", - "item.voluminousenergy.tiny_rosin": "Tiny Rosin", - "item.voluminousenergy.flour_dust": "Flour Dust", - "item.voluminousenergy.ammonia_bucket": "Ammonia Bucket", - "item.voluminousenergy.ammonium_nitrate_solution_bucket": "Ammonium Nitrate Solution Bucket", - "item.voluminousenergy.animal_fat": "Animal Fat", - "item.voluminousenergy.dough": "Dough", - "item.voluminousenergy.mysterious_multiplier": "Mysterious Multiplier", - "item.voluminousenergy.mercury_battery_pack": "Mercury Battery Pack", - "item.voluminousenergy.lead_acid_battery_pack": "Lead-Acid Battery Pack", - "item.voluminousenergy.hydrogen_bucket": "Hydrogen Bucket", - "item.voluminousenergy.fluid_scanner": "Fluid Scanner", - "item.voluminousenergy.rfid_chip": "RFID Chip", - "item.voluminousenergy.creative_fluid_scanner": "Creative Fluid Scanner", - - "_comment": "Multitool Items", - "item.voluminousenergy.empty_multitool": "Empty Multitool", - "item.voluminousenergy.iron_drill_bit": "Iron Drill Bit", - "item.voluminousenergy.iron_chain_bit": "Iron Chain Bit", - "item.voluminousenergy.iron_scooper_bit": "Iron Scooper Bit", - "item.voluminousenergy.iron_trimmer_bit": "Iron Trimmer Bit", - "item.voluminousenergy.iron_chain_multitool": "Iron Chainsaw Multitool", - "item.voluminousenergy.iron_drill_multitool": "Iron Drill Multitool", - "item.voluminousenergy.iron_scooper_multitool": "Iron Scooper Multitool", - "item.voluminousenergy.iron_trimmer_multitool": "Iron Trimmer Multitool", - "item.voluminousenergy.diamond_drill_bit": "Diamond Drill Bit", - "item.voluminousenergy.diamond_chain_bit": "Diamond Chain Bit", - "item.voluminousenergy.diamond_scooper_bit": "Diamond Scooper Bit", - "item.voluminousenergy.diamond_trimmer_bit": "Diamond Trimmer Bit", - "item.voluminousenergy.diamond_chain_multitool": "Diamond Chainsaw Multitool", - "item.voluminousenergy.diamond_drill_multitool": "Diamond Drill Multitool", - "item.voluminousenergy.diamond_scooper_multitool": "Diamond Scooper Multitool", - "item.voluminousenergy.diamond_trimmer_multitool": "Diamond Trimmer Multitool", - "item.voluminousenergy.titanium_drill_bit": "Titanium Drill Bit", - "item.voluminousenergy.titanium_chain_bit": "Titanium Chain Bit", - "item.voluminousenergy.titanium_scooper_bit": "Titanium Scooper Bit", - "item.voluminousenergy.titanium_trimmer_bit": "Titanium Trimmer Bit", - "item.voluminousenergy.titanium_chain_multitool": "Titanium Chainsaw Multitool", - "item.voluminousenergy.titanium_drill_multitool": "Titanium Drill Multitool", - "item.voluminousenergy.titanium_scooper_multitool": "Titanium Scooper Multitool", - "item.voluminousenergy.titanium_trimmer_multitool": "Titanium Trimmer Multitool", - "item.voluminousenergy.nighalite_drill_bit": "Nighalite Drill Bit", - "item.voluminousenergy.nighalite_chain_bit": "Nighalite Chain Bit", - "item.voluminousenergy.nighalite_scooper_bit": "Nighalite Scooper Bit", - "item.voluminousenergy.nighalite_trimmer_bit": "Nighalite Trimmer Bit", - "item.voluminousenergy.nighalite_chain_multitool": "Nighalite Chainsaw Multitool", - "item.voluminousenergy.nighalite_drill_multitool": "Nighalite Drill Multitool", - "item.voluminousenergy.nighalite_scooper_multitool": "Nighalite Scooper Multitool", - "item.voluminousenergy.nighalite_trimmer_multitool": "Nighalite Trimmer Multitool", - "item.voluminousenergy.eighzo_drill_bit": "Eighzo Drill Bit", - "item.voluminousenergy.eighzo_chain_bit": "Eighzo Chain Bit", - "item.voluminousenergy.eighzo_scooper_bit": "Eighzo Scooper Bit", - "item.voluminousenergy.eighzo_trimmer_bit": "Eighzo Trimmer Bit", - "item.voluminousenergy.eighzo_chain_multitool": "Eighzo Chainsaw Multitool", - "item.voluminousenergy.eighzo_drill_multitool": "Eighzo Drill Multitool", - "item.voluminousenergy.eighzo_scooper_multitool": "Eighzo Scooper Multitool", - "item.voluminousenergy.eighzo_trimmer_multitool": "Eighzo Trimmer Multitool", - "item.voluminousenergy.solarium_drill_bit": "Solarium Drill Bit", - "item.voluminousenergy.solarium_chain_bit": "Solarium Chain Bit", - "item.voluminousenergy.solarium_scooper_bit": "Solarium Scooper Bit", - "item.voluminousenergy.solarium_trimmer_bit": "Solarium Trimmer Bit", - "item.voluminousenergy.solarium_chain_multitool": "Solarium Chainsaw Multitool", - "item.voluminousenergy.solarium_drill_multitool": "Solarium Drill Multitool", - "item.voluminousenergy.solarium_scooper_multitool": "Solarium Scooper Multitool", - "item.voluminousenergy.solarium_trimmer_multitool": "Solarium Trimmer Multitool", - - "_comment" : "Advancements", - "advancements.voluminousenergy.root.title": "Voluminous Energy", - "advancements.voluminousenergy.root.description": "The most energetic achievements you've seen!", - "advancements.voluminousenergy.overworld.stuck_in_oil.title": "It's A Lot Stickier Than It Looks", - "advancements.voluminousenergy.overworld.stuck_in_oil.description": "Dip your toes in some crude oil.", - "advancements.voluminousenergy.machine.activate_dimensional_laser.title": "What Have I done?", - "advancements.voluminousenergy.machine.activate_dimensional_laser.description": "Rip open a portal into another dimension.", - "advancements.voluminousenergy.machine.obtain.primitive_blast_furnace.title": "Fuel Doubling", - "advancements.voluminousenergy.machine.obtain.primitive_blast_furnace.description": "Craft a Primitive Blast Furnace to enrich certain solid fuels!", - "advancements.voluminousenergy.machine.obtain.primitive_stirling_generator.title": "Primitive Power", - "advancements.voluminousenergy.machine.obtain.primitive_stirling_generator.description": "Craft a Primitive Stirling Generator to get some power up and running!", - "advancements.voluminousenergy.machine.obtain.crusher.title": "Lust for Dust", - "advancements.voluminousenergy.machine.obtain.crusher.description": "Craft a Crusher to fulfill your desires to get your grubby hands on some grinded up dust!", - "advancements.voluminousenergy.machine.obtain.electrolyzer.title": "Dust Electrocution", - "advancements.voluminousenergy.machine.obtain.electrolyzer.description": "Craft an Electrolyzer to electrocute compound dusts to get their elemental forms!", - "advancements.voluminousenergy.machine.obtain.stirling_generator.title": "Coal Age", - "advancements.voluminousenergy.machine.obtain.stirling_generator.description": "Upgrade your Primitive Stirling Generator to a Stirling Generator to formally enter the age of coal power!", - "advancements.voluminousenergy.machine.obtain.combustion_generator.title": "Fluid Age", - "advancements.voluminousenergy.machine.obtain.combustion_generator.description": "Pfft! Solid fuels are so outdated. Fluid-based fuels offer so much more energy!", - "advancements.voluminousenergy.machine.obtain.battery_box.title": "Is this a battery?", - "advancements.voluminousenergy.machine.obtain.battery_box.description": "Craft a battery box and figure out what it does!", - "advancements.voluminousenergy.machine.obtain.centrifugal_separator.title": "Dizzy dusts unmix", - "advancements.voluminousenergy.machine.obtain.centrifugal_separator.description": "Craft a Centrifugal Separator and start spinning those dusts around!", - "advancements.voluminousenergy.machine.obtain.centrifugal_agitator.title": "Dizzy fluids unmix", - "advancements.voluminousenergy.machine.obtain.centrifugal_agitator.description": "Craft a Centrifugal Agitator and use centrifugal forces caused by the machine's agitator to separate mixed fluids!", - "advancements.voluminousenergy.machine.obtain.aqueoulizer.title": "Solution maker", - "advancements.voluminousenergy.machine.obtain.aqueoulizer.description": "Craft an Aqueoulizer and start making some (mostly aqueous) solutions by \"aqueoulizing\" (dissolving) dusts into water! (... and other fluids too I guess)", - "advancements.voluminousenergy.machine.obtain.distillation_unit.title": "Oil Tycoon", - "advancements.voluminousenergy.machine.obtain.distillation_unit.description": "Craft a Distillation Unit and begin your Oil Tycoon journey!", - "advancements.voluminousenergy.machine.obtain.blast_furnace.title": "Blast 'em with heat", - "advancements.voluminousenergy.machine.obtain.blast_furnace.description": "Craft a Blast Furnace and begin blasting those metals with heat to alloy!", - "advancements.voluminousenergy.machine.obtain.tooling_station.title": "A station for Tooling", - "advancements.voluminousenergy.machine.obtain.tooling_station.description": "Craft a Tooling Station and start tinkering with those bits!", - "advancements.voluminousenergy.item.obtain.solarium_ingot.title": "What color is this?!", - "advancements.voluminousenergy.item.obtain.solarium_ingot.description": "Obtain the elusive Solarium Ingot that seemingly produces different colors depending on the angle of incidence", - "advancements.voluminousenergy.item.obtain.titanium_ingot.title": "Is it Tee-ai or Tie?", - "advancements.voluminousenergy.item.obtain.titanium_ingot.description": "Seriously which one for \"Ti\", does anyone know? Whatever, you got the Titanium Ingot, that's what matters.", - - "_comment": "Biomes", - "biome.voluminousenergy.red_desert": "Red Desert", - - "_comment": "JEI UI Recipe Names", - "jei.voluminousenergy.aqueoulizing": "Aqueoulizing", - "jei.voluminousenergy.centrifugal_agitation": "Centrifugal Agitation", - "jei.voluminousenergy.centrifugal_separation": "Centrifugal Separation", - "jei.voluminousenergy.combustion": "Combustion", - "jei.voluminousenergy.compressing": "Compressing", - "jei.voluminousenergy.crushing": "Crushing", - "jei.voluminousenergy.distilling": "Distilling", - "jei.voluminousenergy.electrolyzing": "Electrolyzing", - "jei.voluminousenergy.implosion_compressing": "Implosion Compressing", - "jei.voluminousenergy.industrial_blasting": "Industrial Blasting", - "jei.voluminousenergy.stirling": "Stirling", - "jei.voluminousenergy.tooling": "Tooling", - "jei.voluminousenergy.sawmilling": "Sawmilling", - "jei.voluminousenergy.fluid_electrolyzing": "Fluid Electrolyzing", - "jei.voluminousenergy.fluid_mixing": "Fluid Mixing", - "jei.voluminousenergy.primitive_blasting": "Primitive Blasting", - "jei.voluminousenergy.hydroponic_incubating": "Hydroponic Incubating", - "jei.voluminousenergy.dimensional_lasing": "Dimensional Lasing", - - "_comment": "JEI UI Info", - "jei.voluminousenergy.crude_oil_info": "Crude Oil can be obtained either from Oil Geysers, Oil Lakes, or Soul Sand in the Centrifugal Separator", - "jei.voluminousenergy.air_compressor_fluid_info": "Compressed Air can be obtained via the Air Compressor", - "jei.voluminousenergy.air_compressor_item_info": "Compressed Air can be obtained via the Air Compressor; The Air Compressor produces Compressed Air", - "jei.voluminousenergy.quartz_multiplier_info": "Quartz Multipliers can speed up machines at the cost of higher power consumption. The upgrade slot is the slot with a green arrow on the top right. See: https://wiki-energy.voluminous.ca/index.php?title=Machine_upgrades for more details.", - "jei.voluminousenergy.mysterious_multiplier_info": "Mysterious Multipliers are old, gold capped clock sources to speed up machines. You'll find them in various loot chests, and maybe even from the sea. Hover over the item in JEI to see details about each quality tier. (Left-click on the item to start cycling between tiers)", - "jei.voluminousenergy.fluid_scanner_info": "Use the Fluid Scanner to scan for fluids in a chunk, then Shift+Right Click to write to an RFID chip for use in the Dimensional Laser.", - - "_comment": "JEI Fluid Types for Combustion", - "jei.voluminousenergy.fluid.fuel": "Fuel", - "jei.voluminousenergy.fluid.oxidizer": "Oxidizer", - - "_comment": "JEI Misc", - "jei.voluminousenergy.volumetric_energy": "Volumetric Energy" + "_comment": "Text", + "text.voluminousenergy.multiblock_warn": "Multiblock Invalid", + "text.voluminousenergy.multiblock.needed_behind": "BEHIND the Machine is needed", + "text.voluminousenergy.multiblock.needed_below": "BELOW the Machine is needed", + "text.voluminousenergy.multiblock.distillation_unit.requirements": "3x3x3 Aluminum Machine Casing", + "text.voluminousenergy.multiblock.blast_furnace.requirements": "3x3x3 Titanium Machine Casing", + "text.voluminousenergy.multiblock.dimensional_laser.requirements": "3x3x3 Solarium Machine Casing", + "text.voluminousenergy.temperature": "Temperature", + "text.voluminousenergy.protective_sheath": "Protective Sheath", + "text.voluminousenergy.generating": "Generating", + "text.voluminousenergy.percent_complete": "Percent Complete", + "text.voluminousenergy.percent_burned": "Percent Burned", + "text.voluminousenergy.ticks_left": "Ticks Left", + "text.voluminousenergy.battery_box.sending_out_power": "Sending out stored energy onto the FE grid", + "text.voluminousenergy.battery_box.receiving_power": "Receiving energy from the FE grid", + "text.voluminousenergy.energy": "Energy", + "text.voluminousenergy.chunk": "Chunk", + "text.voluminousenergy.found_fluid": "Found fluid", + "text.voluminousenergy.fluid_scanner.needs_empty_rfid": "You need an empty RFID chip in order to be able to save fluid data!", + "text.voluminousenergy.fluid_scanner.scanning": "Scanning", + "text.voluminousenergy.rfid.inventory_full": "Cannot write to RFID chip; inventory is full!", + "text.voluminousenergy.rfid.write_success": "Successfully written chunk data to an RFID chip!", + "text.voluminousenergy.rfid.chunk_data_error": "ERROR: Chunk data is null / not saved!", + "text.voluminousenergy.rfid.chunk_not_scanned": "Chunk must be scanned before writing!", + "_comment": "Translators: Quality tiers are translated from Korean to English. For the original, see either ko_kr.json or https://archeage.xlgames.com/wikis/%EC%95%84%EC%9D%B4%ED%85%9C%20%EB%93%B1%EA%B8%89#h2-1", + "text.voluminousenergy.quality": "Quality", + "text.voluminousenergy.quality.unidentified": "Unidentified", + "text.voluminousenergy.quality.basic": "Basic", + "text.voluminousenergy.quality.grand": "Grand", + "text.voluminousenergy.quality.rare": "Rare", + "text.voluminousenergy.quality.arcane": "Arcane", + "text.voluminousenergy.quality.heroic": "Heroic", + "text.voluminousenergy.quality.unique": "Unique", + "text.voluminousenergy.quality.celestial": "Celestial", + "text.voluminousenergy.quality.divine": "Divine", + "text.voluminousenergy.quality.epic": "Epic", + "text.voluminousenergy.quality.legendary": "Legendary", + "text.voluminousenergy.quality.mythic": "Mythic", + "_comment": "Directions", + "direction.voluminousenergy.up": "Up", + "direction.voluminousenergy.down": "Down", + "direction.voluminousenergy.north": "North", + "direction.voluminousenergy.south": "South", + "direction.voluminousenergy.east": "East", + "direction.voluminousenergy.west": "West", + "direction.voluminousenergy.left": "Left", + "direction.voluminousenergy.right": "Right", + "direction.voluminousenergy.front": "Front", + "direction.voluminousenergy.back": "Back", + "_comment": "Slot Names", + "slot.voluminousenergy.rng_slot": "RNG Slot", + "slot.voluminousenergy.input_slot": "Slot", + "slot.voluminousenergy.output_slot": "Slot", + "slot.voluminousenergy.upgrade_slot": "Slot", + "slot.voluminousenergy.bucket_slot": "Bucket Slot", + "_comment": "Tank Names", + "tank.voluminousenergy.input_tank": "Tank", + "tank.voluminousenergy.output_tank": "Tank", + "tank.voluminousenergy.both_tank": "Tank", + "tank.voluminousenergy.invalid": "INVALID", + "tank.voluminousenergy.null": "NULL", + "_comment": "IO Menu Labels (shorts)", + "gui.voluminousenergy.slot_short": "S", + "gui.voluminousenergy.tank_short": "T", + "_comment": "Blocks", + "block.voluminousenergy.primitiveblastfurnace": "Primitive Blast Furnace", + "block.voluminousenergy.primitivestirlinggenerator": "Primitive Stirling Generator", + "block.voluminousenergy.saltpeterore": "Saltpeter Ore", + "block.voluminousenergy.bauxiteore": "Bauxite Ore", + "block.voluminousenergy.cinnabarore": "Cinnabar Ore", + "block.voluminousenergy.rutileore": "Rutile Ore", + "block.voluminousenergy.crusher": "Crusher", + "block.voluminousenergy.galena_ore": "Galena Ore", + "block.voluminousenergy.deepslate_bauxite_ore": "Deepslate Bauxite Ore", + "block.voluminousenergy.deepslate_cinnabar_ore": "Deepslate Cinnabar Ore", + "block.voluminousenergy.deepslate_galena_ore": "Deepslate Galena Ore", + "block.voluminousenergy.deepslate_rutile_ore": "Deepslate Rutile Ore", + "block.voluminousenergy.red_saltpeter_ore": "Saltpeter Ore", + "block.voluminousenergy.electrolyzer": "Electrolyzer", + "block.voluminousenergy.centrifugal_agitator": "Centrifugal Agitator", + "block.voluminousenergy.aluminum_shell": "Aluminum Shell", + "block.voluminousenergy.compressor": "Compressor", + "block.voluminousenergy.stirling_generator": "Stirling Generator", + "block.voluminousenergy.combustion_generator": "Combustion Generator", + "block.voluminousenergy.aqueoulizer": "Aqueoulizer", + "block.voluminousenergy.carbon_shielded_aluminum_machine_frame": "Carbon Shielded Aluminum Machine Frame", + "block.voluminousenergy.air_compressor": "Air Compressor", + "block.voluminousenergy.distillation_unit": "Distillation Unit", + "block.voluminousenergy.aluminum_machine_casing": "Aluminum Machine Casing", + "block.voluminousenergy.titanium_machine_casing": "Titanium Machine Casing", + "block.voluminousenergy.pump": "Pump", + "block.voluminousenergy.gas_fired_furnace": "Gas Furnace", + "block.voluminousenergy.electric_furnace": "Electric Furnace", + "block.voluminousenergy.battery_box": "Battery Box", + "block.voluminousenergy.primitive_solar_panel": "Primitive Solar Panel", + "block.voluminousenergy.solar_panel": "Solar Panel", + "block.voluminousenergy.centrifugal_separator": "Centrifugal Separator", + "block.voluminousenergy.implosion_compressor": "Implosion Compressor", + "block.voluminousenergy.blast_furnace": "Blast Furnace", + "block.voluminousenergy.rice_crop": "Rice", + "block.voluminousenergy.solarium_block": "Block of Solarium", + "block.voluminousenergy.eighzo_ore": "Eighzo Ore", + "block.voluminousenergy.raw_bauxite_block": "Raw Bauxite Block", + "block.voluminousenergy.raw_cinnabar_block": "Raw Cinnabar Block", + "block.voluminousenergy.raw_eighzo_block": "Raw Eighzo Block", + "block.voluminousenergy.raw_galena_block": "Raw Galena Block", + "block.voluminousenergy.raw_rutile_block": "Raw Rutile Block", + "block.voluminousenergy.tooling_station": "Tooling Station", + "block.voluminousenergy.sawmill": "Sawmill", + "block.voluminousenergy.pressure_ladder": "Pressure Ladder", + "block.voluminousenergy.aluminum_tank": "Aluminum Tank", + "block.voluminousenergy.titanium_tank": "Titanium Tank", + "block.voluminousenergy.netherite_tank": "Netherite Tank", + "block.voluminousenergy.nighalite_tank": "Nighalite Tank", + "block.voluminousenergy.eighzo_tank": "Eighzo Tank", + "block.voluminousenergy.solarium_tank": "Solarium Tank", + "block.voluminousenergy.dimensional_laser": "Dimensional laser", + "block.voluminousenergy.fluid_electrolyzer": "Fluid Electrolyzer", + "block.voluminousenergy.fluid_mixer": "Fluid Mixer", + "block.voluminousenergy.hydroponic_incubator": "Hydroponic Incubator", + "block.voluminousenergy.solarium_machine_casing": "Solarium Machine Casing", + "_comment": "Creative Tabs", + "tab.voluminousenergy.voluminousenergy": "Voluminous Energy", + "_comment": "Fluids", + "fluid.voluminousenergy.crude_oil": "Crude Oil", + "fluid.voluminousenergy.biofuel": "Biofuel", + "fluid.voluminousenergy.compressed_air": "Compressed Air", + "fluid.voluminousenergy.diesel": "Diesel", + "fluid.voluminousenergy.dinitrogen_tetroxide": "Dinitrogen Tetroxide", + "fluid.voluminousenergy.gasoline": "Gasoline", + "fluid.voluminousenergy.nitroglycerin": "Nitroglycerin", + "fluid.voluminousenergy.light_fuel": "Light Fuels", + "fluid.voluminousenergy.liquefied_coal": "Liquefied Coal", + "fluid.voluminousenergy.liquefied_coke": "Liquefied Coke", + "fluid.voluminousenergy.mercury": "Mercury", + "fluid.voluminousenergy.naphtha": "Naphtha", + "fluid.voluminousenergy.nitrogen": "Nitrogen", + "fluid.voluminousenergy.oxygen": "Oxygen", + "fluid.voluminousenergy.red_fuming_nitric_acid": "Red Fuming Nitric Acid", + "fluid.voluminousenergy.white_fuming_nitric_acid": "White Fuming Nitric Acid", + "fluid.voluminousenergy.sulfuric_acid": "Sulfuric Acid", + "fluid.voluminousenergy.tree_sap": "Tree Sap", + "fluid.voluminousenergy.treethanol": "Treethanol", + "fluid.voluminousenergy.hydrogen": "Hydrogen", + "fluid.voluminousenergy.ammonia": "Ammonia", + "fluid.voluminousenergy.ammonium_nitrate_solution": "Ammonium Nitrate Solution", + "_comment": "Fluid Types", + "fluid_type.voluminousenergy.crude_oil": "Crude Oil", + "fluid_type.voluminousenergy.biofuel": "Biofuel", + "fluid_type.voluminousenergy.compressed_air": "Compressed Air", + "fluid_type.voluminousenergy.diesel": "Diesel", + "fluid_type.voluminousenergy.dinitrogen_tetroxide": "Dinitrogen Tetroxide", + "fluid_type.voluminousenergy.gasoline": "Gasoline", + "fluid_type.voluminousenergy.nitroglycerin": "Nitroglycerin", + "fluid_type.voluminousenergy.light_fuel": "Light Fuels", + "fluid_type.voluminousenergy.liquefied_coal": "Liquefied Coal", + "fluid_type.voluminousenergy.liquefied_coke": "Liquefied Coke", + "fluid_type.voluminousenergy.mercury": "Mercury", + "fluid_type.voluminousenergy.naphtha": "Naphtha", + "fluid_type.voluminousenergy.nitrogen": "Nitrogen", + "fluid_type.voluminousenergy.oxygen": "Oxygen", + "fluid_type.voluminousenergy.red_fuming_nitric_acid": "Red Fuming Nitric Acid", + "fluid_type.voluminousenergy.white_fuming_nitric_acid": "White Fuming Nitric Acid", + "fluid_type.voluminousenergy.sulfuric_acid": "Sulfuric Acid", + "fluid_type.voluminousenergy.tree_sap": "Tree Sap", + "fluid_type.voluminousenergy.treethanol": "Treethanol", + "fluid_type.voluminousenergy.hydrogen": "Hydrogen", + "fluid_type.voluminousenergy.ammonia": "Ammonia", + "fluid_type.voluminousenergy.ammonium_nitrate_solution": "Ammonium Nitrate Solution", + "_comment": "Fluid Blocks", + "block.voluminousenergy.crude_oil": "Crude Oil", + "block.voluminousenergy.biofuel": "Biofuel", + "block.voluminousenergy.compressed_air": "Compressed Air", + "block.voluminousenergy.diesel": "Diesel", + "block.voluminousenergy.dinitrogen_tetroxide": "Dinitrogen Tetroxide", + "block.voluminousenergy.gasoline": "Gasoline", + "block.voluminousenergy.nitroglycerin": "Nitroglycerin", + "block.voluminousenergy.light_fuel": "Light Fuels", + "block.voluminousenergy.liquefied_coal": "Liquefied Coal", + "block.voluminousenergy.liquefied_coke": "Liquefied Coke", + "block.voluminousenergy.mercury": "Mercury", + "block.voluminousenergy.naphtha": "Naphtha", + "block.voluminousenergy.nitrogen": "Nitrogen", + "block.voluminousenergy.oxygen": "Oxygen", + "block.voluminousenergy.red_fuming_nitric_acid": "Red Fuming Nitric Acid", + "block.voluminousenergy.white_fuming_nitric_acid": "White Fuming Nitric Acid", + "block.voluminousenergy.sulfuric_acid": "Sulfuric Acid", + "block.voluminousenergy.tree_sap": "Tree Sap", + "block.voluminousenergy.treethanol": "Treethanol", + "block.voluminousenergy.hydrogen": "Hydrogen", + "block.voluminousenergy.ammonia": "Ammonia", + "block.voluminousenergy.ammonium_nitrate_solution": "Ammonium Nitrate Solution", + "_comment": "Items", + "item.voluminousenergy.petcoke": "Petcoke", + "item.voluminousenergy.coalcoke": "Coal Coke", + "item.voluminousenergy.coaldust": "Coal Dust", + "item.voluminousenergy.cokedust": "Coke Dust", + "item.voluminousenergy.lapisdust": "Lapis Dust", + "item.voluminousenergy.sulfurdust": "Sulfur Dust", + "item.voluminousenergy.carbondust": "Carbon Dust", + "item.voluminousenergy.saltpeterdust": "Saltpeter Dust", + "item.voluminousenergy.saltpeterchunk": "Saltpeter Chunk", + "item.voluminousenergy.carbonbrick": "Carbon Brick", + "item.voluminousenergy.stonegear": "Stone Gear", + "item.voluminousenergy.irongear": "Iron Gear", + "item.voluminousenergy.carbongear": "Carbon Gear", + "item.voluminousenergy.aluminum_dust": "Aluminum Dust", + "item.voluminousenergy.bauxite_dust": "Bauxite Dust", + "item.voluminousenergy.cinnabar_dust": "Cinnabar Dust", + "item.voluminousenergy.iron_dust": "Iron Dust", + "item.voluminousenergy.quartz_dust": "Quartz Dust", + "item.voluminousenergy.sand_dust": "Sand Dust", + "item.voluminousenergy.soulsand_dust": "Soulsand Dust", + "item.voluminousenergy.titanium_dust": "Titanium Dust", + "item.voluminousenergy.aluminum_ingot": "Aluminum Ingot", + "item.voluminousenergy.titanium_ingot": "Titanium Ingot", + "item.voluminousenergy.aluminum_gear": "Aluminum Gear", + "item.voluminousenergy.titanium_gear": "Titanium Gear", + "item.voluminousenergy.silicon": "Silicon", + "item.voluminousenergy.gold_microchip": "Golden Microchip", + "item.voluminousenergy.rutile_dust": "Rutile Dust", + "item.voluminousenergy.galena_dust": "Galena Dust", + "item.voluminousenergy.lead_dust": "Lead Dust", + "item.voluminousenergy.silver_dust": "Silver Dust", + "item.voluminousenergy.crude_oil_bucket": "Crude Oil Bucket", + "item.voluminousenergy.oxygen_bucket": "Oxygen Bucket", + "item.voluminousenergy.naphtha_bucket": "Naphtha Bucket", + "item.voluminousenergy.red_fuming_nitric_acid_bucket": "Red Fuming Nitric Acid Bucket", + "item.voluminousenergy.white_fuming_nitric_acid_bucket": "White Fuming Nitric Acid Bucket", + "item.voluminousenergy.mercury_bucket": "Mercury Bucket", + "item.voluminousenergy.sulfuric_acid_bucket": "Sulfuric Acid Bucket", + "item.voluminousenergy.silver_ingot": "Silver Ingot", + "item.voluminousenergy.lead_ingot": "Lead Ingot", + "item.voluminousenergy.gold_dust": "Gold Dust", + "item.voluminousenergy.dinitrogen_tetroxide_bucket": "Dinitrogen Tetroxide Bucket", + "item.voluminousenergy.aluminum_plate": "Aluminum Plate", + "item.voluminousenergy.carbon_plate": "Carbon Plate", + "item.voluminousenergy.compressed_air_bucket": "Compressed Air Bucket", + "item.voluminousenergy.nitrogen_bucket": "Nitrogen Bucket", + "item.voluminousenergy.biofuel_bucket": "Biofuel Bucket", + "item.voluminousenergy.diesel_bucket": "Diesel Bucket", + "item.voluminousenergy.gasoline_bucket": "Gasoline Bucket", + "item.voluminousenergy.nitroglycerin_bucket": "Nitroglycerin Bucket", + "item.voluminousenergy.light_fuel_bucket": "Light Fuels Bucket", + "item.voluminousenergy.liquefied_coal_bucket": "Liquefied Coal Bucket", + "item.voluminousenergy.liquefied_coke_bucket": "Liquefied Coke Bucket", + "item.voluminousenergy.shredded_biomass": "Shredded Biomass", + "item.voluminousenergy.silver_microchip": "Silver Microchip", + "item.voluminousenergy.titanium_plate": "Titanium Plate", + "item.voluminousenergy.quartz_multiplier": "Quartz Multiplier", + "item.voluminousenergy.mercury_battery": "Mercury Battery", + "item.voluminousenergy.lead_acid_battery": "Lead-Acid Battery", + "item.voluminousenergy.photovoltaic_dust": "Photovoltaic Dust", + "item.voluminousenergy.end_stone_dust": "End Stone Dust", + "item.voluminousenergy.basalt_dust": "Basalt Dust", + "item.voluminousenergy.flint_dust": "Flint Dust", + "item.voluminousenergy.netherrack_dust": "Netherrack Dust", + "item.voluminousenergy.raw_bauxite": "Raw Bauxite", + "item.voluminousenergy.raw_cinnabar": "Raw Cinnabar", + "item.voluminousenergy.raw_galena": "Raw Galena", + "item.voluminousenergy.raw_rutile": "Raw Rutile", + "item.voluminousenergy.raw_sulfur": "Raw Sulfur", + "item.voluminousenergy.netherite_dust": "Netherite Dust", + "item.voluminousenergy.tungsten_dust": "Tungsten Dust", + "item.voluminousenergy.tungsten_ingot": "Tungsten Ingot", + "item.voluminousenergy.steel_dust": "Steel Dust", + "item.voluminousenergy.steel_ingot": "Steel Ingot", + "item.voluminousenergy.tungsten_steel_ingot": "Tungsten Steel Ingot", + "item.voluminousenergy.raw_eighzo": "Raw Eighzo", + "item.voluminousenergy.eighzo_dust": "Eighzo Dust", + "item.voluminousenergy.eighzo_ingot": "Eighzo Ingot", + "item.voluminousenergy.solarium_dust": "Solarium Dust", + "item.voluminousenergy.solarium_ingot": "Solarium Ingot", + "item.voluminousenergy.solarium_gear": "Solarium Gear", + "item.voluminousenergy.solarium_plate": "Solarium Plate", + "item.voluminousenergy.nighalite_ingot": "Nighalite Ingot", + "item.voluminousenergy.cooked_rice": "Cooked Rice", + "item.voluminousenergy.aluminum_pickaxe": "Aluminum Pickaxe", + "item.voluminousenergy.aluminum_axe": "Aluminum Axe", + "item.voluminousenergy.aluminum_sword": "Aluminum Sword", + "item.voluminousenergy.aluminum_hoe": "Aluminum Hoe", + "item.voluminousenergy.aluminum_shovel": "Aluminum Shovel", + "item.voluminousenergy.carbon_pickaxe": "Carbon Pickaxe", + "item.voluminousenergy.carbon_axe": "Carbon Axe", + "item.voluminousenergy.carbon_sword": "Carbon Sword", + "item.voluminousenergy.carbon_hoe": "Carbon Hoe", + "item.voluminousenergy.carbon_shovel": "Carbon Shovel", + "item.voluminousenergy.titanium_pickaxe": "Titanium Pickaxe", + "item.voluminousenergy.titanium_axe": "Titanium Axe", + "item.voluminousenergy.titanium_sword": "Titanium Sword", + "item.voluminousenergy.titanium_hoe": "Titanium Hoe", + "item.voluminousenergy.titanium_shovel": "Titanium Shovel", + "item.voluminousenergy.tungsten_pickaxe": "Tungsten Pickaxe", + "item.voluminousenergy.tungsten_axe": "Tungsten Axe", + "item.voluminousenergy.tungsten_sword": "Tungsten Sword", + "item.voluminousenergy.tungsten_hoe": "Tungsten Hoe", + "item.voluminousenergy.tungsten_shovel": "Tungsten Shovel", + "item.voluminousenergy.tungsten_steel_pickaxe": "Tungsten Steel Pickaxe", + "item.voluminousenergy.tungsten_steel_axe": "Tungsten Steel Axe", + "item.voluminousenergy.tungsten_steel_sword": "Tungsten Steel Sword", + "item.voluminousenergy.tungsten_steel_hoe": "Tungsten Steel Hoe", + "item.voluminousenergy.tungsten_steel_shovel": "Tungsten Steel Shovel", + "item.voluminousenergy.nighalite_pickaxe": "Nighalite Pickaxe", + "item.voluminousenergy.nighalite_axe": "Nighalite Axe", + "item.voluminousenergy.nighalite_sword": "Nighalite Sword", + "item.voluminousenergy.nighalite_hoe": "Nighalite Hoe", + "item.voluminousenergy.nighalite_shovel": "Nighalite Shovel", + "item.voluminousenergy.eighzo_pickaxe": "Eighzo Pickaxe", + "item.voluminousenergy.eighzo_axe": "Eighzo Axe", + "item.voluminousenergy.eighzo_sword": "Eighzo Sword", + "item.voluminousenergy.eighzo_hoe": "Eighzo Hoe", + "item.voluminousenergy.eighzo_shovel": "Eighzo Shovel", + "item.voluminousenergy.solarium_pickaxe": "Solarium Pickaxe", + "item.voluminousenergy.solarium_axe": "Solarium Axe", + "item.voluminousenergy.solarium_sword": "Solarium Sword", + "item.voluminousenergy.solarium_hoe": "Solarium Hoe", + "item.voluminousenergy.solarium_shovel": "Solarium Shovel", + "item.voluminousenergy.copper_dust": "Copper Dust", + "item.voluminousenergy.cupric_oxide_dust": "Cupric Oxide Dust", + "item.voluminousenergy.copper_carbonate_dust": "Copper Carbonate Dust", + "item.voluminousenergy.titanium_sawblade": "Titanium Sawblade", + "item.voluminousenergy.saw_dust": "Saw Dust", + "item.voluminousenergy.rosin": "Rosin", + "item.voluminousenergy.tree_sap_bucket": "Tree Sap Bucket", + "item.voluminousenergy.treethanol_bucket": "Treethanol Bucket", + "item.voluminousenergy.standard_tank_frame": "Standard Tank Frame", + "item.voluminousenergy.robust_tank_frame": "Robust Tank Frame", + "item.voluminousenergy.impeccable_tank_frame": "Impeccable Tank Frame", + "item.voluminousenergy.tiny_charcoal": "Tiny Charcoal", + "item.voluminousenergy.tiny_coal": "Tiny Coal", + "item.voluminousenergy.tiny_coal_coke": "Tiny Coal Coke", + "item.voluminousenergy.tiny_petcoke": "Tiny Petcoke", + "item.voluminousenergy.tiny_rosin": "Tiny Rosin", + "item.voluminousenergy.flour_dust": "Flour Dust", + "item.voluminousenergy.ammonia_bucket": "Ammonia Bucket", + "item.voluminousenergy.ammonium_nitrate_solution_bucket": "Ammonium Nitrate Solution Bucket", + "item.voluminousenergy.animal_fat": "Animal Fat", + "item.voluminousenergy.dough": "Dough", + "item.voluminousenergy.mysterious_multiplier": "Mysterious Multiplier", + "item.voluminousenergy.mercury_battery_pack": "Mercury Battery Pack", + "item.voluminousenergy.lead_acid_battery_pack": "Lead-Acid Battery Pack", + "item.voluminousenergy.hydrogen_bucket": "Hydrogen Bucket", + "item.voluminousenergy.fluid_scanner": "Fluid Scanner", + "item.voluminousenergy.rfid_chip": "RFID Chip", + "item.voluminousenergy.creative_fluid_scanner": "Creative Fluid Scanner", + "_comment": "Multitool Items", + "item.voluminousenergy.empty_multitool": "Empty Multitool", + "item.voluminousenergy.iron_drill_bit": "Iron Drill Bit", + "item.voluminousenergy.iron_chain_bit": "Iron Chain Bit", + "item.voluminousenergy.iron_scooper_bit": "Iron Scooper Bit", + "item.voluminousenergy.iron_trimmer_bit": "Iron Trimmer Bit", + "item.voluminousenergy.iron_chain_multitool": "Iron Chainsaw Multitool", + "item.voluminousenergy.iron_drill_multitool": "Iron Drill Multitool", + "item.voluminousenergy.iron_scooper_multitool": "Iron Scooper Multitool", + "item.voluminousenergy.iron_trimmer_multitool": "Iron Trimmer Multitool", + "item.voluminousenergy.diamond_drill_bit": "Diamond Drill Bit", + "item.voluminousenergy.diamond_chain_bit": "Diamond Chain Bit", + "item.voluminousenergy.diamond_scooper_bit": "Diamond Scooper Bit", + "item.voluminousenergy.diamond_trimmer_bit": "Diamond Trimmer Bit", + "item.voluminousenergy.diamond_chain_multitool": "Diamond Chainsaw Multitool", + "item.voluminousenergy.diamond_drill_multitool": "Diamond Drill Multitool", + "item.voluminousenergy.diamond_scooper_multitool": "Diamond Scooper Multitool", + "item.voluminousenergy.diamond_trimmer_multitool": "Diamond Trimmer Multitool", + "item.voluminousenergy.titanium_drill_bit": "Titanium Drill Bit", + "item.voluminousenergy.titanium_chain_bit": "Titanium Chain Bit", + "item.voluminousenergy.titanium_scooper_bit": "Titanium Scooper Bit", + "item.voluminousenergy.titanium_trimmer_bit": "Titanium Trimmer Bit", + "item.voluminousenergy.titanium_chain_multitool": "Titanium Chainsaw Multitool", + "item.voluminousenergy.titanium_drill_multitool": "Titanium Drill Multitool", + "item.voluminousenergy.titanium_scooper_multitool": "Titanium Scooper Multitool", + "item.voluminousenergy.titanium_trimmer_multitool": "Titanium Trimmer Multitool", + "item.voluminousenergy.nighalite_drill_bit": "Nighalite Drill Bit", + "item.voluminousenergy.nighalite_chain_bit": "Nighalite Chain Bit", + "item.voluminousenergy.nighalite_scooper_bit": "Nighalite Scooper Bit", + "item.voluminousenergy.nighalite_trimmer_bit": "Nighalite Trimmer Bit", + "item.voluminousenergy.nighalite_chain_multitool": "Nighalite Chainsaw Multitool", + "item.voluminousenergy.nighalite_drill_multitool": "Nighalite Drill Multitool", + "item.voluminousenergy.nighalite_scooper_multitool": "Nighalite Scooper Multitool", + "item.voluminousenergy.nighalite_trimmer_multitool": "Nighalite Trimmer Multitool", + "item.voluminousenergy.eighzo_drill_bit": "Eighzo Drill Bit", + "item.voluminousenergy.eighzo_chain_bit": "Eighzo Chain Bit", + "item.voluminousenergy.eighzo_scooper_bit": "Eighzo Scooper Bit", + "item.voluminousenergy.eighzo_trimmer_bit": "Eighzo Trimmer Bit", + "item.voluminousenergy.eighzo_chain_multitool": "Eighzo Chainsaw Multitool", + "item.voluminousenergy.eighzo_drill_multitool": "Eighzo Drill Multitool", + "item.voluminousenergy.eighzo_scooper_multitool": "Eighzo Scooper Multitool", + "item.voluminousenergy.eighzo_trimmer_multitool": "Eighzo Trimmer Multitool", + "item.voluminousenergy.solarium_drill_bit": "Solarium Drill Bit", + "item.voluminousenergy.solarium_chain_bit": "Solarium Chain Bit", + "item.voluminousenergy.solarium_scooper_bit": "Solarium Scooper Bit", + "item.voluminousenergy.solarium_trimmer_bit": "Solarium Trimmer Bit", + "item.voluminousenergy.solarium_chain_multitool": "Solarium Chainsaw Multitool", + "item.voluminousenergy.solarium_drill_multitool": "Solarium Drill Multitool", + "item.voluminousenergy.solarium_scooper_multitool": "Solarium Scooper Multitool", + "item.voluminousenergy.solarium_trimmer_multitool": "Solarium Trimmer Multitool", + "_comment": "Advancements", + "advancements.voluminousenergy.root.title": "Voluminous Energy", + "advancements.voluminousenergy.root.description": "The most energetic achievements you've seen!", + "advancements.voluminousenergy.overworld.stuck_in_oil.title": "It's A Lot Stickier Than It Looks", + "advancements.voluminousenergy.overworld.stuck_in_oil.description": "Dip your toes in some crude oil.", + "advancements.voluminousenergy.machine.activate_dimensional_laser.title": "What Have I done?", + "advancements.voluminousenergy.machine.activate_dimensional_laser.description": "Rip open a portal into another dimension.", + "advancements.voluminousenergy.machine.obtain.primitive_blast_furnace.title": "Fuel Doubling", + "advancements.voluminousenergy.machine.obtain.primitive_blast_furnace.description": "Craft a Primitive Blast Furnace to enrich certain solid fuels!", + "advancements.voluminousenergy.machine.obtain.primitive_stirling_generator.title": "Primitive Power", + "advancements.voluminousenergy.machine.obtain.primitive_stirling_generator.description": "Craft a Primitive Stirling Generator to get some power up and running!", + "advancements.voluminousenergy.machine.obtain.crusher.title": "Lust for Dust", + "advancements.voluminousenergy.machine.obtain.crusher.description": "Craft a Crusher to fulfill your desires to get your grubby hands on some grinded up dust!", + "advancements.voluminousenergy.machine.obtain.electrolyzer.title": "Dust Electrocution", + "advancements.voluminousenergy.machine.obtain.electrolyzer.description": "Craft an Electrolyzer to electrocute compound dusts to get their elemental forms!", + "advancements.voluminousenergy.machine.obtain.stirling_generator.title": "Coal Age", + "advancements.voluminousenergy.machine.obtain.stirling_generator.description": "Upgrade your Primitive Stirling Generator to a Stirling Generator to formally enter the age of coal power!", + "advancements.voluminousenergy.machine.obtain.combustion_generator.title": "Fluid Age", + "advancements.voluminousenergy.machine.obtain.combustion_generator.description": "Pfft! Solid fuels are so outdated. Fluid-based fuels offer so much more energy!", + "advancements.voluminousenergy.machine.obtain.battery_box.title": "Is this a battery?", + "advancements.voluminousenergy.machine.obtain.battery_box.description": "Craft a battery box and figure out what it does!", + "advancements.voluminousenergy.machine.obtain.centrifugal_separator.title": "Dizzy dusts unmix", + "advancements.voluminousenergy.machine.obtain.centrifugal_separator.description": "Craft a Centrifugal Separator and start spinning those dusts around!", + "advancements.voluminousenergy.machine.obtain.centrifugal_agitator.title": "Dizzy fluids unmix", + "advancements.voluminousenergy.machine.obtain.centrifugal_agitator.description": "Craft a Centrifugal Agitator and use centrifugal forces caused by the machine's agitator to separate mixed fluids!", + "advancements.voluminousenergy.machine.obtain.aqueoulizer.title": "Solution maker", + "advancements.voluminousenergy.machine.obtain.aqueoulizer.description": "Craft an Aqueoulizer and start making some (mostly aqueous) solutions by \"aqueoulizing\" (dissolving) dusts into water! (... and other fluids too I guess)", + "advancements.voluminousenergy.machine.obtain.distillation_unit.title": "Oil Tycoon", + "advancements.voluminousenergy.machine.obtain.distillation_unit.description": "Craft a Distillation Unit and begin your Oil Tycoon journey!", + "advancements.voluminousenergy.machine.obtain.blast_furnace.title": "Blast 'em with heat", + "advancements.voluminousenergy.machine.obtain.blast_furnace.description": "Craft a Blast Furnace and begin blasting those metals with heat to alloy!", + "advancements.voluminousenergy.machine.obtain.tooling_station.title": "A station for Tooling", + "advancements.voluminousenergy.machine.obtain.tooling_station.description": "Craft a Tooling Station and start tinkering with those bits!", + "advancements.voluminousenergy.item.obtain.solarium_ingot.title": "What color is this?!", + "advancements.voluminousenergy.item.obtain.solarium_ingot.description": "Obtain the elusive Solarium Ingot that seemingly produces different colors depending on the angle of incidence", + "advancements.voluminousenergy.item.obtain.titanium_ingot.title": "Is it Tee-ai or Tie?", + "advancements.voluminousenergy.item.obtain.titanium_ingot.description": "Seriously which one for \"Ti\", does anyone know? Whatever, you got the Titanium Ingot, that's what matters.", + "_comment": "Biomes", + "biome.voluminousenergy.red_desert": "Red Desert", + "_comment": "JEI UI Recipe Names", + "jei.voluminousenergy.aqueoulizing": "Aqueoulizing", + "jei.voluminousenergy.centrifugal_agitation": "Centrifugal Agitation", + "jei.voluminousenergy.centrifugal_separation": "Centrifugal Separation", + "jei.voluminousenergy.combustion": "Combustion", + "jei.voluminousenergy.compressing": "Compressing", + "jei.voluminousenergy.crushing": "Crushing", + "jei.voluminousenergy.distilling": "Distilling", + "jei.voluminousenergy.electrolyzing": "Electrolyzing", + "jei.voluminousenergy.implosion_compressing": "Implosion Compressing", + "jei.voluminousenergy.industrial_blasting": "Industrial Blasting", + "jei.voluminousenergy.stirling": "Stirling", + "jei.voluminousenergy.tooling": "Tooling", + "jei.voluminousenergy.sawmilling": "Sawmilling", + "jei.voluminousenergy.fluid_electrolyzing": "Fluid Electrolyzing", + "jei.voluminousenergy.fluid_mixing": "Fluid Mixing", + "jei.voluminousenergy.primitive_blasting": "Primitive Blasting", + "jei.voluminousenergy.hydroponic_incubating": "Hydroponic Incubating", + "jei.voluminousenergy.dimensional_lasing": "Dimensional Lasing", + "_comment": "JEI UI Info", + "jei.voluminousenergy.crude_oil_info": "Crude Oil can be obtained either from Oil Geysers, Oil Lakes, or Soul Sand in the Centrifugal Separator", + "jei.voluminousenergy.air_compressor_fluid_info": "Compressed Air can be obtained via the Air Compressor", + "jei.voluminousenergy.air_compressor_item_info": "Compressed Air can be obtained via the Air Compressor; The Air Compressor produces Compressed Air", + "jei.voluminousenergy.quartz_multiplier_info": "Quartz Multipliers can speed up machines at the cost of higher power consumption. The upgrade slot is the slot with a green arrow on the top right. See: https://wiki-energy.voluminous.ca/index.php?title=Machine_upgrades for more details.", + "jei.voluminousenergy.mysterious_multiplier_info": "Mysterious Multipliers are old, gold capped clock sources to speed up machines. You'll find them in various loot chests, and maybe even from the sea. Hover over the item in JEI to see details about each quality tier. (Left-click on the item to start cycling between tiers)", + "jei.voluminousenergy.fluid_scanner_info": "Use the Fluid Scanner to scan for fluids in a chunk, then Shift+Right Click to write to an RFID chip for use in the Dimensional Laser.", + "_comment": "JEI Fluid Types for Combustion", + "jei.voluminousenergy.fluid.fuel": "Fuel", + "jei.voluminousenergy.fluid.oxidizer": "Oxidizer", + "_comment": "JEI Misc", + "jei.voluminousenergy.volumetric_energy": "Volumetric Energy" } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/lang/ja_jp.json b/src/main/resources/assets/voluminousenergy/lang/ja_jp.json index 4b5ba531a..9576a7e45 100644 --- a/src/main/resources/assets/voluminousenergy/lang/ja_jp.json +++ b/src/main/resources/assets/voluminousenergy/lang/ja_jp.json @@ -19,7 +19,6 @@ "text.voluminousenergy.quality.epic": "叙事詩", "text.voluminousenergy.quality.legendary": "伝説", "text.voluminousenergy.quality.mythic": "神話", - "_comment": "Directions", "direction.voluminousenergy.up": "上", "direction.voluminousenergy.down": "下", @@ -31,24 +30,20 @@ "direction.voluminousenergy.right": "右", "direction.voluminousenergy.front": "前部", "direction.voluminousenergy.back": "後ろ", - "_comment": "Slot Names", "slot.voluminousenergy.rng_slot": "RNGスロット", "slot.voluminousenergy.input_slot": "入力スロット", "slot.voluminousenergy.output_slot": "出すスロット", "slot.voluminousenergy.bucket_slot": "バケツスロット", - "_comment": "Tank Names", "tank.voluminousenergy.input_tank": "入力タンク", "tank.voluminousenergy.output_tank": "出すタンク", - "tank.voluminousenergy.both_tank" : "タンク", + "tank.voluminousenergy.both_tank": "タンク", "tank.voluminousenergy.invalid": "無効", "tank.voluminousenergy.null": "ヌル", - "_comment": "IO Menu Labels (shorts)", "gui.voluminousenergy.slot_short": "ス", "gui.voluminousenergy.tank_short": "タ", - "_comment": "Blocks", "block.voluminousenergy.primitiveblastfurnace": "原始高炉", "block.voluminousenergy.primitivestirlinggenerator": "原始スターリング発電機械", @@ -101,10 +96,8 @@ "block.voluminousenergy.nighalite_tank": "ナイオーライトータンク", "block.voluminousenergy.eighzo_tank": "エイーゾタンク", "block.voluminousenergy.solarium_tank": "ソーラーリウムタンク", - "_comment": "Creative Tabs", "itemGroup.voluminousenergy": "ヴォルミンウスエネルギー(英:Voluminous Energy)", - "_comment": "Fluids", "fluid.voluminousenergy.crude_oil": "原油", "fluid.voluminousenergy.biofuel": "バイオ燃料", @@ -128,7 +121,6 @@ "fluid.voluminousenergy.hydrogen": "水素", "fluid.voluminousenergy.ammonia": "アンモニア", "fluid.voluminousenergy.ammonium_nitrate_solution": "硝酸アンモニウム溶液", - "_comment": "Fluid Types", "fluid_type.voluminousenergy.crude_oil": "原油", "fluid_type.voluminousenergy.biofuel": "バイオ燃料", @@ -152,7 +144,6 @@ "fluid_type.voluminousenergy.hydrogen": "水素", "fluid_type.voluminousenergy.ammonia": "アンモニア", "fluid_type.voluminousenergy.ammonium_nitrate_solution": "硝酸アンモニウム溶液", - "_comment": "Fluid Blocks", "block.voluminousenergy.crude_oil": "原油", "block.voluminousenergy.biofuel": "バイオ燃料", @@ -176,7 +167,6 @@ "block.voluminousenergy.hydrogen": "水素", "block.voluminousenergy.ammonia": "アンモニア", "block.voluminousenergy.ammonium_nitrate_solution": "硝酸アンモニウム溶液", - "_comment": "Items", "item.voluminousenergy.petcoke": "石油コークス", "item.voluminousenergy.coalcoke": "石炭コークス", @@ -327,7 +317,6 @@ "item.voluminousenergy.hydrogen_bucket": "水素バケツ", "item.voluminousenergy.fluid_scanner": "流体場スキャナー", "item.voluminousenergy.rfid_chip": "RFID タグ", - "_comment": "マルチ道具 Items", "item.voluminousenergy.empty_multitool": "空のマルチ道具", "item.voluminousenergy.iron_drill_bit": "鉄ドリルビット", @@ -378,10 +367,8 @@ "item.voluminousenergy.solarium_drill_multitool": "ソーラーリウムドリルマルチ道具", "item.voluminousenergy.solarium_scooper_multitool": "ソーラーリウムスクーパーマルチ道具", "item.voluminousenergy.solarium_trimmer_multitool": "ソーラーリウムトリマーマルチ道具", - "_comment": "Biomes", "biome.voluminousenergy.red_desert": "Red Desert", - "_comment": "JEI UI Recipe Names", "jei.voluminousenergy.aqueoulizing": "水性します", "jei.voluminousenergy.centrifugal_agitation": "遠心力撹拌します", @@ -396,16 +383,13 @@ "jei.voluminousenergy.stirling": "固形燃料の燃焼", "jei.voluminousenergy.tooling": "ツールを作る", "jei.voluminousenergy.sawmilling": "製材します", - "_comment": "JEI UI Info", "jei.voluminousenergy.crude_oil_info": "原油は間欠泉や石油湖から供給されます。遠心分離機械でソウルサンドからも入手可能。", "jei.voluminousenergy.air_compressor_fluid_info": "空気コンプレッサー機械を使用して圧縮空気を取得します。", "jei.voluminousenergy.air_compressor_item_info": "空気コンプレッサー機械は圧縮空気を生成します。", - "_comment": "JEI Fluid Types for Combustion", "jei.voluminousenergy.fluid.fuel": "液体燃料", "jei.voluminousenergy.fluid.oxidizer": "酸化剤", - "_comment": "JEI Misc", "jei.voluminousenergy.volumetric_energy": "体積エネルギー密度" } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/lang/ko_kr.json b/src/main/resources/assets/voluminousenergy/lang/ko_kr.json index e04165356..d5a125ec6 100644 --- a/src/main/resources/assets/voluminousenergy/lang/ko_kr.json +++ b/src/main/resources/assets/voluminousenergy/lang/ko_kr.json @@ -1,396 +1,380 @@ { - "_comment": "Text", - "text.voluminousenergy.multiblock_warn": "유효하지 않은 멀티블록", - "text.voluminousenergy.multiblock.needed_behind": "을 기계 뒤에 설치해야 합니다", - "text.voluminousenergy.multiblock.distillation_unit.requirements": "3x3x3 알루미늄 기계 케이싱", - "text.voluminousenergy.multiblock.blast_furnace.requirements": "3x3x3 티타늄 기계 케이싱", - "text.voluminousenergy.temperature": "온도", - "text.voluminousenergy.protective_sheath": "내구도 보호", - "text.voluminousenergy.generating": "발전량", - "text.voluminousenergy.percent_complete": "완료 진행도", - "text.voluminousenergy.percent_burned": "연소 진행도", - "text.voluminousenergy.ticks_left": "남은 틱", - "text.voluminousenergy.battery_box.sending_out_power": "주변 블록으로 에너지를 송신합니다", - "text.voluminousenergy.battery_box.receiving_power": "주변 블록에서 에너지를 수신합니다", - "text.voluminousenergy.energy": "에너지", - "_comment": "Item quality tiers are natively from Korean. See: https://archeage.xlgames.com/wikis/아이템%20등급#h2-1", - "text.voluminousenergy.quality": "등급", - "text.voluminousenergy.quality.unidentified": "미확인", - "text.voluminousenergy.quality.basic": "일반", - "text.voluminousenergy.quality.grand": "고급", - "text.voluminousenergy.quality.rare": "희귀", - "text.voluminousenergy.quality.arcane": "고대", - "text.voluminousenergy.quality.heroic": "영웅", - "text.voluminousenergy.quality.unique": "유일", - "text.voluminousenergy.quality.celestial": "유물", - "text.voluminousenergy.quality.divine": "경이", - "text.voluminousenergy.quality.epic": "서사", - "text.voluminousenergy.quality.legendary": "전설", - "text.voluminousenergy.quality.mythic": "신화", - - "_comment": "Directions", - "direction.voluminousenergy.up": "위", - "direction.voluminousenergy.down": "아래", - "direction.voluminousenergy.north": "북", - "direction.voluminousenergy.south": "남", - "direction.voluminousenergy.east": "동", - "direction.voluminousenergy.west": "서", - "direction.voluminousenergy.left": "좌", - "direction.voluminousenergy.right": "우", - "direction.voluminousenergy.front": "앞", - "direction.voluminousenergy.back": "뒤", - - "_comment": "Slot Names", - "slot.voluminousenergy.rng_slot": "무작위 슬롯", - "slot.voluminousenergy.input_slot": "입력 슬롯", - "slot.voluminousenergy.output_slot": "출력 슬롯", - "slot.voluminousenergy.bucket_slot": "양동이 슬롯", - - "_comment": "Tank Names", - "tank.voluminousenergy.input_tank": "입력 탱크", - "tank.voluminousenergy.output_tank": "출력 탱크", - "tank.voluminousenergy.both_tank" : "탱크", - "tank.voluminousenergy.invalid": "유효하지 않음", - "tank.voluminousenergy.null": "NULL", - - "_comment": "IO Menu Labels (shorts)", - "gui.voluminousenergy.slot_short": "슬", - "gui.voluminousenergy.tank_short": "탱", - - "_comment": "Blocks", - "block.voluminousenergy.primitiveblastfurnace": "원시 용광로", - "block.voluminousenergy.primitivestirlinggenerator": "원시 스털링 발전기", - "block.voluminousenergy.saltpeterore": "초석 광석", - "block.voluminousenergy.bauxiteore": "보크사이트 광석", - "block.voluminousenergy.cinnabarore": "진사 광석", - "block.voluminousenergy.rutileore": "금홍석 광석", - "block.voluminousenergy.crusher": "분쇄기", - "block.voluminousenergy.galena_ore": "방연석 광석", - "block.voluminousenergy.deepslate_bauxite_ore": "심층암 보크사이트 광석", - "block.voluminousenergy.deepslate_cinnabar_ore": "심층암 진사 광석", - "block.voluminousenergy.deepslate_galena_ore": "심층암 방연석 광석", - "block.voluminousenergy.deepslate_rutile_ore": "심층암 금홍석 광석", - "block.voluminousenergy.red_saltpeter_ore": "초석 광석", - "block.voluminousenergy.electrolyzer": "전해조", - "block.voluminousenergy.centrifugal_agitator": "원심교반기", - "block.voluminousenergy.aluminum_shell": "알루미늄 껍데기", - "block.voluminousenergy.compressor": "압축기", - "block.voluminousenergy.stirling_generator": "스털링 발전기", - "block.voluminousenergy.combustion_generator": "연소 발전기", - "block.voluminousenergy.aqueoulizer": "수성화기", - "block.voluminousenergy.carbon_shielded_aluminum_machine_frame": "탄소 알루미늄 기계 프레임", - "block.voluminousenergy.air_compressor": "공기 압축기", - "block.voluminousenergy.distillation_unit": "증류 장치", - "block.voluminousenergy.aluminum_machine_casing": "알루미늄 기계 케이싱", - "block.voluminousenergy.titanium_machine_casing": "티타늄 기계 케이싱", - "block.voluminousenergy.pump": "펌프", - "block.voluminousenergy.gas_fired_furnace": "가스 화로", - "block.voluminousenergy.electric_furnace": "전기 화로", - "block.voluminousenergy.battery_box": "배터리 박스", - "block.voluminousenergy.primitive_solar_panel": "원시 태양 전지판", - "block.voluminousenergy.solar_panel": "태양 전지판", - "block.voluminousenergy.centrifugal_separator": "원심 분리기", - "block.voluminousenergy.implosion_compressor": "폭파 압축기", - "block.voluminousenergy.blast_furnace": "용광로", - "block.voluminousenergy.rice_crop": "쌀", - "block.voluminousenergy.solarium_block": "솔라륨 블록", - "block.voluminousenergy.eighzo_ore": "에이조 광석", - "block.voluminousenergy.raw_bauxite_block": "보크사이트 원석 블록", - "block.voluminousenergy.raw_cinnabar_block": "진사 원석 블록", - "block.voluminousenergy.raw_eighzo_block": "에이조 원석 블록", - "block.voluminousenergy.raw_galena_block": "방연석 원석 블록", - "block.voluminousenergy.raw_rutile_block": "금홍석 원석 블록", - "block.voluminousenergy.tooling_station": "도구 작업대", - "block.voluminousenergy.sawmill": "제재기", - "block.voluminousenergy.pressure_ladder": "압력 사다리", - "block.voluminousenergy.aluminum_tank": "알루미늄 탱크", - "block.voluminousenergy.titanium_tank": "티타늄 탱크", - "block.voluminousenergy.netherite_tank": "네더라이트 탱크", - "block.voluminousenergy.nighalite_tank": "나이아라이트 탱크", - "block.voluminousenergy.eighzo_tank": "에이조 탱크", - "block.voluminousenergy.solarium_tank": "솔라륨 탱크", - - "_comment": "Creative Tabs", - "itemGroup.voluminousenergy": "Voluminous Energy", - - "_comment": "Fluids", - "fluid.voluminousenergy.crude_oil": "원유", - "fluid.voluminousenergy.biofuel": "바이오연료", - "fluid.voluminousenergy.compressed_air": "압축 공기", - "fluid.voluminousenergy.diesel": "디젤", - "fluid.voluminousenergy.dinitrogen_tetroxide": "사산화 이질소", - "fluid.voluminousenergy.gasoline": "가솔린", - "fluid.voluminousenergy.nitroglycerin": "니트로글리세린", - "fluid.voluminousenergy.light_fuel": "경유", - "fluid.voluminousenergy.liquefied_coal": "액화 석탄", - "fluid.voluminousenergy.liquefied_coke": "액화 코크스", - "fluid.voluminousenergy.mercury": "수은", - "fluid.voluminousenergy.naphtha": "나프타", - "fluid.voluminousenergy.nitrogen": "질소", - "fluid.voluminousenergy.oxygen": "산소", - "fluid.voluminousenergy.red_fuming_nitric_acid": "적연질산", - "fluid.voluminousenergy.white_fuming_nitric_acid": "백연질산", - "fluid.voluminousenergy.sulfuric_acid": "황산", - "fluid.voluminousenergy.tree_sap": "나무 수액", - "fluid.voluminousenergy.treethanol": "나무 에탄올", - - "_comment": "Fluid Types", - "fluid_type.voluminousenergy.crude_oil": "원유", - "fluid_type.voluminousenergy.biofuel": "바이오연료", - "fluid_type.voluminousenergy.compressed_air": "압축 공기", - "fluid_type.voluminousenergy.diesel": "디젤", - "fluid_type.voluminousenergy.dinitrogen_tetroxide": "사산화 이질소", - "fluid_type.voluminousenergy.gasoline": "가솔린", - "fluid_type.voluminousenergy.nitroglycerin": "니트로글리세린", - "fluid_type.voluminousenergy.light_fuel": "경유", - "fluid_type.voluminousenergy.liquefied_coal": "액화 석탄", - "fluid_type.voluminousenergy.liquefied_coke": "액화 코크스", - "fluid_type.voluminousenergy.mercury": "수은", - "fluid_type.voluminousenergy.naphtha": "나프타", - "fluid_type.voluminousenergy.nitrogen": "질소", - "fluid_type.voluminousenergy.oxygen": "산소", - "fluid_type.voluminousenergy.red_fuming_nitric_acid": "적연질산", - "fluid_type.voluminousenergy.white_fuming_nitric_acid": "백연질산", - "fluid_type.voluminousenergy.sulfuric_acid": "황산", - "fluid_type.voluminousenergy.tree_sap": "나무 수액", - "fluid_type.voluminousenergy.treethanol": "나무 에탄올", - - "_comment": "Fluid Blocks", - "block.voluminousenergy.crude_oil": "원유", - "block.voluminousenergy.biofuel": "바이오연료", - "block.voluminousenergy.compressed_air": "압축 공기", - "block.voluminousenergy.diesel": "디젤", - "block.voluminousenergy.dinitrogen_tetroxide": "사산화 이질소", - "block.voluminousenergy.gasoline": "가솔린", - "block.voluminousenergy.nitroglycerin": "니트로글리세린", - "block.voluminousenergy.light_fuel": "경유", - "block.voluminousenergy.liquefied_coal": "액화 석탄", - "block.voluminousenergy.liquefied_coke": "액화 코크스", - "block.voluminousenergy.mercury": "수은", - "block.voluminousenergy.naphtha": "나프타", - "block.voluminousenergy.nitrogen": "질소", - "block.voluminousenergy.oxygen": "신소", - "block.voluminousenergy.red_fuming_nitric_acid": "적연질산", - "block.voluminousenergy.white_fuming_nitric_acid": "백연질산", - "block.voluminousenergy.sulfuric_acid": "황산", - "block.voluminousenergy.tree_sap": "나무 수액", - "block.voluminousenergy.treethanol": "나무 에탄올", - - "_comment": "Items", - "item.voluminousenergy.petcoke": "페트콕", - "item.voluminousenergy.coalcoke": "코크스", - "item.voluminousenergy.coaldust": "석탄 가루", - "item.voluminousenergy.cokedust": "코크스 가루", - "item.voluminousenergy.lapisdust": "청금석 가루", - "item.voluminousenergy.sulfurdust": "황 가루", - "item.voluminousenergy.carbondust": "탄소 가루", - "item.voluminousenergy.saltpeterdust": "초석 가루", - "item.voluminousenergy.saltpeterchunk": "초석 덩어리", - "item.voluminousenergy.carbonbrick": "탄소 벽돌", - "item.voluminousenergy.stonegear": "돌 기어", - "item.voluminousenergy.irongear": "철 기어", - "item.voluminousenergy.carbongear": "탄소 기어", - "item.voluminousenergy.aluminum_dust": "알루미늄 가루", - "item.voluminousenergy.bauxite_dust": "보크사이트 가루", - "item.voluminousenergy.cinnabar_dust": "진사 가루", - "item.voluminousenergy.iron_dust": "철 가루", - "item.voluminousenergy.quartz_dust": "석영 가루", - "item.voluminousenergy.sand_dust": "모래 가루", - "item.voluminousenergy.soulsand_dust": "영혼 모래 가루", - "item.voluminousenergy.titanium_dust": "티타늄 가루", - "item.voluminousenergy.aluminum_ingot": "알루미늄 주괴", - "item.voluminousenergy.titanium_ingot": "티타늄 주괴", - "item.voluminousenergy.aluminum_gear": "알루미늄 기어", - "item.voluminousenergy.titanium_gear": "티타늄 기어", - "item.voluminousenergy.silicon": "실리콘", - "item.voluminousenergy.gold_microchip": "금 마이크로칩", - "item.voluminousenergy.rutile_dust": "금홍석 가루", - "item.voluminousenergy.galena_dust": "방연석 가루", - "item.voluminousenergy.lead_dust": "납 가루", - "item.voluminousenergy.silver_dust": "은 가루", - "item.voluminousenergy.crude_oil_bucket": "원유 양동이", - "item.voluminousenergy.oxygen_bucket": "산소 양동이", - "item.voluminousenergy.naphtha_bucket": "나프타 양동이", - "item.voluminousenergy.red_fuming_nitric_acid_bucket": "적연질산 양동이", - "item.voluminousenergy.white_fuming_nitric_acid_bucket": "백연질산 양동이", - "item.voluminousenergy.mercury_bucket": "수은 양동이", - "item.voluminousenergy.sulfuric_acid_bucket": "황산 양동이", - "item.voluminousenergy.silver_ingot": "은 주괴", - "item.voluminousenergy.lead_ingot": "납 주괴", - "item.voluminousenergy.gold_dust": "금 가루", - "item.voluminousenergy.dinitrogen_tetroxide_bucket": "사산화 이질산 양동이", - "item.voluminousenergy.aluminum_plate": "알루미늄 판", - "item.voluminousenergy.carbon_plate": "탄소 판", - "item.voluminousenergy.compressed_air_bucket": "압축 공기 양동이", - "item.voluminousenergy.nitrogen_bucket": "질소 양동이", - "item.voluminousenergy.biofuel_bucket": "바이오연료 양동이", - "item.voluminousenergy.diesel_bucket": "디젤 양동이", - "item.voluminousenergy.gasoline_bucket": "가솔린 양동이", - "item.voluminousenergy.nitroglycerin_bucket": "니트로글리세린 양동이", - "item.voluminousenergy.light_fuel_bucket": "경유 양동이", - "item.voluminousenergy.liquefied_coal_bucket": "액화 석탄 양동이", - "item.voluminousenergy.liquefied_coke_bucket": "액화 코크스 양동이", - "item.voluminousenergy.shredded_biomass": "갈가리 찢긴 바이오연료", - "item.voluminousenergy.silver_microchip": "은 마이크로칩", - "item.voluminousenergy.titanium_plate": "티타늄 판", - "item.voluminousenergy.quartz_multiplier": "석영 배속기", - "item.voluminousenergy.mercury_battery": "수은 전지", - "item.voluminousenergy.lead_acid_battery": "납 축전지", - "item.voluminousenergy.photovoltaic_dust": "태양 전지 가루", - "item.voluminousenergy.end_stone_dust": "엔드 돌 가루", - "item.voluminousenergy.basalt_dust": "현무암 가루", - "item.voluminousenergy.flint_dust": "부싯돌 가루", - "item.voluminousenergy.netherrack_dust": "네더랙 가루", - "item.voluminousenergy.raw_bauxite": "보크사이트 원석", - "item.voluminousenergy.raw_cinnabar": "진사 원석", - "item.voluminousenergy.raw_galena": "방연석 원석", - "item.voluminousenergy.raw_rutile": "금홍석 원석", - "item.voluminousenergy.raw_sulfur": "황 원석", - "item.voluminousenergy.netherite_dust": "네더라이트 가루", - "item.voluminousenergy.tungsten_dust": "텅스텟 가루", - "item.voluminousenergy.tungsten_ingot": "텅스텐 주괴", - "item.voluminousenergy.steel_dust": "강철 가루", - "item.voluminousenergy.steel_ingot": "강철 주괴", - "item.voluminousenergy.tungsten_steel_ingot": "텅스텐강 주괴", - "item.voluminousenergy.raw_eighzo": "에이조 원석", - "item.voluminousenergy.eighzo_dust": "에이조 가루", - "item.voluminousenergy.eighzo_ingot": "에이조 주괴", - "item.voluminousenergy.solarium_dust": "솔라륨 가루", - "item.voluminousenergy.solarium_ingot": "솔라륨 주괴", - "item.voluminousenergy.solarium_gear": "솔라륨 기어", - "item.voluminousenergy.solarium_plate": "솔라륨 판", - "item.voluminousenergy.nighalite_ingot": "나이아라이트 주괴", - "item.voluminousenergy.cooked_rice": "밥", - "item.voluminousenergy.aluminum_pickaxe": "알루미늄 곡괭이", - "item.voluminousenergy.aluminum_axe": "알루미늄 도끼", - "item.voluminousenergy.aluminum_sword": "알루미늄 검", - "item.voluminousenergy.aluminum_hoe": "알루미늄 괭이", - "item.voluminousenergy.aluminum_shovel": "알루미늄 삽", - "item.voluminousenergy.carbon_pickaxe": "탄소 곡괭이", - "item.voluminousenergy.carbon_axe": "탄소 도끼", - "item.voluminousenergy.carbon_sword": "탄소 검", - "item.voluminousenergy.carbon_hoe": "탄소 괭이", - "item.voluminousenergy.carbon_shovel": "탄소 삽", - "item.voluminousenergy.titanium_pickaxe": "티타늄 곡괭이", - "item.voluminousenergy.titanium_axe": "티타늄 도끼", - "item.voluminousenergy.titanium_sword": "티타늄 검", - "item.voluminousenergy.titanium_hoe": "티타늄 괭이", - "item.voluminousenergy.titanium_shovel": "티타늄 삽", - "item.voluminousenergy.tungsten_pickaxe": "텅스텐 곡괭이", - "item.voluminousenergy.tungsten_axe": "텅스텐 도끼", - "item.voluminousenergy.tungsten_sword": "텅스텐 검", - "item.voluminousenergy.tungsten_hoe": "텅스텐 괭이", - "item.voluminousenergy.tungsten_shovel": "텅스텐 삽", - "item.voluminousenergy.tungsten_steel_pickaxe": "텅스텐강 곡괭이", - "item.voluminousenergy.tungsten_steel_axe": "텅스텐강 도끼", - "item.voluminousenergy.tungsten_steel_sword": "텅스텐강 검", - "item.voluminousenergy.tungsten_steel_hoe": "텅스텐강 괭이", - "item.voluminousenergy.tungsten_steel_shovel": "텅스텐강 삽", - "item.voluminousenergy.nighalite_pickaxe": "나이아라이트 곡괭이", - "item.voluminousenergy.nighalite_axe": "나이아라이트 도끼", - "item.voluminousenergy.nighalite_sword": "나이아라이트 검", - "item.voluminousenergy.nighalite_hoe": "나이아라이트 괭이", - "item.voluminousenergy.nighalite_shovel": "나이아라이트 삽", - "item.voluminousenergy.eighzo_pickaxe": "에이조 곡괭이", - "item.voluminousenergy.eighzo_axe": "에이조 도끼", - "item.voluminousenergy.eighzo_sword": "에이조 검", - "item.voluminousenergy.eighzo_hoe": "에이조 괭이", - "item.voluminousenergy.eighzo_shovel": "에이조 삽", - "item.voluminousenergy.solarium_pickaxe": "솔라륨 곡괭이", - "item.voluminousenergy.solarium_axe": "솔라륨 도끼", - "item.voluminousenergy.solarium_sword": "솔라륨 검", - "item.voluminousenergy.solarium_hoe": "솔라륨 괭이", - "item.voluminousenergy.solarium_shovel": "솔라륨 삽", - "item.voluminousenergy.copper_dust": "구리 가루", - "item.voluminousenergy.cupric_oxide_dust": "산화구리(II)", - "item.voluminousenergy.copper_carbonate_dust": "탄산구리 가루", - "item.voluminousenergy.titanium_sawblade": "티타늄 톱날", - "item.voluminousenergy.saw_dust": "톱밥", - "item.voluminousenergy.rosin": "로진", - "item.voluminousenergy.tree_sap_bucket": "나무 수액 양동이", - "item.voluminousenergy.treethanol_bucket": "나무 에탄올 양동이", - "item.voluminousenergy.standard_tank_frame": "표준 탱크 프레임", - "item.voluminousenergy.robust_tank_frame": "튼튼한 탱크 프레임", - "item.voluminousenergy.impeccable_tank_frame": "완벽한 탱크 프레임", - - "_comment": "Multitool Items", - "item.voluminousenergy.empty_multitool": "빈 멀티툴", - "item.voluminousenergy.iron_drill_bit": "철 드릴 비트", - "item.voluminousenergy.iron_chain_bit": "철 체인 비트", - "item.voluminousenergy.iron_scooper_bit": "철 스쿠퍼 비트", - "item.voluminousenergy.iron_trimmer_bit": "철 트리머 비트", - "item.voluminousenergy.iron_chain_multitool": "철 체인톱 멀티툴", - "item.voluminousenergy.iron_drill_multitool": "철 드릴 멀티툴", - "item.voluminousenergy.iron_scooper_multitool": "철 스쿠퍼 멀티툴", - "item.voluminousenergy.iron_trimmer_multitool": "철 트리머 멀티툴", - "item.voluminousenergy.diamond_drill_bit": "다이아몬드 드릴 비트", - "item.voluminousenergy.diamond_chain_bit": "다이아몬드 체인 비트", - "item.voluminousenergy.diamond_scooper_bit": "다이아몬드 스쿠퍼 비트", - "item.voluminousenergy.diamond_trimmer_bit": "다이아몬드 트리머 비트", - "item.voluminousenergy.diamond_chain_multitool": "다이아몬드 체인톱 멀티툴", - "item.voluminousenergy.diamond_drill_multitool": "다이아몬드 드릴 멀티툴", - "item.voluminousenergy.diamond_scooper_multitool": "다이아몬드 스쿠퍼 멀티툴", - "item.voluminousenergy.diamond_trimmer_multitool": "다이아몬드 트리머 멀티툴", - "item.voluminousenergy.titanium_drill_bit": "티타늄 드릴 비트", - "item.voluminousenergy.titanium_chain_bit": "티타늄 체인 비트", - "item.voluminousenergy.titanium_scooper_bit": "티타늄 스쿠퍼 비트", - "item.voluminousenergy.titanium_trimmer_bit": "티타늄 트리머 비트", - "item.voluminousenergy.titanium_chain_multitool": "티타늄 체인톱 멀티툴", - "item.voluminousenergy.titanium_drill_multitool": "티타늄 드릴 멀티툴", - "item.voluminousenergy.titanium_scooper_multitool": "티타늄 스쿠퍼 멀티툴", - "item.voluminousenergy.titanium_trimmer_multitool": "티타늄 트리머 멀티툴", - "item.voluminousenergy.nighalite_drill_bit": "나이아라이트 드릴 비트", - "item.voluminousenergy.nighalite_chain_bit": "나이아라이트 체인 비트", - "item.voluminousenergy.nighalite_scooper_bit": "나이아라이트 스쿠퍼 비트", - "item.voluminousenergy.nighalite_trimmer_bit": "나이아라이트 트리머 비트", - "item.voluminousenergy.nighalite_chain_multitool": "나이아라이트 체인톱 멀티툴", - "item.voluminousenergy.nighalite_drill_multitool": "나이아라이트 드릴 멀티툴", - "item.voluminousenergy.nighalite_scooper_multitool": "나이아라이트 스쿠퍼 멀티툴", - "item.voluminousenergy.nighalite_trimmer_multitool": "나이아라이트 트리머 멀티툴", - "item.voluminousenergy.eighzo_drill_bit": "에이조 드릴 비트", - "item.voluminousenergy.eighzo_chain_bit": "에이조 체인 비트", - "item.voluminousenergy.eighzo_scooper_bit": "에이조 스쿠퍼 비트", - "item.voluminousenergy.eighzo_trimmer_bit": "에이조 트리머 비트", - "item.voluminousenergy.eighzo_chain_multitool": "에이조 체인톱 멀티툴", - "item.voluminousenergy.eighzo_drill_multitool": "에이조 드릴 멀티툴", - "item.voluminousenergy.eighzo_scooper_multitool": "에이조 스쿠퍼 멀티툴", - "item.voluminousenergy.eighzo_trimmer_multitool": "에이조 트리머 멀티툴", - "item.voluminousenergy.solarium_drill_bit": "솔라륨 드릴 비트", - "item.voluminousenergy.solarium_chain_bit": "솔라륨 체인 비트", - "item.voluminousenergy.solarium_scooper_bit": "솔라륨 스쿠퍼 비트", - "item.voluminousenergy.solarium_trimmer_bit": "솔라륨 트리머 비트", - "item.voluminousenergy.solarium_chain_multitool": "솔라륨 체인톱 멀티툴", - "item.voluminousenergy.solarium_drill_multitool": "솔라륨 드릴 멀티툴", - "item.voluminousenergy.solarium_scooper_multitool": "솔라륨 스쿠퍼 멀티툴", - "item.voluminousenergy.solarium_trimmer_multitool": "솔라륨 트리머 멀티툴", - - "_comment": "Biomes", - "biome.voluminousenergy.red_desert": "붉은 사막", - - "_comment": "JEI UI Recipe Names", - "jei.voluminousenergy.aqueoulizing": "수성화", - "jei.voluminousenergy.centrifugal_agitation": "원심교반", - "jei.voluminousenergy.centrifugal_separation": "원심분리", - "jei.voluminousenergy.combustion": "연소", - "jei.voluminousenergy.compressing": "압축", - "jei.voluminousenergy.crushing": "분쇄", - "jei.voluminousenergy.distilling": "증류", - "jei.voluminousenergy.electrolyzing": "전기분해", - "jei.voluminousenergy.implosion_compressing": "폭파 압축", - "jei.voluminousenergy.industrial_blasting": "용광로", - "jei.voluminousenergy.stirling": "연로 연소", - "jei.voluminousenergy.tooling": "도구 조립", - "jei.voluminousenergy.sawmilling": "제재", - - "_comment": "JEI UI Info", - "jei.voluminousenergy.crude_oil_info": "원유는 원유 간헐천, 유전에서 얻을 수 있습니다, 혹은 영혼 모래를 원심분리기에 넣어서 얻을 수 있습니다", - "jei.voluminousenergy.air_compressor_fluid_info": "압축 공기는 공기 압축기를 통해 얻을 수 있습니다", - "jei.voluminousenergy.air_compressor_item_info": "압축 공기는 공기 압축기를 통해 얻을 수 있습니다", - - "_comment": "JEI Fluid Types for Combustion", - "jei.voluminousenergy.fluid.fuel": "연소", - "jei.voluminousenergy.fluid.oxidizer": "산화제", - - "_comment": "JEI Misc", - "jei.voluminousenergy.volumetric_energy": "체적 에너지" + "_comment": "Text", + "text.voluminousenergy.multiblock_warn": "유효하지 않은 멀티블록", + "text.voluminousenergy.multiblock.needed_behind": "을 기계 뒤에 설치해야 합니다", + "text.voluminousenergy.multiblock.distillation_unit.requirements": "3x3x3 알루미늄 기계 케이싱", + "text.voluminousenergy.multiblock.blast_furnace.requirements": "3x3x3 티타늄 기계 케이싱", + "text.voluminousenergy.temperature": "온도", + "text.voluminousenergy.protective_sheath": "내구도 보호", + "text.voluminousenergy.generating": "발전량", + "text.voluminousenergy.percent_complete": "완료 진행도", + "text.voluminousenergy.percent_burned": "연소 진행도", + "text.voluminousenergy.ticks_left": "남은 틱", + "text.voluminousenergy.battery_box.sending_out_power": "주변 블록으로 에너지를 송신합니다", + "text.voluminousenergy.battery_box.receiving_power": "주변 블록에서 에너지를 수신합니다", + "text.voluminousenergy.energy": "에너지", + "_comment": "Item quality tiers are natively from Korean. See: https://archeage.xlgames.com/wikis/아이템%20등급#h2-1", + "text.voluminousenergy.quality": "등급", + "text.voluminousenergy.quality.unidentified": "미확인", + "text.voluminousenergy.quality.basic": "일반", + "text.voluminousenergy.quality.grand": "고급", + "text.voluminousenergy.quality.rare": "희귀", + "text.voluminousenergy.quality.arcane": "고대", + "text.voluminousenergy.quality.heroic": "영웅", + "text.voluminousenergy.quality.unique": "유일", + "text.voluminousenergy.quality.celestial": "유물", + "text.voluminousenergy.quality.divine": "경이", + "text.voluminousenergy.quality.epic": "서사", + "text.voluminousenergy.quality.legendary": "전설", + "text.voluminousenergy.quality.mythic": "신화", + "_comment": "Directions", + "direction.voluminousenergy.up": "위", + "direction.voluminousenergy.down": "아래", + "direction.voluminousenergy.north": "북", + "direction.voluminousenergy.south": "남", + "direction.voluminousenergy.east": "동", + "direction.voluminousenergy.west": "서", + "direction.voluminousenergy.left": "좌", + "direction.voluminousenergy.right": "우", + "direction.voluminousenergy.front": "앞", + "direction.voluminousenergy.back": "뒤", + "_comment": "Slot Names", + "slot.voluminousenergy.rng_slot": "무작위 슬롯", + "slot.voluminousenergy.input_slot": "입력 슬롯", + "slot.voluminousenergy.output_slot": "출력 슬롯", + "slot.voluminousenergy.bucket_slot": "양동이 슬롯", + "_comment": "Tank Names", + "tank.voluminousenergy.input_tank": "입력 탱크", + "tank.voluminousenergy.output_tank": "출력 탱크", + "tank.voluminousenergy.both_tank": "탱크", + "tank.voluminousenergy.invalid": "유효하지 않음", + "tank.voluminousenergy.null": "NULL", + "_comment": "IO Menu Labels (shorts)", + "gui.voluminousenergy.slot_short": "슬", + "gui.voluminousenergy.tank_short": "탱", + "_comment": "Blocks", + "block.voluminousenergy.primitiveblastfurnace": "원시 용광로", + "block.voluminousenergy.primitivestirlinggenerator": "원시 스털링 발전기", + "block.voluminousenergy.saltpeterore": "초석 광석", + "block.voluminousenergy.bauxiteore": "보크사이트 광석", + "block.voluminousenergy.cinnabarore": "진사 광석", + "block.voluminousenergy.rutileore": "금홍석 광석", + "block.voluminousenergy.crusher": "분쇄기", + "block.voluminousenergy.galena_ore": "방연석 광석", + "block.voluminousenergy.deepslate_bauxite_ore": "심층암 보크사이트 광석", + "block.voluminousenergy.deepslate_cinnabar_ore": "심층암 진사 광석", + "block.voluminousenergy.deepslate_galena_ore": "심층암 방연석 광석", + "block.voluminousenergy.deepslate_rutile_ore": "심층암 금홍석 광석", + "block.voluminousenergy.red_saltpeter_ore": "초석 광석", + "block.voluminousenergy.electrolyzer": "전해조", + "block.voluminousenergy.centrifugal_agitator": "원심교반기", + "block.voluminousenergy.aluminum_shell": "알루미늄 껍데기", + "block.voluminousenergy.compressor": "압축기", + "block.voluminousenergy.stirling_generator": "스털링 발전기", + "block.voluminousenergy.combustion_generator": "연소 발전기", + "block.voluminousenergy.aqueoulizer": "수성화기", + "block.voluminousenergy.carbon_shielded_aluminum_machine_frame": "탄소 알루미늄 기계 프레임", + "block.voluminousenergy.air_compressor": "공기 압축기", + "block.voluminousenergy.distillation_unit": "증류 장치", + "block.voluminousenergy.aluminum_machine_casing": "알루미늄 기계 케이싱", + "block.voluminousenergy.titanium_machine_casing": "티타늄 기계 케이싱", + "block.voluminousenergy.pump": "펌프", + "block.voluminousenergy.gas_fired_furnace": "가스 화로", + "block.voluminousenergy.electric_furnace": "전기 화로", + "block.voluminousenergy.battery_box": "배터리 박스", + "block.voluminousenergy.primitive_solar_panel": "원시 태양 전지판", + "block.voluminousenergy.solar_panel": "태양 전지판", + "block.voluminousenergy.centrifugal_separator": "원심 분리기", + "block.voluminousenergy.implosion_compressor": "폭파 압축기", + "block.voluminousenergy.blast_furnace": "용광로", + "block.voluminousenergy.rice_crop": "쌀", + "block.voluminousenergy.solarium_block": "솔라륨 블록", + "block.voluminousenergy.eighzo_ore": "에이조 광석", + "block.voluminousenergy.raw_bauxite_block": "보크사이트 원석 블록", + "block.voluminousenergy.raw_cinnabar_block": "진사 원석 블록", + "block.voluminousenergy.raw_eighzo_block": "에이조 원석 블록", + "block.voluminousenergy.raw_galena_block": "방연석 원석 블록", + "block.voluminousenergy.raw_rutile_block": "금홍석 원석 블록", + "block.voluminousenergy.tooling_station": "도구 작업대", + "block.voluminousenergy.sawmill": "제재기", + "block.voluminousenergy.pressure_ladder": "압력 사다리", + "block.voluminousenergy.aluminum_tank": "알루미늄 탱크", + "block.voluminousenergy.titanium_tank": "티타늄 탱크", + "block.voluminousenergy.netherite_tank": "네더라이트 탱크", + "block.voluminousenergy.nighalite_tank": "나이아라이트 탱크", + "block.voluminousenergy.eighzo_tank": "에이조 탱크", + "block.voluminousenergy.solarium_tank": "솔라륨 탱크", + "_comment": "Creative Tabs", + "itemGroup.voluminousenergy": "Voluminous Energy", + "_comment": "Fluids", + "fluid.voluminousenergy.crude_oil": "원유", + "fluid.voluminousenergy.biofuel": "바이오연료", + "fluid.voluminousenergy.compressed_air": "압축 공기", + "fluid.voluminousenergy.diesel": "디젤", + "fluid.voluminousenergy.dinitrogen_tetroxide": "사산화 이질소", + "fluid.voluminousenergy.gasoline": "가솔린", + "fluid.voluminousenergy.nitroglycerin": "니트로글리세린", + "fluid.voluminousenergy.light_fuel": "경유", + "fluid.voluminousenergy.liquefied_coal": "액화 석탄", + "fluid.voluminousenergy.liquefied_coke": "액화 코크스", + "fluid.voluminousenergy.mercury": "수은", + "fluid.voluminousenergy.naphtha": "나프타", + "fluid.voluminousenergy.nitrogen": "질소", + "fluid.voluminousenergy.oxygen": "산소", + "fluid.voluminousenergy.red_fuming_nitric_acid": "적연질산", + "fluid.voluminousenergy.white_fuming_nitric_acid": "백연질산", + "fluid.voluminousenergy.sulfuric_acid": "황산", + "fluid.voluminousenergy.tree_sap": "나무 수액", + "fluid.voluminousenergy.treethanol": "나무 에탄올", + "_comment": "Fluid Types", + "fluid_type.voluminousenergy.crude_oil": "원유", + "fluid_type.voluminousenergy.biofuel": "바이오연료", + "fluid_type.voluminousenergy.compressed_air": "압축 공기", + "fluid_type.voluminousenergy.diesel": "디젤", + "fluid_type.voluminousenergy.dinitrogen_tetroxide": "사산화 이질소", + "fluid_type.voluminousenergy.gasoline": "가솔린", + "fluid_type.voluminousenergy.nitroglycerin": "니트로글리세린", + "fluid_type.voluminousenergy.light_fuel": "경유", + "fluid_type.voluminousenergy.liquefied_coal": "액화 석탄", + "fluid_type.voluminousenergy.liquefied_coke": "액화 코크스", + "fluid_type.voluminousenergy.mercury": "수은", + "fluid_type.voluminousenergy.naphtha": "나프타", + "fluid_type.voluminousenergy.nitrogen": "질소", + "fluid_type.voluminousenergy.oxygen": "산소", + "fluid_type.voluminousenergy.red_fuming_nitric_acid": "적연질산", + "fluid_type.voluminousenergy.white_fuming_nitric_acid": "백연질산", + "fluid_type.voluminousenergy.sulfuric_acid": "황산", + "fluid_type.voluminousenergy.tree_sap": "나무 수액", + "fluid_type.voluminousenergy.treethanol": "나무 에탄올", + "_comment": "Fluid Blocks", + "block.voluminousenergy.crude_oil": "원유", + "block.voluminousenergy.biofuel": "바이오연료", + "block.voluminousenergy.compressed_air": "압축 공기", + "block.voluminousenergy.diesel": "디젤", + "block.voluminousenergy.dinitrogen_tetroxide": "사산화 이질소", + "block.voluminousenergy.gasoline": "가솔린", + "block.voluminousenergy.nitroglycerin": "니트로글리세린", + "block.voluminousenergy.light_fuel": "경유", + "block.voluminousenergy.liquefied_coal": "액화 석탄", + "block.voluminousenergy.liquefied_coke": "액화 코크스", + "block.voluminousenergy.mercury": "수은", + "block.voluminousenergy.naphtha": "나프타", + "block.voluminousenergy.nitrogen": "질소", + "block.voluminousenergy.oxygen": "신소", + "block.voluminousenergy.red_fuming_nitric_acid": "적연질산", + "block.voluminousenergy.white_fuming_nitric_acid": "백연질산", + "block.voluminousenergy.sulfuric_acid": "황산", + "block.voluminousenergy.tree_sap": "나무 수액", + "block.voluminousenergy.treethanol": "나무 에탄올", + "_comment": "Items", + "item.voluminousenergy.petcoke": "페트콕", + "item.voluminousenergy.coalcoke": "코크스", + "item.voluminousenergy.coaldust": "석탄 가루", + "item.voluminousenergy.cokedust": "코크스 가루", + "item.voluminousenergy.lapisdust": "청금석 가루", + "item.voluminousenergy.sulfurdust": "황 가루", + "item.voluminousenergy.carbondust": "탄소 가루", + "item.voluminousenergy.saltpeterdust": "초석 가루", + "item.voluminousenergy.saltpeterchunk": "초석 덩어리", + "item.voluminousenergy.carbonbrick": "탄소 벽돌", + "item.voluminousenergy.stonegear": "돌 기어", + "item.voluminousenergy.irongear": "철 기어", + "item.voluminousenergy.carbongear": "탄소 기어", + "item.voluminousenergy.aluminum_dust": "알루미늄 가루", + "item.voluminousenergy.bauxite_dust": "보크사이트 가루", + "item.voluminousenergy.cinnabar_dust": "진사 가루", + "item.voluminousenergy.iron_dust": "철 가루", + "item.voluminousenergy.quartz_dust": "석영 가루", + "item.voluminousenergy.sand_dust": "모래 가루", + "item.voluminousenergy.soulsand_dust": "영혼 모래 가루", + "item.voluminousenergy.titanium_dust": "티타늄 가루", + "item.voluminousenergy.aluminum_ingot": "알루미늄 주괴", + "item.voluminousenergy.titanium_ingot": "티타늄 주괴", + "item.voluminousenergy.aluminum_gear": "알루미늄 기어", + "item.voluminousenergy.titanium_gear": "티타늄 기어", + "item.voluminousenergy.silicon": "실리콘", + "item.voluminousenergy.gold_microchip": "금 마이크로칩", + "item.voluminousenergy.rutile_dust": "금홍석 가루", + "item.voluminousenergy.galena_dust": "방연석 가루", + "item.voluminousenergy.lead_dust": "납 가루", + "item.voluminousenergy.silver_dust": "은 가루", + "item.voluminousenergy.crude_oil_bucket": "원유 양동이", + "item.voluminousenergy.oxygen_bucket": "산소 양동이", + "item.voluminousenergy.naphtha_bucket": "나프타 양동이", + "item.voluminousenergy.red_fuming_nitric_acid_bucket": "적연질산 양동이", + "item.voluminousenergy.white_fuming_nitric_acid_bucket": "백연질산 양동이", + "item.voluminousenergy.mercury_bucket": "수은 양동이", + "item.voluminousenergy.sulfuric_acid_bucket": "황산 양동이", + "item.voluminousenergy.silver_ingot": "은 주괴", + "item.voluminousenergy.lead_ingot": "납 주괴", + "item.voluminousenergy.gold_dust": "금 가루", + "item.voluminousenergy.dinitrogen_tetroxide_bucket": "사산화 이질산 양동이", + "item.voluminousenergy.aluminum_plate": "알루미늄 판", + "item.voluminousenergy.carbon_plate": "탄소 판", + "item.voluminousenergy.compressed_air_bucket": "압축 공기 양동이", + "item.voluminousenergy.nitrogen_bucket": "질소 양동이", + "item.voluminousenergy.biofuel_bucket": "바이오연료 양동이", + "item.voluminousenergy.diesel_bucket": "디젤 양동이", + "item.voluminousenergy.gasoline_bucket": "가솔린 양동이", + "item.voluminousenergy.nitroglycerin_bucket": "니트로글리세린 양동이", + "item.voluminousenergy.light_fuel_bucket": "경유 양동이", + "item.voluminousenergy.liquefied_coal_bucket": "액화 석탄 양동이", + "item.voluminousenergy.liquefied_coke_bucket": "액화 코크스 양동이", + "item.voluminousenergy.shredded_biomass": "갈가리 찢긴 바이오연료", + "item.voluminousenergy.silver_microchip": "은 마이크로칩", + "item.voluminousenergy.titanium_plate": "티타늄 판", + "item.voluminousenergy.quartz_multiplier": "석영 배속기", + "item.voluminousenergy.mercury_battery": "수은 전지", + "item.voluminousenergy.lead_acid_battery": "납 축전지", + "item.voluminousenergy.photovoltaic_dust": "태양 전지 가루", + "item.voluminousenergy.end_stone_dust": "엔드 돌 가루", + "item.voluminousenergy.basalt_dust": "현무암 가루", + "item.voluminousenergy.flint_dust": "부싯돌 가루", + "item.voluminousenergy.netherrack_dust": "네더랙 가루", + "item.voluminousenergy.raw_bauxite": "보크사이트 원석", + "item.voluminousenergy.raw_cinnabar": "진사 원석", + "item.voluminousenergy.raw_galena": "방연석 원석", + "item.voluminousenergy.raw_rutile": "금홍석 원석", + "item.voluminousenergy.raw_sulfur": "황 원석", + "item.voluminousenergy.netherite_dust": "네더라이트 가루", + "item.voluminousenergy.tungsten_dust": "텅스텟 가루", + "item.voluminousenergy.tungsten_ingot": "텅스텐 주괴", + "item.voluminousenergy.steel_dust": "강철 가루", + "item.voluminousenergy.steel_ingot": "강철 주괴", + "item.voluminousenergy.tungsten_steel_ingot": "텅스텐강 주괴", + "item.voluminousenergy.raw_eighzo": "에이조 원석", + "item.voluminousenergy.eighzo_dust": "에이조 가루", + "item.voluminousenergy.eighzo_ingot": "에이조 주괴", + "item.voluminousenergy.solarium_dust": "솔라륨 가루", + "item.voluminousenergy.solarium_ingot": "솔라륨 주괴", + "item.voluminousenergy.solarium_gear": "솔라륨 기어", + "item.voluminousenergy.solarium_plate": "솔라륨 판", + "item.voluminousenergy.nighalite_ingot": "나이아라이트 주괴", + "item.voluminousenergy.cooked_rice": "밥", + "item.voluminousenergy.aluminum_pickaxe": "알루미늄 곡괭이", + "item.voluminousenergy.aluminum_axe": "알루미늄 도끼", + "item.voluminousenergy.aluminum_sword": "알루미늄 검", + "item.voluminousenergy.aluminum_hoe": "알루미늄 괭이", + "item.voluminousenergy.aluminum_shovel": "알루미늄 삽", + "item.voluminousenergy.carbon_pickaxe": "탄소 곡괭이", + "item.voluminousenergy.carbon_axe": "탄소 도끼", + "item.voluminousenergy.carbon_sword": "탄소 검", + "item.voluminousenergy.carbon_hoe": "탄소 괭이", + "item.voluminousenergy.carbon_shovel": "탄소 삽", + "item.voluminousenergy.titanium_pickaxe": "티타늄 곡괭이", + "item.voluminousenergy.titanium_axe": "티타늄 도끼", + "item.voluminousenergy.titanium_sword": "티타늄 검", + "item.voluminousenergy.titanium_hoe": "티타늄 괭이", + "item.voluminousenergy.titanium_shovel": "티타늄 삽", + "item.voluminousenergy.tungsten_pickaxe": "텅스텐 곡괭이", + "item.voluminousenergy.tungsten_axe": "텅스텐 도끼", + "item.voluminousenergy.tungsten_sword": "텅스텐 검", + "item.voluminousenergy.tungsten_hoe": "텅스텐 괭이", + "item.voluminousenergy.tungsten_shovel": "텅스텐 삽", + "item.voluminousenergy.tungsten_steel_pickaxe": "텅스텐강 곡괭이", + "item.voluminousenergy.tungsten_steel_axe": "텅스텐강 도끼", + "item.voluminousenergy.tungsten_steel_sword": "텅스텐강 검", + "item.voluminousenergy.tungsten_steel_hoe": "텅스텐강 괭이", + "item.voluminousenergy.tungsten_steel_shovel": "텅스텐강 삽", + "item.voluminousenergy.nighalite_pickaxe": "나이아라이트 곡괭이", + "item.voluminousenergy.nighalite_axe": "나이아라이트 도끼", + "item.voluminousenergy.nighalite_sword": "나이아라이트 검", + "item.voluminousenergy.nighalite_hoe": "나이아라이트 괭이", + "item.voluminousenergy.nighalite_shovel": "나이아라이트 삽", + "item.voluminousenergy.eighzo_pickaxe": "에이조 곡괭이", + "item.voluminousenergy.eighzo_axe": "에이조 도끼", + "item.voluminousenergy.eighzo_sword": "에이조 검", + "item.voluminousenergy.eighzo_hoe": "에이조 괭이", + "item.voluminousenergy.eighzo_shovel": "에이조 삽", + "item.voluminousenergy.solarium_pickaxe": "솔라륨 곡괭이", + "item.voluminousenergy.solarium_axe": "솔라륨 도끼", + "item.voluminousenergy.solarium_sword": "솔라륨 검", + "item.voluminousenergy.solarium_hoe": "솔라륨 괭이", + "item.voluminousenergy.solarium_shovel": "솔라륨 삽", + "item.voluminousenergy.copper_dust": "구리 가루", + "item.voluminousenergy.cupric_oxide_dust": "산화구리(II)", + "item.voluminousenergy.copper_carbonate_dust": "탄산구리 가루", + "item.voluminousenergy.titanium_sawblade": "티타늄 톱날", + "item.voluminousenergy.saw_dust": "톱밥", + "item.voluminousenergy.rosin": "로진", + "item.voluminousenergy.tree_sap_bucket": "나무 수액 양동이", + "item.voluminousenergy.treethanol_bucket": "나무 에탄올 양동이", + "item.voluminousenergy.standard_tank_frame": "표준 탱크 프레임", + "item.voluminousenergy.robust_tank_frame": "튼튼한 탱크 프레임", + "item.voluminousenergy.impeccable_tank_frame": "완벽한 탱크 프레임", + "_comment": "Multitool Items", + "item.voluminousenergy.empty_multitool": "빈 멀티툴", + "item.voluminousenergy.iron_drill_bit": "철 드릴 비트", + "item.voluminousenergy.iron_chain_bit": "철 체인 비트", + "item.voluminousenergy.iron_scooper_bit": "철 스쿠퍼 비트", + "item.voluminousenergy.iron_trimmer_bit": "철 트리머 비트", + "item.voluminousenergy.iron_chain_multitool": "철 체인톱 멀티툴", + "item.voluminousenergy.iron_drill_multitool": "철 드릴 멀티툴", + "item.voluminousenergy.iron_scooper_multitool": "철 스쿠퍼 멀티툴", + "item.voluminousenergy.iron_trimmer_multitool": "철 트리머 멀티툴", + "item.voluminousenergy.diamond_drill_bit": "다이아몬드 드릴 비트", + "item.voluminousenergy.diamond_chain_bit": "다이아몬드 체인 비트", + "item.voluminousenergy.diamond_scooper_bit": "다이아몬드 스쿠퍼 비트", + "item.voluminousenergy.diamond_trimmer_bit": "다이아몬드 트리머 비트", + "item.voluminousenergy.diamond_chain_multitool": "다이아몬드 체인톱 멀티툴", + "item.voluminousenergy.diamond_drill_multitool": "다이아몬드 드릴 멀티툴", + "item.voluminousenergy.diamond_scooper_multitool": "다이아몬드 스쿠퍼 멀티툴", + "item.voluminousenergy.diamond_trimmer_multitool": "다이아몬드 트리머 멀티툴", + "item.voluminousenergy.titanium_drill_bit": "티타늄 드릴 비트", + "item.voluminousenergy.titanium_chain_bit": "티타늄 체인 비트", + "item.voluminousenergy.titanium_scooper_bit": "티타늄 스쿠퍼 비트", + "item.voluminousenergy.titanium_trimmer_bit": "티타늄 트리머 비트", + "item.voluminousenergy.titanium_chain_multitool": "티타늄 체인톱 멀티툴", + "item.voluminousenergy.titanium_drill_multitool": "티타늄 드릴 멀티툴", + "item.voluminousenergy.titanium_scooper_multitool": "티타늄 스쿠퍼 멀티툴", + "item.voluminousenergy.titanium_trimmer_multitool": "티타늄 트리머 멀티툴", + "item.voluminousenergy.nighalite_drill_bit": "나이아라이트 드릴 비트", + "item.voluminousenergy.nighalite_chain_bit": "나이아라이트 체인 비트", + "item.voluminousenergy.nighalite_scooper_bit": "나이아라이트 스쿠퍼 비트", + "item.voluminousenergy.nighalite_trimmer_bit": "나이아라이트 트리머 비트", + "item.voluminousenergy.nighalite_chain_multitool": "나이아라이트 체인톱 멀티툴", + "item.voluminousenergy.nighalite_drill_multitool": "나이아라이트 드릴 멀티툴", + "item.voluminousenergy.nighalite_scooper_multitool": "나이아라이트 스쿠퍼 멀티툴", + "item.voluminousenergy.nighalite_trimmer_multitool": "나이아라이트 트리머 멀티툴", + "item.voluminousenergy.eighzo_drill_bit": "에이조 드릴 비트", + "item.voluminousenergy.eighzo_chain_bit": "에이조 체인 비트", + "item.voluminousenergy.eighzo_scooper_bit": "에이조 스쿠퍼 비트", + "item.voluminousenergy.eighzo_trimmer_bit": "에이조 트리머 비트", + "item.voluminousenergy.eighzo_chain_multitool": "에이조 체인톱 멀티툴", + "item.voluminousenergy.eighzo_drill_multitool": "에이조 드릴 멀티툴", + "item.voluminousenergy.eighzo_scooper_multitool": "에이조 스쿠퍼 멀티툴", + "item.voluminousenergy.eighzo_trimmer_multitool": "에이조 트리머 멀티툴", + "item.voluminousenergy.solarium_drill_bit": "솔라륨 드릴 비트", + "item.voluminousenergy.solarium_chain_bit": "솔라륨 체인 비트", + "item.voluminousenergy.solarium_scooper_bit": "솔라륨 스쿠퍼 비트", + "item.voluminousenergy.solarium_trimmer_bit": "솔라륨 트리머 비트", + "item.voluminousenergy.solarium_chain_multitool": "솔라륨 체인톱 멀티툴", + "item.voluminousenergy.solarium_drill_multitool": "솔라륨 드릴 멀티툴", + "item.voluminousenergy.solarium_scooper_multitool": "솔라륨 스쿠퍼 멀티툴", + "item.voluminousenergy.solarium_trimmer_multitool": "솔라륨 트리머 멀티툴", + "_comment": "Biomes", + "biome.voluminousenergy.red_desert": "붉은 사막", + "_comment": "JEI UI Recipe Names", + "jei.voluminousenergy.aqueoulizing": "수성화", + "jei.voluminousenergy.centrifugal_agitation": "원심교반", + "jei.voluminousenergy.centrifugal_separation": "원심분리", + "jei.voluminousenergy.combustion": "연소", + "jei.voluminousenergy.compressing": "압축", + "jei.voluminousenergy.crushing": "분쇄", + "jei.voluminousenergy.distilling": "증류", + "jei.voluminousenergy.electrolyzing": "전기분해", + "jei.voluminousenergy.implosion_compressing": "폭파 압축", + "jei.voluminousenergy.industrial_blasting": "용광로", + "jei.voluminousenergy.stirling": "연로 연소", + "jei.voluminousenergy.tooling": "도구 조립", + "jei.voluminousenergy.sawmilling": "제재", + "_comment": "JEI UI Info", + "jei.voluminousenergy.crude_oil_info": "원유는 원유 간헐천, 유전에서 얻을 수 있습니다, 혹은 영혼 모래를 원심분리기에 넣어서 얻을 수 있습니다", + "jei.voluminousenergy.air_compressor_fluid_info": "압축 공기는 공기 압축기를 통해 얻을 수 있습니다", + "jei.voluminousenergy.air_compressor_item_info": "압축 공기는 공기 압축기를 통해 얻을 수 있습니다", + "_comment": "JEI Fluid Types for Combustion", + "jei.voluminousenergy.fluid.fuel": "연소", + "jei.voluminousenergy.fluid.oxidizer": "산화제", + "_comment": "JEI Misc", + "jei.voluminousenergy.volumetric_energy": "체적 에너지" } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/lang/pt_br.json b/src/main/resources/assets/voluminousenergy/lang/pt_br.json index 17b5633f9..fee746579 100644 --- a/src/main/resources/assets/voluminousenergy/lang/pt_br.json +++ b/src/main/resources/assets/voluminousenergy/lang/pt_br.json @@ -1,265 +1,254 @@ { - "_comment": "Text", - "text.voluminousenergy.multiblock_warn": "Multi-bloco Inválido", - "text.voluminousenergy.multiblock.distillation_unit.requirements": "Carcaça de Máquina de Alumínio 3x3x3 ATRÁS da Entidade", - "text.voluminousenergy.multiblock.blast_furnace.requirements": "Carcaça de Máquina de Titânio 3x3x3 ATRÁS da Entidade", - "text.voluminousenergy.temperature": "Temperatura", - "text.voluminousenergy.protective_sheath": "Bainha Protetora", - "text.voluminousenergy.generating": "Gerando", - - "_comment": "Directions", - "direction.voluminousenergy.up": "Cima", - "direction.voluminousenergy.down": "Baixo", - "direction.voluminousenergy.north": "Norte", - "direction.voluminousenergy.south": "Sul", - "direction.voluminousenergy.east": "Leste", - "direction.voluminousenergy.west": "Oeste", - - "_comment": "Slot Names", - "slot.voluminousenergy.rng_slot": "Slot RNG", - "slot.voluminousenergy.input_slot": "Slot Entrada", - "slot.voluminousenergy.output_slot": "Slot Saída", - "slot.voluminousenergy.bucket_slot": "Slot Balde", - - "_comment": "Tank Names", - "tank.voluminousenergy.input_tank": "Tanque Entrada", - "tank.voluminousenergy.output_tank": "Tanque Saída", - "tank.voluminousenergy.invalid": "INVÁLIDO", - "tank.voluminousenergy.null": "NULO", - - "_comment": "Blocks", - "block.voluminousenergy.primitiveblastfurnace": "Alto-Forno Primitivo", - "block.voluminousenergy.saltpeterore": "Minério de Salitre", - "block.voluminousenergy.primitivestirlinggenerator": "Gerador à Vapor Primitivo", - "block.voluminousenergy.bauxiteore": "Minério de Bauxita", - "block.voluminousenergy.cinnabarore": "Minério de Cinábrio", - "block.voluminousenergy.rutileore": "Minério de Rutilo", - "block.voluminousenergy.crusher": "Triturador", - "block.voluminousenergy.galena_ore": "Minério de Galena", - "block.voluminousenergy.electrolyzer": "Eletrolisador", - "block.voluminousenergy.centrifugal_agitator": "Centrífuga Agitadora", - "block.voluminousenergy.aluminum_shell": "Cubo de Alumínio", - "block.voluminousenergy.compressor": "Compressor", - "block.voluminousenergy.stirling_generator": "Gerador à Vapor", - "block.voluminousenergy.combustion_generator": "Gerador à Combustão", - "block.voluminousenergy.aqueoulizer": "Aquecedor", - "block.voluminousenergy.carbon_shielded_aluminum_machine_frame": "Estrutura de Máquina de Alumínio Com Carbono", - "block.voluminousenergy.air_compressor": "Compressor de Ar", - "block.voluminousenergy.distillation_unit": "Unidade de Destilação", - "block.voluminousenergy.aluminum_machine_casing": "Carcaça de Máquina de Alumínio", - "block.voluminousenergy.titanium_machine_casing": "Carcaça de Máquina de Titânio", - "block.voluminousenergy.pump": "Bomba de Fluido", - "block.voluminousenergy.gas_fired_furnace": "Fornalha à Gás", - "block.voluminousenergy.electric_furnace": "Fornalha Elétrica", - "block.voluminousenergy.battery_box": "Caixa de Bateria", - "block.voluminousenergy.primitive_solar_panel": "Painel Solar Primitivo", - "block.voluminousenergy.solar_panel": "Painel Solar", - "block.voluminousenergy.centrifugal_separator": "Centrífuga Separadora", - "block.voluminousenergy.implosion_compressor": "Compressor à Implosão", - "block.voluminousenergy.blast_furnace": "Alto-Forno", - "block.voluminousenergy.rice_crop": "Arroz", - "block.voluminousenergy.solarium_block": "Bloco de Solário", - "block.voluminousenergy.eighzo_ore": "Minério de Eighzo", - - "_comment": "Creative Tabs", - "itemGroup.voluminousenergy": "Voluminous Energy", - - "_comment": "Fluids", - "fluid.voluminousenergy.crude_oil": "Óleo Bruto", - "fluid.voluminousenergy.biofuel": "Biocombustível", - "fluid.voluminousenergy.compressed_air": "Ar Comprimido", - "fluid.voluminousenergy.diesel": "Diesel", - "fluid.voluminousenergy.dinitrogen_tetroxide": "Tetróxido de Dinitrogênio", - "fluid.voluminousenergy.gasoline": "Gasolina", - "fluid.voluminousenergy.nitroglycerin": "Nitroglicerina", - "fluid.voluminousenergy.light_fuel": "Combustível Leve", - "fluid.voluminousenergy.liquefied_coal": "Carvão Liquefeito", - "fluid.voluminousenergy.liquefied_coke": "Coque Liquefeito", - "fluid.voluminousenergy.mercury": "Mercúrio", - "fluid.voluminousenergy.naphtha": "Nafta", - "fluid.voluminousenergy.nitrogen": "Nitrogênio", - "fluid.voluminousenergy.oxygen": "Oxigênio", - "fluid.voluminousenergy.red_fuming_nitric_acid": "Ácido Nítrico Fumegante Vermelho", - "fluid.voluminousenergy.white_fuming_nitric_acid": "Ácido Nítrico Fumegante Branco", - "fluid.voluminousenergy.sulfuric_acid": "Ácido Sulfúrico", - - "_comment": "Fluids", - "fluid_type.voluminousenergy.crude_oil": "Óleo Bruto", - "fluid_type.voluminousenergy.biofuel": "Biocombustível", - "fluid_type.voluminousenergy.compressed_air": "Ar Comprimido", - "fluid_type.voluminousenergy.diesel": "Diesel", - "fluid_type.voluminousenergy.dinitrogen_tetroxide": "Tetróxido de Dinitrogênio", - "fluid_type.voluminousenergy.gasoline": "Gasolina", - "fluid_type.voluminousenergy.nitroglycerin": "Nitroglicerina", - "fluid_type.voluminousenergy.light_fuel": "Combustível Leve", - "fluid_type.voluminousenergy.liquefied_coal": "Carvão Liquefeito", - "fluid_type.voluminousenergy.liquefied_coke": "Coque Liquefeito", - "fluid_type.voluminousenergy.mercury": "Mercúrio", - "fluid_type.voluminousenergy.naphtha": "Nafta", - "fluid_type.voluminousenergy.nitrogen": "Nitrogênio", - "fluid_type.voluminousenergy.oxygen": "Oxigênio", - "fluid_type.voluminousenergy.red_fuming_nitric_acid": "Ácido Nítrico Fumegante Vermelho", - "fluid_type.voluminousenergy.white_fuming_nitric_acid": "Ácido Nítrico Fumegante Branco", - "fluid_type.voluminousenergy.sulfuric_acid": "Ácido Sulfúrico", - - "_comment": "Fluid Blocks", - "block.voluminousenergy.crude_oil": "Óleo Bruto", - "block.voluminousenergy.biofuel": "Biocombustível", - "block.voluminousenergy.compressed_air": "Ar Comprimido Líquido", - "block.voluminousenergy.diesel": "Diesel", - "block.voluminousenergy.dinitrogen_tetroxide": "Tetróxido de Dinitrogênio Líquido", - "block.voluminousenergy.gasoline": "Gasolina", - "block.voluminousenergy.nitroglycerin": "Nitroglicerina Líquida", - "block.voluminousenergy.light_fuel": "Combustível Leve", - "block.voluminousenergy.liquefied_coal": "Carvão Liquefeito", - "block.voluminousenergy.liquefied_coke": "Coque Liquefeito", - "block.voluminousenergy.mercury": "Mercúrio", - "block.voluminousenergy.naphtha": "Nafta", - "block.voluminousenergy.nitrogen": "Nitrogênio Líquido", - "block.voluminousenergy.oxygen": "Oxigênio Líquido", - "block.voluminousenergy.red_fuming_nitric_acid": "Ácido Nítrico Fumegante Vermelho", - "block.voluminousenergy.white_fuming_nitric_acid": "Ácido Nítrico Fumegante Branco", - "block.voluminousenergy.sulfuric_acid": "Ácido Sulfúrico", - - "_comment": "Items", - "item.voluminousenergy.petcoke": "Petrocoque", - "item.voluminousenergy.coalcoke": "Carvão Coque", - "item.voluminousenergy.coaldust": "Pó de Carvão", - "item.voluminousenergy.cokedust": "Pó de Coque", - "item.voluminousenergy.lapisdust": "Pó de Lápis-Lazúli", - "item.voluminousenergy.sulfurdust": "Pó de Enxofre", - "item.voluminousenergy.carbondust": "Pó de Carbono", - "item.voluminousenergy.saltpeterdust": "Pó de Salitre", - "item.voluminousenergy.saltpeterchunk": "Pedaço de Salitre", - "item.voluminousenergy.carbonbrick": "Tijolo de Carbono", - "item.voluminousenergy.stonegear": "Engrenagem de Pedra", - "item.voluminousenergy.irongear": "Engrenagem de Ferro", - "item.voluminousenergy.carbongear": "Engrenagem de Carbono", - "item.voluminousenergy.aluminum_dust": "Pó de Alumínio", - "item.voluminousenergy.bauxite_dust": "Pó de Bauxita", - "item.voluminousenergy.cinnabar_dust": "Pó de Cinábrio", - "item.voluminousenergy.iron_dust": "Pó de Ferro", - "item.voluminousenergy.quartz_dust": "Pó de Quartzo", - "item.voluminousenergy.sand_dust": "Pó de Areia", - "item.voluminousenergy.soulsand_dust": "Pó de Areia das Almas", - "item.voluminousenergy.titanium_dust": "Pó de Titânio", - "item.voluminousenergy.aluminum_ingot": "Lingote de Alumínio", - "item.voluminousenergy.titanium_ingot": "Lingote de Titânio", - "item.voluminousenergy.aluminum_gear": "Engrenagem de Alumínio", - "item.voluminousenergy.titanium_gear": "Engrenagem de Titânio", - "item.voluminousenergy.silicon": "Silício", - "item.voluminousenergy.gold_microchip": "Microchip de Ouro", - "item.voluminousenergy.rutile_dust": "Pó de Rutilo", - "item.voluminousenergy.galena_dust": "Pó de Galena", - "item.voluminousenergy.lead_dust": "Pó de Chumbo", - "item.voluminousenergy.silver_dust": "Pó de Prata", - "item.voluminousenergy.crude_oil_bucket": "Balde de Óleo Bruto", - "item.voluminousenergy.oxygen_bucket": "Balde de Oxigênio Líquido", - "item.voluminousenergy.naphtha_bucket": "Balde de Nafta", - "item.voluminousenergy.red_fuming_nitric_acid_bucket": "Balde de Ácido Nítrico Fumegante Vermelho", - "item.voluminousenergy.white_fuming_nitric_acid_bucket": "Balde de Ácido Nítrico Fumegante Branco", - "item.voluminousenergy.mercury_bucket": "Balde de Mercúrio", - "item.voluminousenergy.sulfuric_acid_bucket": "Balde de Ácido Sulfúrico", - "item.voluminousenergy.silver_ingot": "Lingote de Prata", - "item.voluminousenergy.lead_ingot": "Lingote de Chumbo", - "item.voluminousenergy.gold_dust": "Pó de Ouro", - "item.voluminousenergy.dinitrogen_tetroxide_bucket": "Balde de Tetróxido de Dinitrogênio Líquido", - "item.voluminousenergy.aluminum_plate": "Placa de Alumínio", - "item.voluminousenergy.carbon_plate": "Placa de Carbono", - "item.voluminousenergy.compressed_air_bucket": "Balde de Ar Comprimido Líquido", - "item.voluminousenergy.nitrogen_bucket": "Balde de Nitrogênio Líquido", - "item.voluminousenergy.biofuel_bucket": "Balde de Biocombustível", - "item.voluminousenergy.diesel_bucket": "Balde de Diesel", - "item.voluminousenergy.gasoline_bucket": "Balde de Gasolina", - "item.voluminousenergy.nitroglycerin_bucket": "Balde de Nitroglicerina Líquida", - "item.voluminousenergy.light_fuel_bucket": "Balde de Combustível Leve", - "item.voluminousenergy.liquefied_coal_bucket": "Balde de Carvão Liquefeito", - "item.voluminousenergy.liquefied_coke_bucket": "Balde de Coque Liquefeito", - "item.voluminousenergy.shredded_biomass": "Biomassa Triturada", - "item.voluminousenergy.silver_microchip": "Microchip de Prata", - "item.voluminousenergy.titanium_plate": "Placa de Titânio", - "item.voluminousenergy.quartz_multiplier": "Multiplicador de Quartzo", - "item.voluminousenergy.mercury_battery": "Bateria de Mercúrio", - "item.voluminousenergy.lead_acid_battery": "Bateria Chumbo-Ácido", - "item.voluminousenergy.photovoltaic_dust": "Pó Fotovoltaico", - "item.voluminousenergy.end_stone_dust": "Pó de Pedra do End", - "item.voluminousenergy.basalt_dust": "Pó de Basalto", - "item.voluminousenergy.flint_dust": "Pó de Sílex", - "item.voluminousenergy.netherrack_dust": "Pó de Netherrack", - "item.voluminousenergy.raw_bauxite": "Bauxita Bruta", - "item.voluminousenergy.raw_cinnabar": "Cinábrio Bruto", - "item.voluminousenergy.raw_galena": "Galena Bruta", - "item.voluminousenergy.raw_rutile": "Rutilo Bruto", - "item.voluminousenergy.raw_sulfur": "Enxofre Bruto", - "item.voluminousenergy.netherite_dust": "Pó de Netherita", - "item.voluminousenergy.tungsten_dust": "Pó de Tungstênio", - "item.voluminousenergy.tungsten_ingot": "Lingote de Tungstênio", - "item.voluminousenergy.steel_dust": "Pó de Aço", - "item.voluminousenergy.steel_ingot": "Lingote de Aço", - "item.voluminousenergy.tungsten_steel_ingot": "Lingote de Aço de Tungstênio", - "item.voluminousenergy.raw_eighzo": "Eighzo Bruto", - "item.voluminousenergy.eighzo_dust": "Pó de Eighzo", - "item.voluminousenergy.eighzo_ingot": "Lingote de Eighzo", - "item.voluminousenergy.solarium_dust": "Pó de Solário", - "item.voluminousenergy.solarium_ingot": "Lingote de Solário", - "item.voluminousenergy.solarium_gear": "Engrenagem de Solário", - "item.voluminousenergy.solarium_plate": "Placa de Solário", - "item.voluminousenergy.nighalite_ingot": "Lingote de Nighalita", - "item.voluminousenergy.cooked_rice": "Arroz Cozido", - "item.voluminousenergy.aluminum_pickaxe": "Picareta de Alumínio", - "item.voluminousenergy.aluminum_axe": "Machado de Alumínio", - "item.voluminousenergy.aluminum_sword": "Espada de Alumínio", - "item.voluminousenergy.aluminum_hoe": "Enxada de Alumínio", - "item.voluminousenergy.aluminum_shovel": "Pá de Alumínio", - "item.voluminousenergy.carbon_pickaxe": "Picareta de Carbono", - "item.voluminousenergy.carbon_axe": "Machado de Carbono", - "item.voluminousenergy.carbon_sword": "Espada de Carbono", - "item.voluminousenergy.carbon_hoe": "Enxada de Carbono", - "item.voluminousenergy.carbon_shovel": "Pá de Carbono", - "item.voluminousenergy.titanium_pickaxe": "Picareta de Titânio", - "item.voluminousenergy.titanium_axe": "Machado de Titânio", - "item.voluminousenergy.titanium_sword": "Espada de Titânio", - "item.voluminousenergy.titanium_hoe": "Enxada de Titânio", - "item.voluminousenergy.titanium_shovel": "Pá de Titânio", - "item.voluminousenergy.tungsten_pickaxe": "Picareta de Tungstênio", - "item.voluminousenergy.tungsten_axe": "Machado de Tungstênio", - "item.voluminousenergy.tungsten_sword": "Espada de Tungstênio", - "item.voluminousenergy.tungsten_hoe": "Enxada de de Tungstênio", - "item.voluminousenergy.tungsten_shovel": "Pá de de Tungstênio", - "item.voluminousenergy.tungsten_steel_pickaxe": "Picareta de Aço de Tungstênio", - "item.voluminousenergy.tungsten_steel_axe": "Machado de Aço de Tungstênio", - "item.voluminousenergy.tungsten_steel_sword": "Espada de Aço de Tungstênio", - "item.voluminousenergy.tungsten_steel_hoe": "Enxada de Aço de Tungstênio", - "item.voluminousenergy.tungsten_steel_shovel": "Pá de Aço de Tungstênio", - "item.voluminousenergy.nighalite_pickaxe": "Picareta de Nighalita", - "item.voluminousenergy.nighalite_axe": "Machado de Nighalita", - "item.voluminousenergy.nighalite_sword": "Espada de Nighalita", - "item.voluminousenergy.nighalite_hoe": "Enxada de Nighalita", - "item.voluminousenergy.nighalite_shovel": "Pá de Nighalita", - "item.voluminousenergy.eighzo_pickaxe": "Picareta de Eighzo", - "item.voluminousenergy.eighzo_axe": "Machado de Eighzo", - "item.voluminousenergy.eighzo_sword": "Espada de de Eighzo", - "item.voluminousenergy.eighzo_hoe": "Enxada de Eighzo", - "item.voluminousenergy.eighzo_shovel": "Pá de Eighzo", - "item.voluminousenergy.solarium_pickaxe": "Picareta de Solário", - "item.voluminousenergy.solarium_axe": "Machado de Solário", - "item.voluminousenergy.solarium_sword": "Espada de Solário", - "item.voluminousenergy.solarium_hoe": "Enxada de Solário", - "item.voluminousenergy.solarium_shovel": "Pá de Solário", - - "_comment": "Biomes", - "biome.voluminousenergy.red_desert": "Deserto Vermelho", - - "_comment": "JEI UI Recipe Names", - "jei.voluminousenergy.aqueoulizing": "Aquecendo", - "jei.voluminousenergy.centrifugal_agitation": "Agitação Centrífuga", - "jei.voluminousenergy.centrifugal_separation": "Separação Centrífuga", - "jei.voluminousenergy.combustion": "Combustão", - "jei.voluminousenergy.compressing": "Compressão", - "jei.voluminousenergy.crushing": "Trituração", - "jei.voluminousenergy.distilling": "Destilando", - "jei.voluminousenergy.electrolyzing": "Eletrolisação", - "jei.voluminousenergy.implosion_compressing": "Compressão á Implosão", - "jei.voluminousenergy.industrial_blasting": "Explosão Industrial", - "jei.voluminousenergy.stirling": "Vapor" + "_comment": "Text", + "text.voluminousenergy.multiblock_warn": "Multi-bloco Inválido", + "text.voluminousenergy.multiblock.distillation_unit.requirements": "Carcaça de Máquina de Alumínio 3x3x3 ATRÁS da Entidade", + "text.voluminousenergy.multiblock.blast_furnace.requirements": "Carcaça de Máquina de Titânio 3x3x3 ATRÁS da Entidade", + "text.voluminousenergy.temperature": "Temperatura", + "text.voluminousenergy.protective_sheath": "Bainha Protetora", + "text.voluminousenergy.generating": "Gerando", + "_comment": "Directions", + "direction.voluminousenergy.up": "Cima", + "direction.voluminousenergy.down": "Baixo", + "direction.voluminousenergy.north": "Norte", + "direction.voluminousenergy.south": "Sul", + "direction.voluminousenergy.east": "Leste", + "direction.voluminousenergy.west": "Oeste", + "_comment": "Slot Names", + "slot.voluminousenergy.rng_slot": "Slot RNG", + "slot.voluminousenergy.input_slot": "Slot Entrada", + "slot.voluminousenergy.output_slot": "Slot Saída", + "slot.voluminousenergy.bucket_slot": "Slot Balde", + "_comment": "Tank Names", + "tank.voluminousenergy.input_tank": "Tanque Entrada", + "tank.voluminousenergy.output_tank": "Tanque Saída", + "tank.voluminousenergy.invalid": "INVÁLIDO", + "tank.voluminousenergy.null": "NULO", + "_comment": "Blocks", + "block.voluminousenergy.primitiveblastfurnace": "Alto-Forno Primitivo", + "block.voluminousenergy.saltpeterore": "Minério de Salitre", + "block.voluminousenergy.primitivestirlinggenerator": "Gerador à Vapor Primitivo", + "block.voluminousenergy.bauxiteore": "Minério de Bauxita", + "block.voluminousenergy.cinnabarore": "Minério de Cinábrio", + "block.voluminousenergy.rutileore": "Minério de Rutilo", + "block.voluminousenergy.crusher": "Triturador", + "block.voluminousenergy.galena_ore": "Minério de Galena", + "block.voluminousenergy.electrolyzer": "Eletrolisador", + "block.voluminousenergy.centrifugal_agitator": "Centrífuga Agitadora", + "block.voluminousenergy.aluminum_shell": "Cubo de Alumínio", + "block.voluminousenergy.compressor": "Compressor", + "block.voluminousenergy.stirling_generator": "Gerador à Vapor", + "block.voluminousenergy.combustion_generator": "Gerador à Combustão", + "block.voluminousenergy.aqueoulizer": "Aquecedor", + "block.voluminousenergy.carbon_shielded_aluminum_machine_frame": "Estrutura de Máquina de Alumínio Com Carbono", + "block.voluminousenergy.air_compressor": "Compressor de Ar", + "block.voluminousenergy.distillation_unit": "Unidade de Destilação", + "block.voluminousenergy.aluminum_machine_casing": "Carcaça de Máquina de Alumínio", + "block.voluminousenergy.titanium_machine_casing": "Carcaça de Máquina de Titânio", + "block.voluminousenergy.pump": "Bomba de Fluido", + "block.voluminousenergy.gas_fired_furnace": "Fornalha à Gás", + "block.voluminousenergy.electric_furnace": "Fornalha Elétrica", + "block.voluminousenergy.battery_box": "Caixa de Bateria", + "block.voluminousenergy.primitive_solar_panel": "Painel Solar Primitivo", + "block.voluminousenergy.solar_panel": "Painel Solar", + "block.voluminousenergy.centrifugal_separator": "Centrífuga Separadora", + "block.voluminousenergy.implosion_compressor": "Compressor à Implosão", + "block.voluminousenergy.blast_furnace": "Alto-Forno", + "block.voluminousenergy.rice_crop": "Arroz", + "block.voluminousenergy.solarium_block": "Bloco de Solário", + "block.voluminousenergy.eighzo_ore": "Minério de Eighzo", + "_comment": "Creative Tabs", + "itemGroup.voluminousenergy": "Voluminous Energy", + "_comment": "Fluids", + "fluid.voluminousenergy.crude_oil": "Óleo Bruto", + "fluid.voluminousenergy.biofuel": "Biocombustível", + "fluid.voluminousenergy.compressed_air": "Ar Comprimido", + "fluid.voluminousenergy.diesel": "Diesel", + "fluid.voluminousenergy.dinitrogen_tetroxide": "Tetróxido de Dinitrogênio", + "fluid.voluminousenergy.gasoline": "Gasolina", + "fluid.voluminousenergy.nitroglycerin": "Nitroglicerina", + "fluid.voluminousenergy.light_fuel": "Combustível Leve", + "fluid.voluminousenergy.liquefied_coal": "Carvão Liquefeito", + "fluid.voluminousenergy.liquefied_coke": "Coque Liquefeito", + "fluid.voluminousenergy.mercury": "Mercúrio", + "fluid.voluminousenergy.naphtha": "Nafta", + "fluid.voluminousenergy.nitrogen": "Nitrogênio", + "fluid.voluminousenergy.oxygen": "Oxigênio", + "fluid.voluminousenergy.red_fuming_nitric_acid": "Ácido Nítrico Fumegante Vermelho", + "fluid.voluminousenergy.white_fuming_nitric_acid": "Ácido Nítrico Fumegante Branco", + "fluid.voluminousenergy.sulfuric_acid": "Ácido Sulfúrico", + "_comment": "Fluids", + "fluid_type.voluminousenergy.crude_oil": "Óleo Bruto", + "fluid_type.voluminousenergy.biofuel": "Biocombustível", + "fluid_type.voluminousenergy.compressed_air": "Ar Comprimido", + "fluid_type.voluminousenergy.diesel": "Diesel", + "fluid_type.voluminousenergy.dinitrogen_tetroxide": "Tetróxido de Dinitrogênio", + "fluid_type.voluminousenergy.gasoline": "Gasolina", + "fluid_type.voluminousenergy.nitroglycerin": "Nitroglicerina", + "fluid_type.voluminousenergy.light_fuel": "Combustível Leve", + "fluid_type.voluminousenergy.liquefied_coal": "Carvão Liquefeito", + "fluid_type.voluminousenergy.liquefied_coke": "Coque Liquefeito", + "fluid_type.voluminousenergy.mercury": "Mercúrio", + "fluid_type.voluminousenergy.naphtha": "Nafta", + "fluid_type.voluminousenergy.nitrogen": "Nitrogênio", + "fluid_type.voluminousenergy.oxygen": "Oxigênio", + "fluid_type.voluminousenergy.red_fuming_nitric_acid": "Ácido Nítrico Fumegante Vermelho", + "fluid_type.voluminousenergy.white_fuming_nitric_acid": "Ácido Nítrico Fumegante Branco", + "fluid_type.voluminousenergy.sulfuric_acid": "Ácido Sulfúrico", + "_comment": "Fluid Blocks", + "block.voluminousenergy.crude_oil": "Óleo Bruto", + "block.voluminousenergy.biofuel": "Biocombustível", + "block.voluminousenergy.compressed_air": "Ar Comprimido Líquido", + "block.voluminousenergy.diesel": "Diesel", + "block.voluminousenergy.dinitrogen_tetroxide": "Tetróxido de Dinitrogênio Líquido", + "block.voluminousenergy.gasoline": "Gasolina", + "block.voluminousenergy.nitroglycerin": "Nitroglicerina Líquida", + "block.voluminousenergy.light_fuel": "Combustível Leve", + "block.voluminousenergy.liquefied_coal": "Carvão Liquefeito", + "block.voluminousenergy.liquefied_coke": "Coque Liquefeito", + "block.voluminousenergy.mercury": "Mercúrio", + "block.voluminousenergy.naphtha": "Nafta", + "block.voluminousenergy.nitrogen": "Nitrogênio Líquido", + "block.voluminousenergy.oxygen": "Oxigênio Líquido", + "block.voluminousenergy.red_fuming_nitric_acid": "Ácido Nítrico Fumegante Vermelho", + "block.voluminousenergy.white_fuming_nitric_acid": "Ácido Nítrico Fumegante Branco", + "block.voluminousenergy.sulfuric_acid": "Ácido Sulfúrico", + "_comment": "Items", + "item.voluminousenergy.petcoke": "Petrocoque", + "item.voluminousenergy.coalcoke": "Carvão Coque", + "item.voluminousenergy.coaldust": "Pó de Carvão", + "item.voluminousenergy.cokedust": "Pó de Coque", + "item.voluminousenergy.lapisdust": "Pó de Lápis-Lazúli", + "item.voluminousenergy.sulfurdust": "Pó de Enxofre", + "item.voluminousenergy.carbondust": "Pó de Carbono", + "item.voluminousenergy.saltpeterdust": "Pó de Salitre", + "item.voluminousenergy.saltpeterchunk": "Pedaço de Salitre", + "item.voluminousenergy.carbonbrick": "Tijolo de Carbono", + "item.voluminousenergy.stonegear": "Engrenagem de Pedra", + "item.voluminousenergy.irongear": "Engrenagem de Ferro", + "item.voluminousenergy.carbongear": "Engrenagem de Carbono", + "item.voluminousenergy.aluminum_dust": "Pó de Alumínio", + "item.voluminousenergy.bauxite_dust": "Pó de Bauxita", + "item.voluminousenergy.cinnabar_dust": "Pó de Cinábrio", + "item.voluminousenergy.iron_dust": "Pó de Ferro", + "item.voluminousenergy.quartz_dust": "Pó de Quartzo", + "item.voluminousenergy.sand_dust": "Pó de Areia", + "item.voluminousenergy.soulsand_dust": "Pó de Areia das Almas", + "item.voluminousenergy.titanium_dust": "Pó de Titânio", + "item.voluminousenergy.aluminum_ingot": "Lingote de Alumínio", + "item.voluminousenergy.titanium_ingot": "Lingote de Titânio", + "item.voluminousenergy.aluminum_gear": "Engrenagem de Alumínio", + "item.voluminousenergy.titanium_gear": "Engrenagem de Titânio", + "item.voluminousenergy.silicon": "Silício", + "item.voluminousenergy.gold_microchip": "Microchip de Ouro", + "item.voluminousenergy.rutile_dust": "Pó de Rutilo", + "item.voluminousenergy.galena_dust": "Pó de Galena", + "item.voluminousenergy.lead_dust": "Pó de Chumbo", + "item.voluminousenergy.silver_dust": "Pó de Prata", + "item.voluminousenergy.crude_oil_bucket": "Balde de Óleo Bruto", + "item.voluminousenergy.oxygen_bucket": "Balde de Oxigênio Líquido", + "item.voluminousenergy.naphtha_bucket": "Balde de Nafta", + "item.voluminousenergy.red_fuming_nitric_acid_bucket": "Balde de Ácido Nítrico Fumegante Vermelho", + "item.voluminousenergy.white_fuming_nitric_acid_bucket": "Balde de Ácido Nítrico Fumegante Branco", + "item.voluminousenergy.mercury_bucket": "Balde de Mercúrio", + "item.voluminousenergy.sulfuric_acid_bucket": "Balde de Ácido Sulfúrico", + "item.voluminousenergy.silver_ingot": "Lingote de Prata", + "item.voluminousenergy.lead_ingot": "Lingote de Chumbo", + "item.voluminousenergy.gold_dust": "Pó de Ouro", + "item.voluminousenergy.dinitrogen_tetroxide_bucket": "Balde de Tetróxido de Dinitrogênio Líquido", + "item.voluminousenergy.aluminum_plate": "Placa de Alumínio", + "item.voluminousenergy.carbon_plate": "Placa de Carbono", + "item.voluminousenergy.compressed_air_bucket": "Balde de Ar Comprimido Líquido", + "item.voluminousenergy.nitrogen_bucket": "Balde de Nitrogênio Líquido", + "item.voluminousenergy.biofuel_bucket": "Balde de Biocombustível", + "item.voluminousenergy.diesel_bucket": "Balde de Diesel", + "item.voluminousenergy.gasoline_bucket": "Balde de Gasolina", + "item.voluminousenergy.nitroglycerin_bucket": "Balde de Nitroglicerina Líquida", + "item.voluminousenergy.light_fuel_bucket": "Balde de Combustível Leve", + "item.voluminousenergy.liquefied_coal_bucket": "Balde de Carvão Liquefeito", + "item.voluminousenergy.liquefied_coke_bucket": "Balde de Coque Liquefeito", + "item.voluminousenergy.shredded_biomass": "Biomassa Triturada", + "item.voluminousenergy.silver_microchip": "Microchip de Prata", + "item.voluminousenergy.titanium_plate": "Placa de Titânio", + "item.voluminousenergy.quartz_multiplier": "Multiplicador de Quartzo", + "item.voluminousenergy.mercury_battery": "Bateria de Mercúrio", + "item.voluminousenergy.lead_acid_battery": "Bateria Chumbo-Ácido", + "item.voluminousenergy.photovoltaic_dust": "Pó Fotovoltaico", + "item.voluminousenergy.end_stone_dust": "Pó de Pedra do End", + "item.voluminousenergy.basalt_dust": "Pó de Basalto", + "item.voluminousenergy.flint_dust": "Pó de Sílex", + "item.voluminousenergy.netherrack_dust": "Pó de Netherrack", + "item.voluminousenergy.raw_bauxite": "Bauxita Bruta", + "item.voluminousenergy.raw_cinnabar": "Cinábrio Bruto", + "item.voluminousenergy.raw_galena": "Galena Bruta", + "item.voluminousenergy.raw_rutile": "Rutilo Bruto", + "item.voluminousenergy.raw_sulfur": "Enxofre Bruto", + "item.voluminousenergy.netherite_dust": "Pó de Netherita", + "item.voluminousenergy.tungsten_dust": "Pó de Tungstênio", + "item.voluminousenergy.tungsten_ingot": "Lingote de Tungstênio", + "item.voluminousenergy.steel_dust": "Pó de Aço", + "item.voluminousenergy.steel_ingot": "Lingote de Aço", + "item.voluminousenergy.tungsten_steel_ingot": "Lingote de Aço de Tungstênio", + "item.voluminousenergy.raw_eighzo": "Eighzo Bruto", + "item.voluminousenergy.eighzo_dust": "Pó de Eighzo", + "item.voluminousenergy.eighzo_ingot": "Lingote de Eighzo", + "item.voluminousenergy.solarium_dust": "Pó de Solário", + "item.voluminousenergy.solarium_ingot": "Lingote de Solário", + "item.voluminousenergy.solarium_gear": "Engrenagem de Solário", + "item.voluminousenergy.solarium_plate": "Placa de Solário", + "item.voluminousenergy.nighalite_ingot": "Lingote de Nighalita", + "item.voluminousenergy.cooked_rice": "Arroz Cozido", + "item.voluminousenergy.aluminum_pickaxe": "Picareta de Alumínio", + "item.voluminousenergy.aluminum_axe": "Machado de Alumínio", + "item.voluminousenergy.aluminum_sword": "Espada de Alumínio", + "item.voluminousenergy.aluminum_hoe": "Enxada de Alumínio", + "item.voluminousenergy.aluminum_shovel": "Pá de Alumínio", + "item.voluminousenergy.carbon_pickaxe": "Picareta de Carbono", + "item.voluminousenergy.carbon_axe": "Machado de Carbono", + "item.voluminousenergy.carbon_sword": "Espada de Carbono", + "item.voluminousenergy.carbon_hoe": "Enxada de Carbono", + "item.voluminousenergy.carbon_shovel": "Pá de Carbono", + "item.voluminousenergy.titanium_pickaxe": "Picareta de Titânio", + "item.voluminousenergy.titanium_axe": "Machado de Titânio", + "item.voluminousenergy.titanium_sword": "Espada de Titânio", + "item.voluminousenergy.titanium_hoe": "Enxada de Titânio", + "item.voluminousenergy.titanium_shovel": "Pá de Titânio", + "item.voluminousenergy.tungsten_pickaxe": "Picareta de Tungstênio", + "item.voluminousenergy.tungsten_axe": "Machado de Tungstênio", + "item.voluminousenergy.tungsten_sword": "Espada de Tungstênio", + "item.voluminousenergy.tungsten_hoe": "Enxada de de Tungstênio", + "item.voluminousenergy.tungsten_shovel": "Pá de de Tungstênio", + "item.voluminousenergy.tungsten_steel_pickaxe": "Picareta de Aço de Tungstênio", + "item.voluminousenergy.tungsten_steel_axe": "Machado de Aço de Tungstênio", + "item.voluminousenergy.tungsten_steel_sword": "Espada de Aço de Tungstênio", + "item.voluminousenergy.tungsten_steel_hoe": "Enxada de Aço de Tungstênio", + "item.voluminousenergy.tungsten_steel_shovel": "Pá de Aço de Tungstênio", + "item.voluminousenergy.nighalite_pickaxe": "Picareta de Nighalita", + "item.voluminousenergy.nighalite_axe": "Machado de Nighalita", + "item.voluminousenergy.nighalite_sword": "Espada de Nighalita", + "item.voluminousenergy.nighalite_hoe": "Enxada de Nighalita", + "item.voluminousenergy.nighalite_shovel": "Pá de Nighalita", + "item.voluminousenergy.eighzo_pickaxe": "Picareta de Eighzo", + "item.voluminousenergy.eighzo_axe": "Machado de Eighzo", + "item.voluminousenergy.eighzo_sword": "Espada de de Eighzo", + "item.voluminousenergy.eighzo_hoe": "Enxada de Eighzo", + "item.voluminousenergy.eighzo_shovel": "Pá de Eighzo", + "item.voluminousenergy.solarium_pickaxe": "Picareta de Solário", + "item.voluminousenergy.solarium_axe": "Machado de Solário", + "item.voluminousenergy.solarium_sword": "Espada de Solário", + "item.voluminousenergy.solarium_hoe": "Enxada de Solário", + "item.voluminousenergy.solarium_shovel": "Pá de Solário", + "_comment": "Biomes", + "biome.voluminousenergy.red_desert": "Deserto Vermelho", + "_comment": "JEI UI Recipe Names", + "jei.voluminousenergy.aqueoulizing": "Aquecendo", + "jei.voluminousenergy.centrifugal_agitation": "Agitação Centrífuga", + "jei.voluminousenergy.centrifugal_separation": "Separação Centrífuga", + "jei.voluminousenergy.combustion": "Combustão", + "jei.voluminousenergy.compressing": "Compressão", + "jei.voluminousenergy.crushing": "Trituração", + "jei.voluminousenergy.distilling": "Destilando", + "jei.voluminousenergy.electrolyzing": "Eletrolisação", + "jei.voluminousenergy.implosion_compressing": "Compressão á Implosão", + "jei.voluminousenergy.industrial_blasting": "Explosão Industrial", + "jei.voluminousenergy.stirling": "Vapor" } diff --git a/src/main/resources/assets/voluminousenergy/models/block/dimensional_laser.json b/src/main/resources/assets/voluminousenergy/models/block/dimensional_laser.json index f7e89dd02..084bbcd62 100644 --- a/src/main/resources/assets/voluminousenergy/models/block/dimensional_laser.json +++ b/src/main/resources/assets/voluminousenergy/models/block/dimensional_laser.json @@ -1,849 +1,4648 @@ { - "credit": "Made with Blockbench", - "texture_size": [64, 64], - "textures": { - "0": "voluminousenergy:block/dimensional_laser", - "particle": "voluminousenergy:block/dimensional_laser" - }, - "elements": [ - { - "name": "base", - "from": [0, 0, 0], - "to": [16, 1, 16], - "faces": { - "north": {"uv": [10.5, 8, 14.5, 8.25], "texture": "#0"}, - "east": {"uv": [10.5, 8.25, 14.5, 8.5], "texture": "#0"}, - "south": {"uv": [10.5, 8.5, 14.5, 8.75], "texture": "#0"}, - "west": {"uv": [10.5, 8.75, 14.5, 9], "texture": "#0"}, - "up": {"uv": [4, 4, 0, 0], "texture": "#0"}, - "down": {"uv": [4, 4, 0, 8], "texture": "#0"} - } - }, - { - "from": [0, 1, 0], - "to": [2, 4, 1], - "faces": { - "north": {"uv": [14, 7, 14.5, 7.75], "texture": "#0"}, - "east": {"uv": [10.75, 7, 11, 7.75], "texture": "#0"}, - "south": {"uv": [14, 9, 14.5, 9.75], "texture": "#0"}, - "west": {"uv": [13, 7, 13.25, 7.75], "texture": "#0"}, - "up": {"uv": [13.25, 8, 12.75, 7.75], "texture": "#0"}, - "down": {"uv": [14.25, 7.75, 13.75, 8], "texture": "#0"} - } - }, - { - "from": [0, 1, 1], - "to": [1, 4, 2], - "faces": { - "north": {"uv": [14.5, 1.5, 14.75, 2.25], "texture": "#0"}, - "east": {"uv": [1.75, 14.5, 2, 15.25], "texture": "#0"}, - "south": {"uv": [2, 14.5, 2.25, 15.25], "texture": "#0"}, - "west": {"uv": [2.25, 14.5, 2.5, 15.25], "texture": "#0"}, - "up": {"uv": [14, 7.75, 13.75, 7.5], "texture": "#0"}, - "down": {"uv": [14.5, 6.75, 14.25, 7], "texture": "#0"} - } - }, - { - "from": [1, 1, 1], - "to": [3, 7, 2], - "faces": { - "north": {"uv": [3.25, 11, 3.75, 12.5], "texture": "#0"}, - "east": {"uv": [9, 14, 9.25, 15.5], "texture": "#0"}, - "south": {"uv": [11, 3.5, 11.5, 5], "texture": "#0"}, - "west": {"uv": [14, 9.75, 14.25, 11.25], "texture": "#0"}, - "up": {"uv": [15, 12.25, 14.5, 12], "texture": "#0"}, - "down": {"uv": [15, 12.25, 14.5, 12.5], "texture": "#0"} - } - }, - { - "from": [1, 1, 2], - "to": [2, 7, 3], - "faces": { - "north": {"uv": [7.5, 14, 7.75, 15.5], "texture": "#0"}, - "east": {"uv": [7.75, 14, 8, 15.5], "texture": "#0"}, - "south": {"uv": [8, 14, 8.25, 15.5], "texture": "#0"}, - "west": {"uv": [8.25, 14, 8.5, 15.5], "texture": "#0"}, - "up": {"uv": [11, 8, 10.75, 7.75], "texture": "#0"}, - "down": {"uv": [13, 7.5, 12.75, 7.75], "texture": "#0"} - } - }, - { - "from": [2, 1, 2], - "to": [4, 9, 3], - "faces": { - "north": {"uv": [8.5, 7.5, 9, 9.5], "texture": "#0"}, - "east": {"uv": [10, 0, 10.25, 2], "texture": "#0"}, - "south": {"uv": [9, 0, 9.5, 2], "texture": "#0"}, - "west": {"uv": [4.75, 13, 5, 15], "texture": "#0"}, - "up": {"uv": [15, 12.75, 14.5, 12.5], "texture": "#0"}, - "down": {"uv": [15, 12.75, 14.5, 13], "texture": "#0"} - } - }, - { - "from": [3, 1, 3], - "to": [5, 11, 4], - "faces": { - "north": {"uv": [5, 8, 5.5, 10.5], "texture": "#0"}, - "east": {"uv": [12, 12, 12.25, 14.5], "texture": "#0"}, - "south": {"uv": [5.5, 8, 6, 10.5], "texture": "#0"}, - "west": {"uv": [12.25, 0, 12.5, 2.5], "texture": "#0"}, - "up": {"uv": [15, 13.25, 14.5, 13], "texture": "#0"}, - "down": {"uv": [15, 13.25, 14.5, 13.5], "texture": "#0"} - } - }, - { - "from": [4, 1, 4], - "to": [6, 13, 5], - "faces": { - "north": {"uv": [0.5, 8, 1, 11], "texture": "#0"}, - "east": {"uv": [3.75, 11, 4, 14], "texture": "#0"}, - "south": {"uv": [1, 8, 1.5, 11], "texture": "#0"}, - "west": {"uv": [11, 5, 11.25, 8], "texture": "#0"}, - "up": {"uv": [15, 13.75, 14.5, 13.5], "texture": "#0"}, - "down": {"uv": [15, 13.75, 14.5, 14], "texture": "#0"} - } - }, - { - "from": [5, 1, 5], - "to": [7, 15, 6], - "faces": { - "north": {"uv": [7, 0, 7.5, 3.5], "texture": "#0"}, - "east": {"uv": [6, 10.5, 6.25, 14], "texture": "#0"}, - "south": {"uv": [7, 3.5, 7.5, 7], "texture": "#0"}, - "west": {"uv": [6.25, 10.5, 6.5, 14], "texture": "#0"}, - "up": {"uv": [15, 14.25, 14.5, 14], "texture": "#0"}, - "down": {"uv": [15, 14.25, 14.5, 14.5], "texture": "#0"} - } - }, - { - "from": [6, 1, 6], - "to": [8, 17, 7], - "faces": { - "north": {"uv": [5, 0, 5.5, 4], "texture": "#0"}, - "east": {"uv": [9, 2, 9.25, 6], "texture": "#0"}, - "south": {"uv": [5, 4, 5.5, 8], "texture": "#0"}, - "west": {"uv": [4, 9, 4.25, 13], "texture": "#0"}, - "up": {"uv": [15, 14.75, 14.5, 14.5], "texture": "#0"}, - "down": {"uv": [15.25, 0, 14.75, 0.25], "texture": "#0"} - } - }, - { - "from": [2, 1, 3], - "to": [3, 9, 4], - "faces": { - "north": {"uv": [13, 5, 13.25, 7], "texture": "#0"}, - "east": {"uv": [13, 9, 13.25, 11], "texture": "#0"}, - "south": {"uv": [13, 11, 13.25, 13], "texture": "#0"}, - "west": {"uv": [13, 13, 13.25, 15], "texture": "#0"}, - "up": {"uv": [14.5, 8, 14.25, 7.75], "texture": "#0"}, - "down": {"uv": [15, 11.75, 14.75, 12], "texture": "#0"} - } - }, - { - "from": [3, 1, 4], - "to": [4, 11, 5], - "faces": { - "north": {"uv": [12.25, 4.5, 12.5, 7], "texture": "#0"}, - "east": {"uv": [12.25, 9, 12.5, 11.5], "texture": "#0"}, - "south": {"uv": [12.25, 11.5, 12.5, 14], "texture": "#0"}, - "west": {"uv": [12.5, 0, 12.75, 2.5], "texture": "#0"}, - "up": {"uv": [10.75, 15.25, 10.5, 15], "texture": "#0"}, - "down": {"uv": [11, 15, 10.75, 15.25], "texture": "#0"} - } - }, - { - "from": [4, 1, 5], - "to": [5, 13, 6], - "faces": { - "north": {"uv": [8, 11, 8.25, 14], "texture": "#0"}, - "east": {"uv": [8.25, 11, 8.5, 14], "texture": "#0"}, - "south": {"uv": [11, 9, 11.25, 12], "texture": "#0"}, - "west": {"uv": [11.25, 0, 11.5, 3], "texture": "#0"}, - "up": {"uv": [15.25, 11, 15, 10.75], "texture": "#0"}, - "down": {"uv": [11.25, 15, 11, 15.25], "texture": "#0"} - } - }, - { - "from": [5, 1, 6], - "to": [6, 15, 7], - "faces": { - "north": {"uv": [6.5, 10.5, 6.75, 14], "texture": "#0"}, - "east": {"uv": [6.75, 10.5, 7, 14], "texture": "#0"}, - "south": {"uv": [7, 10.5, 7.25, 14], "texture": "#0"}, - "west": {"uv": [7.25, 10.5, 7.5, 14], "texture": "#0"}, - "up": {"uv": [15.25, 11.25, 15, 11], "texture": "#0"}, - "down": {"uv": [11.5, 15, 11.25, 15.25], "texture": "#0"} - } - }, - { - "from": [6, 1, 7], - "to": [7, 17, 8], - "faces": { - "north": {"uv": [4.25, 9, 4.5, 13], "texture": "#0"}, - "east": {"uv": [4.5, 9, 4.75, 13], "texture": "#0"}, - "south": {"uv": [4.75, 9, 5, 13], "texture": "#0"}, - "west": {"uv": [9, 6, 9.25, 10], "texture": "#0"}, - "up": {"uv": [15.25, 11.5, 15, 11.25], "texture": "#0"}, - "down": {"uv": [11.75, 15, 11.5, 15.25], "texture": "#0"} - } - }, - { - "from": [15, 1, 0], - "to": [16, 4, 2], - "faces": { - "north": {"uv": [14.5, 2.25, 14.75, 3], "texture": "#0"}, - "east": {"uv": [14, 11.25, 14.5, 12], "texture": "#0"}, - "south": {"uv": [2.5, 14.5, 2.75, 15.25], "texture": "#0"}, - "west": {"uv": [14, 12, 14.5, 12.75], "texture": "#0"}, - "up": {"uv": [11.5, 3.5, 11.25, 3], "texture": "#0"}, - "down": {"uv": [11.75, 4.5, 11.5, 5], "texture": "#0"} - } - }, - { - "from": [14, 1, 0], - "to": [15, 4, 1], - "faces": { - "north": {"uv": [2.75, 14.5, 3, 15.25], "texture": "#0"}, - "east": {"uv": [3, 14.5, 3.25, 15.25], "texture": "#0"}, - "south": {"uv": [14.5, 4.5, 14.75, 5.25], "texture": "#0"}, - "west": {"uv": [5, 14.5, 5.25, 15.25], "texture": "#0"}, - "up": {"uv": [15.25, 11.75, 15, 11.5], "texture": "#0"}, - "down": {"uv": [12, 15, 11.75, 15.25], "texture": "#0"} - } - }, - { - "from": [14, 1, 1], - "to": [15, 7, 3], - "faces": { - "north": {"uv": [12.25, 14, 12.5, 15.5], "texture": "#0"}, - "east": {"uv": [11.25, 5, 11.75, 6.5], "texture": "#0"}, - "south": {"uv": [12.5, 14, 12.75, 15.5], "texture": "#0"}, - "west": {"uv": [11.25, 6.5, 11.75, 8], "texture": "#0"}, - "up": {"uv": [12.5, 3, 12.25, 2.5], "texture": "#0"}, - "down": {"uv": [12.5, 7, 12.25, 7.5], "texture": "#0"} - } - }, - { - "from": [13, 1, 1], - "to": [14, 7, 2], - "faces": { - "north": {"uv": [12.75, 14, 13, 15.5], "texture": "#0"}, - "east": {"uv": [14, 12.75, 14.25, 14.25], "texture": "#0"}, - "south": {"uv": [14.25, 0, 14.5, 1.5], "texture": "#0"}, - "west": {"uv": [14.25, 1.5, 14.5, 3], "texture": "#0"}, - "up": {"uv": [15.25, 12, 15, 11.75], "texture": "#0"}, - "down": {"uv": [15.25, 12, 15, 12.25], "texture": "#0"} - } - }, - { - "from": [13, 1, 2], - "to": [14, 9, 4], - "faces": { - "north": {"uv": [13.25, 0, 13.5, 2], "texture": "#0"}, - "east": {"uv": [8, 9, 8.5, 11], "texture": "#0"}, - "south": {"uv": [13.25, 2, 13.5, 4], "texture": "#0"}, - "west": {"uv": [9.25, 2, 9.75, 4], "texture": "#0"}, - "up": {"uv": [15, 0.75, 14.75, 0.25], "texture": "#0"}, - "down": {"uv": [15, 0.75, 14.75, 1.25], "texture": "#0"} - } - }, - { - "from": [12, 1, 3], - "to": [13, 11, 5], - "faces": { - "north": {"uv": [12.5, 2.5, 12.75, 5], "texture": "#0"}, - "east": {"uv": [6, 8, 6.5, 10.5], "texture": "#0"}, - "south": {"uv": [3.25, 12.5, 3.5, 15], "texture": "#0"}, - "west": {"uv": [6.5, 8, 7, 10.5], "texture": "#0"}, - "up": {"uv": [15, 1.75, 14.75, 1.25], "texture": "#0"}, - "down": {"uv": [15, 1.75, 14.75, 2.25], "texture": "#0"} - } - }, - { - "from": [11, 1, 4], - "to": [12, 13, 6], - "faces": { - "north": {"uv": [11.25, 9, 11.5, 12], "texture": "#0"}, - "east": {"uv": [1.5, 8, 2, 11], "texture": "#0"}, - "south": {"uv": [0, 11.5, 0.25, 14.5], "texture": "#0"}, - "west": {"uv": [2, 8, 2.5, 11], "texture": "#0"}, - "up": {"uv": [15, 2.75, 14.75, 2.25], "texture": "#0"}, - "down": {"uv": [15, 2.75, 14.75, 3.25], "texture": "#0"} - } - }, - { - "from": [10, 1, 5], - "to": [11, 15, 7], - "faces": { - "north": {"uv": [7.5, 10.5, 7.75, 14], "texture": "#0"}, - "east": {"uv": [7, 7, 7.5, 10.5], "texture": "#0"}, - "south": {"uv": [7.75, 10.5, 8, 14], "texture": "#0"}, - "west": {"uv": [7.5, 0, 8, 3.5], "texture": "#0"}, - "up": {"uv": [15, 3.75, 14.75, 3.25], "texture": "#0"}, - "down": {"uv": [15, 3.75, 14.75, 4.25], "texture": "#0"} - } - }, - { - "from": [9, 1, 6], - "to": [10, 17, 8], - "faces": { - "north": {"uv": [9.25, 4, 9.5, 8], "texture": "#0"}, - "east": {"uv": [5.5, 0, 6, 4], "texture": "#0"}, - "south": {"uv": [9.25, 8, 9.5, 12], "texture": "#0"}, - "west": {"uv": [5.5, 4, 6, 8], "texture": "#0"}, - "up": {"uv": [15, 4.75, 14.75, 4.25], "texture": "#0"}, - "down": {"uv": [15, 4.75, 14.75, 5.25], "texture": "#0"} - } - }, - { - "from": [12, 1, 2], - "to": [13, 9, 3], - "faces": { - "north": {"uv": [13.25, 4, 13.5, 6], "texture": "#0"}, - "east": {"uv": [13.25, 6, 13.5, 8], "texture": "#0"}, - "south": {"uv": [13.25, 9, 13.5, 11], "texture": "#0"}, - "west": {"uv": [13.25, 11, 13.5, 13], "texture": "#0"}, - "up": {"uv": [15.25, 12.5, 15, 12.25], "texture": "#0"}, - "down": {"uv": [15.25, 12.5, 15, 12.75], "texture": "#0"} - } - }, - { - "from": [11, 1, 3], - "to": [12, 11, 4], - "faces": { - "north": {"uv": [3.5, 12.5, 3.75, 15], "texture": "#0"}, - "east": {"uv": [12.5, 5, 12.75, 7.5], "texture": "#0"}, - "south": {"uv": [12.5, 9, 12.75, 11.5], "texture": "#0"}, - "west": {"uv": [10.5, 12.5, 10.75, 15], "texture": "#0"}, - "up": {"uv": [15.25, 13, 15, 12.75], "texture": "#0"}, - "down": {"uv": [13.25, 15, 13, 15.25], "texture": "#0"} - } - }, - { - "from": [10, 1, 4], - "to": [11, 13, 5], - "faces": { - "north": {"uv": [11.5, 0, 11.75, 3], "texture": "#0"}, - "east": {"uv": [0.25, 11.5, 0.5, 14.5], "texture": "#0"}, - "south": {"uv": [11.5, 9, 11.75, 12], "texture": "#0"}, - "west": {"uv": [11.75, 0, 12, 3], "texture": "#0"}, - "up": {"uv": [15.25, 13.25, 15, 13], "texture": "#0"}, - "down": {"uv": [13.5, 15, 13.25, 15.25], "texture": "#0"} - } - }, - { - "from": [9, 1, 5], - "to": [10, 15, 6], - "faces": { - "north": {"uv": [10.5, 9, 10.75, 12.5], "texture": "#0"}, - "east": {"uv": [10.75, 0, 11, 3.5], "texture": "#0"}, - "south": {"uv": [10.75, 3.5, 11, 7], "texture": "#0"}, - "west": {"uv": [10.75, 9, 11, 12.5], "texture": "#0"}, - "up": {"uv": [15.25, 13.5, 15, 13.25], "texture": "#0"}, - "down": {"uv": [13.75, 15, 13.5, 15.25], "texture": "#0"} - } - }, - { - "from": [8, 1, 6], - "to": [9, 17, 7], - "faces": { - "north": {"uv": [9.5, 4, 9.75, 8], "texture": "#0"}, - "east": {"uv": [9.5, 8, 9.75, 12], "texture": "#0"}, - "south": {"uv": [8.5, 9.5, 8.75, 13.5], "texture": "#0"}, - "west": {"uv": [8.75, 9.5, 9, 13.5], "texture": "#0"}, - "up": {"uv": [15.25, 13.75, 15, 13.5], "texture": "#0"}, - "down": {"uv": [15.25, 13.75, 15, 14], "texture": "#0"} - } - }, - { - "from": [14, 1, 15], - "to": [16, 4, 16], - "faces": { - "north": {"uv": [14.25, 3, 14.75, 3.75], "texture": "#0"}, - "east": {"uv": [5.25, 14.5, 5.5, 15.25], "texture": "#0"}, - "south": {"uv": [14.25, 3.75, 14.75, 4.5], "texture": "#0"}, - "west": {"uv": [14.5, 5.25, 14.75, 6], "texture": "#0"}, - "up": {"uv": [15.25, 5.5, 14.75, 5.25], "texture": "#0"}, - "down": {"uv": [15.25, 5.5, 14.75, 5.75], "texture": "#0"} - } - }, - { - "from": [15, 1, 14], - "to": [16, 4, 15], - "faces": { - "north": {"uv": [5.5, 14.5, 5.75, 15.25], "texture": "#0"}, - "east": {"uv": [5.75, 14.5, 6, 15.25], "texture": "#0"}, - "south": {"uv": [14.5, 6.75, 14.75, 7.5], "texture": "#0"}, - "west": {"uv": [14.5, 7.5, 14.75, 8.25], "texture": "#0"}, - "up": {"uv": [15.25, 14.25, 15, 14], "texture": "#0"}, - "down": {"uv": [15.25, 14.25, 15, 14.5], "texture": "#0"} - } - }, - { - "from": [13, 1, 14], - "to": [15, 7, 15], - "faces": { - "north": {"uv": [11.5, 3, 12, 4.5], "texture": "#0"}, - "east": {"uv": [14.25, 4.5, 14.5, 6], "texture": "#0"}, - "south": {"uv": [11.75, 4.5, 12.25, 6], "texture": "#0"}, - "west": {"uv": [14.25, 9.75, 14.5, 11.25], "texture": "#0"}, - "up": {"uv": [15.25, 6, 14.75, 5.75], "texture": "#0"}, - "down": {"uv": [15.25, 6, 14.75, 6.25], "texture": "#0"} - } - }, - { - "from": [14, 1, 13], - "to": [15, 7, 14], - "faces": { - "north": {"uv": [14.25, 12.75, 14.5, 14.25], "texture": "#0"}, - "east": {"uv": [13.75, 14.25, 14, 15.75], "texture": "#0"}, - "south": {"uv": [14, 14.25, 14.25, 15.75], "texture": "#0"}, - "west": {"uv": [14.25, 14.25, 14.5, 15.75], "texture": "#0"}, - "up": {"uv": [15.25, 14.75, 15, 14.5], "texture": "#0"}, - "down": {"uv": [15.25, 14.75, 15, 15], "texture": "#0"} - } - }, - { - "from": [12, 1, 13], - "to": [14, 9, 14], - "faces": { - "north": {"uv": [9.5, 0, 10, 2], "texture": "#0"}, - "east": {"uv": [13.25, 13, 13.5, 15], "texture": "#0"}, - "south": {"uv": [9.75, 2, 10.25, 4], "texture": "#0"}, - "west": {"uv": [13.5, 0, 13.75, 2], "texture": "#0"}, - "up": {"uv": [15.25, 6.5, 14.75, 6.25], "texture": "#0"}, - "down": {"uv": [15.25, 6.5, 14.75, 6.75], "texture": "#0"} - } - }, - { - "from": [11, 1, 12], - "to": [13, 11, 13], - "faces": { - "north": {"uv": [8, 6.5, 8.5, 9], "texture": "#0"}, - "east": {"uv": [10.75, 12.5, 11, 15], "texture": "#0"}, - "south": {"uv": [8.5, 0, 9, 2.5], "texture": "#0"}, - "west": {"uv": [12.5, 11.5, 12.75, 14], "texture": "#0"}, - "up": {"uv": [15.25, 7, 14.75, 6.75], "texture": "#0"}, - "down": {"uv": [15.25, 7, 14.75, 7.25], "texture": "#0"} - } - }, - { - "from": [10, 1, 11], - "to": [12, 13, 12], - "faces": { - "north": {"uv": [2.5, 8, 3, 11], "texture": "#0"}, - "east": {"uv": [11.75, 9, 12, 12], "texture": "#0"}, - "south": {"uv": [3, 8, 3.5, 11], "texture": "#0"}, - "west": {"uv": [12, 0, 12.25, 3], "texture": "#0"}, - "up": {"uv": [15.25, 7.5, 14.75, 7.25], "texture": "#0"}, - "down": {"uv": [15.25, 7.5, 14.75, 7.75], "texture": "#0"} - } - }, - { - "from": [9, 1, 10], - "to": [11, 15, 11], - "faces": { - "north": {"uv": [7.5, 3.5, 8, 7], "texture": "#0"}, - "east": {"uv": [11, 0, 11.25, 3.5], "texture": "#0"}, - "south": {"uv": [7.5, 7, 8, 10.5], "texture": "#0"}, - "west": {"uv": [0.5, 11, 0.75, 14.5], "texture": "#0"}, - "up": {"uv": [15.25, 8, 14.75, 7.75], "texture": "#0"}, - "down": {"uv": [15.25, 8, 14.75, 8.25], "texture": "#0"} - } - }, - { - "from": [8, 1, 9], - "to": [10, 17, 10], - "faces": { - "north": {"uv": [6, 0, 6.5, 4], "texture": "#0"}, - "east": {"uv": [9.75, 4, 10, 8], "texture": "#0"}, - "south": {"uv": [6, 4, 6.5, 8], "texture": "#0"}, - "west": {"uv": [9.75, 8, 10, 12], "texture": "#0"}, - "up": {"uv": [15.25, 8.5, 14.75, 8.25], "texture": "#0"}, - "down": {"uv": [15.25, 8.5, 14.75, 8.75], "texture": "#0"} - } - }, - { - "from": [13, 1, 12], - "to": [14, 9, 13], - "faces": { - "north": {"uv": [13.5, 2, 13.75, 4], "texture": "#0"}, - "east": {"uv": [13.5, 4, 13.75, 6], "texture": "#0"}, - "south": {"uv": [13.5, 6, 13.75, 8], "texture": "#0"}, - "west": {"uv": [8.5, 13.5, 8.75, 15.5], "texture": "#0"}, - "up": {"uv": [15.25, 15.25, 15, 15], "texture": "#0"}, - "down": {"uv": [0.25, 15.25, 0, 15.5], "texture": "#0"} - } - }, - { - "from": [12, 1, 11], - "to": [13, 11, 12], - "faces": { - "north": {"uv": [12.75, 0, 13, 2.5], "texture": "#0"}, - "east": {"uv": [12.75, 2.5, 13, 5], "texture": "#0"}, - "south": {"uv": [12.75, 5, 13, 7.5], "texture": "#0"}, - "west": {"uv": [12.75, 9, 13, 11.5], "texture": "#0"}, - "up": {"uv": [15.5, 0.25, 15.25, 0], "texture": "#0"}, - "down": {"uv": [0.5, 15.25, 0.25, 15.5], "texture": "#0"} - } - }, - { - "from": [11, 1, 10], - "to": [12, 13, 11], - "faces": { - "north": {"uv": [12, 9, 12.25, 12], "texture": "#0"}, - "east": {"uv": [9.25, 12, 9.5, 15], "texture": "#0"}, - "south": {"uv": [9.5, 12, 9.75, 15], "texture": "#0"}, - "west": {"uv": [9.75, 12, 10, 15], "texture": "#0"}, - "up": {"uv": [15.5, 0.5, 15.25, 0.25], "texture": "#0"}, - "down": {"uv": [15.5, 0.5, 15.25, 0.75], "texture": "#0"} - } - }, - { - "from": [10, 1, 9], - "to": [11, 15, 10], - "faces": { - "north": {"uv": [0.75, 11, 1, 14.5], "texture": "#0"}, - "east": {"uv": [1, 11, 1.25, 14.5], "texture": "#0"}, - "south": {"uv": [1.25, 11, 1.5, 14.5], "texture": "#0"}, - "west": {"uv": [1.5, 11, 1.75, 14.5], "texture": "#0"}, - "up": {"uv": [15.5, 1, 15.25, 0.75], "texture": "#0"}, - "down": {"uv": [15.5, 1, 15.25, 1.25], "texture": "#0"} - } - }, - { - "from": [9, 1, 8], - "to": [10, 17, 9], - "faces": { - "north": {"uv": [10, 4, 10.25, 8], "texture": "#0"}, - "east": {"uv": [10, 8, 10.25, 12], "texture": "#0"}, - "south": {"uv": [9, 10, 9.25, 14], "texture": "#0"}, - "west": {"uv": [10.25, 0, 10.5, 4], "texture": "#0"}, - "up": {"uv": [15.5, 1.5, 15.25, 1.25], "texture": "#0"}, - "down": {"uv": [15.5, 1.5, 15.25, 1.75], "texture": "#0"} - } - }, - { - "from": [0, 1, 14], - "to": [1, 4, 16], - "faces": { - "north": {"uv": [14.5, 8.25, 14.75, 9], "texture": "#0"}, - "east": {"uv": [14.25, 6, 14.75, 6.75], "texture": "#0"}, - "south": {"uv": [14.5, 9, 14.75, 9.75], "texture": "#0"}, - "west": {"uv": [0, 14.5, 0.5, 15.25], "texture": "#0"}, - "up": {"uv": [15, 9.25, 14.75, 8.75], "texture": "#0"}, - "down": {"uv": [15, 9.25, 14.75, 9.75], "texture": "#0"} - } - }, - { - "from": [1, 1, 15], - "to": [2, 4, 16], - "faces": { - "north": {"uv": [14.5, 9.75, 14.75, 10.5], "texture": "#0"}, - "east": {"uv": [14.5, 10.5, 14.75, 11.25], "texture": "#0"}, - "south": {"uv": [14.5, 11.25, 14.75, 12], "texture": "#0"}, - "west": {"uv": [12, 14.5, 12.25, 15.25], "texture": "#0"}, - "up": {"uv": [2, 15.5, 1.75, 15.25], "texture": "#0"}, - "down": {"uv": [15.5, 1.75, 15.25, 2], "texture": "#0"} - } - }, - { - "from": [1, 1, 13], - "to": [2, 7, 15], - "faces": { - "north": {"uv": [14.5, 0, 14.75, 1.5], "texture": "#0"}, - "east": {"uv": [11.75, 6, 12.25, 7.5], "texture": "#0"}, - "south": {"uv": [0.5, 14.5, 0.75, 16], "texture": "#0"}, - "west": {"uv": [12, 3, 12.5, 4.5], "texture": "#0"}, - "up": {"uv": [15, 10.25, 14.75, 9.75], "texture": "#0"}, - "down": {"uv": [15, 10.25, 14.75, 10.75], "texture": "#0"} - } - }, - { - "from": [2, 1, 14], - "to": [3, 7, 15], - "faces": { - "north": {"uv": [0.75, 14.5, 1, 16], "texture": "#0"}, - "east": {"uv": [1, 14.5, 1.25, 16], "texture": "#0"}, - "south": {"uv": [1.25, 14.5, 1.5, 16], "texture": "#0"}, - "west": {"uv": [1.5, 14.5, 1.75, 16], "texture": "#0"}, - "up": {"uv": [2.25, 15.5, 2, 15.25], "texture": "#0"}, - "down": {"uv": [15.5, 2, 15.25, 2.25], "texture": "#0"} - } - }, - { - "from": [2, 1, 12], - "to": [3, 9, 14], - "faces": { - "north": {"uv": [8.75, 13.5, 9, 15.5], "texture": "#0"}, - "east": {"uv": [10.25, 4, 10.75, 6], "texture": "#0"}, - "south": {"uv": [13.5, 9, 13.75, 11], "texture": "#0"}, - "west": {"uv": [10.25, 6, 10.75, 8], "texture": "#0"}, - "up": {"uv": [15, 11.25, 14.75, 10.75], "texture": "#0"}, - "down": {"uv": [15, 11.25, 14.75, 11.75], "texture": "#0"} - } - }, - { - "from": [3, 1, 11], - "to": [4, 11, 13], - "faces": { - "north": {"uv": [12.75, 11.5, 13, 14], "texture": "#0"}, - "east": {"uv": [8.5, 2.5, 9, 5], "texture": "#0"}, - "south": {"uv": [13, 0, 13.25, 2.5], "texture": "#0"}, - "west": {"uv": [8.5, 5, 9, 7.5], "texture": "#0"}, - "up": {"uv": [14.75, 15.25, 14.5, 14.75], "texture": "#0"}, - "down": {"uv": [15, 14.75, 14.75, 15.25], "texture": "#0"} - } - }, - { - "from": [4, 1, 10], - "to": [5, 13, 12], - "faces": { - "north": {"uv": [10, 12, 10.25, 15], "texture": "#0"}, - "east": {"uv": [3.5, 8, 4, 11], "texture": "#0"}, - "south": {"uv": [10.25, 12, 10.5, 15], "texture": "#0"}, - "west": {"uv": [8, 3.5, 8.5, 6.5], "texture": "#0"}, - "up": {"uv": [15.25, 0.75, 15, 0.25], "texture": "#0"}, - "down": {"uv": [15.25, 0.75, 15, 1.25], "texture": "#0"} - } - }, - { - "from": [5, 1, 9], - "to": [6, 15, 11], - "faces": { - "north": {"uv": [1.75, 11, 2, 14.5], "texture": "#0"}, - "east": {"uv": [0, 8, 0.5, 11.5], "texture": "#0"}, - "south": {"uv": [2, 11, 2.25, 14.5], "texture": "#0"}, - "west": {"uv": [8, 0, 8.5, 3.5], "texture": "#0"}, - "up": {"uv": [15.25, 1.75, 15, 1.25], "texture": "#0"}, - "down": {"uv": [15.25, 1.75, 15, 2.25], "texture": "#0"} - } - }, - { - "from": [6, 1, 8], - "to": [7, 17, 10], - "faces": { - "north": {"uv": [10.25, 8, 10.5, 12], "texture": "#0"}, - "east": {"uv": [6.5, 0, 7, 4], "texture": "#0"}, - "south": {"uv": [10.5, 0, 10.75, 4], "texture": "#0"}, - "west": {"uv": [6.5, 4, 7, 8], "texture": "#0"}, - "up": {"uv": [15.25, 2.75, 15, 2.25], "texture": "#0"}, - "down": {"uv": [15.25, 2.75, 15, 3.25], "texture": "#0"} - } - }, - { - "from": [3, 1, 13], - "to": [4, 9, 14], - "faces": { - "north": {"uv": [13.5, 11, 13.75, 13], "texture": "#0"}, - "east": {"uv": [13.5, 13, 13.75, 15], "texture": "#0"}, - "south": {"uv": [13.75, 0, 14, 2], "texture": "#0"}, - "west": {"uv": [13.75, 2, 14, 4], "texture": "#0"}, - "up": {"uv": [2.5, 15.5, 2.25, 15.25], "texture": "#0"}, - "down": {"uv": [15.5, 2.25, 15.25, 2.5], "texture": "#0"} - } - }, - { - "from": [4, 1, 12], - "to": [5, 11, 13], - "faces": { - "north": {"uv": [13, 2.5, 13.25, 5], "texture": "#0"}, - "east": {"uv": [4, 13, 4.25, 15.5], "texture": "#0"}, - "south": {"uv": [4.25, 13, 4.5, 15.5], "texture": "#0"}, - "west": {"uv": [4.5, 13, 4.75, 15.5], "texture": "#0"}, - "up": {"uv": [2.75, 15.5, 2.5, 15.25], "texture": "#0"}, - "down": {"uv": [15.5, 2.5, 15.25, 2.75], "texture": "#0"} - } - }, - { - "from": [5, 1, 11], - "to": [6, 13, 12], - "faces": { - "north": {"uv": [11, 12, 11.25, 15], "texture": "#0"}, - "east": {"uv": [11.25, 12, 11.5, 15], "texture": "#0"}, - "south": {"uv": [11.5, 12, 11.75, 15], "texture": "#0"}, - "west": {"uv": [11.75, 12, 12, 15], "texture": "#0"}, - "up": {"uv": [3, 15.5, 2.75, 15.25], "texture": "#0"}, - "down": {"uv": [15.5, 2.75, 15.25, 3], "texture": "#0"} - } - }, - { - "from": [6, 1, 10], - "to": [7, 15, 11], - "faces": { - "north": {"uv": [2.25, 11, 2.5, 14.5], "texture": "#0"}, - "east": {"uv": [2.5, 11, 2.75, 14.5], "texture": "#0"}, - "south": {"uv": [2.75, 11, 3, 14.5], "texture": "#0"}, - "west": {"uv": [3, 11, 3.25, 14.5], "texture": "#0"}, - "up": {"uv": [3.25, 15.5, 3, 15.25], "texture": "#0"}, - "down": {"uv": [15.5, 3, 15.25, 3.25], "texture": "#0"} - } - }, - { - "from": [7, 1, 9], - "to": [8, 17, 10], - "faces": { - "north": {"uv": [5, 10.5, 5.25, 14.5], "texture": "#0"}, - "east": {"uv": [5.25, 10.5, 5.5, 14.5], "texture": "#0"}, - "south": {"uv": [5.5, 10.5, 5.75, 14.5], "texture": "#0"}, - "west": {"uv": [5.75, 10.5, 6, 14.5], "texture": "#0"}, - "up": {"uv": [15.5, 3.5, 15.25, 3.25], "texture": "#0"}, - "down": {"uv": [15.5, 3.5, 15.25, 3.75], "texture": "#0"} - } - }, - { - "from": [7, 1, 7], - "to": [9, 19, 9], - "faces": { - "north": {"uv": [4, 0, 4.5, 4.5], "texture": "#0"}, - "east": {"uv": [4.5, 0, 5, 4.5], "texture": "#0"}, - "south": {"uv": [4, 4.5, 4.5, 9], "texture": "#0"}, - "west": {"uv": [4.5, 4.5, 5, 9], "texture": "#0"}, - "up": {"uv": [12.25, 8, 11.75, 7.5], "texture": "#0"}, - "down": {"uv": [12.75, 7.5, 12.25, 8], "texture": "#0"} - } - }, - { - "from": [7, 19, 7], - "to": [8, 21, 8], - "faces": { - "north": {"uv": [3.25, 15, 3.5, 15.5], "texture": "#0"}, - "east": {"uv": [15, 3.25, 15.25, 3.75], "texture": "#0"}, - "south": {"uv": [3.5, 15, 3.75, 15.5], "texture": "#0"}, - "west": {"uv": [15, 3.75, 15.25, 4.25], "texture": "#0"}, - "up": {"uv": [15.5, 4, 15.25, 3.75], "texture": "#0"}, - "down": {"uv": [15.5, 4, 15.25, 4.25], "texture": "#0"} - } - }, - { - "from": [8, 19, 8], - "to": [9, 21, 9], - "faces": { - "north": {"uv": [15, 4.25, 15.25, 4.75], "texture": "#0"}, - "east": {"uv": [4.75, 15, 5, 15.5], "texture": "#0"}, - "south": {"uv": [15, 4.75, 15.25, 5.25], "texture": "#0"}, - "west": {"uv": [15, 8.75, 15.25, 9.25], "texture": "#0"}, - "up": {"uv": [15.5, 4.5, 15.25, 4.25], "texture": "#0"}, - "down": {"uv": [15.5, 4.5, 15.25, 4.75], "texture": "#0"} - } - }, - { - "from": [9, 17, 9], - "to": [10, 24, 10], - "faces": { - "north": {"uv": [13.75, 4, 14, 5.75], "texture": "#0"}, - "east": {"uv": [13.75, 5.75, 14, 7.5], "texture": "#0"}, - "south": {"uv": [13.75, 9, 14, 10.75], "texture": "#0"}, - "west": {"uv": [13.75, 10.75, 14, 12.5], "texture": "#0"}, - "up": {"uv": [15.5, 5, 15.25, 4.75], "texture": "#0"}, - "down": {"uv": [5.25, 15.25, 5, 15.5], "texture": "#0"} - } - }, - { - "from": [6, 17, 9], - "to": [7, 24, 10], - "faces": { - "north": {"uv": [13.75, 12.5, 14, 14.25], "texture": "#0"}, - "east": {"uv": [14, 0, 14.25, 1.75], "texture": "#0"}, - "south": {"uv": [14, 1.75, 14.25, 3.5], "texture": "#0"}, - "west": {"uv": [14, 3.5, 14.25, 5.25], "texture": "#0"}, - "up": {"uv": [15.5, 5.25, 15.25, 5], "texture": "#0"}, - "down": {"uv": [5.5, 15.25, 5.25, 15.5], "texture": "#0"} - } - }, - { - "from": [9, 17, 6], - "to": [10, 24, 7], - "faces": { - "north": {"uv": [3.75, 14, 4, 15.75], "texture": "#0"}, - "east": {"uv": [14, 5.25, 14.25, 7], "texture": "#0"}, - "south": {"uv": [6, 14, 6.25, 15.75], "texture": "#0"}, - "west": {"uv": [6.25, 14, 6.5, 15.75], "texture": "#0"}, - "up": {"uv": [15.5, 5.5, 15.25, 5.25], "texture": "#0"}, - "down": {"uv": [5.75, 15.25, 5.5, 15.5], "texture": "#0"} - } - }, - { - "from": [6, 17, 6], - "to": [7, 24, 7], - "faces": { - "north": {"uv": [6.5, 14, 6.75, 15.75], "texture": "#0"}, - "east": {"uv": [6.75, 14, 7, 15.75], "texture": "#0"}, - "south": {"uv": [7, 14, 7.25, 15.75], "texture": "#0"}, - "west": {"uv": [7.25, 14, 7.5, 15.75], "texture": "#0"}, - "up": {"uv": [15.5, 5.75, 15.25, 5.5], "texture": "#0"}, - "down": {"uv": [6, 15.25, 5.75, 15.5], "texture": "#0"} - } - }, - { - "from": [7, 19, 8], - "to": [8, 21, 9], - "faces": { - "north": {"uv": [9.25, 15, 9.5, 15.5], "texture": "#0"}, - "east": {"uv": [15, 9.25, 15.25, 9.75], "texture": "#0"}, - "south": {"uv": [9.5, 15, 9.75, 15.5], "texture": "#0"}, - "west": {"uv": [9.75, 15, 10, 15.5], "texture": "#0"}, - "up": {"uv": [15.5, 6, 15.25, 5.75], "texture": "#0"}, - "down": {"uv": [15.5, 6, 15.25, 6.25], "texture": "#0"} - } - }, - { - "from": [8, 19, 7], - "to": [9, 21, 8], - "faces": { - "north": {"uv": [15, 9.75, 15.25, 10.25], "texture": "#0"}, - "east": {"uv": [10, 15, 10.25, 15.5], "texture": "#0"}, - "south": {"uv": [10.25, 15, 10.5, 15.5], "texture": "#0"}, - "west": {"uv": [15, 10.25, 15.25, 10.75], "texture": "#0"}, - "up": {"uv": [15.5, 6.5, 15.25, 6.25], "texture": "#0"}, - "down": {"uv": [15.5, 6.5, 15.25, 6.75], "texture": "#0"} - } - } - ], - "display": {}, - "groups": [ - { - "name": "base", - "origin": [0, 0, 0], - "color": 0, - "children": [0] - }, - { - "name": "arms", - "origin": [0, 0, 0], - "color": 0, - "children": [ - { - "name": "arm_1", - "origin": [8, 8, 8], - "color": 0, - "children": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14] - }, - { - "name": "arm_2", - "origin": [8, 8, 8], - "color": 0, - "children": [15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28] - }, - { - "name": "arm_3", - "origin": [8, 8, 8], - "color": 0, - "children": [29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42] - }, - { - "name": "arm_4", - "origin": [8, 8, 8], - "color": 0, - "children": [43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56] - }, - { - "name": "center_piece", - "origin": [0, 0, 0], - "color": 0, - "children": [57, 58, 59, 60, 61, 62, 63, 64, 65] - } - ] - } - ] + "credit": "Made with Blockbench", + "texture_size": [ + 64, + 64 + ], + "textures": { + "0": "voluminousenergy:block/dimensional_laser", + "particle": "voluminousenergy:block/dimensional_laser" + }, + "elements": [ + { + "name": "base", + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 1, + 16 + ], + "faces": { + "north": { + "uv": [ + 10.5, + 8, + 14.5, + 8.25 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 10.5, + 8.25, + 14.5, + 8.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 10.5, + 8.5, + 14.5, + 8.75 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 10.5, + 8.75, + 14.5, + 9 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 4, + 4, + 0, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 4, + 4, + 0, + 8 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 0, + 1, + 0 + ], + "to": [ + 2, + 4, + 1 + ], + "faces": { + "north": { + "uv": [ + 14, + 7, + 14.5, + 7.75 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 10.75, + 7, + 11, + 7.75 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 14, + 9, + 14.5, + 9.75 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 13, + 7, + 13.25, + 7.75 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 13.25, + 8, + 12.75, + 7.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 14.25, + 7.75, + 13.75, + 8 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 0, + 1, + 1 + ], + "to": [ + 1, + 4, + 2 + ], + "faces": { + "north": { + "uv": [ + 14.5, + 1.5, + 14.75, + 2.25 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 1.75, + 14.5, + 2, + 15.25 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 2, + 14.5, + 2.25, + 15.25 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 2.25, + 14.5, + 2.5, + 15.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 14, + 7.75, + 13.75, + 7.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 14.5, + 6.75, + 14.25, + 7 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 1, + 1, + 1 + ], + "to": [ + 3, + 7, + 2 + ], + "faces": { + "north": { + "uv": [ + 3.25, + 11, + 3.75, + 12.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 9, + 14, + 9.25, + 15.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 11, + 3.5, + 11.5, + 5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 14, + 9.75, + 14.25, + 11.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 12.25, + 14.5, + 12 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 12.25, + 14.5, + 12.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 1, + 1, + 2 + ], + "to": [ + 2, + 7, + 3 + ], + "faces": { + "north": { + "uv": [ + 7.5, + 14, + 7.75, + 15.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 7.75, + 14, + 8, + 15.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8, + 14, + 8.25, + 15.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 8.25, + 14, + 8.5, + 15.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 11, + 8, + 10.75, + 7.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 13, + 7.5, + 12.75, + 7.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 2, + 1, + 2 + ], + "to": [ + 4, + 9, + 3 + ], + "faces": { + "north": { + "uv": [ + 8.5, + 7.5, + 9, + 9.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 10, + 0, + 10.25, + 2 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 9, + 0, + 9.5, + 2 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4.75, + 13, + 5, + 15 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 12.75, + 14.5, + 12.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 12.75, + 14.5, + 13 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 3, + 1, + 3 + ], + "to": [ + 5, + 11, + 4 + ], + "faces": { + "north": { + "uv": [ + 5, + 8, + 5.5, + 10.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 12, + 12, + 12.25, + 14.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 5.5, + 8, + 6, + 10.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 12.25, + 0, + 12.5, + 2.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 13.25, + 14.5, + 13 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 13.25, + 14.5, + 13.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 4, + 1, + 4 + ], + "to": [ + 6, + 13, + 5 + ], + "faces": { + "north": { + "uv": [ + 0.5, + 8, + 1, + 11 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 3.75, + 11, + 4, + 14 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 1, + 8, + 1.5, + 11 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 11, + 5, + 11.25, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 13.75, + 14.5, + 13.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 13.75, + 14.5, + 14 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 5, + 1, + 5 + ], + "to": [ + 7, + 15, + 6 + ], + "faces": { + "north": { + "uv": [ + 7, + 0, + 7.5, + 3.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6, + 10.5, + 6.25, + 14 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 7, + 3.5, + 7.5, + 7 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6.25, + 10.5, + 6.5, + 14 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 14.25, + 14.5, + 14 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 14.25, + 14.5, + 14.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 1, + 6 + ], + "to": [ + 8, + 17, + 7 + ], + "faces": { + "north": { + "uv": [ + 5, + 0, + 5.5, + 4 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 9, + 2, + 9.25, + 6 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 5, + 4, + 5.5, + 8 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4, + 9, + 4.25, + 13 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 14.75, + 14.5, + 14.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 0, + 14.75, + 0.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 2, + 1, + 3 + ], + "to": [ + 3, + 9, + 4 + ], + "faces": { + "north": { + "uv": [ + 13, + 5, + 13.25, + 7 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 13, + 9, + 13.25, + 11 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 13, + 11, + 13.25, + 13 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 13, + 13, + 13.25, + 15 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 14.5, + 8, + 14.25, + 7.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 11.75, + 14.75, + 12 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 3, + 1, + 4 + ], + "to": [ + 4, + 11, + 5 + ], + "faces": { + "north": { + "uv": [ + 12.25, + 4.5, + 12.5, + 7 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 12.25, + 9, + 12.5, + 11.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 12.25, + 11.5, + 12.5, + 14 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 12.5, + 0, + 12.75, + 2.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 10.75, + 15.25, + 10.5, + 15 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 11, + 15, + 10.75, + 15.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 4, + 1, + 5 + ], + "to": [ + 5, + 13, + 6 + ], + "faces": { + "north": { + "uv": [ + 8, + 11, + 8.25, + 14 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 8.25, + 11, + 8.5, + 14 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 11, + 9, + 11.25, + 12 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 11.25, + 0, + 11.5, + 3 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 11, + 15, + 10.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 11.25, + 15, + 11, + 15.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 5, + 1, + 6 + ], + "to": [ + 6, + 15, + 7 + ], + "faces": { + "north": { + "uv": [ + 6.5, + 10.5, + 6.75, + 14 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6.75, + 10.5, + 7, + 14 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 7, + 10.5, + 7.25, + 14 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 7.25, + 10.5, + 7.5, + 14 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 11.25, + 15, + 11 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 11.5, + 15, + 11.25, + 15.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 1, + 7 + ], + "to": [ + 7, + 17, + 8 + ], + "faces": { + "north": { + "uv": [ + 4.25, + 9, + 4.5, + 13 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 4.5, + 9, + 4.75, + 13 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 4.75, + 9, + 5, + 13 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 9, + 6, + 9.25, + 10 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 11.5, + 15, + 11.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 11.75, + 15, + 11.5, + 15.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 15, + 1, + 0 + ], + "to": [ + 16, + 4, + 2 + ], + "faces": { + "north": { + "uv": [ + 14.5, + 2.25, + 14.75, + 3 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 14, + 11.25, + 14.5, + 12 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 2.5, + 14.5, + 2.75, + 15.25 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 14, + 12, + 14.5, + 12.75 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 11.5, + 3.5, + 11.25, + 3 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 11.75, + 4.5, + 11.5, + 5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 14, + 1, + 0 + ], + "to": [ + 15, + 4, + 1 + ], + "faces": { + "north": { + "uv": [ + 2.75, + 14.5, + 3, + 15.25 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 3, + 14.5, + 3.25, + 15.25 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 14.5, + 4.5, + 14.75, + 5.25 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 5, + 14.5, + 5.25, + 15.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 11.75, + 15, + 11.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 12, + 15, + 11.75, + 15.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 14, + 1, + 1 + ], + "to": [ + 15, + 7, + 3 + ], + "faces": { + "north": { + "uv": [ + 12.25, + 14, + 12.5, + 15.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 11.25, + 5, + 11.75, + 6.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 12.5, + 14, + 12.75, + 15.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 11.25, + 6.5, + 11.75, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 12.5, + 3, + 12.25, + 2.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 12.5, + 7, + 12.25, + 7.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 13, + 1, + 1 + ], + "to": [ + 14, + 7, + 2 + ], + "faces": { + "north": { + "uv": [ + 12.75, + 14, + 13, + 15.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 14, + 12.75, + 14.25, + 14.25 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 14.25, + 0, + 14.5, + 1.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 14.25, + 1.5, + 14.5, + 3 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 12, + 15, + 11.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 12, + 15, + 12.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 13, + 1, + 2 + ], + "to": [ + 14, + 9, + 4 + ], + "faces": { + "north": { + "uv": [ + 13.25, + 0, + 13.5, + 2 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 8, + 9, + 8.5, + 11 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 13.25, + 2, + 13.5, + 4 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 9.25, + 2, + 9.75, + 4 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 0.75, + 14.75, + 0.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 0.75, + 14.75, + 1.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 12, + 1, + 3 + ], + "to": [ + 13, + 11, + 5 + ], + "faces": { + "north": { + "uv": [ + 12.5, + 2.5, + 12.75, + 5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6, + 8, + 6.5, + 10.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 3.25, + 12.5, + 3.5, + 15 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6.5, + 8, + 7, + 10.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 1.75, + 14.75, + 1.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 1.75, + 14.75, + 2.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 11, + 1, + 4 + ], + "to": [ + 12, + 13, + 6 + ], + "faces": { + "north": { + "uv": [ + 11.25, + 9, + 11.5, + 12 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 1.5, + 8, + 2, + 11 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0, + 11.5, + 0.25, + 14.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 2, + 8, + 2.5, + 11 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 2.75, + 14.75, + 2.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 2.75, + 14.75, + 3.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 10, + 1, + 5 + ], + "to": [ + 11, + 15, + 7 + ], + "faces": { + "north": { + "uv": [ + 7.5, + 10.5, + 7.75, + 14 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 7, + 7, + 7.5, + 10.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 7.75, + 10.5, + 8, + 14 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 7.5, + 0, + 8, + 3.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 3.75, + 14.75, + 3.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 3.75, + 14.75, + 4.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 9, + 1, + 6 + ], + "to": [ + 10, + 17, + 8 + ], + "faces": { + "north": { + "uv": [ + 9.25, + 4, + 9.5, + 8 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 5.5, + 0, + 6, + 4 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 9.25, + 8, + 9.5, + 12 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 5.5, + 4, + 6, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 4.75, + 14.75, + 4.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 4.75, + 14.75, + 5.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 12, + 1, + 2 + ], + "to": [ + 13, + 9, + 3 + ], + "faces": { + "north": { + "uv": [ + 13.25, + 4, + 13.5, + 6 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 13.25, + 6, + 13.5, + 8 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 13.25, + 9, + 13.5, + 11 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 13.25, + 11, + 13.5, + 13 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 12.5, + 15, + 12.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 12.5, + 15, + 12.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 11, + 1, + 3 + ], + "to": [ + 12, + 11, + 4 + ], + "faces": { + "north": { + "uv": [ + 3.5, + 12.5, + 3.75, + 15 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 12.5, + 5, + 12.75, + 7.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 12.5, + 9, + 12.75, + 11.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 10.5, + 12.5, + 10.75, + 15 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 13, + 15, + 12.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 13.25, + 15, + 13, + 15.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 10, + 1, + 4 + ], + "to": [ + 11, + 13, + 5 + ], + "faces": { + "north": { + "uv": [ + 11.5, + 0, + 11.75, + 3 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0.25, + 11.5, + 0.5, + 14.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 11.5, + 9, + 11.75, + 12 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 11.75, + 0, + 12, + 3 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 13.25, + 15, + 13 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 13.5, + 15, + 13.25, + 15.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 9, + 1, + 5 + ], + "to": [ + 10, + 15, + 6 + ], + "faces": { + "north": { + "uv": [ + 10.5, + 9, + 10.75, + 12.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 10.75, + 0, + 11, + 3.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 10.75, + 3.5, + 11, + 7 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 10.75, + 9, + 11, + 12.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 13.5, + 15, + 13.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 13.75, + 15, + 13.5, + 15.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 8, + 1, + 6 + ], + "to": [ + 9, + 17, + 7 + ], + "faces": { + "north": { + "uv": [ + 9.5, + 4, + 9.75, + 8 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 9.5, + 8, + 9.75, + 12 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8.5, + 9.5, + 8.75, + 13.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 8.75, + 9.5, + 9, + 13.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 13.75, + 15, + 13.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 13.75, + 15, + 14 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 14, + 1, + 15 + ], + "to": [ + 16, + 4, + 16 + ], + "faces": { + "north": { + "uv": [ + 14.25, + 3, + 14.75, + 3.75 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 5.25, + 14.5, + 5.5, + 15.25 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 14.25, + 3.75, + 14.75, + 4.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 14.5, + 5.25, + 14.75, + 6 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 5.5, + 14.75, + 5.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 5.5, + 14.75, + 5.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 15, + 1, + 14 + ], + "to": [ + 16, + 4, + 15 + ], + "faces": { + "north": { + "uv": [ + 5.5, + 14.5, + 5.75, + 15.25 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 5.75, + 14.5, + 6, + 15.25 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 14.5, + 6.75, + 14.75, + 7.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 14.5, + 7.5, + 14.75, + 8.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 14.25, + 15, + 14 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 14.25, + 15, + 14.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 13, + 1, + 14 + ], + "to": [ + 15, + 7, + 15 + ], + "faces": { + "north": { + "uv": [ + 11.5, + 3, + 12, + 4.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 14.25, + 4.5, + 14.5, + 6 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 11.75, + 4.5, + 12.25, + 6 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 14.25, + 9.75, + 14.5, + 11.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 6, + 14.75, + 5.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 6, + 14.75, + 6.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 14, + 1, + 13 + ], + "to": [ + 15, + 7, + 14 + ], + "faces": { + "north": { + "uv": [ + 14.25, + 12.75, + 14.5, + 14.25 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 13.75, + 14.25, + 14, + 15.75 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 14, + 14.25, + 14.25, + 15.75 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 14.25, + 14.25, + 14.5, + 15.75 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 14.75, + 15, + 14.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 14.75, + 15, + 15 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 12, + 1, + 13 + ], + "to": [ + 14, + 9, + 14 + ], + "faces": { + "north": { + "uv": [ + 9.5, + 0, + 10, + 2 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 13.25, + 13, + 13.5, + 15 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 9.75, + 2, + 10.25, + 4 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 13.5, + 0, + 13.75, + 2 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 6.5, + 14.75, + 6.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 6.5, + 14.75, + 6.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 11, + 1, + 12 + ], + "to": [ + 13, + 11, + 13 + ], + "faces": { + "north": { + "uv": [ + 8, + 6.5, + 8.5, + 9 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 10.75, + 12.5, + 11, + 15 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8.5, + 0, + 9, + 2.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 12.5, + 11.5, + 12.75, + 14 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 7, + 14.75, + 6.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 7, + 14.75, + 7.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 10, + 1, + 11 + ], + "to": [ + 12, + 13, + 12 + ], + "faces": { + "north": { + "uv": [ + 2.5, + 8, + 3, + 11 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 11.75, + 9, + 12, + 12 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 3, + 8, + 3.5, + 11 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 12, + 0, + 12.25, + 3 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 7.5, + 14.75, + 7.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 7.5, + 14.75, + 7.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 9, + 1, + 10 + ], + "to": [ + 11, + 15, + 11 + ], + "faces": { + "north": { + "uv": [ + 7.5, + 3.5, + 8, + 7 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 11, + 0, + 11.25, + 3.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 7.5, + 7, + 8, + 10.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0.5, + 11, + 0.75, + 14.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 8, + 14.75, + 7.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 8, + 14.75, + 8.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 8, + 1, + 9 + ], + "to": [ + 10, + 17, + 10 + ], + "faces": { + "north": { + "uv": [ + 6, + 0, + 6.5, + 4 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 9.75, + 4, + 10, + 8 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 6, + 4, + 6.5, + 8 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 9.75, + 8, + 10, + 12 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 8.5, + 14.75, + 8.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 8.5, + 14.75, + 8.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 13, + 1, + 12 + ], + "to": [ + 14, + 9, + 13 + ], + "faces": { + "north": { + "uv": [ + 13.5, + 2, + 13.75, + 4 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 13.5, + 4, + 13.75, + 6 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 13.5, + 6, + 13.75, + 8 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 8.5, + 13.5, + 8.75, + 15.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 15.25, + 15, + 15 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0.25, + 15.25, + 0, + 15.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 12, + 1, + 11 + ], + "to": [ + 13, + 11, + 12 + ], + "faces": { + "north": { + "uv": [ + 12.75, + 0, + 13, + 2.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 12.75, + 2.5, + 13, + 5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 12.75, + 5, + 13, + 7.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 12.75, + 9, + 13, + 11.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 0.25, + 15.25, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 0.5, + 15.25, + 0.25, + 15.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 11, + 1, + 10 + ], + "to": [ + 12, + 13, + 11 + ], + "faces": { + "north": { + "uv": [ + 12, + 9, + 12.25, + 12 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 9.25, + 12, + 9.5, + 15 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 9.5, + 12, + 9.75, + 15 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 9.75, + 12, + 10, + 15 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 0.5, + 15.25, + 0.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 0.5, + 15.25, + 0.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 10, + 1, + 9 + ], + "to": [ + 11, + 15, + 10 + ], + "faces": { + "north": { + "uv": [ + 0.75, + 11, + 1, + 14.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 1, + 11, + 1.25, + 14.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 1.25, + 11, + 1.5, + 14.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 1.5, + 11, + 1.75, + 14.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 1, + 15.25, + 0.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 1, + 15.25, + 1.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 9, + 1, + 8 + ], + "to": [ + 10, + 17, + 9 + ], + "faces": { + "north": { + "uv": [ + 10, + 4, + 10.25, + 8 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 10, + 8, + 10.25, + 12 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 9, + 10, + 9.25, + 14 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 10.25, + 0, + 10.5, + 4 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 1.5, + 15.25, + 1.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 1.5, + 15.25, + 1.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 0, + 1, + 14 + ], + "to": [ + 1, + 4, + 16 + ], + "faces": { + "north": { + "uv": [ + 14.5, + 8.25, + 14.75, + 9 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 14.25, + 6, + 14.75, + 6.75 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 14.5, + 9, + 14.75, + 9.75 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 14.5, + 0.5, + 15.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 9.25, + 14.75, + 8.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 9.25, + 14.75, + 9.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 1, + 1, + 15 + ], + "to": [ + 2, + 4, + 16 + ], + "faces": { + "north": { + "uv": [ + 14.5, + 9.75, + 14.75, + 10.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 14.5, + 10.5, + 14.75, + 11.25 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 14.5, + 11.25, + 14.75, + 12 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 12, + 14.5, + 12.25, + 15.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 2, + 15.5, + 1.75, + 15.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 1.75, + 15.25, + 2 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 1, + 1, + 13 + ], + "to": [ + 2, + 7, + 15 + ], + "faces": { + "north": { + "uv": [ + 14.5, + 0, + 14.75, + 1.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 11.75, + 6, + 12.25, + 7.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 0.5, + 14.5, + 0.75, + 16 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 12, + 3, + 12.5, + 4.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 10.25, + 14.75, + 9.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 10.25, + 14.75, + 10.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 2, + 1, + 14 + ], + "to": [ + 3, + 7, + 15 + ], + "faces": { + "north": { + "uv": [ + 0.75, + 14.5, + 1, + 16 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 1, + 14.5, + 1.25, + 16 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 1.25, + 14.5, + 1.5, + 16 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 1.5, + 14.5, + 1.75, + 16 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 2.25, + 15.5, + 2, + 15.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 2, + 15.25, + 2.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 2, + 1, + 12 + ], + "to": [ + 3, + 9, + 14 + ], + "faces": { + "north": { + "uv": [ + 8.75, + 13.5, + 9, + 15.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 10.25, + 4, + 10.75, + 6 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 13.5, + 9, + 13.75, + 11 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 10.25, + 6, + 10.75, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15, + 11.25, + 14.75, + 10.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 11.25, + 14.75, + 11.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 3, + 1, + 11 + ], + "to": [ + 4, + 11, + 13 + ], + "faces": { + "north": { + "uv": [ + 12.75, + 11.5, + 13, + 14 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 8.5, + 2.5, + 9, + 5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 13, + 0, + 13.25, + 2.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 8.5, + 5, + 9, + 7.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 14.75, + 15.25, + 14.5, + 14.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15, + 14.75, + 14.75, + 15.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 4, + 1, + 10 + ], + "to": [ + 5, + 13, + 12 + ], + "faces": { + "north": { + "uv": [ + 10, + 12, + 10.25, + 15 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 3.5, + 8, + 4, + 11 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 10.25, + 12, + 10.5, + 15 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 8, + 3.5, + 8.5, + 6.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 0.75, + 15, + 0.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 0.75, + 15, + 1.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 5, + 1, + 9 + ], + "to": [ + 6, + 15, + 11 + ], + "faces": { + "north": { + "uv": [ + 1.75, + 11, + 2, + 14.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 8, + 0.5, + 11.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 2, + 11, + 2.25, + 14.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 8, + 0, + 8.5, + 3.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 1.75, + 15, + 1.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 1.75, + 15, + 2.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 1, + 8 + ], + "to": [ + 7, + 17, + 10 + ], + "faces": { + "north": { + "uv": [ + 10.25, + 8, + 10.5, + 12 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6.5, + 0, + 7, + 4 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 10.5, + 0, + 10.75, + 4 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6.5, + 4, + 7, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.25, + 2.75, + 15, + 2.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.25, + 2.75, + 15, + 3.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 3, + 1, + 13 + ], + "to": [ + 4, + 9, + 14 + ], + "faces": { + "north": { + "uv": [ + 13.5, + 11, + 13.75, + 13 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 13.5, + 13, + 13.75, + 15 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 13.75, + 0, + 14, + 2 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 13.75, + 2, + 14, + 4 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 2.5, + 15.5, + 2.25, + 15.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 2.25, + 15.25, + 2.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 4, + 1, + 12 + ], + "to": [ + 5, + 11, + 13 + ], + "faces": { + "north": { + "uv": [ + 13, + 2.5, + 13.25, + 5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 4, + 13, + 4.25, + 15.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 4.25, + 13, + 4.5, + 15.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4.5, + 13, + 4.75, + 15.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 2.75, + 15.5, + 2.5, + 15.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 2.5, + 15.25, + 2.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 5, + 1, + 11 + ], + "to": [ + 6, + 13, + 12 + ], + "faces": { + "north": { + "uv": [ + 11, + 12, + 11.25, + 15 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 11.25, + 12, + 11.5, + 15 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 11.5, + 12, + 11.75, + 15 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 11.75, + 12, + 12, + 15 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 3, + 15.5, + 2.75, + 15.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 2.75, + 15.25, + 3 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 1, + 10 + ], + "to": [ + 7, + 15, + 11 + ], + "faces": { + "north": { + "uv": [ + 2.25, + 11, + 2.5, + 14.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 2.5, + 11, + 2.75, + 14.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 2.75, + 11, + 3, + 14.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 3, + 11, + 3.25, + 14.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 3.25, + 15.5, + 3, + 15.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 3, + 15.25, + 3.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 7, + 1, + 9 + ], + "to": [ + 8, + 17, + 10 + ], + "faces": { + "north": { + "uv": [ + 5, + 10.5, + 5.25, + 14.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 5.25, + 10.5, + 5.5, + 14.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 5.5, + 10.5, + 5.75, + 14.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 5.75, + 10.5, + 6, + 14.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 3.5, + 15.25, + 3.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 3.5, + 15.25, + 3.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 7, + 1, + 7 + ], + "to": [ + 9, + 19, + 9 + ], + "faces": { + "north": { + "uv": [ + 4, + 0, + 4.5, + 4.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 4.5, + 0, + 5, + 4.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 4, + 4.5, + 4.5, + 9 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4.5, + 4.5, + 5, + 9 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 12.25, + 8, + 11.75, + 7.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 12.75, + 7.5, + 12.25, + 8 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 7, + 19, + 7 + ], + "to": [ + 8, + 21, + 8 + ], + "faces": { + "north": { + "uv": [ + 3.25, + 15, + 3.5, + 15.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 15, + 3.25, + 15.25, + 3.75 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 3.5, + 15, + 3.75, + 15.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 15, + 3.75, + 15.25, + 4.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 4, + 15.25, + 3.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 4, + 15.25, + 4.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 8, + 19, + 8 + ], + "to": [ + 9, + 21, + 9 + ], + "faces": { + "north": { + "uv": [ + 15, + 4.25, + 15.25, + 4.75 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 4.75, + 15, + 5, + 15.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 15, + 4.75, + 15.25, + 5.25 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 15, + 8.75, + 15.25, + 9.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 4.5, + 15.25, + 4.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 4.5, + 15.25, + 4.75 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 9, + 17, + 9 + ], + "to": [ + 10, + 24, + 10 + ], + "faces": { + "north": { + "uv": [ + 13.75, + 4, + 14, + 5.75 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 13.75, + 5.75, + 14, + 7.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 13.75, + 9, + 14, + 10.75 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 13.75, + 10.75, + 14, + 12.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 5, + 15.25, + 4.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 5.25, + 15.25, + 5, + 15.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 17, + 9 + ], + "to": [ + 7, + 24, + 10 + ], + "faces": { + "north": { + "uv": [ + 13.75, + 12.5, + 14, + 14.25 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 14, + 0, + 14.25, + 1.75 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 14, + 1.75, + 14.25, + 3.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 14, + 3.5, + 14.25, + 5.25 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 5.25, + 15.25, + 5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 5.5, + 15.25, + 5.25, + 15.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 9, + 17, + 6 + ], + "to": [ + 10, + 24, + 7 + ], + "faces": { + "north": { + "uv": [ + 3.75, + 14, + 4, + 15.75 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 14, + 5.25, + 14.25, + 7 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 6, + 14, + 6.25, + 15.75 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6.25, + 14, + 6.5, + 15.75 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 5.5, + 15.25, + 5.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 5.75, + 15.25, + 5.5, + 15.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 17, + 6 + ], + "to": [ + 7, + 24, + 7 + ], + "faces": { + "north": { + "uv": [ + 6.5, + 14, + 6.75, + 15.75 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6.75, + 14, + 7, + 15.75 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 7, + 14, + 7.25, + 15.75 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 7.25, + 14, + 7.5, + 15.75 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 5.75, + 15.25, + 5.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 6, + 15.25, + 5.75, + 15.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 7, + 19, + 8 + ], + "to": [ + 8, + 21, + 9 + ], + "faces": { + "north": { + "uv": [ + 9.25, + 15, + 9.5, + 15.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 15, + 9.25, + 15.25, + 9.75 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 9.5, + 15, + 9.75, + 15.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 9.75, + 15, + 10, + 15.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 6, + 15.25, + 5.75 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 6, + 15.25, + 6.25 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 8, + 19, + 7 + ], + "to": [ + 9, + 21, + 8 + ], + "faces": { + "north": { + "uv": [ + 15, + 9.75, + 15.25, + 10.25 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 10, + 15, + 10.25, + 15.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 10.25, + 15, + 10.5, + 15.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 15, + 10.25, + 15.25, + 10.75 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 15.5, + 6.5, + 15.25, + 6.25 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 15.5, + 6.5, + 15.25, + 6.75 + ], + "texture": "#0" + } + } + } + ], + "display": {}, + "groups": [ + { + "name": "base", + "origin": [ + 0, + 0, + 0 + ], + "color": 0, + "children": [ + 0 + ] + }, + { + "name": "arms", + "origin": [ + 0, + 0, + 0 + ], + "color": 0, + "children": [ + { + "name": "arm_1", + "origin": [ + 8, + 8, + 8 + ], + "color": 0, + "children": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14 + ] + }, + { + "name": "arm_2", + "origin": [ + 8, + 8, + 8 + ], + "color": 0, + "children": [ + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28 + ] + }, + { + "name": "arm_3", + "origin": [ + 8, + 8, + 8 + ], + "color": 0, + "children": [ + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42 + ] + }, + { + "name": "arm_4", + "origin": [ + 8, + 8, + 8 + ], + "color": 0, + "children": [ + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56 + ] + }, + { + "name": "center_piece", + "origin": [ + 0, + 0, + 0 + ], + "color": 0, + "children": [ + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65 + ] + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/models/block/pressure_ladder.json b/src/main/resources/assets/voluminousenergy/models/block/pressure_ladder.json index 0adf4c24a..a3b609f1d 100644 --- a/src/main/resources/assets/voluminousenergy/models/block/pressure_ladder.json +++ b/src/main/resources/assets/voluminousenergy/models/block/pressure_ladder.json @@ -5,12 +5,37 @@ "texture": "voluminousenergy:block/pressure_ladder" }, "elements": [ - { "from": [ 0, 0, 15.2 ], - "to": [ 16, 16, 15.2 ], + { + "from": [ + 0, + 0, + 15.2 + ], + "to": [ + 16, + 16, + 15.2 + ], "shade": false, "faces": { - "north": { "uv": [ 0, 0, 16, 16 ], "texture": "#texture" }, - "south": { "uv": [ 16, 0, 0, 16 ], "texture": "#texture" } + "north": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#texture" + }, + "south": { + "uv": [ + 16, + 0, + 0, + 16 + ], + "texture": "#texture" + } } } ] diff --git a/src/main/resources/assets/voluminousenergy/models/block/primitiveblastfurnace.json b/src/main/resources/assets/voluminousenergy/models/block/primitiveblastfurnace.json index 5f6776d79..6269b61b2 100644 --- a/src/main/resources/assets/voluminousenergy/models/block/primitiveblastfurnace.json +++ b/src/main/resources/assets/voluminousenergy/models/block/primitiveblastfurnace.json @@ -1,12 +1,12 @@ { - "parent": "block/cube", - "textures": { - "particle": "minecraft:block/iron_block", - "down": "voluminousenergy:block/primitiveblastfurnace_top", - "up": "voluminousenergy:block/primitiveblastfurnace_top", - "east": "voluminousenergy:block/primitiveblastfurnace_side", - "west": "voluminousenergy:block/primitiveblastfurnace_side", - "north": "voluminousenergy:block/primitiveblastfurnace_front", - "south": "voluminousenergy:block/primitiveblastfurnace_side" - } + "parent": "block/cube", + "textures": { + "particle": "minecraft:block/iron_block", + "down": "voluminousenergy:block/primitiveblastfurnace_top", + "up": "voluminousenergy:block/primitiveblastfurnace_top", + "east": "voluminousenergy:block/primitiveblastfurnace_side", + "west": "voluminousenergy:block/primitiveblastfurnace_side", + "north": "voluminousenergy:block/primitiveblastfurnace_front", + "south": "voluminousenergy:block/primitiveblastfurnace_side" + } } diff --git a/src/main/resources/assets/voluminousenergy/models/block/sawmill.json b/src/main/resources/assets/voluminousenergy/models/block/sawmill.json index a481d1609..858cb314d 100644 --- a/src/main/resources/assets/voluminousenergy/models/block/sawmill.json +++ b/src/main/resources/assets/voluminousenergy/models/block/sawmill.json @@ -1,4 +1,5 @@ -{ "parent": "block/block", +{ + "parent": "block/block", "textures": { "particle": "voluminousenergy:block/sawmill_bottom", "bottom": "voluminousenergy:block/sawmill_bottom", @@ -7,22 +8,111 @@ "saw": "voluminousenergy:block/sawmill_saw" }, "elements": [ - { "from": [ 0, 0, 0 ], - "to": [ 16, 9, 16 ], + { + "from": [ + 0, + 0, + 0 + ], + "to": [ + 16, + 9, + 16 + ], "faces": { - "down": { "uv": [ 0, 0, 16, 16 ], "texture": "#bottom", "cullface": "down" }, - "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" }, - "north": { "uv": [ 0, 7, 16, 16 ], "texture": "#side", "cullface": "north" }, - "south": { "uv": [ 0, 7, 16, 16 ], "texture": "#side", "cullface": "south" }, - "west": { "uv": [ 0, 7, 16, 16 ], "texture": "#side", "cullface": "west" }, - "east": { "uv": [ 0, 7, 16, 16 ], "texture": "#side", "cullface": "east" } + "down": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#bottom", + "cullface": "down" + }, + "up": { + "uv": [ + 0, + 0, + 16, + 16 + ], + "texture": "#top" + }, + "north": { + "uv": [ + 0, + 7, + 16, + 16 + ], + "texture": "#side", + "cullface": "north" + }, + "south": { + "uv": [ + 0, + 7, + 16, + 16 + ], + "texture": "#side", + "cullface": "south" + }, + "west": { + "uv": [ + 0, + 7, + 16, + 16 + ], + "texture": "#side", + "cullface": "west" + }, + "east": { + "uv": [ + 0, + 7, + 16, + 16 + ], + "texture": "#side", + "cullface": "east" + } } }, - { "from": [ 1, 9, 8 ], - "to": [ 15, 16, 8 ], + { + "from": [ + 1, + 9, + 8 + ], + "to": [ + 15, + 16, + 8 + ], "faces": { - "north": { "uv": [ 1, 9, 15, 16 ], "texture": "#saw", "tintindex": 0 }, - "south": { "uv": [ 15, 9, 1, 16 ], "texture": "#saw", "tintindex": 0 } + "north": { + "uv": [ + 1, + 9, + 15, + 16 + ], + "texture": "#saw", + "tintindex": 0 + }, + "south": { + "uv": [ + 15, + 9, + 1, + 16 + ], + "texture": "#saw", + "tintindex": 0 + } } } ] diff --git a/src/main/resources/assets/voluminousenergy/models/item/creative_fluid_scanner.json b/src/main/resources/assets/voluminousenergy/models/item/creative_fluid_scanner.json index 79e651092..a6dcc712f 100644 --- a/src/main/resources/assets/voluminousenergy/models/item/creative_fluid_scanner.json +++ b/src/main/resources/assets/voluminousenergy/models/item/creative_fluid_scanner.json @@ -1,153 +1,828 @@ { "credit": "Made with Blockbench", - "texture_size": [32, 32], + "texture_size": [ + 32, + 32 + ], "textures": { "0": "voluminousenergy:item/creative_fluid_scanner", "particle": "voluminousenergy:item/creative_fluid_scanner" }, "elements": [ { - "from": [6, 8, 6], - "to": [10, 12, 7], + "from": [ + 6, + 8, + 6 + ], + "to": [ + 10, + 12, + 7 + ], "faces": { - "north": {"uv": [5.5, 4, 7.5, 6], "texture": "#0"}, - "east": {"uv": [5.5, 6, 6, 8], "texture": "#0"}, - "south": {"uv": [6, 0, 8, 2], "texture": "#0"}, - "west": {"uv": [6, 6, 6.5, 8], "texture": "#0"}, - "up": {"uv": [8, 4, 6, 3.5], "texture": "#0"}, - "down": {"uv": [8.5, 6, 6.5, 6.5], "texture": "#0"} + "north": { + "uv": [ + 5.5, + 4, + 7.5, + 6 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 5.5, + 6, + 6, + 8 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 6, + 0, + 8, + 2 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6, + 6, + 6.5, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8, + 4, + 6, + 3.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 8.5, + 6, + 6.5, + 6.5 + ], + "texture": "#0" + } } }, { - "from": [5, 8, 7], - "to": [11, 12, 12], + "from": [ + 5, + 8, + 7 + ], + "to": [ + 11, + 12, + 12 + ], "faces": { - "north": {"uv": [3, 0, 6, 2], "texture": "#0"}, - "east": {"uv": [3, 4, 5.5, 6], "texture": "#0"}, - "south": {"uv": [3, 2, 6, 4], "texture": "#0"}, - "west": {"uv": [0, 5, 2.5, 7], "texture": "#0"}, - "up": {"uv": [3, 2.5, 0, 0], "texture": "#0"}, - "down": {"uv": [3, 2.5, 0, 5], "texture": "#0"} + "north": { + "uv": [ + 3, + 0, + 6, + 2 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 3, + 4, + 5.5, + 6 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 3, + 2, + 6, + 4 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 5, + 2.5, + 7 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 3, + 2.5, + 0, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 3, + 2.5, + 0, + 5 + ], + "texture": "#0" + } } }, { - "from": [7, 5, 9], - "to": [9, 8, 10], + "from": [ + 7, + 5, + 9 + ], + "to": [ + 9, + 8, + 10 + ], "faces": { - "north": {"uv": [6, 2, 7, 3.5], "texture": "#0"}, - "east": {"uv": [6.5, 6.5, 7, 8], "texture": "#0"}, - "south": {"uv": [2.5, 6, 3.5, 7.5], "texture": "#0"}, - "west": {"uv": [0, 7, 0.5, 8.5], "texture": "#0"}, - "up": {"uv": [8, 3, 7, 2.5], "texture": "#0"}, - "down": {"uv": [8, 3, 7, 3.5], "texture": "#0"} + "north": { + "uv": [ + 6, + 2, + 7, + 3.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6.5, + 6.5, + 7, + 8 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 2.5, + 6, + 3.5, + 7.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 7, + 0.5, + 8.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8, + 3, + 7, + 2.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 8, + 3, + 7, + 3.5 + ], + "texture": "#0" + } } }, { - "from": [9, 11, 5], - "to": [10, 12, 6], + "from": [ + 9, + 11, + 5 + ], + "to": [ + 10, + 12, + 6 + ], "faces": { - "north": {"uv": [2, 7, 2.5, 7.5], "texture": "#0"}, - "east": {"uv": [3.5, 7, 4, 7.5], "texture": "#0"}, - "south": {"uv": [4, 7, 4.5, 7.5], "texture": "#0"}, - "west": {"uv": [4.5, 7, 5, 7.5], "texture": "#0"}, - "up": {"uv": [5.5, 7.5, 5, 7], "texture": "#0"}, - "down": {"uv": [7.5, 6.5, 7, 7], "texture": "#0"} + "north": { + "uv": [ + 2, + 7, + 2.5, + 7.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 3.5, + 7, + 4, + 7.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 4, + 7, + 4.5, + 7.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4.5, + 7, + 5, + 7.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 5.5, + 7.5, + 5, + 7 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 7.5, + 6.5, + 7, + 7 + ], + "texture": "#0" + } } }, { - "from": [6, 11, 5], - "to": [7, 12, 6], + "from": [ + 6, + 11, + 5 + ], + "to": [ + 7, + 12, + 6 + ], "faces": { - "north": {"uv": [7, 7, 7.5, 7.5], "texture": "#0"}, - "east": {"uv": [1, 7.5, 1.5, 8], "texture": "#0"}, - "south": {"uv": [1.5, 7.5, 2, 8], "texture": "#0"}, - "west": {"uv": [2, 7.5, 2.5, 8], "texture": "#0"}, - "up": {"uv": [3, 8, 2.5, 7.5], "texture": "#0"}, - "down": {"uv": [3.5, 7.5, 3, 8], "texture": "#0"} + "north": { + "uv": [ + 7, + 7, + 7.5, + 7.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 1, + 7.5, + 1.5, + 8 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 1.5, + 7.5, + 2, + 8 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 2, + 7.5, + 2.5, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 3, + 8, + 2.5, + 7.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 3.5, + 7.5, + 3, + 8 + ], + "texture": "#0" + } } }, { - "from": [6, 8, 5], - "to": [7, 9, 6], + "from": [ + 6, + 8, + 5 + ], + "to": [ + 7, + 9, + 6 + ], "faces": { - "north": {"uv": [3.5, 7.5, 4, 8], "texture": "#0"}, - "east": {"uv": [4, 7.5, 4.5, 8], "texture": "#0"}, - "south": {"uv": [7.5, 4, 8, 4.5], "texture": "#0"}, - "west": {"uv": [4.5, 7.5, 5, 8], "texture": "#0"}, - "up": {"uv": [8, 5, 7.5, 4.5], "texture": "#0"}, - "down": {"uv": [5.5, 7.5, 5, 8], "texture": "#0"} + "north": { + "uv": [ + 3.5, + 7.5, + 4, + 8 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 4, + 7.5, + 4.5, + 8 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 7.5, + 4, + 8, + 4.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4.5, + 7.5, + 5, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8, + 5, + 7.5, + 4.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 5.5, + 7.5, + 5, + 8 + ], + "texture": "#0" + } } }, { - "from": [9, 8, 5], - "to": [10, 9, 6], + "from": [ + 9, + 8, + 5 + ], + "to": [ + 10, + 9, + 6 + ], "faces": { - "north": {"uv": [7.5, 5, 8, 5.5], "texture": "#0"}, - "east": {"uv": [7.5, 5.5, 8, 6], "texture": "#0"}, - "south": {"uv": [7.5, 6.5, 8, 7], "texture": "#0"}, - "west": {"uv": [7, 7.5, 7.5, 8], "texture": "#0"}, - "up": {"uv": [8, 7.5, 7.5, 7], "texture": "#0"}, - "down": {"uv": [8, 7.5, 7.5, 8], "texture": "#0"} + "north": { + "uv": [ + 7.5, + 5, + 8, + 5.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 7.5, + 5.5, + 8, + 6 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 7.5, + 6.5, + 8, + 7 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 7, + 7.5, + 7.5, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8, + 7.5, + 7.5, + 7 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 8, + 7.5, + 7.5, + 8 + ], + "texture": "#0" + } } }, { - "from": [8, 11, 4], - "to": [9, 12, 5], + "from": [ + 8, + 11, + 4 + ], + "to": [ + 9, + 12, + 5 + ], "faces": { - "north": {"uv": [8, 0, 8.5, 0.5], "texture": "#0"}, - "east": {"uv": [0.5, 8, 1, 8.5], "texture": "#0"}, - "south": {"uv": [8, 0.5, 8.5, 1], "texture": "#0"}, - "west": {"uv": [1, 8, 1.5, 8.5], "texture": "#0"}, - "up": {"uv": [8.5, 1.5, 8, 1], "texture": "#0"}, - "down": {"uv": [2, 8, 1.5, 8.5], "texture": "#0"} + "north": { + "uv": [ + 8, + 0, + 8.5, + 0.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0.5, + 8, + 1, + 8.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8, + 0.5, + 8.5, + 1 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 1, + 8, + 1.5, + 8.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8.5, + 1.5, + 8, + 1 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 2, + 8, + 1.5, + 8.5 + ], + "texture": "#0" + } } }, { - "from": [7, 11, 4], - "to": [8, 12, 5], + "from": [ + 7, + 11, + 4 + ], + "to": [ + 8, + 12, + 5 + ], "faces": { - "north": {"uv": [8, 1.5, 8.5, 2], "texture": "#0"}, - "east": {"uv": [2, 8, 2.5, 8.5], "texture": "#0"}, - "south": {"uv": [8, 2, 8.5, 2.5], "texture": "#0"}, - "west": {"uv": [2.5, 8, 3, 8.5], "texture": "#0"}, - "up": {"uv": [8.5, 3, 8, 2.5], "texture": "#0"}, - "down": {"uv": [3.5, 8, 3, 8.5], "texture": "#0"} + "north": { + "uv": [ + 8, + 1.5, + 8.5, + 2 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 2, + 8, + 2.5, + 8.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8, + 2, + 8.5, + 2.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 2.5, + 8, + 3, + 8.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8.5, + 3, + 8, + 2.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 3.5, + 8, + 3, + 8.5 + ], + "texture": "#0" + } } }, { - "from": [7, 8, 4], - "to": [8, 9, 5], + "from": [ + 7, + 8, + 4 + ], + "to": [ + 8, + 9, + 5 + ], "faces": { - "north": {"uv": [8, 3, 8.5, 3.5], "texture": "#0"}, - "east": {"uv": [3.5, 8, 4, 8.5], "texture": "#0"}, - "south": {"uv": [8, 3.5, 8.5, 4], "texture": "#0"}, - "west": {"uv": [4, 8, 4.5, 8.5], "texture": "#0"}, - "up": {"uv": [8.5, 4.5, 8, 4], "texture": "#0"}, - "down": {"uv": [5, 8, 4.5, 8.5], "texture": "#0"} + "north": { + "uv": [ + 8, + 3, + 8.5, + 3.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 3.5, + 8, + 4, + 8.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8, + 3.5, + 8.5, + 4 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4, + 8, + 4.5, + 8.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8.5, + 4.5, + 8, + 4 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 5, + 8, + 4.5, + 8.5 + ], + "texture": "#0" + } } }, { - "from": [8, 8, 4], - "to": [9, 9, 5], + "from": [ + 8, + 8, + 4 + ], + "to": [ + 9, + 9, + 5 + ], "faces": { - "north": {"uv": [8, 4.5, 8.5, 5], "texture": "#0"}, - "east": {"uv": [5, 8, 5.5, 8.5], "texture": "#0"}, - "south": {"uv": [8, 5, 8.5, 5.5], "texture": "#0"}, - "west": {"uv": [5.5, 8, 6, 8.5], "texture": "#0"}, - "up": {"uv": [8.5, 6, 8, 5.5], "texture": "#0"}, - "down": {"uv": [6.5, 8, 6, 8.5], "texture": "#0"} + "north": { + "uv": [ + 8, + 4.5, + 8.5, + 5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 5, + 8, + 5.5, + 8.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8, + 5, + 8.5, + 5.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 5.5, + 8, + 6, + 8.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8.5, + 6, + 8, + 5.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 6.5, + 8, + 6, + 8.5 + ], + "texture": "#0" + } } }, { - "from": [7, 9, 3], - "to": [9, 11, 4], + "from": [ + 7, + 9, + 3 + ], + "to": [ + 9, + 11, + 4 + ], "faces": { - "north": {"uv": [3.5, 6, 4.5, 7], "texture": "#0"}, - "east": {"uv": [2.5, 5, 3, 6], "texture": "#0"}, - "south": {"uv": [4.5, 6, 5.5, 7], "texture": "#0"}, - "west": {"uv": [0.5, 7, 1, 8], "texture": "#0"}, - "up": {"uv": [2, 7.5, 1, 7], "texture": "#0"}, - "down": {"uv": [8, 2, 7, 2.5], "texture": "#0"} + "north": { + "uv": [ + 3.5, + 6, + 4.5, + 7 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 2.5, + 5, + 3, + 6 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 4.5, + 6, + 5.5, + 7 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0.5, + 7, + 1, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 2, + 7.5, + 1, + 7 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 8, + 2, + 7, + 2.5 + ], + "texture": "#0" + } } } ], diff --git a/src/main/resources/assets/voluminousenergy/models/item/fluid_scanner.json b/src/main/resources/assets/voluminousenergy/models/item/fluid_scanner.json index 8a1a30309..8d4589ae9 100644 --- a/src/main/resources/assets/voluminousenergy/models/item/fluid_scanner.json +++ b/src/main/resources/assets/voluminousenergy/models/item/fluid_scanner.json @@ -1,155 +1,830 @@ { - "credit": "Made with Blockbench", - "texture_size": [32, 32], - "textures": { - "0": "voluminousenergy:item/fluid_scanner", - "particle": "voluminousenergy:item/fluid_scanner" - }, - "elements": [ - { - "from": [6, 8, 6], - "to": [10, 12, 7], - "faces": { - "north": {"uv": [5.5, 4, 7.5, 6], "texture": "#0"}, - "east": {"uv": [5.5, 6, 6, 8], "texture": "#0"}, - "south": {"uv": [6, 0, 8, 2], "texture": "#0"}, - "west": {"uv": [6, 6, 6.5, 8], "texture": "#0"}, - "up": {"uv": [8, 4, 6, 3.5], "texture": "#0"}, - "down": {"uv": [8.5, 6, 6.5, 6.5], "texture": "#0"} - } - }, - { - "from": [5, 8, 7], - "to": [11, 12, 12], - "faces": { - "north": {"uv": [3, 0, 6, 2], "texture": "#0"}, - "east": {"uv": [3, 4, 5.5, 6], "texture": "#0"}, - "south": {"uv": [3, 2, 6, 4], "texture": "#0"}, - "west": {"uv": [0, 5, 2.5, 7], "texture": "#0"}, - "up": {"uv": [3, 2.5, 0, 0], "texture": "#0"}, - "down": {"uv": [3, 2.5, 0, 5], "texture": "#0"} - } - }, - { - "from": [7, 5, 9], - "to": [9, 8, 10], - "faces": { - "north": {"uv": [6, 2, 7, 3.5], "texture": "#0"}, - "east": {"uv": [6.5, 6.5, 7, 8], "texture": "#0"}, - "south": {"uv": [2.5, 6, 3.5, 7.5], "texture": "#0"}, - "west": {"uv": [0, 7, 0.5, 8.5], "texture": "#0"}, - "up": {"uv": [8, 3, 7, 2.5], "texture": "#0"}, - "down": {"uv": [8, 3, 7, 3.5], "texture": "#0"} - } - }, - { - "from": [9, 11, 5], - "to": [10, 12, 6], - "faces": { - "north": {"uv": [2, 7, 2.5, 7.5], "texture": "#0"}, - "east": {"uv": [3.5, 7, 4, 7.5], "texture": "#0"}, - "south": {"uv": [4, 7, 4.5, 7.5], "texture": "#0"}, - "west": {"uv": [4.5, 7, 5, 7.5], "texture": "#0"}, - "up": {"uv": [5.5, 7.5, 5, 7], "texture": "#0"}, - "down": {"uv": [7.5, 6.5, 7, 7], "texture": "#0"} - } - }, - { - "from": [6, 11, 5], - "to": [7, 12, 6], - "faces": { - "north": {"uv": [7, 7, 7.5, 7.5], "texture": "#0"}, - "east": {"uv": [1, 7.5, 1.5, 8], "texture": "#0"}, - "south": {"uv": [1.5, 7.5, 2, 8], "texture": "#0"}, - "west": {"uv": [2, 7.5, 2.5, 8], "texture": "#0"}, - "up": {"uv": [3, 8, 2.5, 7.5], "texture": "#0"}, - "down": {"uv": [3.5, 7.5, 3, 8], "texture": "#0"} - } - }, - { - "from": [6, 8, 5], - "to": [7, 9, 6], - "faces": { - "north": {"uv": [3.5, 7.5, 4, 8], "texture": "#0"}, - "east": {"uv": [4, 7.5, 4.5, 8], "texture": "#0"}, - "south": {"uv": [7.5, 4, 8, 4.5], "texture": "#0"}, - "west": {"uv": [4.5, 7.5, 5, 8], "texture": "#0"}, - "up": {"uv": [8, 5, 7.5, 4.5], "texture": "#0"}, - "down": {"uv": [5.5, 7.5, 5, 8], "texture": "#0"} - } - }, - { - "from": [9, 8, 5], - "to": [10, 9, 6], - "faces": { - "north": {"uv": [7.5, 5, 8, 5.5], "texture": "#0"}, - "east": {"uv": [7.5, 5.5, 8, 6], "texture": "#0"}, - "south": {"uv": [7.5, 6.5, 8, 7], "texture": "#0"}, - "west": {"uv": [7, 7.5, 7.5, 8], "texture": "#0"}, - "up": {"uv": [8, 7.5, 7.5, 7], "texture": "#0"}, - "down": {"uv": [8, 7.5, 7.5, 8], "texture": "#0"} - } - }, - { - "from": [8, 11, 4], - "to": [9, 12, 5], - "faces": { - "north": {"uv": [8, 0, 8.5, 0.5], "texture": "#0"}, - "east": {"uv": [0.5, 8, 1, 8.5], "texture": "#0"}, - "south": {"uv": [8, 0.5, 8.5, 1], "texture": "#0"}, - "west": {"uv": [1, 8, 1.5, 8.5], "texture": "#0"}, - "up": {"uv": [8.5, 1.5, 8, 1], "texture": "#0"}, - "down": {"uv": [2, 8, 1.5, 8.5], "texture": "#0"} - } - }, - { - "from": [7, 11, 4], - "to": [8, 12, 5], - "faces": { - "north": {"uv": [8, 1.5, 8.5, 2], "texture": "#0"}, - "east": {"uv": [2, 8, 2.5, 8.5], "texture": "#0"}, - "south": {"uv": [8, 2, 8.5, 2.5], "texture": "#0"}, - "west": {"uv": [2.5, 8, 3, 8.5], "texture": "#0"}, - "up": {"uv": [8.5, 3, 8, 2.5], "texture": "#0"}, - "down": {"uv": [3.5, 8, 3, 8.5], "texture": "#0"} - } - }, - { - "from": [7, 8, 4], - "to": [8, 9, 5], - "faces": { - "north": {"uv": [8, 3, 8.5, 3.5], "texture": "#0"}, - "east": {"uv": [3.5, 8, 4, 8.5], "texture": "#0"}, - "south": {"uv": [8, 3.5, 8.5, 4], "texture": "#0"}, - "west": {"uv": [4, 8, 4.5, 8.5], "texture": "#0"}, - "up": {"uv": [8.5, 4.5, 8, 4], "texture": "#0"}, - "down": {"uv": [5, 8, 4.5, 8.5], "texture": "#0"} - } - }, - { - "from": [8, 8, 4], - "to": [9, 9, 5], - "faces": { - "north": {"uv": [8, 4.5, 8.5, 5], "texture": "#0"}, - "east": {"uv": [5, 8, 5.5, 8.5], "texture": "#0"}, - "south": {"uv": [8, 5, 8.5, 5.5], "texture": "#0"}, - "west": {"uv": [5.5, 8, 6, 8.5], "texture": "#0"}, - "up": {"uv": [8.5, 6, 8, 5.5], "texture": "#0"}, - "down": {"uv": [6.5, 8, 6, 8.5], "texture": "#0"} - } - }, - { - "from": [7, 9, 3], - "to": [9, 11, 4], - "faces": { - "north": {"uv": [3.5, 6, 4.5, 7], "texture": "#0"}, - "east": {"uv": [2.5, 5, 3, 6], "texture": "#0"}, - "south": {"uv": [4.5, 6, 5.5, 7], "texture": "#0"}, - "west": {"uv": [0.5, 7, 1, 8], "texture": "#0"}, - "up": {"uv": [2, 7.5, 1, 7], "texture": "#0"}, - "down": {"uv": [8, 2, 7, 2.5], "texture": "#0"} - } - } - ], - "display": {} + "credit": "Made with Blockbench", + "texture_size": [ + 32, + 32 + ], + "textures": { + "0": "voluminousenergy:item/fluid_scanner", + "particle": "voluminousenergy:item/fluid_scanner" + }, + "elements": [ + { + "from": [ + 6, + 8, + 6 + ], + "to": [ + 10, + 12, + 7 + ], + "faces": { + "north": { + "uv": [ + 5.5, + 4, + 7.5, + 6 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 5.5, + 6, + 6, + 8 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 6, + 0, + 8, + 2 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6, + 6, + 6.5, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8, + 4, + 6, + 3.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 8.5, + 6, + 6.5, + 6.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 5, + 8, + 7 + ], + "to": [ + 11, + 12, + 12 + ], + "faces": { + "north": { + "uv": [ + 3, + 0, + 6, + 2 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 3, + 4, + 5.5, + 6 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 3, + 2, + 6, + 4 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 5, + 2.5, + 7 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 3, + 2.5, + 0, + 0 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 3, + 2.5, + 0, + 5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 7, + 5, + 9 + ], + "to": [ + 9, + 8, + 10 + ], + "faces": { + "north": { + "uv": [ + 6, + 2, + 7, + 3.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6.5, + 6.5, + 7, + 8 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 2.5, + 6, + 3.5, + 7.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0, + 7, + 0.5, + 8.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8, + 3, + 7, + 2.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 8, + 3, + 7, + 3.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 9, + 11, + 5 + ], + "to": [ + 10, + 12, + 6 + ], + "faces": { + "north": { + "uv": [ + 2, + 7, + 2.5, + 7.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 3.5, + 7, + 4, + 7.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 4, + 7, + 4.5, + 7.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4.5, + 7, + 5, + 7.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 5.5, + 7.5, + 5, + 7 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 7.5, + 6.5, + 7, + 7 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 11, + 5 + ], + "to": [ + 7, + 12, + 6 + ], + "faces": { + "north": { + "uv": [ + 7, + 7, + 7.5, + 7.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 1, + 7.5, + 1.5, + 8 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 1.5, + 7.5, + 2, + 8 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 2, + 7.5, + 2.5, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 3, + 8, + 2.5, + 7.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 3.5, + 7.5, + 3, + 8 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 6, + 8, + 5 + ], + "to": [ + 7, + 9, + 6 + ], + "faces": { + "north": { + "uv": [ + 3.5, + 7.5, + 4, + 8 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 4, + 7.5, + 4.5, + 8 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 7.5, + 4, + 8, + 4.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4.5, + 7.5, + 5, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8, + 5, + 7.5, + 4.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 5.5, + 7.5, + 5, + 8 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 9, + 8, + 5 + ], + "to": [ + 10, + 9, + 6 + ], + "faces": { + "north": { + "uv": [ + 7.5, + 5, + 8, + 5.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 7.5, + 5.5, + 8, + 6 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 7.5, + 6.5, + 8, + 7 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 7, + 7.5, + 7.5, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8, + 7.5, + 7.5, + 7 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 8, + 7.5, + 7.5, + 8 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 8, + 11, + 4 + ], + "to": [ + 9, + 12, + 5 + ], + "faces": { + "north": { + "uv": [ + 8, + 0, + 8.5, + 0.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0.5, + 8, + 1, + 8.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8, + 0.5, + 8.5, + 1 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 1, + 8, + 1.5, + 8.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8.5, + 1.5, + 8, + 1 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 2, + 8, + 1.5, + 8.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 7, + 11, + 4 + ], + "to": [ + 8, + 12, + 5 + ], + "faces": { + "north": { + "uv": [ + 8, + 1.5, + 8.5, + 2 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 2, + 8, + 2.5, + 8.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8, + 2, + 8.5, + 2.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 2.5, + 8, + 3, + 8.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8.5, + 3, + 8, + 2.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 3.5, + 8, + 3, + 8.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 7, + 8, + 4 + ], + "to": [ + 8, + 9, + 5 + ], + "faces": { + "north": { + "uv": [ + 8, + 3, + 8.5, + 3.5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 3.5, + 8, + 4, + 8.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8, + 3.5, + 8.5, + 4 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 4, + 8, + 4.5, + 8.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8.5, + 4.5, + 8, + 4 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 5, + 8, + 4.5, + 8.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 8, + 8, + 4 + ], + "to": [ + 9, + 9, + 5 + ], + "faces": { + "north": { + "uv": [ + 8, + 4.5, + 8.5, + 5 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 5, + 8, + 5.5, + 8.5 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 8, + 5, + 8.5, + 5.5 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 5.5, + 8, + 6, + 8.5 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 8.5, + 6, + 8, + 5.5 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 6.5, + 8, + 6, + 8.5 + ], + "texture": "#0" + } + } + }, + { + "from": [ + 7, + 9, + 3 + ], + "to": [ + 9, + 11, + 4 + ], + "faces": { + "north": { + "uv": [ + 3.5, + 6, + 4.5, + 7 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 2.5, + 5, + 3, + 6 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 4.5, + 6, + 5.5, + 7 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0.5, + 7, + 1, + 8 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 2, + 7.5, + 1, + 7 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 8, + 2, + 7, + 2.5 + ], + "texture": "#0" + } + } + } + ], + "display": {} } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/models/item/rfid_chip.json b/src/main/resources/assets/voluminousenergy/models/item/rfid_chip.json index c2013af24..183da7ddc 100644 --- a/src/main/resources/assets/voluminousenergy/models/item/rfid_chip.json +++ b/src/main/resources/assets/voluminousenergy/models/item/rfid_chip.json @@ -1,27 +1,90 @@ { - "credit": "Made with Blockbench", - "texture_size": [32, 32], - "textures": { - "0": "voluminousenergy:item/rfid_chip", - "particle": "voluminousenergy:item/rfid_chip" - }, - "elements": [ - { - "from": [3, 2, -1], - "to": [11, 16, 0], - "faces": { - "north": {"uv": [0, 0, 4, 7], "texture": "#0"}, - "east": {"uv": [0, 7, 0.5, 14], "texture": "#0"}, - "south": {"uv": [4, 0, 8, 7], "texture": "#0"}, - "west": {"uv": [0.5, 7, 1, 14], "texture": "#0"}, - "up": {"uv": [5, 7.5, 1, 7], "texture": "#0"}, - "down": {"uv": [9, 7, 5, 7.5], "texture": "#0"} - } - } - ], - "display": { - "thirdperson_righthand": { - "translation": [2, 2, 8] - } - } + "credit": "Made with Blockbench", + "texture_size": [ + 32, + 32 + ], + "textures": { + "0": "voluminousenergy:item/rfid_chip", + "particle": "voluminousenergy:item/rfid_chip" + }, + "elements": [ + { + "from": [ + 3, + 2, + -1 + ], + "to": [ + 11, + 16, + 0 + ], + "faces": { + "north": { + "uv": [ + 0, + 0, + 4, + 7 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 0, + 7, + 0.5, + 14 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 4, + 0, + 8, + 7 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 0.5, + 7, + 1, + 14 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 5, + 7.5, + 1, + 7 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 9, + 7, + 5, + 7.5 + ], + "texture": "#0" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [ + 2, + 2, + 8 + ] + } + } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/models/item/titanium_sawblade.json b/src/main/resources/assets/voluminousenergy/models/item/titanium_sawblade.json index 99234b9a7..f1eaf87ba 100644 --- a/src/main/resources/assets/voluminousenergy/models/item/titanium_sawblade.json +++ b/src/main/resources/assets/voluminousenergy/models/item/titanium_sawblade.json @@ -4,11 +4,38 @@ "saw": "voluminousenergy:item/titanium_sawblade" }, "elements": [ - { "from": [ 1, 1, 8 ], - "to": [ 15, 15, 8 ], + { + "from": [ + 1, + 1, + 8 + ], + "to": [ + 15, + 15, + 8 + ], "faces": { - "north": { "uv": [ 1, 1, 15, 15 ], "texture": "#saw", "tintindex": 0 }, - "south": { "uv": [ 1, 1, 15, 15 ], "texture": "#saw", "tintindex": 0 } + "north": { + "uv": [ + 1, + 1, + 15, + 15 + ], + "texture": "#saw", + "tintindex": 0 + }, + "south": { + "uv": [ + 1, + 1, + 15, + 15 + ], + "texture": "#saw", + "tintindex": 0 + } } } ] diff --git a/src/main/resources/assets/voluminousenergy/sounds.json b/src/main/resources/assets/voluminousenergy/sounds.json index 7864d132f..dca35c3ae 100644 --- a/src/main/resources/assets/voluminousenergy/sounds.json +++ b/src/main/resources/assets/voluminousenergy/sounds.json @@ -1,38 +1,56 @@ { "energy_beam_activate": { "subtitle": "voluminousenergy.subtitle.energy_beam_activate", - "sounds": [ "voluminousenergy:energy_beam_activate" ] + "sounds": [ + "voluminousenergy:energy_beam_activate" + ] }, - "energy_beam_fired" : { + "energy_beam_fired": { "subtitle": "voluminousenergy.subtitle.energy_beam_fired", - "sounds": [ "voluminousenergy:energy_beam_fired" ] - }, - "air_compressor_active" : { - "subtitle" : "voluminousenergy.subtitle.air_compressor_active", - "sounds" : ["voluminousenergy:air_compressor_active"] - }, - "aqueoulizer_active" : { - "subtitle" : "voluminousenergy.subtitle.aqueoulizer_active", - "sounds" : ["voluminousenergy:aqueoulizer_active"] - }, - "compressor_active" : { - "subtitle" : "voluminousenergy.subtitle.compressor_active", - "sounds" : ["voluminousenergy:compressor_active"] - }, - "crusher_active" : { - "subtitle" : "voluminousenergy.subtitle.crusher_active", - "sounds" : ["voluminousenergy:crusher_active"] - }, - "furnace_active" : { - "subtitle" : "voluminousenergy.subtitle.furnace_active", - "sounds" : ["voluminousenergy:furnace_active"] - }, - "general_machine_noise" : { - "subtitle" : "voluminousenergy.subtitle.general_machine_noise", - "sounds" : ["voluminousenergy:general_machine_noise"] - }, - "implosion_compressor_active" : { - "subtitle" : "voluminousenergy.subtitle.implosion_compressor_active", - "sounds" : ["voluminousenergy:implosion_compressor_active"] + "sounds": [ + "voluminousenergy:energy_beam_fired" + ] + }, + "air_compressor_active": { + "subtitle": "voluminousenergy.subtitle.air_compressor_active", + "sounds": [ + "voluminousenergy:air_compressor_active" + ] + }, + "aqueoulizer_active": { + "subtitle": "voluminousenergy.subtitle.aqueoulizer_active", + "sounds": [ + "voluminousenergy:aqueoulizer_active" + ] + }, + "compressor_active": { + "subtitle": "voluminousenergy.subtitle.compressor_active", + "sounds": [ + "voluminousenergy:compressor_active" + ] + }, + "crusher_active": { + "subtitle": "voluminousenergy.subtitle.crusher_active", + "sounds": [ + "voluminousenergy:crusher_active" + ] + }, + "furnace_active": { + "subtitle": "voluminousenergy.subtitle.furnace_active", + "sounds": [ + "voluminousenergy:furnace_active" + ] + }, + "general_machine_noise": { + "subtitle": "voluminousenergy.subtitle.general_machine_noise", + "sounds": [ + "voluminousenergy:general_machine_noise" + ] + }, + "implosion_compressor_active": { + "subtitle": "voluminousenergy.subtitle.implosion_compressor_active", + "sounds": [ + "voluminousenergy:implosion_compressor_active" + ] } } \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/textures/block/fluids/crude_oil_flowing.png.mcmeta b/src/main/resources/assets/voluminousenergy/textures/block/fluids/crude_oil_flowing.png.mcmeta index dd3c73017..6cc687f6b 100644 --- a/src/main/resources/assets/voluminousenergy/textures/block/fluids/crude_oil_flowing.png.mcmeta +++ b/src/main/resources/assets/voluminousenergy/textures/block/fluids/crude_oil_flowing.png.mcmeta @@ -1,5 +1,5 @@ { - "animation": { - "frametime": 5 - } - } \ No newline at end of file + "animation": { + "frametime": 5 + } +} \ No newline at end of file diff --git a/src/main/resources/data/forge/tags/blocks/storage_blocks.json b/src/main/resources/data/forge/tags/blocks/storage_blocks.json index c806eaff5..0393d4e6e 100644 --- a/src/main/resources/data/forge/tags/blocks/storage_blocks.json +++ b/src/main/resources/data/forge/tags/blocks/storage_blocks.json @@ -1,4 +1,3 @@ - { "replace": false, "values": [ diff --git a/src/main/resources/data/forge/tags/items/storage_blocks.json b/src/main/resources/data/forge/tags/items/storage_blocks.json index c806eaff5..0393d4e6e 100644 --- a/src/main/resources/data/forge/tags/items/storage_blocks.json +++ b/src/main/resources/data/forge/tags/items/storage_blocks.json @@ -1,4 +1,3 @@ - { "replace": false, "values": [ diff --git a/src/main/resources/data/voluminousenergy/loot_tables/blocks/compressor.json b/src/main/resources/data/voluminousenergy/loot_tables/blocks/compressor.json index 43028a461..e005dbfa1 100644 --- a/src/main/resources/data/voluminousenergy/loot_tables/blocks/compressor.json +++ b/src/main/resources/data/voluminousenergy/loot_tables/blocks/compressor.json @@ -46,7 +46,7 @@ "target": "BlockEntityTag.output_slot_direction", "op": "replace" } - ] + ] }, { "function": "minecraft:set_contents", diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/combustible.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/combustible.json index 1e3253887..ee613145c 100644 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/combustible.json +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/combustible.json @@ -3,11 +3,11 @@ "fluid_ingredients": [ { "tag": "voluminousenergy:combustible", - "amount" : 250 + "amount": 250 }, { "tag": "voluminousenergy:oxidizer", - "amount" : 250 + "amount": 250 } ] } \ No newline at end of file diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 922ff3381..61d7e09c8 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,7 @@ { - "pack": { - "description": "VoluminousEnergy resources", - "pack_format": 4, - "_comment": "A pack_format of 4 requires json lang files. Note: we require v4 pack meta for all mods." - } + "pack": { + "description": "VoluminousEnergy resources", + "pack_format": 4, + "_comment": "A pack_format of 4 requires json lang files. Note: we require v4 pack meta for all mods." + } } From 4190de2a2dfd736b30addf2d56894fea44c49d3e Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Sun, 7 Apr 2024 21:12:33 -0400 Subject: [PATCH 10/27] Finished the ElectricFurnace. Fixed an issue with machine upgrade calculations. --- .../blocks/machines/ElectricFurnaceBlock.java | 4 +- .../blocks/screens/ElectricFurnaceScreen.java | 19 +- .../blocks/tiles/DimensionalLaserTile.java | 279 ------------------ .../blocks/tiles/ElectricFurnaceTile.java | 262 ---------------- .../blocks/tiles/GasFiredFurnaceTile.java | 2 +- .../blocks/tiles/SawmillTile.java | 4 +- .../blocks/tiles/VETileEntities.java | 6 +- .../blocks/tiles/VETileEntity.java | 51 +++- .../blocks/tiles/VETileEntityFactory.java | 2 +- .../handlers/AbstractItemStackValidator.java | 3 +- .../DimensionalLaserInventoryValidator.java | 13 +- .../handlers/FurnaceInventoryValidator.java | 24 ++ .../tiles/handlers/VEItemStackHandler.java | 2 +- .../processor/AirCompressorProcessor.java | 2 +- .../recipe/processor/DefaultProcessor.java | 13 +- .../DimensionalLaserRecipeProcessor.java | 13 +- .../processor/ElectricFurnaceProcessor.java | 87 ++++++ .../processor/GasFiredFurnaceProcessor.java | 17 ++ 18 files changed, 214 insertions(+), 589 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/FurnaceInventoryValidator.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/ElectricFurnaceProcessor.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectricFurnaceBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectricFurnaceBlock.java index a5f56885a..499570f57 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectricFurnaceBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectricFurnaceBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.ElectricFurnaceTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -31,7 +31,7 @@ public ElectricFurnaceBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new ElectricFurnaceTile(pos, state); + return VETileEntities.ELECTRIC_FURNACE_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java index 2e84d9687..85d727526 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java @@ -3,11 +3,12 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.ElectricFurnaceTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotBoolButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotDirectionButton; +import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.GameRenderer; @@ -22,14 +23,14 @@ public class ElectricFurnaceScreen extends VEContainerScreen { - private ElectricFurnaceTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/electric_furnace_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public ElectricFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (ElectricFurnaceTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -41,21 +42,23 @@ protected void init() { })); + List managers = tileEntity.getManagers(); + // Input insert - addRenderableWidget(new SlotBoolButton(tileEntity.inputSlotManager, (this.width / 2) - 198, this.topPos, button -> { + addRenderableWidget(new SlotBoolButton(managers.get(0), (this.width / 2) - 198, this.topPos, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.inputSlotManager, (this.width / 2) - 184, this.topPos, button -> { + addRenderableWidget(new SlotDirectionButton(managers.get(0), (this.width / 2) - 184, this.topPos, button -> { // Do nothing })); // Input Extract - addRenderableWidget(new SlotBoolButton(tileEntity.outputSlotManager, (this.width / 2) - 198, this.topPos + 20, button -> { + addRenderableWidget(new SlotBoolButton(managers.get(1), (this.width / 2) - 198, this.topPos + 20, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.outputSlotManager, (this.width / 2) - 184, this.topPos + 20, button -> { + addRenderableWidget(new SlotDirectionButton(managers.get(1), (this.width / 2) - 184, this.topPos + 20, button -> { // Do nothing })); @@ -100,7 +103,7 @@ public Rect2i getTooltipArea() { public List getTooltips() { return Arrays.asList( Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.percent_complete").getString() + ": " + tileEntity.progressCounterPercent() + "%"), - Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.getCounter())); + Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.getData("counter"))); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java deleted file mode 100644 index fe5967a01..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java +++ /dev/null @@ -1,279 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.achievements.triggers.VECriteriaTriggers; -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; -import com.veteam.voluminousenergy.items.VEItems; -import com.veteam.voluminousenergy.items.tools.RFIDChip; -import com.veteam.voluminousenergy.persistence.ChunkFluid; -import com.veteam.voluminousenergy.persistence.SingleChunkFluid; -import com.veteam.voluminousenergy.sounds.VESounds; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import com.veteam.voluminousenergy.util.VERelationalTank; -import com.veteam.voluminousenergy.util.WorldUtil; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.nbt.Tag; -import net.minecraft.server.level.ServerPlayer; -import net.minecraft.sounds.SoundSource; -import net.minecraft.world.entity.EntityType; -import net.minecraft.world.entity.LightningBolt; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.ChunkPos; -import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.phys.AABB; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import javax.annotation.Nonnull; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; - -public class DimensionalLaserTile extends VEMultiBlockTileEntity { - - public VESlotManager bucketTopSm = new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0); - public VESlotManager bucketBottomSm = new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT); - public VESlotManager RFIDsm = new VESlotManager(2, Direction.NORTH, true, SlotType.OUTPUT); - - List slotManagers = new ArrayList<>() {{ - add(bucketTopSm); - add(bucketBottomSm); - add(RFIDsm); - }}; - - VERelationalTank outputTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.OUTPUT, "outputTank:output_tank_gui"); - - List fluidManagers = new ArrayList<>() {{ - add(outputTank); - }}; - - //private boolean multiBlockComplete = false; - - private int tickTimer = 0; - private byte multiblockTickChecker = 19; - private boolean complete = false; - private boolean firstStageComplete = false; - private boolean initialized = true; - private boolean soundPlayed = false; - - public DimensionalLaserTile(BlockPos pos, BlockState state) { - super(VEBlocks.DIMENSIONAL_LASER_TILE.get(), pos, state, null); - this.outputTank.setAllowAny(true); - this.RFIDsm.addAllowedItem(VEItems.RFID_CHIP.get()); - } - - public ItemStackHandler inventory = new VEItemStackHandler(this, 4); - - @Override - public void tick() { - updateClients(); - multiblockTickChecker++; - if (multiblockTickChecker == 20) { - multiblockTickChecker = 0; - validity = isMultiBlockValid(VEBlocks.SOLARIUM_MACHINE_CASING_BLOCK.get()); - } - if (!validity) return; - - if (!complete) { - setChanged(); - if (!firstStageComplete) { - tickTimer(); - if (tickTimer >= 400) { - setFirstStageComplete(); - resetTickTimer(); - } - } else { - tickTimer(); - if (tickTimer >= 600) complete = true; - if (tickTimer % 12 == 0 && (new Random()).nextInt(2) == 1) { - BlockPos blockPos = level.getBlockRandomPos(this.getBlockPos().getX(), 0, this.getBlockPos().getZ(), 5); - - blockPos = blockPos.atY(this.getBlockPos().getY()); - - LightningBolt lightningBolt = new LightningBolt(EntityType.LIGHTNING_BOLT, level); - lightningBolt.setVisualOnly(true); - lightningBolt.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ()); - level.addFreshEntity(lightningBolt); - } - } - - if (initialized && !soundPlayed) { - level.playSound(null, this.getBlockPos(), VESounds.ENERGY_BEAM_ACTIVATE, SoundSource.BLOCKS, 1.0F, 1.0F); - soundPlayed = true; - } - - if (initialized && firstStageComplete) { - initialized = false; - level.playSound(null, this.getBlockPos(), VESounds.ENERGY_BEAM_FIRED, SoundSource.BLOCKS, 1.0F, 1.0F); - } - } - - int x = this.getBlockPos().getX(); - int y = this.getBlockPos().getY(); - int z = this.getBlockPos().getZ(); - if (this.complete) { - - for (ServerPlayer serverplayer : level.getEntitiesOfClass(ServerPlayer.class, (new AABB(x, y, z, x, y - 4, z)).inflate(50.0D, 50.0D, 50.0D))) { - VECriteriaTriggers.CONSTRUCT_DIMENSIONAL_LASER_TRIGGER.trigger(serverplayer, 3); - } - - // Main tick code - processFluidIO(); - - - ItemStack rfidStack = inventory.getStackInSlot(2); - - if (rfidStack.getItem() instanceof RFIDChip) { - CompoundTag rfidTag = rfidStack.getOrCreateTag(); - Tag veX = rfidTag.get("ve_x"); - Tag veZ = rfidTag.get("ve_z"); - - if (veX != null && veZ != null) { - - int veXi = Integer.valueOf(veX.toString()); - int veZi = Integer.valueOf(veZ.toString()); - - ChunkPos chunkPos = new ChunkPos(veXi, veZi); - BlockPos blockPos = chunkPos.getBlockAt(0, 64, 0); - - ChunkFluid fluidFromPos = WorldUtil.getFluidFromPosition(level, blockPos); - - SingleChunkFluid fluid = fluidFromPos.getFluids().get(0); - - if (super.canConsumeEnergy() && outputTank.getTank().getFluidAmount() < DEFAULT_TANK_CAPACITY) { - if (counter == 1) { - - if (outputTank.isFluidValid(fluid.getFluid())) { - int fillSize = Math.min(fluid.getAmount(), DEFAULT_TANK_CAPACITY - outputTank.getTank().getFluidAmount()); - fillSize = Math.min(fillSize, fluid.getAmount()); - outputTank.getTank().fill(new FluidStack(fluid.getFluid(), fillSize), IFluidHandler.FluidAction.EXECUTE); - } - counter--; - consumeEnergy(); - this.setChanged(); - } else if (counter > 0) { - counter--; - consumeEnergy(); - } else { - int counterTemp = this.calculateCounter(Config.DIMENSIONAL_LASER_PROCESS_TIME.get(), inventory.getStackInSlot(this.energy.getUpgradeSlotId()).copy()); - counter = counterTemp != 0 ? counterTemp : 1; - length = counter; - } - } else { // Energy Check - } - } else { // If no RFID chip, set counter to 0 - counter = 0; - } - } else { - counter = 0; - } - } - } - - @Override - public AABB getRenderBoundingBox() { - return INFINITE_EXTENT_AABB; - } - - public int getTickTimer() { - return tickTimer; - } - - public void tickTimer() { - if (this.complete) return; - this.tickTimer += 1; - } - - @Override - public void load(CompoundTag tag) { - firstStageComplete = tag.getBoolean("first_stage_complete"); - complete = tag.getBoolean("fully_built"); - tickTimer = tag.getInt("tick_timer"); - super.load(tag); - } - - @Override - public void saveAdditional(@NotNull CompoundTag tag) { - tag.putBoolean("first_stage_complete", firstStageComplete); - tag.putBoolean("fully_built", complete); - tag.putInt("tick_timer", tickTimer); - super.saveAdditional(tag); - } - - public boolean isComplete() { - return complete; - } - - @Nonnull - @Override - public List getRelationalTanks() { - return this.fluidManagers; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int id, @Nonnull Inventory playerInventory, @Nonnull Player player) { - return VEContainers.DIMENSIONAL_LASER_FACTORY.create(id, level, worldPosition, playerInventory, player); - } - - @Nullable - @Override - public ItemStackHandler getInventoryHandler() { - return this.inventory; - } - - @Nonnull - @Override - public List getSlotManagers() { - return this.slotManagers; - } - - public void setComplete() { - this.complete = true; - } - - public boolean isFirstStageComplete() { - return firstStageComplete; - } - - public void setFirstStageComplete() { - this.firstStageComplete = true; - } - - public void resetTickTimer() { - this.tickTimer = 0; - } - - @Override - public boolean isMultiBlockValid(Block block) { - - // Tweak box based on direction -- This is the search range to ensure this is a valid multiblock before operation - for (final BlockPos blockPos : BlockPos.betweenClosed(worldPosition.offset(-1, -3, -1), worldPosition.offset(1, -1, 1))) { - final BlockState blockState = level.getBlockState(blockPos); - - if (blockState.getBlock() != block) { // Fails MultiBlock condition - return false; - } - } - return true; - } - - public boolean getMultiblockValidity() { - return validity; - } - -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java deleted file mode 100644 index eef4796d4..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.java +++ /dev/null @@ -1,262 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.sounds.VESounds; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TagUtil; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.sounds.SoundSource; -import net.minecraft.util.Mth; -import net.minecraft.world.SimpleContainer; -import net.minecraft.world.entity.ExperienceOrb; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.world.item.crafting.BlastingRecipe; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.item.crafting.SmeltingRecipe; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.concurrent.atomic.AtomicReference; - -public class ElectricFurnaceTile extends VETileEntity { - - public VESlotManager inputSlotManager = new VESlotManager(0, Direction.UP, true, SlotType.INPUT); - public VESlotManager outputSlotManager = new VESlotManager(1, Direction.DOWN, true, SlotType.OUTPUT); - - public List slotManagers = new ArrayList<>() {{ - add(inputSlotManager); - add(outputSlotManager); - }}; - - private final AtomicReference inputItemStack = new AtomicReference<>(new ItemStack(Items.AIR, 0)); - private final AtomicReference referenceStack = new AtomicReference<>(new ItemStack(Items.AIR, 0)); - - public ElectricFurnaceTile(BlockPos pos, BlockState state) { - super(VEBlocks.ELECTRIC_FURNACE_TILE.get(), pos, state, null); - } - - public ItemStackHandler inventory = createHandler(); - - private SmeltingRecipe furnaceRecipe; - private BlastingRecipe blastingRecipe; - - @Override - public void tick() { - updateClients(); - validateRecipe(); - ItemStack furnaceInput = inventory.getStackInSlot(0).copy(); - ItemStack furnaceOutput = inventory.getStackInSlot(1).copy(); - - inputItemStack.set(furnaceInput.copy()); - if (!canConsumeEnergy()) return; - - if ((furnaceRecipe != null || blastingRecipe != null) && countChecker(furnaceRecipe, blastingRecipe, furnaceOutput.copy()) && itemChecker(furnaceRecipe, blastingRecipe, furnaceOutput.copy())) { - if (counter == 1) { - // Extract item - inventory.extractItem(0, 1, false); - - // Set output based on recipe - ItemStack newOutputStack; - newOutputStack = Objects.requireNonNullElse(furnaceRecipe, blastingRecipe).getResultItem(level.registryAccess()).copy(); - //LOGGER.debug("NewOutputStack: " + newOutputStack); - - // Output Item - if (furnaceOutput.getItem() != newOutputStack.getItem() || furnaceOutput.getItem() == Items.AIR) { - //LOGGER.debug("The output is not equal to the new output Stack"); - if (furnaceOutput.getItem() == Items.AIR) { // Fix air >1 jamming slots - furnaceOutput.setCount(1); - } - if (furnaceRecipe != null) { - newOutputStack.setCount(furnaceRecipe.getResultItem(level.registryAccess()).getCount()); - } else { - newOutputStack.setCount(blastingRecipe.getResultItem(level.registryAccess()).getCount()); - } - //LOGGER.debug("About to insert in pt1: " + newOutputStack); - inventory.insertItem(1, newOutputStack.copy(), false); // CRASH the game if this is not empty! - - } else { // Assuming the recipe output item is already in the output tilePos - // Simply change the item to equal the output amount - furnaceOutput.setCount(Objects.requireNonNullElse(furnaceRecipe, blastingRecipe).getResultItem(level.registryAccess()).getCount()); - //LOGGER.debug("About to insert in pt2: " + furnaceOutput); - inventory.insertItem(1, furnaceOutput.copy(), false); // Place the new output item on top of the old one - } - markRecipeDirty(); - consumeEnergy(); - counter--; - this.setChanged(); - } else if (counter > 0) { - consumeEnergy(); - counter--; - if (++sound_tick == 19) { - sound_tick = 0; - if (Config.PLAY_MACHINE_SOUNDS.get()) { - level.playSound(null, this.getBlockPos(), VESounds.GENERAL_MACHINE_NOISE, SoundSource.BLOCKS, 1.0F, 1.0F); - } - } - } else { - counter = this.calculateCounter(200, inventory.getStackInSlot(this.energy.getUpgradeSlotId())); - length = counter; - this.referenceStack.set(furnaceInput.copy()); - } - - } else counter = 0; - } - - @Override - public void validateRecipe() { - if (!this.isRecipeDirty) { - return; - } - this.isRecipeDirty = false; - ItemStack furnaceInput = slotManagers.get(0).getItem(this.inventory); - var furnaceRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(furnaceInput.copy()), level).orElse(null); - var blastingRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(furnaceInput.copy()), level).orElse(null); - - if (furnaceRecipeNew != null) furnaceRecipe = furnaceRecipeNew.value(); - else furnaceRecipe = null; - if (blastingRecipeNew != null) blastingRecipe = blastingRecipeNew.value(); - else blastingRecipe = null; - } - - private ItemStackHandler createHandler() { - return new ItemStackHandler(3) { - @Override - protected void onContentsChanged(int slot) { - setChanged(); - markRecipeDirty(); - } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if (slot == 0) { - return level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(stack), level).orElse(null) != null - || level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(stack), level).orElse(null) != null; - } else if (slot == 1) { - var furnaceRecipe = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(inputItemStack.get()), level).orElse(null); - var blastingRecipe = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(inputItemStack.get()), level).orElse(null); - - // If both recipes are null, then don't bother - if (blastingRecipe == null && furnaceRecipe == null) return false; - - return stack.getItem() == Objects.requireNonNullElse(furnaceRecipe, blastingRecipe).value().getResultItem(level.registryAccess()).getItem(); - - } else if (slot == 2) { - return TagUtil.isTaggedMachineUpgradeItem(stack); - } - return false; - } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { //ALSO DO THIS PER SLOT BASIS TO SAVE DEBUG HOURS!!! - if (slot == 0) { - ItemStack referenceStack = stack.copy(); - referenceStack.setCount(64); - SmeltingRecipe recipe = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(referenceStack), level).orElse(null).value(); - BlastingRecipe blastingRecipe = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(referenceStack), level).orElse(null).value(); - - if (recipe != null || blastingRecipe != null) { - return super.insertItem(slot, stack, simulate); - } - - } else if (slot == 1) { - return super.insertItem(slot, stack, simulate); - } else if (slot == 2 && TagUtil.isTaggedMachineUpgradeItem(stack)) { - return super.insertItem(slot, stack, simulate); - } - return stack; - } - - @Override - @Nonnull - public ItemStack extractItem(int slot, int amount, boolean simulate) { - if (level != null && !simulate) { - var furnaceRecipe = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(referenceStack.get()), level).orElse(null); - var blastingRecipe = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(referenceStack.get()), level).orElse(null); - if (blastingRecipe != null) { - if (inventory.getStackInSlot(slot).getItem() == blastingRecipe.value().getResultItem(level.registryAccess()).getItem()) { - if (blastingRecipe.value().getExperience() > 0) { - generateXP(amount, blastingRecipe.value().getExperience()); - } - } - } else if (furnaceRecipe != null) { - if (inventory.getStackInSlot(slot).getItem() == furnaceRecipe.value().getResultItem(level.registryAccess()).getItem()) { - if (furnaceRecipe.value().getExperience() > 0) { - generateXP(amount, furnaceRecipe.value().getExperience()); - } - } - } - } - return super.extractItem(slot, amount, simulate); - } - }; - } - - private void generateXP(int craftedAmount, float experience) { - if (level == null) return; - int i = Mth.floor((float) craftedAmount * experience); - float f = Mth.frac((float) craftedAmount * experience); - if (f != 0.0F && Math.random() < (double) f) ++i; - - while (i > 0) { - int j = ExperienceOrb.getExperienceValue(i); - i -= j; - level.addFreshEntity(new ExperienceOrb(level, worldPosition.getX(), worldPosition.getY(), worldPosition.getZ(), j)); - } - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.ELECTRIC_FURNACE_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } - - public boolean countChecker(SmeltingRecipe furnaceRecipe, BlastingRecipe blastingRecipe, ItemStack itemStack) { - if (furnaceRecipe != null) { - return (itemStack.getCount() + furnaceRecipe.getResultItem(level.registryAccess()).getCount()) <= 64; - } else if (blastingRecipe != null) { - return (itemStack.getCount() + blastingRecipe.getResultItem(level.registryAccess()).getCount()) <= 64; - } - return false; - } - - public boolean itemChecker(SmeltingRecipe furnaceRecipe, BlastingRecipe blastingRecipe, ItemStack itemStack) { - if (furnaceRecipe != null) { - if (itemStack.getItem() == Items.AIR || itemStack.isEmpty()) return true; - return furnaceRecipe.getResultItem(level.registryAccess()).getItem() == itemStack.getItem(); - } else if (blastingRecipe != null) { - if (itemStack.getItem() == Items.AIR || itemStack.isEmpty()) return true; - return blastingRecipe.getResultItem(level.registryAccess()).getItem() == itemStack.getItem(); - } - return false; - } - - public int getCounter() { - return counter; - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java index 4fbb738a6..9b568ebc0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java @@ -123,7 +123,7 @@ public void tick() { } else if (counter > 0) { counter--; } else { - counter = this.calculateCounter(200, inventory.getStackInSlot(4)); + counter = updateCounter(200); length = counter; this.referenceStack.set(furnaceInput.copy()); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java index f402d174a..95a5eefe7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java @@ -238,8 +238,8 @@ private void coreTickProcessing(@Nullable VEFluidSawmillRecipe VEFluidSawmillRec } } else { counter = VEFluidSawmillRecipe != null - ? this.calculateCounter(VEFluidSawmillRecipe.getProcessTime(), inventory.getStackInSlot(this.energy.getUpgradeSlotId()).copy()) // Sawmill recipe not null - : this.calculateCounter(Config.SAWMILL_PROCESSING_TIME.get(), inventory.getStackInSlot(this.energy.getUpgradeSlotId()).copy());// Use default values when null + ? updateCounter(VEFluidSawmillRecipe.getProcessTime()) // Sawmill recipe not null + : updateCounter(Config.SAWMILL_PROCESSING_TIME.get()); // Use default values when null length = counter; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index 1d79f20ed..6a3f9b38d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -5,6 +5,7 @@ import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidInputTank; import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidOutputTank; import com.veteam.voluminousenergy.blocks.tiles.handlers.DimensionalLaserInventoryValidator; +import com.veteam.voluminousenergy.blocks.tiles.handlers.FurnaceInventoryValidator; import com.veteam.voluminousenergy.recipe.processor.*; import com.veteam.voluminousenergy.tools.Config; @@ -160,7 +161,6 @@ public class VETileEntities { .withRecipe(DISTILLING) .withCustomRecipeProcessing(new MultiBlockRecipeProcessor(VEBlocks.ALUMINUM_MACHINE_CASING_BLOCK)); - // TODO needs a furnace processor public static final VETileEntityFactory ELECTRIC_FURNACE_FACTORY = new VETileEntityFactory(VEBlocks.ELECTRIC_FURNACE_TILE, VEContainers.ELECTRIC_FURNACE_FACTORY) .addEnergyStorageWithConsumption(Config.ELECTROLYZER_MAX_POWER.get(), @@ -168,7 +168,8 @@ public class VETileEntities { Config.ELECTRIC_FURNACE_POWER_USAGE.get()) .countable() .makesSound() - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomInventoryValidator(new FurnaceInventoryValidator()) + .withCustomRecipeProcessing(new ElectricFurnaceProcessor()); public static final VETileEntityFactory ELECTROLYZER_FACTORY = new VETileEntityFactory(VEBlocks.ELECTROLYZER_TILE, VEContainers.ELECTROLYZER_FACTORY) @@ -217,6 +218,7 @@ public class VETileEntities { ) .countable() .makesSound() + .withCustomInventoryValidator(new FurnaceInventoryValidator()) .withCustomRecipeProcessing(new DefaultProcessor()); public static final VETileEntityFactory HYDROPONIC_INCUBATOR_FACTORY = diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 79e33a65d..994c0b9f1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -207,7 +207,13 @@ public void updateClients() { level.sendBlockUpdated(this.worldPosition, this.getBlockState(), this.getBlockState(), 1); } - public int calculateCounter(int processTime, ItemStack upgradeStack) { + /** + * This is for internal use only. Call this outside at your own peril + * @param processTime The base time it takes to process + * @param upgradeStack The stack to use to calculate it + * @return the new counter int. + */ + private int calculateCounter(int processTime, ItemStack upgradeStack) { if (upgradeStack.getItem() == VEItems.QUARTZ_MULTIPLIER.get()) { int count = upgradeStack.getCount(); if (count == 4) { @@ -217,7 +223,7 @@ public int calculateCounter(int processTime, ItemStack upgradeStack) { } } else if (!upgradeStack.isEmpty() && TagUtil.isTaggedMachineUpgradeItem(upgradeStack)) { CompoundTag compound = upgradeStack.getTag(); - return compound != null ? (int) ((float) (processTime * compound.getFloat("multiplier"))) : processTime; + return compound != null ? (int) (processTime * compound.getFloat("multiplier")) : processTime; } return processTime; } @@ -667,4 +673,45 @@ public void setSelectedRecipe(VERecipe recipe) { public AbstractRecipeProcessor getRecipeProcessor() { return recipeProcessor; } + + public int updateCounter(VERecipe recipe) { + int newLength; + ItemStackHandler handler = this.getInventoryHandler(); + if (this.getEnergy() != null && handler != null) { + newLength = this.calculateCounter(recipe.getProcessTime(), + handler.getStackInSlot(energy.getUpgradeSlotId()).copy()); + } else { + newLength = this.calculateCounter(recipe.getProcessTime(), ItemStack.EMPTY); + } + + double ratio = (double) this.getData("length") / (double) newLength; + this.setData("length", newLength); + this.setData("counter", (int) (this.getData("counter") / ratio)); + return newLength; + } + + /** + * This updates the counter and takes into account an upgrade slot if + * it exists. + * @param defaultProcessTime The base processing time in ticks. + * @return The new length. Only need to use this if you potentially write to a new length + */ + public int updateCounter(int defaultProcessTime) { + int newLength; + ItemStackHandler handler = this.getInventoryHandler(); + if (this.getEnergy() != null && handler != null) { + newLength = this.calculateCounter(defaultProcessTime, + handler.getStackInSlot(energy.getUpgradeSlotId()).copy()); + } else { + newLength = this.calculateCounter(defaultProcessTime, ItemStack.EMPTY); + } + double ratio = (double) this.getData("length") / (double) newLength; + this.setData("length", newLength); + + int ratioedCounter = (int) (this.getData("counter") / ratio); + + this.setData("counter", ratioedCounter == 0 ? newLength : ratioedCounter); + this.setChanged(); + return newLength; + } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java index 49243a4ef..06f65a764 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java @@ -50,7 +50,7 @@ public VETileEntityFactory(RegistryObject> tileReg public VETileEntity create(BlockPos pos, BlockState state) { - VETileEntity newTile = new VETileEntity(tileRegistry.get(), pos, state, recipeType.get()) { + VETileEntity newTile = new VETileEntity(tileRegistry.get(), pos, state, recipeType == null ? null : recipeType.get()) { @Nullable @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/AbstractItemStackValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/AbstractItemStackValidator.java index 259a4d23d..a4c88e7cb 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/AbstractItemStackValidator.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/AbstractItemStackValidator.java @@ -1,9 +1,10 @@ package com.veteam.voluminousenergy.blocks.tiles.handlers; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import net.minecraft.world.item.ItemStack; public interface AbstractItemStackValidator { - boolean isItemValid(int slot, ItemStack itemStack); + boolean isItemValid(int slot, ItemStack itemStack, VETileEntity tile); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/DimensionalLaserInventoryValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/DimensionalLaserInventoryValidator.java index 2fee1baf1..0b70dd3ec 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/DimensionalLaserInventoryValidator.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/DimensionalLaserInventoryValidator.java @@ -1,14 +1,16 @@ package com.veteam.voluminousenergy.blocks.tiles.handlers; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.items.tools.RFIDChip; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.BucketItem; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.level.material.Fluids; public class DimensionalLaserInventoryValidator implements AbstractItemStackValidator { @Override - public boolean isItemValid(int slot, ItemStack stack) { + public boolean isItemValid(int slot, ItemStack stack, VETileEntity tile) { if (slot == 2) { if (!(stack.getItem() instanceof RFIDChip)) { return false; @@ -16,10 +18,11 @@ public boolean isItemValid(int slot, ItemStack stack) { CompoundTag tag = stack.getOrCreateTag(); if (!tag.contains("ve_x")) return false; } - if (slot == 0 || slot == 1) { - if (!(stack.getItem() instanceof BucketItem)) { - return false; - } + if (slot == 1) { + return stack.getItem() instanceof BucketItem; + } + if (slot == 0) { + return stack.getItem() instanceof BucketItem bucketItem && bucketItem.getFluid().isSame(Fluids.EMPTY); } return true; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/FurnaceInventoryValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/FurnaceInventoryValidator.java new file mode 100644 index 000000000..c0ec5dd43 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/FurnaceInventoryValidator.java @@ -0,0 +1,24 @@ +package com.veteam.voluminousenergy.blocks.tiles.handlers; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.util.TagUtil; +import net.minecraft.world.SimpleContainer; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.level.Level; + +public class FurnaceInventoryValidator implements AbstractItemStackValidator { + + @Override + public boolean isItemValid(int slot, ItemStack stack, VETileEntity tile) { + if(tile.getEnergy() != null && tile.getEnergy().getUpgradeSlotId() == slot) return TagUtil.isTaggedMachineUpgradeItem(stack); + if(slot != 0) return true; + Level level = tile.getLevel(); + var furnaceRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, + new SimpleContainer(stack.copy()), level).orElse(null); + if(furnaceRecipeNew != null) return true; + var blastingRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, + new SimpleContainer(stack.copy()), level).orElse(null); + return blastingRecipeNew != null; + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/VEItemStackHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/VEItemStackHandler.java index 572ce85a8..4eed7cbc1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/VEItemStackHandler.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/VEItemStackHandler.java @@ -58,7 +58,7 @@ else if (slot < managers.size()) { public boolean isItemValid(int slot, @Nonnull ItemStack stack) { // For simple custom validation. if (validator != null) { - return validator.isItemValid(slot, stack); + return validator.isItemValid(slot, stack,tileEntity); } if (slot == upgradeSlotLocation) return TagUtil.isTaggedMachineUpgradeItem(stack); VESlotManager manager = tileEntity.getSlotManagers().get(slot); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java index e76b38094..3b2730e0c 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java @@ -54,7 +54,7 @@ public void processRecipe(VETileEntity tile) { } } tile.setData("sound_tick", soundTick); - counter = (byte) tile.calculateCounter(20, tile.getInventory().getStackInSlot(tile.getEnergy().getUpgradeSlotId())); + counter = tile.updateCounter(20); tile.setChanged(); } } else { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java index 85cda0d15..02f31ca78 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java @@ -24,18 +24,7 @@ public void validateRecipe(VETileEntity tile) { return; } - int newLength; - ItemStackHandler handler = tile.getInventoryHandler(); - if (tile.getEnergy() != null && handler != null) { - newLength = tile.calculateCounter(newRecipe.getProcessTime(), - handler.getStackInSlot(tile.getEnergy().getUpgradeSlotId()).copy()); - } else { - newLength = tile.calculateCounter(newRecipe.getProcessTime(), ItemStack.EMPTY); - } - - double ratio = (double) tile.getData("length") / (double) newLength; - tile.setData("length", newLength); - tile.setData("counter", (int) (tile.getData("counter") / ratio)); + int newLength = tile.updateCounter(newRecipe); if (tile.getSelectedRecipe() != newRecipe) { tile.setSelectedRecipe(newRecipe); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java index cc5aa23c3..4969e01f2 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java @@ -71,11 +71,7 @@ public void processRecipe(VETileEntity tile) { if (!tile.canConsumeEnergy()) return; ItemStack stack = tile.getStackInSlot(2); if (stack.isEmpty()) { - int counterTemp = tile.calculateCounter(Config.DIMENSIONAL_LASER_PROCESS_TIME.get(), - tile.getStackInSlot(tile.getEnergy().getUpgradeSlotId()).copy()); - int counter = counterTemp != 0 ? counterTemp : 1; - tile.setData("length", counter); - tile.setData("counter", counter); + tile.updateCounter(Config.DIMENSIONAL_LASER_PROCESS_TIME.get()); return; } @@ -102,19 +98,16 @@ public void processRecipe(VETileEntity tile) { int counter = tile.getData("counter"); if (counter == 1) { + counter--; FluidStack fluidStack = new FluidStack(singleChunkFluid.getFluid(), amount); tile.getTank(0).fillTank(fluidStack); - counter--; tile.consumeEnergy(); tile.setChanged(); } else if (counter > 0) { counter--; tile.consumeEnergy(); } else { - int counterTemp = tile.calculateCounter(Config.DIMENSIONAL_LASER_PROCESS_TIME.get(), - tile.getStackInSlot(tile.getEnergy().getUpgradeSlotId()).copy()); - counter = counterTemp != 0 ? counterTemp : 1; - tile.setData("length", counter); + counter = tile.updateCounter(Config.DIMENSIONAL_LASER_PROCESS_TIME.get()); } tile.setData("counter", counter); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/ElectricFurnaceProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/ElectricFurnaceProcessor.java new file mode 100644 index 000000000..49bad5bfe --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/ElectricFurnaceProcessor.java @@ -0,0 +1,87 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.sounds.VESounds; +import com.veteam.voluminousenergy.tools.Config; +import net.minecraft.core.RegistryAccess; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.SimpleContainer; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.BlastingRecipe; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.item.crafting.SmeltingRecipe; +import net.minecraft.world.level.Level; + +public class ElectricFurnaceProcessor implements AbstractRecipeProcessor { + + private SmeltingRecipe furnaceRecipe; + private BlastingRecipe blastingRecipe; + + @Override + public void processRecipe(VETileEntity tile) { + if (!tile.canConsumeEnergy()) return; + + if (blastingRecipe != null) processForRecipe(blastingRecipe, tile); + else if (furnaceRecipe != null) processForRecipe(furnaceRecipe, tile); + } + + void processForRecipe(Recipe recipe, VETileEntity tile) { + if (!canInsertIntoResult(recipe, tile.getLevel().registryAccess(), tile.getStackInSlot(1))) { + return; + } + int counter = tile.getData("counter"); + VoluminousEnergy.LOGGER.info("Counter: " + counter); + if (counter == 1) { + counter--; + tile.getInventory().extractItem(0, 1, false); + ItemStack output = recipe.getResultItem(tile.getLevel().registryAccess()).copy(); + tile.getInventory().insertItem(1, output, false); + } else if (counter > 0) { + counter--; + int soundTick = tile.getData("sound_tick"); + if (++soundTick == 19) { + soundTick = 0; + if (Config.PLAY_MACHINE_SOUNDS.get()) { + tile.getLevel().playSound(null, tile.getBlockPos(), VESounds.GENERAL_MACHINE_NOISE, SoundSource.BLOCKS, 1.0F, 1.0F); + } + } + tile.setData("sound_tick", soundTick); + } else { + counter = tile.updateCounter(200); + } + tile.setData("counter", counter); + tile.setChanged(); + } + + @Override + public void validateRecipe(VETileEntity tile) { + Level level = tile.getLevel(); + ItemStack furnaceInput = tile.getStackInSlot(0); + var blastingRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(furnaceInput.copy()), level).orElse(null); + if (blastingRecipeNew != null) { + blastingRecipe = blastingRecipeNew.value(); + tile.updateCounter(200); + tile.setChanged(); + return; + } else blastingRecipe = null; + var furnaceRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(furnaceInput.copy()), level).orElse(null); + if (furnaceRecipeNew != null) { + furnaceRecipe = furnaceRecipeNew.value(); + tile.updateCounter(200); + tile.setChanged(); + return; + } else furnaceRecipe = null; + + tile.setData("counter", 0); + tile.setData("length", 0); + tile.setChanged(); + } + + boolean canInsertIntoResult(Recipe recipe, RegistryAccess access, ItemStack currentStack) { + ItemStack result = recipe.getResultItem(access); + if (!result.is(currentStack.getItem()) && !currentStack.isEmpty()) return false; + return result.getCount() + currentStack.getCount() <= result.getMaxStackSize(); + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java new file mode 100644 index 000000000..41fa0c602 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java @@ -0,0 +1,17 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; + +public class GasFiredFurnaceProcessor implements AbstractRecipeProcessor { + + @Override + public void processRecipe(VETileEntity tile) { + + } + + @Override + public void validateRecipe(VETileEntity tile) { + + } + +} From c968dc5054219beec946e47d4194b233a037e6c6 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Sun, 7 Apr 2024 23:19:32 -0400 Subject: [PATCH 11/27] Updated the Pump --- .../blocks/screens/PumpScreen.java | 14 +- .../blocks/tiles/VETileEntities.java | 13 +- .../blocks/tiles/VETileEntity.java | 20 ++- .../blocks/tiles/VETileEntityFactory.java | 10 +- .../processor/AbstractRecipeProcessor.java | 18 +-- .../recipe/processor/PumpTileProcessor.java | 127 ++++++++++++++++++ 6 files changed, 182 insertions(+), 20 deletions(-) create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/PumpTileProcessor.java diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java index a47be4f53..cb2c4d80e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.PumpTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; @@ -16,17 +16,18 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; public class PumpScreen extends VEContainerScreen { - private PumpTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/air_compressor_gui.png"); public PumpScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (PumpTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -80,8 +81,9 @@ protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { } if (isHovering(93, 18, 12, 50, mouseX, mouseY)) { // Oxidizer Tank - String name = tileEntity.getAirTankFluid().getTranslationKey(); - int amount = tileEntity.getAirTankFluid().getAmount(); + FluidStack stack = tileEntity.getTank(0).getTank().getFluid(); + String name = stack.getTranslationKey(); + int amount = stack.getAmount(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } @@ -110,7 +112,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); try { - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getAirTankFluid(), tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getTank(0).getTank().getFluid(), tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); } catch (Exception e) { } drawIOSideHelper(); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index 6a3f9b38d..dd366c757 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -57,9 +57,9 @@ public class VETileEntities { new FluidInputTank(0, DEFAULT_TANK_CAPACITY) ) .countable() - .withDataFlag("temperature_kelvin") - .withDataFlag("temperature_celsius") - .withDataFlag("temperature_fahrenheit") + .addDataFlag("temperature_kelvin") + .addDataFlag("temperature_celsius") + .addDataFlag("temperature_fahrenheit") .makesSound() .withRecipe(INDUSTRIAL_BLASTING) .withCustomRecipeProcessing(new MultiBlockRecipeProcessor(VEBlocks.TITANIUM_MACHINE_CASING_BLOCK)); @@ -139,7 +139,7 @@ public class VETileEntities { ) .countable() .makesSound() - .withDataFlag("build_tick") + .addDataFlag("build_tick") .withRecipe(DIMENSIONAL_LASING) .withInfiniteRender() .withCustomInventoryValidator(new DimensionalLaserInventoryValidator()) @@ -295,6 +295,11 @@ public class VETileEntities { ) .addTanks(new FluidOutputTank(0, DEFAULT_TANK_CAPACITY)) .countable() + .addDataFlag("lx") + .addDataFlag("ly") + .addDataFlag("lz") + .addSavableTag("selected_fluid") + .withCustomRecipeProcessing(new PumpTileProcessor()) .makesSound(); // TODO make a custom processor diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 994c0b9f1..4cefda6af 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -59,6 +59,7 @@ public abstract class VETileEntity extends BlockEntity implements MenuProvider { final List tanks = new ArrayList<>(); final List managers = new ArrayList<>(); final HashMap dataMap = new HashMap<>(); + final HashMap tagMap = new HashMap<>(); AbstractRecipeProcessor recipeProcessor; boolean sendsOutPower; @@ -303,6 +304,10 @@ public void load(CompoundTag tag) { dataMap.put(entry.getKey(), tag.getInt(entry.getKey())); } + for(var entry : tagMap.entrySet()) { + tagMap.put(entry.getKey(), tag.getCompound(entry.getKey())); + } + for (VESlotManager manager : getSlotManagers()) { manager.read(tag); } @@ -340,6 +345,10 @@ public void saveAdditional(@NotNull CompoundTag tag) { tag.putInt(entry.getKey(), entry.getValue()); } + for(var entry: tagMap.entrySet()) { + tag.put(entry.getKey(), entry.getValue()); + } + for (VERelationalTank relationalTank : getRelationalTanks()) { CompoundTag compoundTag = new CompoundTag(); relationalTank.getTank().writeToNBT(compoundTag); @@ -636,6 +645,15 @@ public void setData(String key, int value) { this.dataMap.put(key, value); } + @NotNull + public CompoundTag getCompoundTag(String key) { + return this.tagMap.getOrDefault(key,null); + } + + public void setCompoundTag(@NotNull String key,@NotNull CompoundTag value) { + this.tagMap.put(key, value); + } + public void setRecipeDirty(boolean dirty) { this.isRecipeDirty = dirty; } @@ -694,7 +712,7 @@ public int updateCounter(VERecipe recipe) { * This updates the counter and takes into account an upgrade slot if * it exists. * @param defaultProcessTime The base processing time in ticks. - * @return The new length. Only need to use this if you potentially write to a new length + * @return The new length. Only need to use this if you potentially overwrite the changes here (this.setData("length") for example) */ public int updateCounter(int defaultProcessTime) { int newLength; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java index 06f65a764..f5f495cca 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java @@ -12,6 +12,7 @@ import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; @@ -40,6 +41,7 @@ public class VETileEntityFactory { private AbstractItemStackValidator validator = null; private final HashMap dataMap = new HashMap<>(); + private final HashMap tagMap = new HashMap<>(); private AbstractRecipeProcessor processor; private boolean sendsOutPower = false; @@ -86,6 +88,7 @@ public AABB getRenderBoundingBox() { newTile.addTanks(tanks.stream().map(t -> t.asTank(index.getAndIncrement())).toList()); // Populate the data map newTile.dataMap.putAll(dataMap); + newTile.tagMap.putAll(tagMap); // Set energy before the tilePos count otherwise we'll run into issues with the data tilePos if (storage != null) @@ -139,7 +142,7 @@ public VETileEntityFactory isMultiBlock() { return this; } - public VETileEntityFactory withDataFlag(String flag) { + public VETileEntityFactory addDataFlag(String flag) { this.dataMap.put(flag, 0); return this; } @@ -179,6 +182,11 @@ public VETileEntityFactory withCustomInventoryValidator(AbstractItemStackValidat return this; } + public VETileEntityFactory addSavableTag(String tagId) { + this.tagMap.put(tagId,new CompoundTag()); + return this; + } + public record ItemInputSlot(Direction direction) implements TileSlot { @Override public VESlotManager asManager(int id) { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java index 111af0428..f07f12451 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java @@ -4,6 +4,15 @@ public interface AbstractRecipeProcessor { + /** + * Only called when the recipe has been marked as "dirty" + * use processRecipe for extra checks if this tile requires + * external checks that won't mark the tile as "dirty" + * + * @param tile The tile to validate the recipe for + */ + void validateRecipe(VETileEntity tile); + /** * Handles the main processing for this tile. * For tiles without recipes you can just use this without @@ -17,13 +26,6 @@ public interface AbstractRecipeProcessor { */ void processRecipe(VETileEntity tile); - /** - * Only called when the recipe has been marked as "dirty" - * use processRecipe for extra checks if this tile requires - * external checks that won't mark the tile as "dirty" - * - * @param tile The tile to validate the recipe for - */ - void validateRecipe(VETileEntity tile); + } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/PumpTileProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/PumpTileProcessor.java new file mode 100644 index 000000000..93f966a8b --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/PumpTileProcessor.java @@ -0,0 +1,127 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.sounds.VESounds; +import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.util.VERelationalTank; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Fluid; +import net.minecraft.world.level.material.Fluids; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.IFluidHandler; + +import static com.veteam.voluminousenergy.blocks.tiles.VETileEntity.DEFAULT_TANK_CAPACITY; + +public class PumpTileProcessor implements AbstractRecipeProcessor { + + int lX; + int lY; + int lZ; + + @Override + public void validateRecipe(VETileEntity tile) { + } + + @Override + public void processRecipe(VETileEntity tile) { + + if (!tile.canConsumeEnergy()) return; + + lX = tile.getData("lx"); + lY = tile.getData("ly"); + lZ = tile.getData("lz"); + + VERelationalTank fluidTank = tile.getTank(0); + + if (fluidTank.getTank().getFluidAmount() + 1000 <= DEFAULT_TANK_CAPACITY) { + for (int i = 0; i < 50; i++) { + if (fluidPumpMethod(tile)) { + tile.markFluidInputDirty(); + break; + } + } + tile.setChanged(); + + int soundTick = tile.getData("sound_tick"); + if (++soundTick == 19) { + soundTick = 0; + if (Config.PLAY_MACHINE_SOUNDS.get()) { + tile.getLevel().playSound(null, + tile.getBlockPos(), VESounds.AIR_COMPRESSOR, SoundSource.BLOCKS, 1.0F, 1.0F); + } + } + tile.setData("sound_tick", soundTick); + tile.setData("lx", lX); + tile.setData("ly", lY); + tile.setData("lz", lZ); + tile.setChanged(); + } + } + + public boolean fluidPumpMethod(VETileEntity tile) { + CompoundTag fluidTag = tile.getCompoundTag("selected_fluid"); + Fluid pumpingFluid = null; + if (fluidTag.isEmpty()) { + BlockState block = tile.getLevel().getBlockState(tile.getBlockPos().offset(0, -1, 0)); + if (!block.getFluidState().is(Fluids.EMPTY)) { + pumpingFluid = block.getFluidState().getType(); + + CompoundTag tag = new CompoundTag(); + new FluidStack(pumpingFluid, 1).writeToNBT(tag); + tile.setCompoundTag("selected_fluid", tag); + lX = -22; + lY = -1; + lZ = -22; + tile.setData("lx", lX); + tile.setData("ly", lY); + tile.setData("lz", lZ); + } + } else { + pumpingFluid = FluidStack.loadFluidStackFromNBT(fluidTag).getFluid(); + } + if (pumpingFluid == null) { + VoluminousEnergy.LOGGER.info("Pumping fluid is null!"); + return false; + } + + Level level = tile.getLevel(); + if (lX < 22) { + lX++; + BlockState state = level.getBlockState(tile.getBlockPos().offset(lX, lY, lZ)); + if (pumpingFluid.isSame(state.getFluidState().getType())) { + addFluidToTank(tile,pumpingFluid); + return true; + } + + } else if (lZ < 22) { + lZ++; + lX = -22; + if (pumpingFluid.isSame(level.getBlockState(tile.getBlockPos().offset(lX, lY, lZ)).getFluidState().getType())) { + addFluidToTank(tile,pumpingFluid); + return true; + } + } else if (tile.getBlockPos().offset(0, lY, 0).getY() > level.dimensionType().minY()) { + lY--; + lX = -22; + lZ = -22; + if (pumpingFluid.isSame(level.getBlockState(tile.getBlockPos().offset(lX, lY, lZ)).getFluidState().getType())) { + addFluidToTank(tile,pumpingFluid); + return true; + } + } + return false; + } + + + void addFluidToTank(VETileEntity tile,Fluid fluid) { + tile.getLevel().setBlockAndUpdate(tile.getBlockPos().offset(lX, lY, lZ), Blocks.AIR.defaultBlockState()); + tile.consumeEnergy(); + tile.getTank(0).getTank() + .fill(new FluidStack(fluid, 1000), IFluidHandler.FluidAction.EXECUTE); + } +} From 30a7ed419569c73874c79e4cc4c95a821154be9b Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Sun, 7 Apr 2024 23:19:32 -0400 Subject: [PATCH 12/27] Updated the Pump --- .../blocks/screens/PumpScreen.java | 14 +- .../blocks/tiles/PumpTile.java | 285 ------------------ .../blocks/tiles/VETileEntities.java | 13 +- .../blocks/tiles/VETileEntity.java | 20 +- .../blocks/tiles/VETileEntityFactory.java | 10 +- .../processor/AbstractRecipeProcessor.java | 18 +- .../recipe/processor/PumpTileProcessor.java | 127 ++++++++ 7 files changed, 182 insertions(+), 305 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/PumpTileProcessor.java diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java index a47be4f53..cb2c4d80e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.PumpTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; @@ -16,17 +16,18 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; public class PumpScreen extends VEContainerScreen { - private PumpTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/air_compressor_gui.png"); public PumpScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (PumpTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -80,8 +81,9 @@ protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { } if (isHovering(93, 18, 12, 50, mouseX, mouseY)) { // Oxidizer Tank - String name = tileEntity.getAirTankFluid().getTranslationKey(); - int amount = tileEntity.getAirTankFluid().getAmount(); + FluidStack stack = tileEntity.getTank(0).getTank().getFluid(); + String name = stack.getTranslationKey(); + int amount = stack.getAmount(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } @@ -110,7 +112,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); try { - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getAirTankFluid(), tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getTank(0).getTank().getFluid(), tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); } catch (Exception e) { } drawIOSideHelper(); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java deleted file mode 100644 index 7003955e8..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java +++ /dev/null @@ -1,285 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.sounds.VESounds; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.IntToDirection; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import com.veteam.voluminousenergy.util.VERelationalTank; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.sounds.SoundSource; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Fluid; -import net.minecraft.world.level.material.Fluids; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.IItemHandler; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public class PumpTile extends VETileEntity { - private final LazyOptional handler = LazyOptional.of(() -> this.inventory); - private final LazyOptional fluid = LazyOptional.of(this::createFluid); - - public List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); - add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); - }}; - - private final int tankCapacity = 4000; - - // Working data - private boolean initDone = false; - private int lX = 0; - private int lY = 0; - private int lZ = 0; - - private final VERelationalTank fluidTank = new VERelationalTank(new FluidTank(tankCapacity), 0, TankType.OUTPUT, "tank:tank_gui"); - private Fluid pumpingFluid = Fluids.EMPTY; - private final ItemStackHandler inventory = this.createHandler(); - - public PumpTile(BlockPos pos, BlockState state) { - super(VEBlocks.PUMP_TILE.get(), pos, state, null); - fluidTank.setAllowAny(true); - fluidTank.setIgnoreDirection(true); - } - - @Override - public void tick() { - updateClients(); - processFluidIO(); - handler.ifPresent(h -> { - if (fluidTank.getTank() != null && (fluidTank.getTank().getFluidAmount() + 1000) <= tankCapacity && this.getCapability(ForgeCapabilities.ENERGY).map(IEnergyStorage::getEnergyStored).orElse(0) > 0) { - for (int i = 0; i < 50; i++) { - if (fluidPumpMethod()) break; - } - setChanged(); - if (++sound_tick == 19) { - sound_tick = 0; - if (Config.PLAY_MACHINE_SOUNDS.get()) { - level.playSound(null, this.getBlockPos(), VESounds.AIR_COMPRESSOR, SoundSource.BLOCKS, 1.0F, 1.0F); - } - } - } - }); - } - - public void addFluidToTank() { - if ((fluidTank.getTank().getFluidAmount() + 1000) <= tankCapacity) { - energy.consumeEnergy(Config.PUMP_POWER_USAGE.get()); - fluidTank.getTank().fill(new FluidStack(this.pumpingFluid, 1000), IFluidHandler.FluidAction.EXECUTE); - } - } - - @Override - public void load(CompoundTag tag) { - lX = tag.getInt("lx"); - lY = tag.getInt("ly"); - lZ = tag.getInt("lz"); - initDone = tag.getBoolean("init_done"); - super.load(tag); - pumpingFluid = fluidTank.getTank().getFluid().getRawFluid(); - } - - @Override - public void saveAdditional(@NotNull CompoundTag tag) { - tag.putInt("lx", lX); - tag.putInt("ly", lY); - tag.putInt("lz", lZ); - tag.putBoolean("init_done", initDone); - super.saveAdditional(tag); - } - - public void updatePacketFromGui(int direction, int slotId) { - for (VESlotManager slot : getSlotManagers()) { - if (slotId == slot.getSlotNum()) { - slot.setDirection(direction); - return; - } - } - } - - public void updateTankPacketFromGui(int direction, int id) { - for (VERelationalTank tank : getRelationalTanks()) { - if (id == tank.getSlotNum()) { - tank.setSideDirection(IntToDirection.IntegerToDirection(direction)); - } - } - } - - private @Nonnull IFluidHandler createFluid() { - return new IFluidHandler() { - @Override - public int getTanks() { - return 1; - } - - @Nonnull - @Override - public FluidStack getFluidInTank(int tank) { - return fluidTank.getTank().getFluid(); - } - - @Override - public int getTankCapacity(int tank) { - return fluidTank.getTank() == null ? 0 : fluidTank.getTank().getCapacity(); - } - - @Override - public boolean isFluidValid(int tank, @Nonnull FluidStack stack) { - return fluidTank.getTank().isFluidValid(stack); - } - - @Override - public int fill(FluidStack resource, FluidAction action) { - if (isFluidValid(0, resource) && fluidTank.getTank().isEmpty() || resource.isFluidEqual(fluidTank.getTank().getFluid())) { - return fluidTank.getTank().fill(resource.copy(), action); - } - return 0; - } - - @Nonnull - @Override - public FluidStack drain(FluidStack resource, FluidAction action) { - if (resource.isEmpty()) { - return FluidStack.EMPTY; - } - if (resource.isFluidEqual(fluidTank.getTank().getFluid())) { - return fluidTank.getTank().drain(resource.copy(), action); - } - return FluidStack.EMPTY; - } - - @Nonnull - @Override - public FluidStack drain(int maxDrain, FluidAction action) { - if (fluidTank.getTank().getFluidAmount() > 0) { - return fluidTank.getTank().drain(maxDrain, action); - } - return FluidStack.EMPTY; - } - }; - } - - private ItemStackHandler createHandler() { - return new ItemStackHandler(2) { - @Override - protected void onContentsChanged(int slot) { - setChanged(); - } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - return true; - } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - return super.insertItem(slot, stack, simulate); - } - }; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.PUMP_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Nullable - @Override - public ItemStackHandler getInventoryHandler() { - return null; - } - - @Override - public @Nonnull List getSlotManagers() { - return slotManagers; - } - - public FluidStack getAirTankFluid() { - return this.fluidTank.getTank().getFluid(); - } - - public int getTankCapacity() { - return tankCapacity; - } - - @Override - public @NotNull List getRelationalTanks() { - return Collections.singletonList(fluidTank); - } - - public boolean fluidPumpMethod() { - if (!(initDone)) { - lX = -22; - lY = -1; - lZ = -22; - - try { - this.pumpingFluid = this.level.getBlockState(this.getBlockPos().offset(0, -1, 0)).getFluidState().getType(); - initDone = true; - } catch (Exception e) { - return false; - } - } - - if (this.pumpingFluid == Fluids.EMPTY || this.pumpingFluid.isSame(Fluids.EMPTY) || this.pumpingFluid == null) { // Sanity check to prevent mass destruction - initDone = false; - return false; - } - - if (lX < 22) { - lX++; - if (this.pumpingFluid.isSame(this.level.getBlockState(this.getBlockPos().offset(lX, lY, lZ)).getFluidState().getType())) { - this.level.setBlockAndUpdate(this.getBlockPos().offset(lX, lY, lZ), Blocks.AIR.defaultBlockState()); // setBlockAndUpdate is the replacement for setBlockState in MCP mappings. This is obvious because of the flag of 3. - addFluidToTank(); - return true; - } - - } else if (lZ < 22) { - lZ++; - lX = -22; - if (this.pumpingFluid.isSame(this.level.getBlockState(this.getBlockPos().offset(lX, lY, lZ)).getFluidState().getType())) { - this.level.setBlockAndUpdate(this.getBlockPos().offset(lX, lY, lZ), Blocks.AIR.defaultBlockState()); - addFluidToTank(); - return true; - } - } else if (this.getBlockPos().offset(0, lY, 0).getY() > -63) { - lY--; - lX = -22; - lZ = -22; - if (this.pumpingFluid.isSame(this.level.getBlockState(this.getBlockPos().offset(lX, lY, lZ)).getFluidState().getType())) { - this.level.setBlockAndUpdate(this.getBlockPos().offset(lX, lY, lZ), Blocks.AIR.defaultBlockState()); - addFluidToTank(); - return true; - } - } - return false; - } - - public VERelationalTank getTank() { - return this.fluidTank; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index 6a3f9b38d..dd366c757 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -57,9 +57,9 @@ public class VETileEntities { new FluidInputTank(0, DEFAULT_TANK_CAPACITY) ) .countable() - .withDataFlag("temperature_kelvin") - .withDataFlag("temperature_celsius") - .withDataFlag("temperature_fahrenheit") + .addDataFlag("temperature_kelvin") + .addDataFlag("temperature_celsius") + .addDataFlag("temperature_fahrenheit") .makesSound() .withRecipe(INDUSTRIAL_BLASTING) .withCustomRecipeProcessing(new MultiBlockRecipeProcessor(VEBlocks.TITANIUM_MACHINE_CASING_BLOCK)); @@ -139,7 +139,7 @@ public class VETileEntities { ) .countable() .makesSound() - .withDataFlag("build_tick") + .addDataFlag("build_tick") .withRecipe(DIMENSIONAL_LASING) .withInfiniteRender() .withCustomInventoryValidator(new DimensionalLaserInventoryValidator()) @@ -295,6 +295,11 @@ public class VETileEntities { ) .addTanks(new FluidOutputTank(0, DEFAULT_TANK_CAPACITY)) .countable() + .addDataFlag("lx") + .addDataFlag("ly") + .addDataFlag("lz") + .addSavableTag("selected_fluid") + .withCustomRecipeProcessing(new PumpTileProcessor()) .makesSound(); // TODO make a custom processor diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 994c0b9f1..4cefda6af 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -59,6 +59,7 @@ public abstract class VETileEntity extends BlockEntity implements MenuProvider { final List tanks = new ArrayList<>(); final List managers = new ArrayList<>(); final HashMap dataMap = new HashMap<>(); + final HashMap tagMap = new HashMap<>(); AbstractRecipeProcessor recipeProcessor; boolean sendsOutPower; @@ -303,6 +304,10 @@ public void load(CompoundTag tag) { dataMap.put(entry.getKey(), tag.getInt(entry.getKey())); } + for(var entry : tagMap.entrySet()) { + tagMap.put(entry.getKey(), tag.getCompound(entry.getKey())); + } + for (VESlotManager manager : getSlotManagers()) { manager.read(tag); } @@ -340,6 +345,10 @@ public void saveAdditional(@NotNull CompoundTag tag) { tag.putInt(entry.getKey(), entry.getValue()); } + for(var entry: tagMap.entrySet()) { + tag.put(entry.getKey(), entry.getValue()); + } + for (VERelationalTank relationalTank : getRelationalTanks()) { CompoundTag compoundTag = new CompoundTag(); relationalTank.getTank().writeToNBT(compoundTag); @@ -636,6 +645,15 @@ public void setData(String key, int value) { this.dataMap.put(key, value); } + @NotNull + public CompoundTag getCompoundTag(String key) { + return this.tagMap.getOrDefault(key,null); + } + + public void setCompoundTag(@NotNull String key,@NotNull CompoundTag value) { + this.tagMap.put(key, value); + } + public void setRecipeDirty(boolean dirty) { this.isRecipeDirty = dirty; } @@ -694,7 +712,7 @@ public int updateCounter(VERecipe recipe) { * This updates the counter and takes into account an upgrade slot if * it exists. * @param defaultProcessTime The base processing time in ticks. - * @return The new length. Only need to use this if you potentially write to a new length + * @return The new length. Only need to use this if you potentially overwrite the changes here (this.setData("length") for example) */ public int updateCounter(int defaultProcessTime) { int newLength; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java index 06f65a764..f5f495cca 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java @@ -12,6 +12,7 @@ import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; +import net.minecraft.nbt.CompoundTag; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; @@ -40,6 +41,7 @@ public class VETileEntityFactory { private AbstractItemStackValidator validator = null; private final HashMap dataMap = new HashMap<>(); + private final HashMap tagMap = new HashMap<>(); private AbstractRecipeProcessor processor; private boolean sendsOutPower = false; @@ -86,6 +88,7 @@ public AABB getRenderBoundingBox() { newTile.addTanks(tanks.stream().map(t -> t.asTank(index.getAndIncrement())).toList()); // Populate the data map newTile.dataMap.putAll(dataMap); + newTile.tagMap.putAll(tagMap); // Set energy before the tilePos count otherwise we'll run into issues with the data tilePos if (storage != null) @@ -139,7 +142,7 @@ public VETileEntityFactory isMultiBlock() { return this; } - public VETileEntityFactory withDataFlag(String flag) { + public VETileEntityFactory addDataFlag(String flag) { this.dataMap.put(flag, 0); return this; } @@ -179,6 +182,11 @@ public VETileEntityFactory withCustomInventoryValidator(AbstractItemStackValidat return this; } + public VETileEntityFactory addSavableTag(String tagId) { + this.tagMap.put(tagId,new CompoundTag()); + return this; + } + public record ItemInputSlot(Direction direction) implements TileSlot { @Override public VESlotManager asManager(int id) { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java index 111af0428..f07f12451 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java @@ -4,6 +4,15 @@ public interface AbstractRecipeProcessor { + /** + * Only called when the recipe has been marked as "dirty" + * use processRecipe for extra checks if this tile requires + * external checks that won't mark the tile as "dirty" + * + * @param tile The tile to validate the recipe for + */ + void validateRecipe(VETileEntity tile); + /** * Handles the main processing for this tile. * For tiles without recipes you can just use this without @@ -17,13 +26,6 @@ public interface AbstractRecipeProcessor { */ void processRecipe(VETileEntity tile); - /** - * Only called when the recipe has been marked as "dirty" - * use processRecipe for extra checks if this tile requires - * external checks that won't mark the tile as "dirty" - * - * @param tile The tile to validate the recipe for - */ - void validateRecipe(VETileEntity tile); + } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/PumpTileProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/PumpTileProcessor.java new file mode 100644 index 000000000..93f966a8b --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/PumpTileProcessor.java @@ -0,0 +1,127 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.sounds.VESounds; +import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.util.VERelationalTank; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.material.Fluid; +import net.minecraft.world.level.material.Fluids; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.IFluidHandler; + +import static com.veteam.voluminousenergy.blocks.tiles.VETileEntity.DEFAULT_TANK_CAPACITY; + +public class PumpTileProcessor implements AbstractRecipeProcessor { + + int lX; + int lY; + int lZ; + + @Override + public void validateRecipe(VETileEntity tile) { + } + + @Override + public void processRecipe(VETileEntity tile) { + + if (!tile.canConsumeEnergy()) return; + + lX = tile.getData("lx"); + lY = tile.getData("ly"); + lZ = tile.getData("lz"); + + VERelationalTank fluidTank = tile.getTank(0); + + if (fluidTank.getTank().getFluidAmount() + 1000 <= DEFAULT_TANK_CAPACITY) { + for (int i = 0; i < 50; i++) { + if (fluidPumpMethod(tile)) { + tile.markFluidInputDirty(); + break; + } + } + tile.setChanged(); + + int soundTick = tile.getData("sound_tick"); + if (++soundTick == 19) { + soundTick = 0; + if (Config.PLAY_MACHINE_SOUNDS.get()) { + tile.getLevel().playSound(null, + tile.getBlockPos(), VESounds.AIR_COMPRESSOR, SoundSource.BLOCKS, 1.0F, 1.0F); + } + } + tile.setData("sound_tick", soundTick); + tile.setData("lx", lX); + tile.setData("ly", lY); + tile.setData("lz", lZ); + tile.setChanged(); + } + } + + public boolean fluidPumpMethod(VETileEntity tile) { + CompoundTag fluidTag = tile.getCompoundTag("selected_fluid"); + Fluid pumpingFluid = null; + if (fluidTag.isEmpty()) { + BlockState block = tile.getLevel().getBlockState(tile.getBlockPos().offset(0, -1, 0)); + if (!block.getFluidState().is(Fluids.EMPTY)) { + pumpingFluid = block.getFluidState().getType(); + + CompoundTag tag = new CompoundTag(); + new FluidStack(pumpingFluid, 1).writeToNBT(tag); + tile.setCompoundTag("selected_fluid", tag); + lX = -22; + lY = -1; + lZ = -22; + tile.setData("lx", lX); + tile.setData("ly", lY); + tile.setData("lz", lZ); + } + } else { + pumpingFluid = FluidStack.loadFluidStackFromNBT(fluidTag).getFluid(); + } + if (pumpingFluid == null) { + VoluminousEnergy.LOGGER.info("Pumping fluid is null!"); + return false; + } + + Level level = tile.getLevel(); + if (lX < 22) { + lX++; + BlockState state = level.getBlockState(tile.getBlockPos().offset(lX, lY, lZ)); + if (pumpingFluid.isSame(state.getFluidState().getType())) { + addFluidToTank(tile,pumpingFluid); + return true; + } + + } else if (lZ < 22) { + lZ++; + lX = -22; + if (pumpingFluid.isSame(level.getBlockState(tile.getBlockPos().offset(lX, lY, lZ)).getFluidState().getType())) { + addFluidToTank(tile,pumpingFluid); + return true; + } + } else if (tile.getBlockPos().offset(0, lY, 0).getY() > level.dimensionType().minY()) { + lY--; + lX = -22; + lZ = -22; + if (pumpingFluid.isSame(level.getBlockState(tile.getBlockPos().offset(lX, lY, lZ)).getFluidState().getType())) { + addFluidToTank(tile,pumpingFluid); + return true; + } + } + return false; + } + + + void addFluidToTank(VETileEntity tile,Fluid fluid) { + tile.getLevel().setBlockAndUpdate(tile.getBlockPos().offset(lX, lY, lZ), Blocks.AIR.defaultBlockState()); + tile.consumeEnergy(); + tile.getTank(0).getTank() + .fill(new FluidStack(fluid, 1000), IFluidHandler.FluidAction.EXECUTE); + } +} From 2233c45d480e6b026b112f41788e63a817136460 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Mon, 8 Apr 2024 04:00:34 -0400 Subject: [PATCH 13/27] Updated the sawmill. --- .../blocks/blocks/machines/SawmillBlock.java | 6 +- .../blocks/screens/SawmillScreen.java | 6 +- .../blocks/tiles/SawmillTile.java | 16 +- .../blocks/tiles/VETileEntities.java | 2 + .../compat/jei/VoluminousEnergyPlugin.java | 2 +- .../compat/jei/category/SawmillCategory.java | 12 +- ...dSawmillRecipe.java => SawmillRecipe.java} | 45 +++--- .../voluminousenergy/recipe/VERecipes.java | 2 +- .../recipe/parser/AbstractRecipeParser.java | 64 ++++++++ .../recipe/parser/HydroponicParser.java | 1 + .../recipe/parser/RNGRecipeParser.java | 1 + .../recipe/parser/RecipeParser.java | 95 ++++------- .../recipe/parser/SawmillParser.java | 151 ++++++++++++++++++ .../util/recipe/RecipeUtil.java | 38 ++--- .../recipes/sawmilling/all_planks.json | 14 +- 15 files changed, 323 insertions(+), 132 deletions(-) rename src/main/java/com/veteam/voluminousenergy/recipe/{VEFluidSawmillRecipe.java => SawmillRecipe.java} (69%) create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/parser/AbstractRecipeParser.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java index 03a428065..71038e9ca 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlock; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.SawmillTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; @@ -75,13 +75,13 @@ public MenuProvider getMenuProvider(BlockState p_57105_, Level p_57106_, BlockPo @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { // Replaces old createBlockEntity method - return new SawmillTile(pos, state); + return VETileEntities.SAWMILL_FACTORY.create(pos, state); } // NEW TICK SYSTEM @Nullable protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { - return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, SawmillTile::serverTick); + return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, VETileEntity::serverTick); } public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java index d9389e934..e2394f480 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.SawmillTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; @@ -19,14 +19,14 @@ import java.util.List; public class SawmillScreen extends VEContainerScreen { - private SawmillTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/sawmill_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public SawmillScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (SawmillTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java index 95a5eefe7..d25390732 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.VEFluidSawmillRecipe; +import com.veteam.voluminousenergy.recipe.SawmillRecipe; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; @@ -67,11 +67,11 @@ public List getSlotManagers() { } public SawmillTile(BlockPos pos, BlockState state) { - super(VEBlocks.SAWMILL_TILE.get(), pos, state, com.veteam.voluminousenergy.recipe.VEFluidSawmillRecipe.RECIPE_TYPE); + super(VEBlocks.SAWMILL_TILE.get(), pos, state, SawmillRecipe.RECIPE_TYPE); outputTank.setAllowAny(true); } - VEFluidSawmillRecipe recipe; + SawmillRecipe recipe; @Override public void tick() { @@ -182,7 +182,7 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate }; } - private void coreTickProcessing(@Nullable VEFluidSawmillRecipe VEFluidSawmillRecipe, + private void coreTickProcessing(@Nullable SawmillRecipe SawmillRecipe, ItemStack logInput, ItemStack resolvedPlankOutput, ItemStack secondItemOutput, @@ -191,7 +191,7 @@ private void coreTickProcessing(@Nullable VEFluidSawmillRecipe VEFluidSawmillRec if (counter == 1) { // Core processing occurs here - inventory.extractItem(0, (VEFluidSawmillRecipe != null ? VEFluidSawmillRecipe.getIngredient(0).getItems()[0].getCount() : Config.SAWMILL_LOG_CONSUMPTION_RATE.get()), false); // Extract log + inventory.extractItem(0, (SawmillRecipe != null ? SawmillRecipe.getIngredient(0).getItems()[0].getCount() : Config.SAWMILL_LOG_CONSUMPTION_RATE.get()), false); // Extract log // Plank output ItemStack currentPlankStack = inventory.getStackInSlot(1); @@ -237,8 +237,8 @@ private void coreTickProcessing(@Nullable VEFluidSawmillRecipe VEFluidSawmillRec } } } else { - counter = VEFluidSawmillRecipe != null - ? updateCounter(VEFluidSawmillRecipe.getProcessTime()) // Sawmill recipe not null + counter = SawmillRecipe != null + ? updateCounter(SawmillRecipe.getProcessTime()) // Sawmill recipe not null : updateCounter(Config.SAWMILL_PROCESSING_TIME.get()); // Use default values when null length = counter; } @@ -265,6 +265,6 @@ public FluidStack getFluidStackFromTank(int num) { @Override public RecipeType> getRecipeType() { - return VEFluidSawmillRecipe.RECIPE_TYPE; + return SawmillRecipe.RECIPE_TYPE; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index dd366c757..6b9818ea1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -308,6 +308,8 @@ public class VETileEntities { .addEnergyStorage( Config.SAWMILL_MAX_POWER.get(), Config.SAWMILL_TRANSFER.get() + ).addTanks( + new FluidOutputTank(0, DEFAULT_TANK_CAPACITY) ) .countable() .makesSound() diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java index a608a98a7..138bdf8a0 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java @@ -100,7 +100,7 @@ public void registerRecipes(IRecipeRegistration registration) {// Add recipes registration.addRecipes(ImplosionCompressionCategory.RECIPE_TYPE, getRecipesOfType(ImplosionCompressorRecipe.RECIPE_TYPE)); registration.addRecipes(IndustrialBlastingCategory.RECIPE_TYPE, getRecipesOfType(IndustrialBlastingRecipe.RECIPE_TYPE)); registration.addRecipes(ToolingCategory.RECIPE_TYPE, getRecipesOfType(ToolingRecipe.RECIPE_TYPE)); - registration.addRecipes(SawmillCategory.RECIPE_TYPE, getRecipesOfType(VEFluidSawmillRecipe.RECIPE_TYPE)); + registration.addRecipes(SawmillCategory.RECIPE_TYPE, getRecipesOfType(SawmillRecipe.RECIPE_TYPE)); registration.addRecipes(FluidElectrolyzingCategory.RECIPE_TYPE, getRecipesOfType(FluidElectrolyzerRecipe.RECIPE_TYPE)); registration.addRecipes(FluidMixingCategory.RECIPE_TYPE, getRecipesOfType(FluidMixerRecipe.RECIPE_TYPE)); registration.addRecipes(PrimitiveBlastingCategory.RECIPE_TYPE, getRecipesOfType(PrimitiveBlastFurnaceRecipe.RECIPE_TYPE)); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/SawmillCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/SawmillCategory.java index 06530d86d..3297f0f15 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/SawmillCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/SawmillCategory.java @@ -3,7 +3,7 @@ import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.compat.jei.VoluminousEnergyPlugin; -import com.veteam.voluminousenergy.recipe.VEFluidSawmillRecipe; +import com.veteam.voluminousenergy.recipe.SawmillRecipe; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.RegistryLookups; import com.veteam.voluminousenergy.util.TextUtil; @@ -34,14 +34,14 @@ import java.util.Arrays; import java.util.concurrent.atomic.AtomicReference; -public class SawmillCategory implements IRecipeCategory { +public class SawmillCategory implements IRecipeCategory { private final IDrawable background; private IDrawable icon; private IDrawable slotDrawable; private IDrawable arrow; private IDrawable emptyArrow; - public static final RecipeType RECIPE_TYPE = new RecipeType(VoluminousEnergyPlugin.SAWMILL_UID, VEFluidSawmillRecipe.class); + public static final RecipeType RECIPE_TYPE = new RecipeType(VoluminousEnergyPlugin.SAWMILL_UID, SawmillRecipe.class); //protected static ArrayList> logPlankPairList = new ArrayList<>(); @@ -76,7 +76,7 @@ public IDrawable getIcon() { } @Override - public void draw(VEFluidSawmillRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics matrixStack, double mouseX, double mouseY) { + public void draw(SawmillRecipe recipe, IRecipeSlotsView recipeSlotsView, GuiGraphics matrixStack, double mouseX, double mouseY) { slotDrawable.draw(matrixStack, 2, 10); slotDrawable.draw(matrixStack, 48, 1); slotDrawable.draw(matrixStack, 48, 19); @@ -85,7 +85,7 @@ public void draw(VEFluidSawmillRecipe recipe, IRecipeSlotsView recipeSlotsView, emptyArrow.draw(matrixStack, 24, 11); } - public void ingredientHandler(VEFluidSawmillRecipe recipe, + public void ingredientHandler(SawmillRecipe recipe, IIngredientAcceptor inputItemAcceptor, IIngredientAcceptor primaryItemOutputAcceptor, IIngredientAcceptor secondaryItemOutputAcceptor, @@ -140,7 +140,7 @@ public void ingredientHandler(VEFluidSawmillRecipe recipe, } @Override - public void setRecipe(IRecipeLayoutBuilder recipeLayout, VEFluidSawmillRecipe recipe, IFocusGroup focusGroup) { + public void setRecipe(IRecipeLayoutBuilder recipeLayout, SawmillRecipe recipe, IFocusGroup focusGroup) { IRecipeSlotBuilder inputItem = recipeLayout.addSlot(RecipeIngredientRole.INPUT, 3, 11); IRecipeSlotBuilder primaryOutputItem = recipeLayout.addSlot(RecipeIngredientRole.OUTPUT, 49, 2); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java similarity index 69% rename from src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java rename to src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java index 8b346ab9d..82215eff0 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java @@ -2,8 +2,10 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; +import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.SawmillParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; @@ -21,47 +23,54 @@ import javax.annotation.Nullable; import java.util.List; -public class VEFluidSawmillRecipe extends VERecipe { +public class SawmillRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.SAWMILLING.get(); private boolean isLogRecipe; - public VEFluidSawmillRecipe() { + private final RecipeParser parser = + new SawmillParser(this) + .addIngredient(0,0) + .addFluidResult(0,0) + .addItemResult(1,0) + .addItemResult(2,1); + + public SawmillRecipe() { } - public VEFluidSawmillRecipe(List i, List of, List oi, int processTime, boolean isLogRecipe) { + public SawmillRecipe(List i, List of, List oi, int processTime, boolean isLogRecipe) { super(i, List.of(), of, oi, processTime); this.isLogRecipe = isLogRecipe; } - private static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { + private static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { - public static final Codec VE_RECIPE_CODEC = RecordCodecBuilder.create((instance) -> instance.group( + public static final Codec VE_RECIPE_CODEC = RecordCodecBuilder.create((instance) -> instance.group( VERecipeCodecs.VE_LAZY_INGREDIENT_CODEC.listOf().fieldOf("ingredients").forGetter((getter) -> getter.registryIngredients), VERecipeCodecs.VE_OUTPUT_FLUID_CODEC.listOf().fieldOf("fluid_results").forGetter((getter) -> getter.fluidOutputList), ItemStack.ITEM_WITH_COUNT_CODEC.listOf().fieldOf("item_results").forGetter((getter) -> getter.results), Codec.INT.fieldOf("process_time").forGetter((getter) -> getter.processTime), - Codec.BOOL.fieldOf("is_log_recipe").forGetter(VEFluidSawmillRecipe::isLogRecipe) - ).apply(instance, VEFluidSawmillRecipe::new)); + Codec.BOOL.fieldOf("is_log_recipe").forGetter(SawmillRecipe::isLogRecipe) + ).apply(instance, SawmillRecipe::new)); - private static final FluidSerializerHelper helper = new FluidSerializerHelper<>(); + private static final FluidSerializerHelper helper = new FluidSerializerHelper<>(); @Nullable @Override - public VEFluidSawmillRecipe fromNetwork(@NotNull FriendlyByteBuf buffer) { - VEFluidSawmillRecipe recipe = new VEFluidSawmillRecipe(); + public SawmillRecipe fromNetwork(@NotNull FriendlyByteBuf buffer) { + SawmillRecipe recipe = new SawmillRecipe(); recipe.isLogRecipe = buffer.readBoolean(); - return helper.fromNetwork(new VEFluidSawmillRecipe(), buffer); + return helper.fromNetwork(new SawmillRecipe(), buffer); } @Override - public @NotNull Codec codec() { + public @NotNull Codec codec() { return VE_RECIPE_CODEC; } @Override - public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull VEFluidSawmillRecipe recipe) { + public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull SawmillRecipe recipe) { buffer.writeBoolean(recipe.isLogRecipe); helper.toNetwork(buffer, recipe); } @@ -96,17 +105,9 @@ public List getOutputFluids() { return super.getOutputFluids(); } - @Override - public FluidStack getOutputFluid(int slot) { - if (this.isLogRecipe && Config.SAWMILL_ALLOW_NON_SAWMILL_RECIPE_LOGS_TO_BE_SAWED.get()) { - return this.getOutputFluid(0); - } - return super.getOutputFluid(slot); - } - @Override public RecipeParser getParser() { - return null; + return parser; } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java index d95f9a183..05346cb15 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipes.java @@ -98,7 +98,7 @@ public static final class VERecipeTypes { public static final RegistryObject> TOOLING = VE_RECIPE_SERIALIZERS_REGISTRY.register("tooling", () -> new ToolingRecipe().getSerializer()); public static final RegistryObject> SAWMILLING = - VE_RECIPE_SERIALIZERS_REGISTRY.register("sawmilling", () -> new VEFluidSawmillRecipe().getSerializer()); + VE_RECIPE_SERIALIZERS_REGISTRY.register("sawmilling", () -> new SawmillRecipe().getSerializer()); public static final RegistryObject> DIMENSIONAL_LASING = VE_RECIPE_SERIALIZERS_REGISTRY.register("dimensional_lasing", () -> new DimensionalLaserRecipe().getSerializer()); public static final RegistryObject> FLUID_ELECTROLYZING = diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/AbstractRecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/AbstractRecipeParser.java new file mode 100644 index 000000000..6d988d7a2 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/AbstractRecipeParser.java @@ -0,0 +1,64 @@ +package com.veteam.voluminousenergy.recipe.parser; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; +import net.minecraft.world.item.ItemStack; + +/** + * A recipe parser system for taking a recipe and translating it into something more consumable + */ +public interface AbstractRecipeParser { + + /** + * @param tile The tile entity that is being checked + * @return returns true if the recipe partially matches. + * This means that AIR and EMPTY for items and fluids respectively are ignored + */ + boolean isPartialRecipe(VETileEntity tile); + + /** + * @param tile The tile to check + * @return returns true if the recipe is completed. You must validate your + * input amounts here or else risk over-insertion. + */ + boolean isCompleteRecipe(VETileEntity tile); + + /** + * @param tile The tile to check + * @return returns true if the tile has enough space in the output + * to insert the finished product. Note that making this fail + * for any other reason can cause a 99% deadlock. If your tile + * is deadlocking at recipe completion this is probably why. + */ + boolean canCompleteRecipe(VETileEntity tile); + + /** + * This code will be called when your recipe has been validated using + * {@link #canCompleteRecipe(VETileEntity)}. Thus insuring that amounts, inputs, outputs, are all valid + * and ready to be added to / subtracted from. When called it should handle + * all the processing required. + * + * @param tile The tile to complete the recipe for + */ + void completeRecipe(VETileEntity tile); + + /** + * This a copy of the ItemHandlers isItemValid. This will be called to + * validate item IO for the {@link VEItemStackHandler}. You should also + * check NBT data like in {@link com.veteam.voluminousenergy.recipe.processor.DimensionalLaserRecipeProcessor} + * + * @param slot the slot position in the tile inventory + * @param stack The stack to be inserted + * @return If the item is valid given the Parsers context + */ + boolean canInsertItem(int slot, ItemStack stack); + + /** + * A simple util record to help with readability + * @param tilePos The position of the item/fluid/etc within the tile (ie tank 0) + * @param recipePos The position of the item/fluid/etc within the recipe (ie result 0) + */ + record SlotAndRecipePos(int tilePos, int recipePos) { + + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java index 61b04f49e..1cf038851 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java @@ -4,6 +4,7 @@ import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.recipe.parser.AbstractRecipeParser.SlotAndRecipePos; import net.minecraft.world.item.ItemStack; import net.minecraftforge.fluids.FluidStack; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java index b5fa3c3e1..2bcec6e4f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java @@ -4,6 +4,7 @@ import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.recipe.parser.AbstractRecipeParser.SlotAndRecipePos; import net.minecraft.world.item.ItemStack; import java.util.ArrayList; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java index add8e9f19..202d4d223 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java @@ -3,6 +3,7 @@ import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.recipe.parser.AbstractRecipeParser.SlotAndRecipePos; import com.veteam.voluminousenergy.util.recipe.FluidIngredient; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; @@ -12,10 +13,6 @@ import java.util.ArrayList; import java.util.List; - -/** - * A recipe parser system for taking a recipe and translating it into something more consumable - */ public class RecipeParser { List ingredientPositions = new ArrayList<>(); @@ -49,23 +46,18 @@ public RecipeParser addFluidResult(int tilePos, int recipePos) { return this; } - /** - * @param tile The tile entity that is being checked - * @return returns true if the recipe partially matches. - * This means that AIR and EMPTY for items and fluids respectively are ignored - */ public boolean isPartialRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : ingredientPositions) { - ItemStack stackInSlot = tile.getStackInSlot(pos.tilePos); - Ingredient ingredient = recipe.getIngredient(pos.recipePos); + ItemStack stackInSlot = tile.getStackInSlot(pos.tilePos()); + Ingredient ingredient = recipe.getIngredient(pos.recipePos()); if (stackInSlot.isEmpty()) continue; if (ingredient.test(stackInSlot)) continue; return false; } for (SlotAndRecipePos pos : fluidIngredientPositions) { - FluidStack stack = tile.getFluidStackFromTank(pos.tilePos); - FluidIngredient fluidIngredient = recipe.getFluidIngredient(pos.recipePos); + FluidStack stack = tile.getFluidStackFromTank(pos.tilePos()); + FluidIngredient fluidIngredient = recipe.getFluidIngredient(pos.recipePos()); if (stack.isEmpty()) continue; if (fluidIngredient.test(stack)) continue; return false; @@ -73,24 +65,19 @@ public boolean isPartialRecipe(VETileEntity tile) { return true; } - /** - * @param tile The tile to check - * @return returns true if the recipe is completed. You must validate your - * input amounts here or else risk over-insertion. - */ public boolean isCompleteRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : ingredientPositions) { - ItemStack stackInSlot = tile.getStackInSlot(pos.tilePos); - Ingredient ingredient = recipe.getIngredient(pos.recipePos); - int amountNeeded = recipe.getIngredientCount(pos.recipePos); + ItemStack stackInSlot = tile.getStackInSlot(pos.tilePos()); + Ingredient ingredient = recipe.getIngredient(pos.recipePos()); + int amountNeeded = recipe.getIngredientCount(pos.recipePos()); if (ingredient.isEmpty()) continue; if (!ingredient.test(stackInSlot) || stackInSlot.getCount() < amountNeeded) return false; } for (SlotAndRecipePos pos : fluidIngredientPositions) { - FluidStack stack = tile.getFluidStackFromTank(pos.tilePos); - FluidIngredient fluidIngredient = recipe.getFluidIngredient(pos.recipePos); + FluidStack stack = tile.getFluidStackFromTank(pos.tilePos()); + FluidIngredient fluidIngredient = recipe.getFluidIngredient(pos.recipePos()); if (fluidIngredient.isEmpty()) continue; int amountNeeded = fluidIngredient.getAmountNeeded(); if (!fluidIngredient.test(stack) || stack.getAmount() < amountNeeded) @@ -99,95 +86,69 @@ public boolean isCompleteRecipe(VETileEntity tile) { return true; } - /** - * @param tile The tile to check - * @return returns true if the tile has enough space in the output - * to insert the finished product. Note that making this fail - * for any other reason can cause a 99% deadlock. If your tile - * is deadlocking at recipe completion this is probably why. - */ + public boolean canCompleteRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : itemResultPositions) { - ItemStack stack = tile.getStackInSlot(pos.tilePos); - ItemStack result = recipe.getResult(pos.recipePos); + ItemStack stack = tile.getStackInSlot(pos.tilePos()); + ItemStack result = recipe.getResult(pos.recipePos()); if (stack.isEmpty()) continue; if (!stack.is(result.getItem()) || result.getCount() + stack.getCount() > result.getMaxStackSize()) return false; } for (SlotAndRecipePos pos : fluidResultPositions) { - FluidStack stack = tile.getFluidStackFromTank(pos.tilePos); - FluidStack result = recipe.getOutputFluid(pos.recipePos); + FluidStack stack = tile.getFluidStackFromTank(pos.tilePos()); + FluidStack result = recipe.getOutputFluid(pos.recipePos()); if (stack.isEmpty()) continue; - if (!stack.isFluidEqual(result) || result.getAmount() + stack.getAmount() > tile.getTankCapacity(pos.tilePos)) + if (!stack.isFluidEqual(result) || result.getAmount() + stack.getAmount() > tile.getTankCapacity(pos.tilePos())) return false; } return true; } - /** - * This code will be called when your recipe has been validated using - * {@link #canCompleteRecipe(VETileEntity)}. Thus insuring that amounts, inputs, outputs, are all valid - * and ready to be added to / subtracted from. When called it should handle - * all the processing required. - * - * @param tile The tile to complete the recipe for - */ public void completeRecipe(VETileEntity tile) { VEItemStackHandler handler = tile.getInventory(); // Subtract the amounts for (SlotAndRecipePos pos : ingredientPositions) { - handler.extractItem(pos.tilePos, recipe.getIngredientCount(pos.recipePos), false); + handler.extractItem(pos.tilePos(), recipe.getIngredientCount(pos.recipePos()), false); } for (SlotAndRecipePos pos : fluidIngredientPositions) { - tile.getTank(pos.tilePos) - .getTank().drain(recipe.getFluidIngredientAmount(pos.recipePos), IFluidHandler.FluidAction.EXECUTE); + tile.getTank(pos.tilePos()) + .getTank().drain(recipe.getFluidIngredientAmount(pos.recipePos()), IFluidHandler.FluidAction.EXECUTE); } // Insert the results for (SlotAndRecipePos pos : itemResultPositions) { - ItemStack result = recipe.getResult(pos.recipePos); - handler.insertItem(pos.tilePos, result.copy(), false); + ItemStack result = recipe.getResult(pos.recipePos()); + handler.insertItem(pos.tilePos(), result.copy(), false); } for (SlotAndRecipePos pos : fluidResultPositions) { - FluidStack result = recipe.getOutputFluid(pos.recipePos); - tile.getTank(pos.tilePos).fillTank(result.copy()); + FluidStack result = recipe.getOutputFluid(pos.recipePos()); + tile.getTank(pos.tilePos()).fillTank(result.copy()); } // mark fluid IO as dirty tile.markFluidInputDirty(); } - /** - * This a copy of the ItemHandlers isItemValid. This will be called to - * validate item IO for the {@link VEItemStackHandler}. You should also - * check NBT data like in {@link com.veteam.voluminousenergy.recipe.processor.DimensionalLaserRecipeProcessor} - * - * @param slot the slot position in the tile inventory - * @param stack The stack to be inserted - * @return If the item is valid given the Parsers context - */ + public boolean canInsertItem(int slot, ItemStack stack) { for (SlotAndRecipePos pos : ingredientPositions) { - if (pos.tilePos == slot) { - Ingredient recipeIngredient = recipe.getIngredient(pos.recipePos); + if (pos.tilePos() == slot) { + Ingredient recipeIngredient = recipe.getIngredient(pos.recipePos()); return recipeIngredient.test(stack); } } for (SlotAndRecipePos pos : itemResultPositions) { - if (pos.tilePos == slot) { - ItemStack itemStack = recipe.getResult(pos.recipePos); + if (pos.tilePos() == slot) { + ItemStack itemStack = recipe.getResult(pos.recipePos()); return itemStack.is(stack.getItem()); } } return false; } - - record SlotAndRecipePos(int tilePos, int recipePos) { - - } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java new file mode 100644 index 000000000..482978f14 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java @@ -0,0 +1,151 @@ +package com.veteam.voluminousenergy.recipe.parser; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.SawmillRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.util.RegistryLookups; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.registries.ForgeRegistries; +import org.jetbrains.annotations.Nullable; + +import java.util.HashMap; + +public class SawmillParser extends RecipeParser { + + private final HashMap cache = new HashMap<>(); + private final SawmillRecipe recipe; + + public SawmillParser(VERecipe recipe) { + super(recipe); + this.recipe = (SawmillRecipe) recipe; + } + + @Override + public boolean isPartialRecipe(VETileEntity tile) { + if (recipe.isLogRecipe()) { + ItemStack stack = tile.getStackInSlot(0); + if (stack.isEmpty()) return true; + return getPlankFromLog(tile) != null; + } + return super.isPartialRecipe(tile); + } + + @Override + public boolean isCompleteRecipe(VETileEntity tile) { + if (recipe.isLogRecipe()) { + return getPlankFromLog(tile) != null; + } + return super.isCompleteRecipe(tile); + } + + @Nullable + ItemStack getPlankFromLog(VETileEntity tile) { + ItemStack stack = tile.getStackInSlot(0); + String path = RegistryLookups.lookupItem(stack).getPath(); + if (path.endsWith("_log")) { + String id = path.replace("_log", ""); + if (getCache().containsKey(id)) { + LogPlank plank = getCache().get(id); + return plank.log.is(stack.getItem()) ? plank.plank : null; + } + } + return null; + } + + @Override + public boolean canCompleteRecipe(VETileEntity tile) { + if (recipe.isLogRecipe()) { + ItemStack plank = getPlankFromLog(tile); + ItemStack plankOutput = tile.getStackInSlot(1); + ItemStack dustOutput = tile.getStackInSlot(2); + boolean plankValid = plankOutput.isEmpty() || plank.is(plankOutput.getItem()); + boolean dustValid = dustOutput.isEmpty() || dustOutput.is(recipe.getResult(0).getItem()); + return plankValid && dustValid && tile.getTank(0).canInsertOutputFluid(recipe,0); + } + return super.canCompleteRecipe(tile); + } + + @Override + public void completeRecipe(VETileEntity tile) { + if (recipe.isLogRecipe()) { + ItemStack plank = getPlankFromLog(tile); + ItemStack dust = recipe.getResult(0); + FluidStack stack = recipe.getOutputFluid(0); + tile.getInventory().extractItem(0,1,false); + tile.getInventory().insertItem(1,plank.copy(), false); + tile.getInventory().insertItem(2,dust.copy(), false); + tile.getTank(0).fillTank(stack.copy()); + return; + } + super.completeRecipe(tile); + } + + @Override + public boolean canInsertItem(int slot, ItemStack stack) { + if (recipe.isLogRecipe() && Config.SAWMILL_ALLOW_NON_SAWMILL_RECIPE_LOGS_TO_BE_SAWED.get()) { + if (slot == 0) { + String path = RegistryLookups.lookupItem(stack.getItem()).getPath(); + return path.endsWith("_log"); + } + return true; + } + return super.canInsertItem(slot, stack); + } + + HashMap getCache() { + if (cache.isEmpty()) buildCache(); + return cache; + } + + void buildCache() { + ForgeRegistries.ITEMS.getValues().forEach(registeredItem -> { + String path = RegistryLookups.lookupItem(registeredItem).getPath(); + if (path.startsWith("stripped_")) return; + if (path.endsWith("_log")) { + String logName = path.replace("_log", ""); + if (cache.containsKey(logName)) { + cache.get(logName).log = new ItemStack(registeredItem, Config.SAWMILL_LOG_CONSUMPTION_RATE.get()); + } else { + LogPlank logPlank = new LogPlank(); + logPlank.log = new ItemStack(registeredItem, Config.SAWMILL_LOG_CONSUMPTION_RATE.get()); + cache.put(logName, logPlank); + } + } else if (path.endsWith("_planks")) { + String logName = path.replace("_planks", ""); + if (cache.containsKey(logName)) { + cache.get(logName).plank = new ItemStack(registeredItem, Config.SAWMILL_PRIMARY_OUTPUT_COUNT.get()); + } else { + LogPlank logPlank = new LogPlank(); + logPlank.plank = new ItemStack(registeredItem, Config.SAWMILL_PRIMARY_OUTPUT_COUNT.get()); + cache.put(logName, logPlank); + } + } + }); + } + + private static class LogPlank { + ItemStack log; + ItemStack plank; + + public LogPlank() { + } + + public ItemStack getLog() { + return log; + } + + public void setLog(ItemStack log) { + this.log = log; + } + + public ItemStack getPlank() { + return plank; + } + + public void setPlank(ItemStack plank) { + this.plank = plank; + } + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeUtil.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeUtil.java index 0d8d021c7..f71877f97 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeUtil.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/RecipeUtil.java @@ -5,7 +5,7 @@ import com.veteam.voluminousenergy.recipe.CrusherRecipe; import com.veteam.voluminousenergy.recipe.StirlingGeneratorRecipe; import com.veteam.voluminousenergy.recipe.ToolingRecipe; -import com.veteam.voluminousenergy.recipe.VEFluidSawmillRecipe; +import com.veteam.voluminousenergy.recipe.SawmillRecipe; import com.veteam.voluminousenergy.util.RegistryLookups; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; @@ -101,15 +101,15 @@ public static ArrayList getLogFromPlankParallel(Level world, ItemStac return atomicItemStackArray.get(); } - public static VEFluidSawmillRecipe getSawmillingRecipeFromLog(Level world, ItemStack logStack) { // Parallel by default + public static SawmillRecipe getSawmillingRecipeFromLog(Level world, ItemStack logStack) { // Parallel by default if (logStack.isEmpty()) return null; - AtomicReference atomicRecipe = new AtomicReference<>(null); + AtomicReference atomicRecipe = new AtomicReference<>(null); world.getRecipeManager().getRecipes().parallelStream().forEach(recipe -> { - if (recipe.value() instanceof VEFluidSawmillRecipe VEFluidSawmillRecipe) { - if (!VEFluidSawmillRecipe.isLogRecipe()) { - for (ItemStack ingredientStack : VEFluidSawmillRecipe.getIngredient(0).getItems()) { + if (recipe.value() instanceof SawmillRecipe SawmillRecipe) { + if (!SawmillRecipe.isLogRecipe()) { + for (ItemStack ingredientStack : SawmillRecipe.getIngredient(0).getItems()) { if (ingredientStack.getItem().equals(logStack.getItem())) { - atomicRecipe.set(VEFluidSawmillRecipe); + atomicRecipe.set(SawmillRecipe); break; } } @@ -120,15 +120,15 @@ public static VEFluidSawmillRecipe getSawmillingRecipeFromLog(Level world, ItemS return atomicRecipe.get(); } - public static VEFluidSawmillRecipe getSawmillingRecipeFromPlank(Level world, ItemStack plankStack) { // Parallel by default + public static SawmillRecipe getSawmillingRecipeFromPlank(Level world, ItemStack plankStack) { // Parallel by default if (plankStack.isEmpty()) return null; - AtomicReference atomicRecipe = new AtomicReference<>(null); + AtomicReference atomicRecipe = new AtomicReference<>(null); world.getRecipeManager().getRecipes().parallelStream().forEach(recipe -> { - if (recipe.value() instanceof VEFluidSawmillRecipe VEFluidSawmillRecipe) { - if (!VEFluidSawmillRecipe.isLogRecipe()) { - if (VEFluidSawmillRecipe.getResult(0).getItem().equals(plankStack.getItem())) { - atomicRecipe.set(VEFluidSawmillRecipe); + if (recipe.value() instanceof SawmillRecipe SawmillRecipe) { + if (!SawmillRecipe.isLogRecipe()) { + if (SawmillRecipe.getResult(0).getItem().equals(plankStack.getItem())) { + atomicRecipe.set(SawmillRecipe); } } } @@ -137,16 +137,16 @@ public static VEFluidSawmillRecipe getSawmillingRecipeFromPlank(Level world, Ite return atomicRecipe.get(); } - public static VEFluidSawmillRecipe getSawmillingRecipeFromSecondOutput(Level level, ItemStack itemStack) { + public static SawmillRecipe getSawmillingRecipeFromSecondOutput(Level level, ItemStack itemStack) { if (itemStack.isEmpty()) return null; - AtomicReference atomicRecipe = new AtomicReference<>(null); + AtomicReference atomicRecipe = new AtomicReference<>(null); level.getRecipeManager().getRecipes().parallelStream().forEach(recipe -> { - if (recipe.value() instanceof VEFluidSawmillRecipe VEFluidSawmillRecipe) { - if (!VEFluidSawmillRecipe.isLogRecipe()) { - Item item = VEFluidSawmillRecipe.getResult(0).getItem(); + if (recipe.value() instanceof SawmillRecipe SawmillRecipe) { + if (!SawmillRecipe.isLogRecipe()) { + Item item = SawmillRecipe.getResult(0).getItem(); if (itemStack.getItem().equals(item)) { - atomicRecipe.set(VEFluidSawmillRecipe); + atomicRecipe.set(SawmillRecipe); } } } diff --git a/src/main/resources/data/voluminousenergy/recipes/sawmilling/all_planks.json b/src/main/resources/data/voluminousenergy/recipes/sawmilling/all_planks.json index 3de33bd47..128080634 100644 --- a/src/main/resources/data/voluminousenergy/recipes/sawmilling/all_planks.json +++ b/src/main/resources/data/voluminousenergy/recipes/sawmilling/all_planks.json @@ -3,6 +3,16 @@ "is_log_recipe": true, "ingredients": [], "process_time": 200, - "item_results": [], - "fluid_results": [] + "item_results": [ + { + "item": "voluminousenergy:saw_dust", + "count": 1 + } + ], + "fluid_results": [ + { + "fluid": "voluminousenergy:tree_sap", + "amount": 250 + } + ] } \ No newline at end of file From f6142138cfbc727df3fe9ede7c45e3c617172a67 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Mon, 8 Apr 2024 21:17:53 -0400 Subject: [PATCH 14/27] Fixed CombustionGenerator --- .../voluminousenergy/VoluminousEnergy.java | 4 - .../machines/CombustionGeneratorBlock.java | 4 +- .../screens/CombustionGeneratorScreen.java | 10 +- .../blocks/tiles/CombustionGeneratorTile.java | 193 ------------- .../blocks/tiles/SawmillTile.java | 270 ------------------ .../blocks/tiles/VETileEntities.java | 2 +- .../blocks/tiles/VETileEntity.java | 2 +- .../jei/category/CombustionCategory.java | 161 +++++------ .../events/VEClientSideListener.java | 25 +- .../events/VERecipeReloadListener.java | 16 -- .../events/VEServerSideListener.java | 26 +- .../items/data/CombustibleFluidsData.java | 78 +++++ .../items/data/CustomDataLoader.java | 5 + .../items/data/OxidizerFluidsData.java | 82 ++++++ .../voluminousenergy/recipe/RecipeCache.java | 1 + .../voluminousenergy/recipe/VERecipe.java | 2 - .../recipe/parser/SawmillParser.java | 6 +- .../CombustionGeneratorProcessor.java | 81 ++++++ .../networking/packets/BoolButtonPacket.java | 1 - .../util/recipe/VERecipeCodecs.java | 55 ++++ .../fluid_data/combustion/biofuel.json | 4 + .../fluid_data/combustion/crude_oil.json | 4 + .../fluid_data/combustion/diesel.json | 4 + .../fluid_data/combustion/gasoline.json | 4 + .../fluid_data/combustion/light_fuel.json | 4 + .../fluid_data/combustion/liquefied_coal.json | 4 + .../fluid_data/combustion/liquefied_coke.json | 4 + .../fluid_data/combustion/naphtha.json | 4 + .../fluid_data/combustion/nitroglycerin.json | 4 + .../fluid_data/combustion/treethanol.json | 4 + .../fluid_data/oxidizers/compressed_air.json | 4 + .../oxidizers/dinitrogen_tetroxide.json | 4 + .../fluid_data/oxidizers/oxygen.json | 4 + .../{combustible.json => biofuel.json} | 2 +- .../recipes/fuel_combustion/crude_oil.json | 13 + .../recipes/fuel_combustion/diesel.json | 13 + .../recipes/fuel_combustion/gasoline.json | 13 + .../recipes/fuel_combustion/light_fuel.json | 13 + .../fuel_combustion/liquefied_coal.json | 13 + .../fuel_combustion/liquefied_coke.json | 13 + .../recipes/fuel_combustion/naphtha.json | 13 + .../fuel_combustion/nitroglycerin.json | 13 + .../recipes/fuel_combustion/treethanol.json | 13 + .../oxidizer_combustion/compressed_air.json | 10 - .../dinitrogen_tetroxide.json | 10 - .../recipes/oxidizer_combustion/oxygen.json | 10 - 46 files changed, 607 insertions(+), 618 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/events/VERecipeReloadListener.java create mode 100644 src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java create mode 100644 src/main/java/com/veteam/voluminousenergy/items/data/CustomDataLoader.java create mode 100644 src/main/java/com/veteam/voluminousenergy/items/data/OxidizerFluidsData.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/combustion/biofuel.json create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/combustion/crude_oil.json create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/combustion/diesel.json create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/combustion/gasoline.json create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/combustion/light_fuel.json create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/combustion/liquefied_coal.json create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/combustion/liquefied_coke.json create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/combustion/naphtha.json create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/combustion/nitroglycerin.json create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/combustion/treethanol.json create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/oxidizers/compressed_air.json create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/oxidizers/dinitrogen_tetroxide.json create mode 100644 src/main/resources/data/voluminousenergy/fluid_data/oxidizers/oxygen.json rename src/main/resources/data/voluminousenergy/recipes/fuel_combustion/{combustible.json => biofuel.json} (80%) create mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/crude_oil.json create mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/diesel.json create mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/gasoline.json create mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/light_fuel.json create mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coal.json create mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coke.json create mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/naphtha.json create mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/nitroglycerin.json create mode 100644 src/main/resources/data/voluminousenergy/recipes/fuel_combustion/treethanol.json delete mode 100644 src/main/resources/data/voluminousenergy/recipes/oxidizer_combustion/compressed_air.json delete mode 100644 src/main/resources/data/voluminousenergy/recipes/oxidizer_combustion/dinitrogen_tetroxide.json delete mode 100644 src/main/resources/data/voluminousenergy/recipes/oxidizer_combustion/oxygen.json diff --git a/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java b/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java index 0dbb79bdc..c54634434 100644 --- a/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java +++ b/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java @@ -5,7 +5,6 @@ import com.veteam.voluminousenergy.client.renderers.entity.LaserBlockEntityRenderer; import com.veteam.voluminousenergy.datagen.VEGlobalLootModifierData; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; -import com.veteam.voluminousenergy.events.VERecipeReloadListener; import com.veteam.voluminousenergy.fluids.VEFluids; import com.veteam.voluminousenergy.items.VEBlockItems; import com.veteam.voluminousenergy.items.VEItems; @@ -21,15 +20,12 @@ import com.veteam.voluminousenergy.tools.networking.VENetwork; import com.veteam.voluminousenergy.world.feature.VEFeatures; import com.veteam.voluminousenergy.world.modifiers.VEModifiers; -import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemBlockRenderTypes; import net.minecraft.client.renderer.RenderType; import net.minecraft.core.HolderLookup; import net.minecraft.data.DataGenerator; import net.minecraft.data.PackOutput; import net.minecraft.server.MinecraftServer; -import net.minecraft.server.packs.resources.ReloadableResourceManager; -import net.minecraft.server.packs.resources.ResourceManager; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.EntityRenderersEvent; import net.minecraftforge.common.MinecraftForge; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CombustionGeneratorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CombustionGeneratorBlock.java index 2d07382d3..9dd72c1b0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CombustionGeneratorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CombustionGeneratorBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.CombustionGeneratorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -30,7 +30,7 @@ public CombustionGeneratorBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new CombustionGeneratorTile(pos, state); + return VETileEntities.COMBUSTION_GENERATOR_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java index bc9dcc6f5..b334890be 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.CombustionGeneratorTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; @@ -20,14 +20,14 @@ import java.util.List; public class CombustionGeneratorScreen extends VEContainerScreen { - private CombustionGeneratorTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/combustion_generator_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public CombustionGeneratorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (CombustionGeneratorTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -48,7 +48,7 @@ protected void init() { protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("combustion_generator"), 8, 6, WHITE_TEXT_STYLE); - TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(tileEntity.getEnergyRate() + " FE/t"), 96, 18, WHITE_TEXT_STYLE); + TextUtil.renderCenteredShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty(tileEntity.getEnergy().getProduction() + " FE/t"), 96, 18, WHITE_TEXT_STYLE); TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateString("container.inventory"), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); super.renderLabels(matrixStack, mouseX, mouseY); @@ -100,7 +100,7 @@ public List getTooltips() { return Arrays.asList( Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.percent_burned").getString() + ": " + tileEntity.progressCounterPercent() + "%"), Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.ticksLeft()), - Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergyRate() + " FE/t")); + Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.generating").getString() + ": " + tileEntity.getEnergy().getProduction() + " FE/t")); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java deleted file mode 100644 index 6cb2d5508..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java +++ /dev/null @@ -1,193 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.sounds.VESounds; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import com.veteam.voluminousenergy.util.VERelationalTank; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.sounds.SoundSource; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.energy.IEnergyStorage; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class CombustionGeneratorTile extends VETileEntity { - - List slotManagers = new ArrayList<>() { - { - add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); - add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(2, Direction.NORTH, true, SlotType.FLUID_INPUT, 3, 1)); - add(new VESlotManager(3, Direction.SOUTH, true, SlotType.FLUID_OUTPUT)); - } - }; - - private final int tankCapacity = 4000; - - public static final int COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT = 250; - List fluidManagers = new ArrayList<>() { - { - add(new VERelationalTank(new FluidTank(tankCapacity), 0, 0, TankType.INPUT, "oxidizerTank:oxidizer_tank_gui")); - add(new VERelationalTank(new FluidTank(tankCapacity), 1, 0, TankType.INPUT, "fuelTank:fuel_tank_gui")); - } - }; - private int energyRate; - - public CombustionGeneratorTile(BlockPos pos, BlockState state) { - super(VEBlocks.COMBUSTION_GENERATOR_TILE.get(), pos, state, null); - fluidManagers.get(0).getTank().setValidator(fluid -> { - List recipes = CombustionGeneratorRecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE); - return recipes.stream().anyMatch(r -> r.getFluidIngredient(0).test(fluid)); - }); - } - - private LazyOptional energyCapability = null; - - VERecipe oxidizerRecipe; - VERecipe fuelRecipe; - - @Override - public void tick() { - updateClients(); - processFluidIO(); - validateRecipe(); - - // Main Combustion Generator tick logic - if (counter > 0) { - if (energyCapability == null) { - energyCapability = this.getCapability(ForgeCapabilities.ENERGY); - } - if (energyCapability.map(IEnergyStorage::getEnergyStored).orElse(0) + energyRate <= Config.COMBUSTION_GENERATOR_MAX_POWER.get()) { - counter--; - energy.addEnergy(energyRate); //Amount of energy to add per tick - if (++sound_tick == 19) { - sound_tick = 0; - if (Config.PLAY_MACHINE_SOUNDS.get()) { - level.playSound(null, this.getBlockPos(), VESounds.GENERAL_MACHINE_NOISE, SoundSource.BLOCKS, 1.0F, 1.0F); - } - } - } - setChanged(); - } else if (!fluidManagers.get(0).getTank().isEmpty()) { - if (oxidizerRecipe != null && fuelRecipe != null) { - fluidManagers.get(0).getTank().drain(COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT, IFluidHandler.FluidAction.EXECUTE); - fluidManagers.get(1).getTank().drain(COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT, IFluidHandler.FluidAction.EXECUTE); - if (Config.COMBUSTION_GENERATOR_BALANCED_MODE.get()) { - counter = (oxidizerRecipe.getProcessTime()) / 4; - } else { - counter = Config.COMBUSTION_GENERATOR_FIXED_TICK_TIME.get() / 4; - } - energyRate = fuelRecipe.getProcessTime() / oxidizerRecipe.getProcessTime(); // Process time in fuel recipe is really volumetric energy - length = counter; - setChanged(); - } - } - - if (counter == 0) { - energyRate = 0; - } - sendOutPower(); - } - - @Override - public void load(CompoundTag tag) { - energyRate = tag.getInt("energy_rate"); - super.load(tag); - } - - @Override - public void saveAdditional(@NotNull CompoundTag tag) { - tag.putInt("energy_rate", energyRate); - super.saveAdditional(tag); - } - - public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxReceive) { - return tileEntity.getCapability(ForgeCapabilities.ENERGY, from).map(handler -> - handler.receiveEnergy(maxReceive, false)).orElse(0); - } - - void sendOutPower() { - for (Direction dir : Direction.values()) { - BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); - Direction opposite = dir.getOpposite(); - if (tileEntity != null) { - // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount - int smallest = Math.min(Config.COMBUSTION_GENERATOR_SEND.get(), energy.getEnergyStored()); - int received = receiveEnergy(tileEntity, opposite, smallest); - energy.consumeEnergy(received); - if (energy.getEnergyStored() <= 0) { - break; - } - } - } - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.COMBUSTION_GENERATOR_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } - - public int progressBurnCounterPX(int px) { - if (counter == 0) { - return 0; - } else { - return (px * (((counter * 100) / length))) / 100; - } - } - - public FluidStack getFluidStackFromTank(int num) { - if (num == 0) { - return fluidManagers.get(0).getTank().getFluid(); - } else if (num == 1) { - return fluidManagers.get(1).getTank().getFluid(); - } - return FluidStack.EMPTY; - } - - public int getTankCapacity() { - return tankCapacity; - } - - @Override - public @NotNull List getRelationalTanks() { - return fluidManagers; - } - - public int getEnergyRate() { - return energyRate; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java deleted file mode 100644 index d25390732..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java +++ /dev/null @@ -1,270 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.recipe.SawmillRecipe; -import com.veteam.voluminousenergy.sounds.VESounds; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TagUtil; -import com.veteam.voluminousenergy.util.TankType; -import com.veteam.voluminousenergy.util.VERelationalTank; -import com.veteam.voluminousenergy.util.recipe.RecipeUtil; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.sounds.SoundSource; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.BucketItem; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.world.item.crafting.Recipe; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; -import net.minecraftforge.registries.ForgeRegistries; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; - -public class SawmillTile extends VETileEntity { - - List slotManagers = new ArrayList<>() {{ -// add(new VESlotManager(0,0, Direction.UP, true, SlotType.INPUT)); -// add(new VESlotManager(1,0, Direction.DOWN, true,SlotType.OUTPUT)); -// add(new VESlotManager(2,1, Direction.NORTH, true,SlotType.OUTPUT)); - add(new VESlotManager(3, Direction.SOUTH, true, SlotType.FLUID_INPUT, 4, 0)); - add(new VESlotManager(4, Direction.EAST, true, SlotType.FLUID_OUTPUT)); - }}; - VERelationalTank outputTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.OUTPUT, "outputTank:output_tank_gui"); - private final FluidStack configuredFluidForNoRecipe = new FluidStack(Objects.requireNonNull(ForgeRegistries.FLUIDS.getValue(new ResourceLocation(Config.SAWMILL_FLUID_LOCATION.get()))), Config.SAWMILL_FLUID_AMOUNT.get()); - - List fluidManagers = new ArrayList<>() {{ - add(outputTank); - }}; - - private final ItemStackHandler inventory = createHandler(); - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } - - public SawmillTile(BlockPos pos, BlockState state) { - super(VEBlocks.SAWMILL_TILE.get(), pos, state, SawmillRecipe.RECIPE_TYPE); - outputTank.setAllowAny(true); - } - - SawmillRecipe recipe; - - @Override - public void tick() { - updateClients(); - validateRecipe(); - processFluidIO(); - - ItemStack logInput = inventory.getStackInSlot(0).copy(); // Log input - //ItemStack plankOutput = inventory.getStackInSlot(1).copy(); // Plank Output - //ItemStack secondOutput = inventory.getStackInSlot(2).copy(); // Second output - - // Resolve recipes: - if (!logInput.isEmpty()) { - ItemStack plankOutputStack; - ItemStack secondOutputStack; - - if ((recipe == null && Config.SAWMILL_ALLOW_NON_SAWMILL_RECIPE_LOGS_TO_BE_SAWED.get()) - || (recipe != null && recipe.isLogRecipe() && Config.SAWMILL_ALLOW_NON_SAWMILL_RECIPE_LOGS_TO_BE_SAWED.get())) { // Recipe is null, use alternative method if allowed, or dummy recipe - plankOutputStack = RecipeUtil.getPlankFromLogParallel(level, logInput.copy()); //RecipeUtil.getPlankFromLogParallel(level, logInput.copy()); - secondOutputStack = new ItemStack(ForgeRegistries.ITEMS.getValue(new ResourceLocation(Config.SAWMILL_SECOND_OUTPUT_RESOURCE_LOCATION.get())), Config.SAWMILL_SECOND_OUTPUT_COUNT.get()); - - if (plankOutputStack != null) { // Valid Item! - if (this.configuredFluidForNoRecipe != null - && (outputTank.getTank().getFluidAmount() + Config.SAWMILL_FLUID_AMOUNT.get()) <= DEFAULT_TANK_CAPACITY - && (inventory.getStackInSlot(1).isEmpty() || inventory.getStackInSlot(1).getItem() == plankOutputStack.getItem()) - && (inventory.getStackInSlot(2).isEmpty() || inventory.getStackInSlot(2).getItem() == secondOutputStack.getItem()) - && (inventory.getStackInSlot(1).getCount() + Config.SAWMILL_PRIMARY_OUTPUT_COUNT.get()) <= 64 - && (inventory.getStackInSlot(2).getCount() + Config.SAWMILL_SECOND_OUTPUT_COUNT.get()) <= 64) { - - if (outputTank.getTank().getFluid().isFluidEqual(this.configuredFluidForNoRecipe.copy()) || outputTank.getTank().getFluid().isEmpty()) { - plankOutputStack.setCount(Config.SAWMILL_PRIMARY_OUTPUT_COUNT.get()); - coreTickProcessing(null, - logInput, - plankOutputStack.copy(), - secondOutputStack.copy(), - this.configuredFluidForNoRecipe.copy() - ); - } else { - counter = 0; - } - } else { - counter = 0; - } - } else { - counter = 0; - } - - } else if (recipe != null && !recipe.isLogRecipe()) { // Using Recipe - plankOutputStack = recipe.getResult(0).copy(); - secondOutputStack = recipe.getResult(1).copy(); - FluidStack outputFluid = recipe.getOutputFluid(0).copy(); - - if ((outputTank.getTank().getFluidAmount() + outputFluid.getAmount()) <= DEFAULT_TANK_CAPACITY - && (inventory.getStackInSlot(1).isEmpty() || inventory.getStackInSlot(1).getItem() == plankOutputStack.getItem()) - && (inventory.getStackInSlot(2).isEmpty() || inventory.getStackInSlot(2).getItem() == secondOutputStack.getItem()) - && (inventory.getStackInSlot(1).getCount() + recipe.getResult(0).getCount()) <= 64 - && (inventory.getStackInSlot(2).getCount() + recipe.getResult(1).getCount()) <= 64) { - if (outputTank.getTank().getFluid().isFluidEqual(outputFluid.copy()) || outputTank.getTank().getFluid().isEmpty()) { - coreTickProcessing(recipe, logInput, plankOutputStack, secondOutputStack, outputFluid); - } else { - counter = 0; - } - } else { - counter = 0; - } - } - } else { - counter = 0; - } - } - - @Override - public void validateRecipe() { - if (!this.isRecipeDirty) { - return; - } - this.isRecipeDirty = false; - ItemStack logInput = inventory.getStackInSlot(0).copy(); - recipe = RecipeUtil.getSawmillingRecipeFromLog(level, logInput.copy()); - } - - private ItemStackHandler createHandler() { - return new ItemStackHandler(6) { - @Override - protected void onContentsChanged(int slot) { - setChanged(); - markRecipeDirty(); - } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if (slot == 0 || slot == 1 || slot == 2) { - return true; - } else if (slot == 3 || slot == 4) { - return stack.getItem() instanceof BucketItem; - } else if (slot == 5) { - return TagUtil.isTaggedMachineUpgradeItem(stack); // this is the upgrade tilePos - } - return true; - } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { //ALSO DO THIS PER SLOT BASIS TO SAVE DEBUG HOURS!!! - if (!isItemValid(slot, stack)) return stack; - return super.insertItem(slot, stack, simulate); - } - }; - } - - private void coreTickProcessing(@Nullable SawmillRecipe SawmillRecipe, - ItemStack logInput, - ItemStack resolvedPlankOutput, - ItemStack secondItemOutput, - FluidStack fluidOutput) { - if (canConsumeEnergy()) { - if (counter == 1) { - // Core processing occurs here - - inventory.extractItem(0, (SawmillRecipe != null ? SawmillRecipe.getIngredient(0).getItems()[0].getCount() : Config.SAWMILL_LOG_CONSUMPTION_RATE.get()), false); // Extract log - - // Plank output - ItemStack currentPlankStack = inventory.getStackInSlot(1); - if (currentPlankStack.getItem() != resolvedPlankOutput.getItem() || currentPlankStack.getItem() == Items.AIR) { - if (currentPlankStack.getItem() == Items.AIR) { - currentPlankStack.setCount(1); - } - inventory.insertItem(1, resolvedPlankOutput.copy(), false); - } else { // Assuming the recipe output item is already in the output tilePos - // currentPlankStack.setCount(.getCount()); // Simply change the item to equal the output amount - inventory.insertItem(1, resolvedPlankOutput.copy(), false); // Place the new output item on top of the old one - } - - // Second output - ItemStack currentSecondOutput = inventory.getStackInSlot(2); - if (currentSecondOutput.getItem() != secondItemOutput.getItem() || currentSecondOutput.getItem() == Items.AIR) { - if (currentSecondOutput.getItem() == Items.AIR) { - currentSecondOutput.setCount(1); - } - inventory.insertItem(2, secondItemOutput.copy(), false); - } else { // Assuming the recipe output item is already in the output tilePos - //currentSecondOutput.setCount(secondItemOutput.getCount()); // Simply change the item to equal the output amount - inventory.insertItem(2, secondItemOutput.copy(), false); // Place the new output item on top of the old one - } - - // Output Tank - if (outputTank.getTank().getFluid().getRawFluid() != fluidOutput.getRawFluid()) { - outputTank.getTank().setFluid(fluidOutput.copy()); - } else { - outputTank.getTank().fill(fluidOutput.copy(), IFluidHandler.FluidAction.EXECUTE); - } - - counter--; - consumeEnergy(); - this.setChanged(); - } else if (counter > 0) { - counter--; - consumeEnergy(); - if (++sound_tick == 19) { - sound_tick = 0; - if (Config.PLAY_MACHINE_SOUNDS.get()) { - level.playSound(null, this.getBlockPos(), VESounds.GENERAL_MACHINE_NOISE, SoundSource.BLOCKS, 1.0F, 1.0F); - } - } - } else { - counter = SawmillRecipe != null - ? updateCounter(SawmillRecipe.getProcessTime()) // Sawmill recipe not null - : updateCounter(Config.SAWMILL_PROCESSING_TIME.get()); // Use default values when null - length = counter; - } - } - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.SAWMILL_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - public FluidStack getFluidStackFromTank(int num) { - if (num == 0) { - return outputTank.getTank().getFluid(); - } - return FluidStack.EMPTY; - } - - @Override - public @NotNull List getRelationalTanks() { - return fluidManagers; - } - - @Override - public RecipeType> getRecipeType() { - return SawmillRecipe.RECIPE_TYPE; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index 6b9818ea1..6bd0e2d60 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -104,7 +104,7 @@ public class VETileEntities { .makesSound() .sendsOutPower() .withRecipe(FUEL_COMBUSTION) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new CombustionGeneratorProcessor()); public static final VETileEntityFactory COMPRESSOR_FACTORY = new VETileEntityFactory(VEBlocks.COMPRESSOR_TILE, VEContainers.COMPRESSOR_FACTORY) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 4cefda6af..94cf0046b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -695,7 +695,7 @@ public AbstractRecipeProcessor getRecipeProcessor() { public int updateCounter(VERecipe recipe) { int newLength; ItemStackHandler handler = this.getInventoryHandler(); - if (this.getEnergy() != null && handler != null) { + if (energy != null && handler != null && energy.getUpgradeSlotId() != -1) { newLength = this.calculateCounter(recipe.getProcessTime(), handler.getStackInSlot(energy.getUpgradeSlotId()).copy()); } else { diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java index 900ee6f76..68d57de57 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java @@ -2,8 +2,14 @@ import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.blocks.screens.VEContainerScreen; import com.veteam.voluminousenergy.compat.jei.VoluminousEnergyPlugin; +import com.veteam.voluminousenergy.items.data.CombustibleFluidsData; +import com.veteam.voluminousenergy.items.data.OxidizerFluidsData; import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; +import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.util.NumberUtil; import com.veteam.voluminousenergy.util.TextUtil; import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.forge.ForgeTypes; @@ -17,6 +23,7 @@ import mezz.jei.api.recipe.RecipeIngredientRole; import mezz.jei.api.recipe.RecipeType; import mezz.jei.api.recipe.category.IRecipeCategory; +import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; @@ -27,6 +34,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Optional; public class CombustionCategory implements IRecipeCategory { @@ -65,82 +73,72 @@ public CombustionCategory(IGuiHelper guiHelper) { @Override public void draw(CombustionGeneratorRecipe recipe, IRecipeSlotsView slotsView, @NotNull GuiGraphics matrixStack, double mouseX, double mouseY) { -// -// // Volumetric Energy label -// TextUtil.renderShadowedText( -// matrixStack, -// Minecraft.getInstance().font, -// TextUtil.translateString("jei.voluminousenergy.volumetric_energy").copy().append(": "), -// 16, -// 4, -// VEContainerScreen.WHITE_TEXT_STYLE -// ); -// -// // Actual Volumetric Energy value + FE/B units added on the end -// TextUtil.renderUnshadowedText( -// matrixStack, -// Minecraft.getInstance().font, -// Component.nullToEmpty(recipe.getVolumetricEnergy() + " FE/B"), -// 35, -// 16, -// VEContainerScreen.GREY_TEXT_STYLE -// ); -// -// slotDrawable.draw(matrixStack, 17, 35); // Fuel fluid -// slotDrawable.draw(matrixStack, 85, 35); // Oxidizer fluid -// -// Optional oxiStack = slotsView.getSlotViews(RecipeIngredientRole.CATALYST).get(0).getDisplayedIngredient(ForgeTypes.FLUID_STACK); -// -// if (oxiStack.isPresent()){ -// -// List recipes = VERecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE); -// -// CombustionGeneratorOxidizerRecipe oxidizerRecipe = null; -// -// for(VERecipe VERecipe : recipes) { -// if(VERecipe instanceof CombustionGeneratorOxidizerRecipe cor) { -// if(cor.getFluidIngredient(0).test(oxiStack.get())) { -// oxidizerRecipe = cor; -// } -// } -// } -// if(oxidizerRecipe == null) throw new IllegalStateException("No matching oxidizer for category: " + this.getClass().getName()); -// -// int fePerTick = recipe.getVolumetricEnergy()/oxidizerRecipe.getProcessTime(); -// Component fePerTickComponent = Component.nullToEmpty(fePerTick+""); -// int x = 50; -// if (fePerTick < 100){ -// x = 54; -// } else if (fePerTick > 999 && fePerTick < 10_000){ -// x = 46; -// } else if (fePerTick > 9999){ -// NumberUtil.numberToTextComponent4FE(fePerTick); -// x = 46; -// } -// -// TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, fePerTickComponent, x, 45,VEContainerScreen.GREY_TEXT_STYLE); -// } -// -// TextUtil.renderShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("FE/t:"), 48,35,VEContainerScreen.WHITE_TEXT_STYLE); -// -// TextUtil.renderUnshadowedText( -// matrixStack, -// Minecraft.getInstance().font, -// TextUtil.translateString("jei.voluminousenergy.fluid.fuel").copy().append(":"), -// 16, -// 26, -// VEContainerScreen.GREY_TEXT_STYLE -// ); -// -// // Oxidizer Label -// TextUtil.renderUnshadowedText( -// matrixStack, -// Minecraft.getInstance().font, -// TextUtil.translateString("jei.voluminousenergy.fluid.oxidizer").copy().append(":"), -// 76, -// 26, -// VEContainerScreen.GREY_TEXT_STYLE -// ); + + // Volumetric Energy label + TextUtil.renderShadowedText( + matrixStack, + Minecraft.getInstance().font, + TextUtil.translateString("jei.voluminousenergy.volumetric_energy").copy().append(": "), + 16, + 4, + VEContainerScreen.WHITE_TEXT_STYLE + ); + + FluidStack input = recipe.getFluidIngredient(0).getFluids()[0]; + int energy = CombustibleFluidsData.getEnergyProduced(input) * 1600; + + // Actual Volumetric Energy value + FE/B units added on the end + TextUtil.renderUnshadowedText( + matrixStack, + Minecraft.getInstance().font, + Component.nullToEmpty(energy + " FE/B"), + 35, + 16, + VEContainerScreen.GREY_TEXT_STYLE + ); + + slotDrawable.draw(matrixStack, 17, 35); // Fuel fluid + slotDrawable.draw(matrixStack, 85, 35); // Oxidizer fluid + + Optional oxiStack = slotsView.getSlotViews(RecipeIngredientRole.CATALYST).get(0).getDisplayedIngredient(ForgeTypes.FLUID_STACK); + + if (oxiStack.isPresent()) { + + int fePerTick = energy / Config.COMBUSTION_GENERATOR_FIXED_TICK_TIME.get(); + Component fePerTickComponent = Component.nullToEmpty(fePerTick+""); + int x = 50; + if (fePerTick < 100){ + x = 54; + } else if (fePerTick > 999 && fePerTick < 10_000){ + x = 46; + } else if (fePerTick > 9999){ + NumberUtil.numberToTextComponent4FE(fePerTick); + x = 46; + } + + TextUtil.renderUnshadowedText(matrixStack, Minecraft.getInstance().font, fePerTickComponent, x, 45,VEContainerScreen.GREY_TEXT_STYLE); + } + + TextUtil.renderShadowedText(matrixStack, Minecraft.getInstance().font, Component.nullToEmpty("FE/t:"), 48,35,VEContainerScreen.WHITE_TEXT_STYLE); + + TextUtil.renderUnshadowedText( + matrixStack, + Minecraft.getInstance().font, + TextUtil.translateString("jei.voluminousenergy.fluid.fuel").copy().append(":"), + 16, + 26, + VEContainerScreen.GREY_TEXT_STYLE + ); + + // Oxidizer Label + TextUtil.renderUnshadowedText( + matrixStack, + Minecraft.getInstance().font, + TextUtil.translateString("jei.voluminousenergy.fluid.oxidizer").copy().append(":"), + 76, + 26, + VEContainerScreen.GREY_TEXT_STYLE + ); } @@ -150,15 +148,8 @@ public void ingredientHandler(CombustionGeneratorRecipe recipe, List inputList = new ArrayList<>(Arrays.asList(recipe.getFluidIngredient(0).getFluids())); fuelAcceptor.addIngredients(ForgeTypes.FLUID_STACK, inputList); - - ArrayList oxiStacks = new ArrayList<>(); -// for (VERecipe oxidizerRecipe : VERecipe.getCachedRecipes(CombustionGeneratorOxidizerRecipe.RECIPE_TYPE)) { -// oxiStacks.addAll(Arrays.asList(oxidizerRecipe.getFluidIngredient(0).getFluids())); -// } - - oxidizerAcceptor.addIngredients(ForgeTypes.FLUID_STACK, oxiStacks); - - + oxidizerAcceptor.addIngredients(ForgeTypes.FLUID_STACK, + OxidizerFluidsData.getAllOxidizerFluids().stream().map(f -> new FluidStack(f,250)).toList()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/events/VEClientSideListener.java b/src/main/java/com/veteam/voluminousenergy/events/VEClientSideListener.java index 5fae7baf9..0daa63669 100644 --- a/src/main/java/com/veteam/voluminousenergy/events/VEClientSideListener.java +++ b/src/main/java/com/veteam/voluminousenergy/events/VEClientSideListener.java @@ -1,9 +1,15 @@ package com.veteam.voluminousenergy.events; import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.items.data.CombustibleFluidsData; +import com.veteam.voluminousenergy.items.data.OxidizerFluidsData; import com.veteam.voluminousenergy.persistence.ChunkFluids; import com.veteam.voluminousenergy.recipe.VERecipe; +import net.minecraft.client.Minecraft; +import net.minecraft.client.server.IntegratedServer; +import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.world.level.Level; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.client.event.RecipesUpdatedEvent; @@ -19,12 +25,27 @@ public class VEClientSideListener { public static void onServerStart(ServerStartedEvent event) { ServerLevel level = event.getServer().getLevel(Level.OVERWORLD); ChunkFluids.loadInstance(level); - VoluminousEnergy.LOGGER.info("Loaded chunk fluids!"); + doDataProcess(event.getServer()); } @SubscribeEvent(priority = EventPriority.HIGHEST) public static void onDataPackSync(RecipesUpdatedEvent event) { - VoluminousEnergy.LOGGER.info("Finalizing recipe cache on client!"); VERecipe.updateCache(); + IntegratedServer server = Minecraft.getInstance().getSingleplayerServer(); + if (server != null) { + doDataProcess(server); + } + } + + /** + * Register our data processors here for the server + * + * @param server The minecraft server to process with + */ + private static void doDataProcess(MinecraftServer server) { + ResourceManager manager = server.getResourceManager(); + CombustibleFluidsData.loadData(manager); + OxidizerFluidsData.loadData(manager); + VoluminousEnergy.LOGGER.info("Finished data processing!"); } } diff --git a/src/main/java/com/veteam/voluminousenergy/events/VERecipeReloadListener.java b/src/main/java/com/veteam/voluminousenergy/events/VERecipeReloadListener.java deleted file mode 100644 index ff8c76352..000000000 --- a/src/main/java/com/veteam/voluminousenergy/events/VERecipeReloadListener.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.veteam.voluminousenergy.events; - -import com.veteam.voluminousenergy.VoluminousEnergy; -import net.minecraft.server.packs.resources.ResourceManager; -import net.minecraft.server.packs.resources.ResourceManagerReloadListener; -import org.jetbrains.annotations.NotNull; - -public class VERecipeReloadListener implements ResourceManagerReloadListener { - - @Override - public void onResourceManagerReload(@NotNull ResourceManager resourceManager) { - VoluminousEnergy.LOGGER.info("We are reloading right now!"); - } - -} - diff --git a/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java b/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java index c71e5316a..f580f8209 100644 --- a/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java +++ b/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java @@ -1,9 +1,13 @@ package com.veteam.voluminousenergy.events; import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.items.data.CombustibleFluidsData; +import com.veteam.voluminousenergy.items.data.OxidizerFluidsData; import com.veteam.voluminousenergy.persistence.ChunkFluids; import com.veteam.voluminousenergy.recipe.VERecipe; +import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.world.level.Level; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.event.OnDatapackSyncEvent; @@ -17,19 +21,35 @@ public class VEServerSideListener { @SubscribeEvent(priority = EventPriority.HIGHEST) public static void onDataPackSync(OnDatapackSyncEvent event) { + + MinecraftServer server; // When event.getPlayer() != null it's a player joining, so we check to make sure it's a group reload if (event.getPlayer() == null) { - VoluminousEnergy.LOGGER.info("Finalizing recipe cache on server reload!"); + server = event.getPlayer().getServer(); VERecipe.updateCache(); + } else { + server = event.getPlayerList().getServer(); } + + doDataProcess(server); } @SubscribeEvent public static void onServerStart(ServerStartedEvent event) { ServerLevel level = event.getServer().getLevel(Level.OVERWORLD); ChunkFluids.loadInstance(level); - VoluminousEnergy.LOGGER.info("Loaded chunk fluids!"); - VoluminousEnergy.LOGGER.info("Finalizing recipe cache on server!"); VERecipe.updateCache(); + doDataProcess(event.getServer()); + } + + /** + * Register our data processors here for the server + * @param server The minecraft server to process with + */ + private static void doDataProcess(MinecraftServer server) { + ResourceManager manager = server.getResourceManager(); + CombustibleFluidsData.loadData(manager); + OxidizerFluidsData.loadData(manager); + VoluminousEnergy.LOGGER.info("Finished data processing!"); } } diff --git a/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java b/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java new file mode 100644 index 000000000..7885dd5ea --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java @@ -0,0 +1,78 @@ +package com.veteam.voluminousenergy.items.data; + +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import com.mojang.serialization.DataResult; +import com.mojang.serialization.JsonOps; +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.packs.resources.Resource; +import net.minecraft.server.packs.resources.ResourceManager; +import net.minecraft.world.level.material.Fluid; +import net.minecraftforge.fluids.FluidStack; + +import java.io.BufferedReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.veteam.voluminousenergy.util.recipe.VERecipeCodecs.REGISTRY_COMBUSTION_FLUID_CODEC; + +public class CombustibleFluidsData { + + static final List rawData = new ArrayList<>(); + static final HashMap combustibleFluidData = new HashMap<>(); + + public static void loadData(ResourceManager manager) { + resetCache(); + ResourceLocation prefix = new ResourceLocation("voluminousenergy", "fluid_data/combustion"); + Map resourceLocations = manager.listResources(prefix.getPath(), s -> s.getPath().endsWith(".json")); + + for (Resource resource : resourceLocations.values()) { + try (BufferedReader reader = resource.openAsReader()) { + JsonElement jsonElement = JsonParser.parseReader(reader); + if (jsonElement != null) { + DataResult result = REGISTRY_COMBUSTION_FLUID_CODEC.parse(JsonOps.INSTANCE, jsonElement); + result.resultOrPartial(VoluminousEnergy.LOGGER::error) + .ifPresent(rawData::add); + } + } catch (IOException e) { + VoluminousEnergy.LOGGER.error("Unable to read combustion fluid data ", e); + } + } + } + + + public static boolean isCombustible(FluidStack stack) { + buildCache(); + return combustibleFluidData.containsKey(stack.getFluid()); + } + + public static int getEnergyProduced(FluidStack stack) { + buildCache(); + return combustibleFluidData.getOrDefault(stack.getFluid(), 0); + } + + public static List getAllCombustibleFluids() { + buildCache(); + return new ArrayList<>(combustibleFluidData.keySet()); + } + + private static void buildCache() { + if (!combustibleFluidData.isEmpty()) { + return; + } + for (VERecipeCodecs.RegistryFluidValue rawItem : rawData) { + for (Fluid fluid : rawItem.getAsValuePair().fluids) { + combustibleFluidData.put(fluid, (int) rawItem.value()); + } + } + } + + private static void resetCache() { + combustibleFluidData.clear(); + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/items/data/CustomDataLoader.java b/src/main/java/com/veteam/voluminousenergy/items/data/CustomDataLoader.java new file mode 100644 index 000000000..1ba1258fe --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/items/data/CustomDataLoader.java @@ -0,0 +1,5 @@ +package com.veteam.voluminousenergy.items.data; + +public class CustomDataLoader { + +} diff --git a/src/main/java/com/veteam/voluminousenergy/items/data/OxidizerFluidsData.java b/src/main/java/com/veteam/voluminousenergy/items/data/OxidizerFluidsData.java new file mode 100644 index 000000000..c2543d798 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/items/data/OxidizerFluidsData.java @@ -0,0 +1,82 @@ +package com.veteam.voluminousenergy.items.data; + +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import com.mojang.serialization.DataResult; +import com.mojang.serialization.JsonOps; +import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.server.packs.resources.Resource; +import net.minecraft.server.packs.resources.ResourceManager; +import net.minecraft.world.level.material.Fluid; +import net.minecraftforge.fluids.FluidStack; + +import java.io.BufferedReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static com.veteam.voluminousenergy.util.recipe.VERecipeCodecs.REGISTRY_OXIDIZER_FLUID_CODEC; + +public class OxidizerFluidsData { + + static final List rawData = new ArrayList<>(); + static final HashMap oxidizerFluidData = new HashMap<>(); + + public static void loadData(ResourceManager manager) { + resetCache(); + ResourceLocation prefix = new ResourceLocation("voluminousenergy", "fluid_data/oxidizers"); + Map resourceLocations = manager.listResources(prefix.getPath(), s -> s.getPath().endsWith(".json")); + + for (Resource resource : resourceLocations.values()) { + try (BufferedReader reader = resource.openAsReader()) { + JsonElement jsonElement = JsonParser.parseReader(reader); + if (jsonElement != null) { + DataResult result = REGISTRY_OXIDIZER_FLUID_CODEC.parse(JsonOps.INSTANCE, jsonElement); + result.resultOrPartial(VoluminousEnergy.LOGGER::error) + .ifPresent(rawData::add); + } + } catch (IOException e) { + VoluminousEnergy.LOGGER.error("Unable to read oxidizer fluid data ", e); + } + } + } + + + public static boolean isOxidizer(FluidStack stack) { + buildCache(); + return oxidizerFluidData.containsKey(stack.getFluid()); + } + + + public static float getOxidizerMultiplier(FluidStack stack) { + for(var data : oxidizerFluidData.entrySet()) { + if(data.getKey().isSame(stack.getFluid())) return data.getValue(); + } + return 0; + } + + public static List getAllOxidizerFluids() { + buildCache(); + return new ArrayList<>(oxidizerFluidData.keySet()); + } + + private static void buildCache() { + if (!oxidizerFluidData.isEmpty()) { + return; + } + for (VERecipeCodecs.RegistryFluidValue rawItem : rawData) { + + for (Fluid fluid : rawItem.getAsValuePair().fluids) { + oxidizerFluidData.put(fluid, rawItem.value()); + } + } + } + + private static void resetCache() { + oxidizerFluidData.clear(); + } +} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java index 9a6a651bd..3b503cd82 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java @@ -9,6 +9,7 @@ import javax.annotation.Nullable; import java.util.List; +@Deprecated public class RecipeCache { @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java index cfb0b6c13..91002d570 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java @@ -51,7 +51,6 @@ public VERecipe(List ingredients, List Config.COMBUSTION_GENERATOR_MAX_POWER.get()) + return; + + if (counter > 0) { + counter--; + storage.addEnergy(storage.getProduction()); + int soundTick = tile.getData("sound_tick"); + if (++soundTick == 19) { + soundTick = 0; + if (Config.PLAY_MACHINE_SOUNDS.get()) { + tile.getLevel().playSound(null, tile.getBlockPos(), VESounds.GENERAL_MACHINE_NOISE, SoundSource.BLOCKS, 1.0F, 1.0F); + } + } + tile.setData("sound_tick", soundTick); + tile.setChanged(); + } else if (recipe != null) { + FluidStack fuel = tile.getFluidStackFromTank(0); + FluidStack oxi = tile.getFluidStackFromTank(1); + + tile.getTank(0).getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); + tile.getTank(1).getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); + + int powerGeneration = CombustibleFluidsData.getEnergyProduced(fuel); + float multiplier = OxidizerFluidsData.getOxidizerMultiplier(oxi); + + if (Config.COMBUSTION_GENERATOR_BALANCED_MODE.get()) { + counter = COMBUSTION_GENERATOR_PROCESS_TIME / 4; + } else { + counter = Config.COMBUSTION_GENERATOR_FIXED_TICK_TIME.get() / 4; + } + + tile.getEnergy().setProduction((int) (powerGeneration * multiplier)); + tile.setData("length",counter); + tile.setChanged(); + } else { + tile.getEnergy().setProduction(0); + } + tile.setData("counter", counter); + } + +} diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BoolButtonPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BoolButtonPacket.java index f11abe016..481129657 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BoolButtonPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BoolButtonPacket.java @@ -36,7 +36,6 @@ public void toBytes(FriendlyByteBuf buffer) { } public static void handle(BoolButtonPacket packet, CustomPayloadEvent.Context contextSupplier) { - //VoluminousEnergy.LOGGER.debug(contextSupplier.get().getDirection()); NetworkDirection packetDirection = contextSupplier.getDirection(); switch (packetDirection) { case PLAY_TO_CLIENT: diff --git a/src/main/java/com/veteam/voluminousenergy/util/recipe/VERecipeCodecs.java b/src/main/java/com/veteam/voluminousenergy/util/recipe/VERecipeCodecs.java index ebb2d925d..23b325ffb 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/VERecipeCodecs.java +++ b/src/main/java/com/veteam/voluminousenergy/util/recipe/VERecipeCodecs.java @@ -21,6 +21,9 @@ import oshi.util.tuples.Pair; import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.concurrent.atomic.AtomicReference; public class VERecipeCodecs { @@ -137,6 +140,24 @@ public Ingredient getIngredient() { ).apply(instance, ClimateData::new); }); + public static final Codec REGISTRY_COMBUSTION_FLUID_CODEC = RecordCodecBuilder.create((instance) -> instance.group( + ExtraCodecs.strictOptionalField(Codec.STRING, "tag", "") + .forGetter(RegistryFluidValue::tag), + ExtraCodecs.strictOptionalField(Codec.STRING, "fluid", "") + .forGetter(RegistryFluidValue::fluid), + ExtraCodecs.strictOptionalField(Codec.FLOAT, "energy_per_tick", 0f) + .forGetter((ingredient) -> 1f) + ).apply(instance, RegistryFluidValue::new)); + + public static final Codec REGISTRY_OXIDIZER_FLUID_CODEC = RecordCodecBuilder.create((instance) -> instance.group( + ExtraCodecs.strictOptionalField(Codec.STRING, "tag", "") + .forGetter(RegistryFluidValue::tag), + ExtraCodecs.strictOptionalField(Codec.STRING, "fluid", "") + .forGetter(RegistryFluidValue::fluid), + ExtraCodecs.strictOptionalField(Codec.FLOAT, "multiplier", 0f) + .forGetter((ingredient) -> 1f) + ).apply(instance, RegistryFluidValue::new)); + public record FloatPair(float min, float max) { } @@ -176,6 +197,40 @@ public FluidIngredient getIngredient() { } } + public record RegistryFluidValue(String tag, String fluid, float value) { + public FluidSetWithValue getAsValuePair() { + + if (!tag.isBlank()) { + ResourceLocation res = ResourceLocation.of(tag, ':'); + TagKey tag = TagKey.create(ForgeRegistries.FLUIDS.getRegistryKey(), res); + HolderSet holderSet = BuiltInRegistries.FLUID.getOrCreateTag(tag); + AtomicReference> fluidSet = new AtomicReference<>(new HashSet<>()); + holderSet.stream().forEach(itemHolder -> fluidSet.get().add(itemHolder.value())); + return new FluidSetWithValue(fluidSet.get(),value); + } else if (!fluid.isBlank()) { + ResourceLocation res = ResourceLocation.of(fluid, ':'); + Fluid single = ForgeRegistries.FLUIDS.getValue(res); + if (single == null) { + throw new IllegalStateException("Invalid recipe fluid ingredient object: " + fluid); + } + return new FluidSetWithValue(Set.of(single),value); + } else { + throw new IllegalStateException("Recipe missing fluid/tag JSON syntax!"); + } + } + } + + public static class FluidSetWithValue { + public Set fluids; + public float value; + + public FluidSetWithValue(Set fluids,float value) { + this.fluids = fluids; + this.value = value; + } + + } + public static final Codec VE_OUTPUT_FLUID_CODEC = RecordCodecBuilder.create((instance) -> { return instance.group(FLUID_NONAIR_CODEC.fieldOf("fluid").forGetter(FluidStack::getFluid), ExtraCodecs.strictOptionalField(Codec.INT, "amount", 1) diff --git a/src/main/resources/data/voluminousenergy/fluid_data/combustion/biofuel.json b/src/main/resources/data/voluminousenergy/fluid_data/combustion/biofuel.json new file mode 100644 index 000000000..be7727dd5 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/combustion/biofuel.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:biofuel", + "energy_per_tick" : 72 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/fluid_data/combustion/crude_oil.json b/src/main/resources/data/voluminousenergy/fluid_data/combustion/crude_oil.json new file mode 100644 index 000000000..6a0d6f07a --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/combustion/crude_oil.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:crude_oil", + "energy_per_tick" : 16 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/fluid_data/combustion/diesel.json b/src/main/resources/data/voluminousenergy/fluid_data/combustion/diesel.json new file mode 100644 index 000000000..107451391 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/combustion/diesel.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:diesel", + "energy_per_tick" : 160 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/fluid_data/combustion/gasoline.json b/src/main/resources/data/voluminousenergy/fluid_data/combustion/gasoline.json new file mode 100644 index 000000000..38aefda39 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/combustion/gasoline.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:gasoline", + "energy_per_tick" : 128 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/fluid_data/combustion/light_fuel.json b/src/main/resources/data/voluminousenergy/fluid_data/combustion/light_fuel.json new file mode 100644 index 000000000..c59023d83 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/combustion/light_fuel.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:light_fuel", + "energy_per_tick" : 64 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/fluid_data/combustion/liquefied_coal.json b/src/main/resources/data/voluminousenergy/fluid_data/combustion/liquefied_coal.json new file mode 100644 index 000000000..6e08d9fe5 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/combustion/liquefied_coal.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:liquefied_coal", + "energy_per_tick" : 64 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/fluid_data/combustion/liquefied_coke.json b/src/main/resources/data/voluminousenergy/fluid_data/combustion/liquefied_coke.json new file mode 100644 index 000000000..c90257abe --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/combustion/liquefied_coke.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:liquefied_coke", + "energy_per_tick" : 128 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/fluid_data/combustion/naphtha.json b/src/main/resources/data/voluminousenergy/fluid_data/combustion/naphtha.json new file mode 100644 index 000000000..51c09ec09 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/combustion/naphtha.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:naphtha", + "energy_per_tick" : 32 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/fluid_data/combustion/nitroglycerin.json b/src/main/resources/data/voluminousenergy/fluid_data/combustion/nitroglycerin.json new file mode 100644 index 000000000..0eaa8d330 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/combustion/nitroglycerin.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:nitroglycerin", + "energy_per_tick" : 234 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/fluid_data/combustion/treethanol.json b/src/main/resources/data/voluminousenergy/fluid_data/combustion/treethanol.json new file mode 100644 index 000000000..0e57770cd --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/combustion/treethanol.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:treethanol", + "energy_per_tick" : 64 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/fluid_data/oxidizers/compressed_air.json b/src/main/resources/data/voluminousenergy/fluid_data/oxidizers/compressed_air.json new file mode 100644 index 000000000..65c11a8f2 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/oxidizers/compressed_air.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:compressed_air", + "multiplier": 1 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/fluid_data/oxidizers/dinitrogen_tetroxide.json b/src/main/resources/data/voluminousenergy/fluid_data/oxidizers/dinitrogen_tetroxide.json new file mode 100644 index 000000000..2eeded3f4 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/oxidizers/dinitrogen_tetroxide.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:dinitrogen_tetroxide", + "multiplier": 4 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/fluid_data/oxidizers/oxygen.json b/src/main/resources/data/voluminousenergy/fluid_data/oxidizers/oxygen.json new file mode 100644 index 000000000..cbd50cd17 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/fluid_data/oxidizers/oxygen.json @@ -0,0 +1,4 @@ +{ + "tag": "forge:oxygen", + "multiplier": 2 +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/combustible.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/biofuel.json similarity index 80% rename from src/main/resources/data/voluminousenergy/recipes/fuel_combustion/combustible.json rename to src/main/resources/data/voluminousenergy/recipes/fuel_combustion/biofuel.json index ee613145c..9edd3fe4a 100644 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/combustible.json +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/biofuel.json @@ -2,7 +2,7 @@ "type": "voluminousenergy:fuel_combustion", "fluid_ingredients": [ { - "tag": "voluminousenergy:combustible", + "tag": "forge:biofuel", "amount": 250 }, { diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/crude_oil.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/crude_oil.json new file mode 100644 index 000000000..1b8146705 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/crude_oil.json @@ -0,0 +1,13 @@ +{ + "type": "voluminousenergy:fuel_combustion", + "fluid_ingredients": [ + { + "tag": "forge:crude_oil", + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "amount": 250 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/diesel.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/diesel.json new file mode 100644 index 000000000..bd99425d3 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/diesel.json @@ -0,0 +1,13 @@ +{ + "type": "voluminousenergy:fuel_combustion", + "fluid_ingredients": [ + { + "tag": "forge:diesel", + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "amount": 250 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/gasoline.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/gasoline.json new file mode 100644 index 000000000..7c71faf5e --- /dev/null +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/gasoline.json @@ -0,0 +1,13 @@ +{ + "type": "voluminousenergy:fuel_combustion", + "fluid_ingredients": [ + { + "tag": "forge:gasoline", + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "amount": 250 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/light_fuel.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/light_fuel.json new file mode 100644 index 000000000..0a0fe6843 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/light_fuel.json @@ -0,0 +1,13 @@ +{ + "type": "voluminousenergy:fuel_combustion", + "fluid_ingredients": [ + { + "tag": "forge:light_fuel", + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "amount": 250 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coal.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coal.json new file mode 100644 index 000000000..366212215 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coal.json @@ -0,0 +1,13 @@ +{ + "type": "voluminousenergy:fuel_combustion", + "fluid_ingredients": [ + { + "tag": "forge:liquefied_coal", + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "amount": 250 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coke.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coke.json new file mode 100644 index 000000000..13f4df476 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coke.json @@ -0,0 +1,13 @@ +{ + "type": "voluminousenergy:fuel_combustion", + "fluid_ingredients": [ + { + "tag": "forge:liquefied_coke", + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "amount": 250 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/naphtha.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/naphtha.json new file mode 100644 index 000000000..ecd564c70 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/naphtha.json @@ -0,0 +1,13 @@ +{ + "type": "voluminousenergy:fuel_combustion", + "fluid_ingredients": [ + { + "tag": "forge:naphtha", + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "amount": 250 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/nitroglycerin.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/nitroglycerin.json new file mode 100644 index 000000000..60c2f0bf1 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/nitroglycerin.json @@ -0,0 +1,13 @@ +{ + "type": "voluminousenergy:fuel_combustion", + "fluid_ingredients": [ + { + "tag": "forge:nitroglycerin", + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "amount": 250 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/treethanol.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/treethanol.json new file mode 100644 index 000000000..d2a19e593 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/treethanol.json @@ -0,0 +1,13 @@ +{ + "type": "voluminousenergy:fuel_combustion", + "fluid_ingredients": [ + { + "tag": "forge:treethanol", + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "amount": 250 + } + ] +} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/oxidizer_combustion/compressed_air.json b/src/main/resources/data/voluminousenergy/recipes/oxidizer_combustion/compressed_air.json deleted file mode 100644 index a5760c8a2..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/oxidizer_combustion/compressed_air.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:oxidizer_combustion", - "process_time": 1600, - "fluid_ingredients": [ - { - "tag": "forge:compressed_air", - "amount": 250 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/oxidizer_combustion/dinitrogen_tetroxide.json b/src/main/resources/data/voluminousenergy/recipes/oxidizer_combustion/dinitrogen_tetroxide.json deleted file mode 100644 index 1663b6daf..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/oxidizer_combustion/dinitrogen_tetroxide.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:oxidizer_combustion", - "process_time": 400, - "fluid_ingredients": [ - { - "tag": "forge:dinitrogen_tetroxide", - "amount": 250 - } - ] -} \ No newline at end of file diff --git a/src/main/resources/data/voluminousenergy/recipes/oxidizer_combustion/oxygen.json b/src/main/resources/data/voluminousenergy/recipes/oxidizer_combustion/oxygen.json deleted file mode 100644 index 42dae3dff..000000000 --- a/src/main/resources/data/voluminousenergy/recipes/oxidizer_combustion/oxygen.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "type": "voluminousenergy:oxidizer_combustion", - "process_time": 800, - "fluid_ingredients": [ - { - "tag": "forge:oxygen", - "amount": 250 - } - ] -} \ No newline at end of file From 303d6cad82f6b28c8f9bd575a31f6ca399f90027 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Tue, 9 Apr 2024 20:06:57 -0400 Subject: [PATCH 15/27] Renamed some methods, updated the gas furnace --- .../blocks/blocks/DimensionalLaserBlock.java | 17 +++ .../blocks/machines/GasFiredFurnaceBlock.java | 4 +- .../blocks/machines/ToolingStationBlock.java | 6 +- .../blocks/screens/GasFiredFurnaceScreen.java | 20 ++-- .../blocks/screens/PumpScreen.java | 4 +- .../blocks/screens/ToolingStationScreen.java | 8 +- .../blocks/tiles/VETileEntities.java | 16 +-- .../blocks/tiles/VETileEntity.java | 4 +- .../blocks/tiles/VETileEntityFactory.java | 4 +- .../AbstractItemStackValidator.java | 2 +- .../DimensionalLaserInventoryValidator.java | 2 +- .../FurnaceInventoryValidator.java | 2 +- .../inventory/GasFiredFurnaceValidator.java | 36 ++++++ .../VEItemStackHandler.java | 2 +- .../items/data/CombustibleFluidsData.java | 5 + .../recipe/ToolingRecipe.java | 4 +- .../recipe/parser/AbstractRecipeParser.java | 2 +- .../recipe/parser/HydroponicParser.java | 2 +- .../recipe/parser/RNGRecipeParser.java | 2 +- .../recipe/parser/RecipeParser.java | 6 +- .../recipe/parser/SawmillParser.java | 4 +- .../processor/AirCompressorProcessor.java | 2 +- .../CombustionGeneratorProcessor.java | 5 +- .../DimensionalLaserRecipeProcessor.java | 17 ++- .../processor/ElectricFurnaceProcessor.java | 1 - .../processor/GasFiredFurnaceProcessor.java | 104 ++++++++++++++++++ .../recipe/processor/PumpTileProcessor.java | 4 +- 27 files changed, 231 insertions(+), 54 deletions(-) rename src/main/java/com/veteam/voluminousenergy/blocks/tiles/{handlers => inventory}/AbstractItemStackValidator.java (79%) rename src/main/java/com/veteam/voluminousenergy/blocks/tiles/{handlers => inventory}/DimensionalLaserInventoryValidator.java (94%) rename src/main/java/com/veteam/voluminousenergy/blocks/tiles/{handlers => inventory}/FurnaceInventoryValidator.java (94%) create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/GasFiredFurnaceValidator.java rename src/main/java/com/veteam/voluminousenergy/blocks/tiles/{handlers => inventory}/VEItemStackHandler.java (98%) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java index 5deaa5d08..a2766cfd0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java @@ -3,14 +3,20 @@ import com.veteam.voluminousenergy.blocks.blocks.machines.VEFaceableMachineBlock; import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; +import com.veteam.voluminousenergy.sounds.VESounds; +import net.minecraft.client.Minecraft; +import net.minecraft.client.sounds.SoundManager; import net.minecraft.core.BlockPos; +import net.minecraft.sounds.SoundSource; import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityTicker; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.NotNull; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -39,4 +45,15 @@ public BlockEntity newBlockEntity(@Nonnull BlockPos blockPos, @Nonnull BlockStat public BlockEntityTicker getTicker(@Nonnull Level level, @Nonnull BlockState state, @Nonnull BlockEntityType blockEntityType) { return createTicker(level, blockEntityType, VEBlocks.DIMENSIONAL_LASER_TILE.get()); } + + @Override + public void destroy(@NotNull LevelAccessor levelAccessor, @NotNull BlockPos blockPos, @NotNull BlockState blockState) { + if (levelAccessor.isClientSide()) { + SoundManager manager = Minecraft.getInstance().getSoundManager(); + manager.stop(VESounds.ENERGY_BEAM_ACTIVATE.getLocation(), SoundSource.BLOCKS); + manager.stop(VESounds.ENERGY_BEAM_FIRED.getLocation(), SoundSource.BLOCKS); + return; + } + super.destroy(levelAccessor, blockPos, blockState); + } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/GasFiredFurnaceBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/GasFiredFurnaceBlock.java index 7360661c0..326bec66f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/GasFiredFurnaceBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/GasFiredFurnaceBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.GasFiredFurnaceTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -32,7 +32,7 @@ public GasFiredFurnaceBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new GasFiredFurnaceTile(pos, state); + return VETileEntities.GAS_FIRED_FURNACE.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ToolingStationBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ToolingStationBlock.java index 36c2420f0..25583c195 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ToolingStationBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ToolingStationBlock.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.blocks.util.FaceableBlock; -import com.veteam.voluminousenergy.blocks.tiles.ToolingStationTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; @@ -39,13 +39,13 @@ public ToolingStationBlock() { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { // Replaces old createBlockEntity method - return new ToolingStationTile(pos, state); + return VETileEntities.TOOLING_STATION_FACTORY.create(pos, state); } // NEW TICK SYSTEM @Nullable protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { - return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, ToolingStationTile::serverTick); + return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, VETileEntity::serverTick); } public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java index e193daa33..fd60029ea 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.GasFiredFurnaceTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; @@ -18,14 +18,14 @@ import java.util.List; public class GasFiredFurnaceScreen extends VEContainerScreen { - private GasFiredFurnaceTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/gas_fired_furnace_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public GasFiredFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (GasFiredFurnaceTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -63,8 +63,8 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(31, 18, 12, 49, mouseX, mouseY)) { - int amount = tileEntity.getFluidFromTank().getAmount(); - String name = tileEntity.getFluidFromTank().getTranslationKey(); + int amount = tileEntity.getFluidStackFromTank(0).getAmount(); + String name = tileEntity.getFluidStackFromTank(0).getTranslationKey(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); } else if (!VoluminousEnergy.JEI_LOADED && isHovering(getFuelTooltipArea(), mouseX, mouseY)) { matrixStack.renderComponentTooltip(this.font, getFuelTooltips(), mouseX, mouseY); @@ -81,8 +81,8 @@ public Rect2i getFuelTooltipArea() { public List getFuelTooltips() { return Arrays.asList( - Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.percent_burned").getString() + ": " + tileEntity.progressFuelCounterPercent() + "%"), - Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.getFuelCounter())); + Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.percent_burned").getString() + ": " + tileEntity.progressCounterPercent() + "%"), + Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.getData("counter"))); } public Rect2i getCounterTooltipArea() { @@ -92,7 +92,7 @@ public Rect2i getCounterTooltipArea() { public List getCounterTooltips() { return Arrays.asList( Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.percent_complete").getString() + ": " + tileEntity.progressCounterPercent() + "%"), - Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.getCounter())); + Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.getData("counter"))); } @Override @@ -106,7 +106,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, final int flameHeight = 14; if (tileEntity != null) { int progress = tileEntity.progressProcessingCounterPX(9); - int fuelProgress = tileEntity.progressFuelCounterPX(flameHeight); + int fuelProgress = tileEntity.progressBurnCounterPX(flameHeight); /*Note for this.blit below: p_blit_1_ = starting x for blit on screen @@ -119,7 +119,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(GUI, i + 81, j + 31, 176, 0, progress, 17); matrixStack.blit(GUI, i + 54, j + (54 + (flameHeight - fuelProgress)), 176, 24 + (flameHeight - fuelProgress), flameHeight, fuelProgress); - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidFromTank(), tileEntity.getTankCapacity(), i + 31, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 31, j + 18, 0, 12, 50); drawIOSideHelper(); } RenderSystem.setShaderTexture(0, GUI_TOOLS); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java index cb2c4d80e..d373b8e3a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java @@ -81,7 +81,7 @@ protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { } if (isHovering(93, 18, 12, 50, mouseX, mouseY)) { // Oxidizer Tank - FluidStack stack = tileEntity.getTank(0).getTank().getFluid(); + FluidStack stack = tileEntity.getRelationalTank(0).getTank().getFluid(); String name = stack.getTranslationKey(); int amount = stack.getAmount(); matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); @@ -112,7 +112,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); try { - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getTank(0).getTank().getFluid(), tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getRelationalTank(0).getTank().getFluid(), tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); } catch (Exception e) { } drawIOSideHelper(); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java index 0db9632ae..1e4b44a3e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java @@ -3,7 +3,7 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.ToolingStationTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; @@ -15,14 +15,14 @@ import org.jetbrains.annotations.NotNull; public class ToolingStationScreen extends VEContainerScreen { - private ToolingStationTile tileEntity; + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/tooling_station_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public ToolingStationScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (ToolingStationTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -87,7 +87,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); if (tileEntity != null) { - boolean lightArrow = tileEntity.hasValidRecipe(); + boolean lightArrow = (tileEntity.getSelectedRecipe() == null); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index 6bd0e2d60..67beb60c5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -4,8 +4,9 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidInputTank; import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidOutputTank; -import com.veteam.voluminousenergy.blocks.tiles.handlers.DimensionalLaserInventoryValidator; -import com.veteam.voluminousenergy.blocks.tiles.handlers.FurnaceInventoryValidator; +import com.veteam.voluminousenergy.blocks.tiles.inventory.DimensionalLaserInventoryValidator; +import com.veteam.voluminousenergy.blocks.tiles.inventory.FurnaceInventoryValidator; +import com.veteam.voluminousenergy.blocks.tiles.inventory.GasFiredFurnaceValidator; import com.veteam.voluminousenergy.recipe.processor.*; import com.veteam.voluminousenergy.tools.Config; @@ -91,7 +92,6 @@ public class VETileEntities { .withRecipe(CENTRIFUGAL_SEPARATION) .withCustomRecipeProcessing(new DefaultProcessor()); - // TODO processing public static final VETileEntityFactory COMBUSTION_GENERATOR_FACTORY = new VETileEntityFactory(VEBlocks.COMBUSTION_GENERATOR_TILE, VEContainers.COMBUSTION_GENERATOR_FACTORY) .addEnergyStorage( @@ -210,16 +210,19 @@ public class VETileEntities { .withRecipe(FLUID_MIXING) .withCustomRecipeProcessing(new DefaultProcessor()); - // TODO needs a furnace processor public static final VETileEntityFactory GAS_FIRED_FURNACE = new VETileEntityFactory(VEBlocks.GAS_FIRED_FURNACE_TILE, VEContainers.GAS_FIRED_FURNACE_FACTORY) + // We have an upgrade slot, so we add an empty energy storage. Less than ideal. + .addEnergyStorage(0,0) .addTanks( new FluidInputTank(0, DEFAULT_TANK_CAPACITY) ) .countable() .makesSound() - .withCustomInventoryValidator(new FurnaceInventoryValidator()) - .withCustomRecipeProcessing(new DefaultProcessor()); + .addDataFlag("fuel_length") + .addDataFlag("fuel_counter") + .withCustomInventoryValidator(new GasFiredFurnaceValidator()) + .withCustomRecipeProcessing(new GasFiredFurnaceProcessor()); public static final VETileEntityFactory HYDROPONIC_INCUBATOR_FACTORY = new VETileEntityFactory(VEBlocks.HYDROPONIC_INCUBATOR_TILE, VEContainers.HYDROPONIC_INCUBATOR_FACTORY) @@ -302,7 +305,6 @@ public class VETileEntities { .withCustomRecipeProcessing(new PumpTileProcessor()) .makesSound(); - // TODO make a custom processor public static final VETileEntityFactory SAWMILL_FACTORY = new VETileEntityFactory(VEBlocks.SAWMILL_TILE, VEContainers.SAWMILL_FACTORY) .addEnergyStorage( diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 94cf0046b..768f77a56 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.blocks.tiles; -import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; +import com.veteam.voluminousenergy.blocks.tiles.inventory.VEItemStackHandler; import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.items.upgrades.MysteriousMultiplier; import com.veteam.voluminousenergy.recipe.VERecipe; @@ -617,7 +617,7 @@ public List getTanks() { return tanks; } - public VERelationalTank getTank(int id) { + public VERelationalTank getRelationalTank(int id) { return tanks.get(id); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java index f5f495cca..59197c652 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java @@ -1,8 +1,8 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory; -import com.veteam.voluminousenergy.blocks.tiles.handlers.AbstractItemStackValidator; -import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; +import com.veteam.voluminousenergy.blocks.tiles.inventory.AbstractItemStackValidator; +import com.veteam.voluminousenergy.blocks.tiles.inventory.VEItemStackHandler; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.processor.AbstractRecipeProcessor; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/AbstractItemStackValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/AbstractItemStackValidator.java similarity index 79% rename from src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/AbstractItemStackValidator.java rename to src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/AbstractItemStackValidator.java index a4c88e7cb..b0543e042 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/AbstractItemStackValidator.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/AbstractItemStackValidator.java @@ -1,4 +1,4 @@ -package com.veteam.voluminousenergy.blocks.tiles.handlers; +package com.veteam.voluminousenergy.blocks.tiles.inventory; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import net.minecraft.world.item.ItemStack; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/DimensionalLaserInventoryValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/DimensionalLaserInventoryValidator.java similarity index 94% rename from src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/DimensionalLaserInventoryValidator.java rename to src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/DimensionalLaserInventoryValidator.java index 0b70dd3ec..34edd9d3b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/DimensionalLaserInventoryValidator.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/DimensionalLaserInventoryValidator.java @@ -1,4 +1,4 @@ -package com.veteam.voluminousenergy.blocks.tiles.handlers; +package com.veteam.voluminousenergy.blocks.tiles.inventory; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.items.tools.RFIDChip; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/FurnaceInventoryValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/FurnaceInventoryValidator.java similarity index 94% rename from src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/FurnaceInventoryValidator.java rename to src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/FurnaceInventoryValidator.java index c0ec5dd43..7c1a0c141 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/FurnaceInventoryValidator.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/FurnaceInventoryValidator.java @@ -1,4 +1,4 @@ -package com.veteam.voluminousenergy.blocks.tiles.handlers; +package com.veteam.voluminousenergy.blocks.tiles.inventory; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.util.TagUtil; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/GasFiredFurnaceValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/GasFiredFurnaceValidator.java new file mode 100644 index 000000000..a9d43acb6 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/GasFiredFurnaceValidator.java @@ -0,0 +1,36 @@ +package com.veteam.voluminousenergy.blocks.tiles.inventory; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.items.data.CombustibleFluidsData; +import com.veteam.voluminousenergy.util.TagUtil; +import net.minecraft.world.SimpleContainer; +import net.minecraft.world.item.BucketItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.material.Fluids; + +public class GasFiredFurnaceValidator extends FurnaceInventoryValidator { + + @Override + public boolean isItemValid(int slot, ItemStack stack, VETileEntity tile) { + if(tile.getEnergy() != null && tile.getEnergy().getUpgradeSlotId() == slot) return TagUtil.isTaggedMachineUpgradeItem(stack); + + if(slot == 0) { + if(stack.getItem() instanceof BucketItem item) { + return item.getFluid().isSame(Fluids.EMPTY) || CombustibleFluidsData.isCombustible(item.getFluid()); + } + return false; + } + if (slot == 1) return stack.getItem() instanceof BucketItem; + if (slot != 2) return true; + Level level = tile.getLevel(); + var furnaceRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, + new SimpleContainer(stack.copy()), level).orElse(null); + if(furnaceRecipeNew != null) return true; + var blastingRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, + new SimpleContainer(stack.copy()), level).orElse(null); + return blastingRecipeNew != null; + } + +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/VEItemStackHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/VEItemStackHandler.java similarity index 98% rename from src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/VEItemStackHandler.java rename to src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/VEItemStackHandler.java index 4eed7cbc1..7d3ec3170 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/handlers/VEItemStackHandler.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/VEItemStackHandler.java @@ -1,4 +1,4 @@ -package com.veteam.voluminousenergy.blocks.tiles.handlers; +package com.veteam.voluminousenergy.blocks.tiles.inventory; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.recipe.VERecipe; diff --git a/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java b/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java index 7885dd5ea..3a779d125 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java +++ b/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java @@ -51,6 +51,11 @@ public static boolean isCombustible(FluidStack stack) { return combustibleFluidData.containsKey(stack.getFluid()); } + public static boolean isCombustible(Fluid fluid) { + buildCache(); + return combustibleFluidData.containsKey(fluid); + } + public static int getEnergyProduced(FluidStack stack) { buildCache(); return combustibleFluidData.getOrDefault(stack.getFluid(), 0); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java index dde7fd174..41b3782c6 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java @@ -25,12 +25,12 @@ public class ToolingRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.TOOLING.get(); + private final RecipeParser parser = new RecipeParser(this); + public ToolingRecipe() { } - private final RecipeParser parser = new RecipeParser(this); - public ToolingRecipe(List i, List oi) { super(i, new ArrayList<>(), new ArrayList<>(), oi, 0); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/AbstractRecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/AbstractRecipeParser.java index 6d988d7a2..06554304c 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/AbstractRecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/AbstractRecipeParser.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.recipe.parser; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; +import com.veteam.voluminousenergy.blocks.tiles.inventory.VEItemStackHandler; import net.minecraft.world.item.ItemStack; /** diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java index 1cf038851..871190a6d 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.recipe.parser; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; +import com.veteam.voluminousenergy.blocks.tiles.inventory.VEItemStackHandler; import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.parser.AbstractRecipeParser.SlotAndRecipePos; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java index 2bcec6e4f..c5939232b 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.recipe.parser; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; +import com.veteam.voluminousenergy.blocks.tiles.inventory.VEItemStackHandler; import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.parser.AbstractRecipeParser.SlotAndRecipePos; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java index 202d4d223..8877990fe 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.recipe.parser; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.blocks.tiles.handlers.VEItemStackHandler; +import com.veteam.voluminousenergy.blocks.tiles.inventory.VEItemStackHandler; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.recipe.parser.AbstractRecipeParser.SlotAndRecipePos; import com.veteam.voluminousenergy.util.recipe.FluidIngredient; @@ -116,7 +116,7 @@ public void completeRecipe(VETileEntity tile) { } for (SlotAndRecipePos pos : fluidIngredientPositions) { - tile.getTank(pos.tilePos()) + tile.getRelationalTank(pos.tilePos()) .getTank().drain(recipe.getFluidIngredientAmount(pos.recipePos()), IFluidHandler.FluidAction.EXECUTE); } @@ -128,7 +128,7 @@ public void completeRecipe(VETileEntity tile) { for (SlotAndRecipePos pos : fluidResultPositions) { FluidStack result = recipe.getOutputFluid(pos.recipePos()); - tile.getTank(pos.tilePos()).fillTank(result.copy()); + tile.getRelationalTank(pos.tilePos()).fillTank(result.copy()); } // mark fluid IO as dirty diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java index 3b7cfef8e..d9f87f5c1 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java @@ -64,7 +64,7 @@ public boolean canCompleteRecipe(VETileEntity tile) { (plank.is(plankOutput.getItem()) && plankOutput.getCount() + plank.getCount() <= plankOutput.getMaxStackSize()); boolean dustValid = dustOutput.isEmpty() || (dustOutput.is(recipe.getResult(0).getItem()) && dustOutput.getCount() + recipe.getResultCount(0) <= dustOutput.getMaxStackSize()); - return plankValid && dustValid && tile.getTank(0).canInsertOutputFluid(recipe,0); + return plankValid && dustValid && tile.getRelationalTank(0).canInsertOutputFluid(recipe,0); } return super.canCompleteRecipe(tile); } @@ -78,7 +78,7 @@ public void completeRecipe(VETileEntity tile) { tile.getInventory().extractItem(0,1,false); tile.getInventory().insertItem(1,plank.copy(), false); tile.getInventory().insertItem(2,dust.copy(), false); - tile.getTank(0).fillTank(stack.copy()); + tile.getRelationalTank(0).fillTank(stack.copy()); return; } super.completeRecipe(tile); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java index 3b2730e0c..5730efff6 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java @@ -45,7 +45,7 @@ public void processRecipe(VETileEntity tile) { airMultiplier++; if (Blocks.AIR == level.getBlockState(new BlockPos(x, y, z - 1)).getBlock()) airMultiplier++; - if (addAirToTank(airMultiplier, tile.getTank(0))) { + if (addAirToTank(airMultiplier, tile.getRelationalTank(0))) { tile.consumeEnergy(); if (++soundTick == 19) { soundTick = 0; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java index e4a098680..832f5a8f5 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java @@ -16,6 +16,7 @@ public class CombustionGeneratorProcessor extends DefaultProcessor { public static final int COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT = 250; public static final int COMBUSTION_GENERATOR_PROCESS_TIME = 1600; + // TODO Make sure it doesn't do an extra "empty" process when it's finished processing @Override public void validateRecipe(VETileEntity tile) { tile.setPotentialRecipes(VERecipe.getPotentialRecipes(tile)); @@ -57,8 +58,8 @@ public void processRecipe(VETileEntity tile) { FluidStack fuel = tile.getFluidStackFromTank(0); FluidStack oxi = tile.getFluidStackFromTank(1); - tile.getTank(0).getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); - tile.getTank(1).getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); + tile.getRelationalTank(0).getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); + tile.getRelationalTank(1).getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); int powerGeneration = CombustibleFluidsData.getEnergyProduced(fuel); float multiplier = OxidizerFluidsData.getOxidizerMultiplier(oxi); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java index 4969e01f2..107704f58 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java @@ -1,6 +1,7 @@ package com.veteam.voluminousenergy.recipe.processor; import com.veteam.voluminousenergy.VoluminousEnergy; +import com.veteam.voluminousenergy.achievements.triggers.VECriteriaTriggers; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.persistence.ChunkFluid; import com.veteam.voluminousenergy.persistence.ChunkFluids; @@ -9,6 +10,7 @@ import com.veteam.voluminousenergy.tools.Config; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundSource; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LightningBolt; @@ -16,6 +18,7 @@ import net.minecraft.world.level.ChunkPos; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.AABB; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.registries.RegistryObject; @@ -37,6 +40,15 @@ public void processRecipe(VETileEntity tile) { int buildTick = tile.getData("build_tick"); if (buildTick != 1000) { + if(buildTick == 999) { + int x = tile.getBlockPos().getX(); + int y = tile.getBlockPos().getY(); + int z = tile.getBlockPos().getZ(); + for (ServerPlayer serverplayer : tile.getLevel().getEntitiesOfClass(ServerPlayer.class, (new AABB(x, y, z, x, y - 4, z)).inflate(50.0D, 50.0D, 50.0D))) { + VECriteriaTriggers.CONSTRUCT_DIMENSIONAL_LASER_TRIGGER.trigger(serverplayer, 3); + } + } + if (buildTick == 1) { tile.getLevel().playSound(null, tile.getBlockPos(), VESounds.ENERGY_BEAM_ACTIVATE, SoundSource.BLOCKS, 1.0F, 1.0F); } @@ -68,6 +80,7 @@ public void processRecipe(VETileEntity tile) { tile.setData("build_tick", buildTick + 1); return; } + if (!tile.canConsumeEnergy()) return; ItemStack stack = tile.getStackInSlot(2); if (stack.isEmpty()) { @@ -92,7 +105,7 @@ public void processRecipe(VETileEntity tile) { FluidStack currentFluid = tile.getFluidStackFromTank(0); int amount = Math.min(singleChunkFluid.getAmount(), DEFAULT_TANK_CAPACITY - currentFluid.getAmount()); - boolean canFill = tile.getTank(0).testFillTank(new FluidStack(singleChunkFluid.getFluid(), amount)) > 0; + boolean canFill = tile.getRelationalTank(0).testFillTank(new FluidStack(singleChunkFluid.getFluid(), amount)) > 0; if (!canFill) return; int counter = tile.getData("counter"); @@ -100,7 +113,7 @@ public void processRecipe(VETileEntity tile) { if (counter == 1) { counter--; FluidStack fluidStack = new FluidStack(singleChunkFluid.getFluid(), amount); - tile.getTank(0).fillTank(fluidStack); + tile.getRelationalTank(0).fillTank(fluidStack); tile.consumeEnergy(); tile.setChanged(); } else if (counter > 0) { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/ElectricFurnaceProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/ElectricFurnaceProcessor.java index 49bad5bfe..f50cca732 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/ElectricFurnaceProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/ElectricFurnaceProcessor.java @@ -32,7 +32,6 @@ void processForRecipe(Recipe recipe, VETileEntity tile) { return; } int counter = tile.getData("counter"); - VoluminousEnergy.LOGGER.info("Counter: " + counter); if (counter == 1) { counter--; tile.getInventory().extractItem(0, 1, false); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java index 41fa0c602..b2a3cb70d 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java @@ -1,17 +1,121 @@ package com.veteam.voluminousenergy.recipe.processor; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.blocks.tiles.inventory.VEItemStackHandler; +import com.veteam.voluminousenergy.items.VEItems; +import com.veteam.voluminousenergy.items.data.CombustibleFluidsData; +import com.veteam.voluminousenergy.sounds.VESounds; +import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.util.TagUtil; +import net.minecraft.core.RegistryAccess; +import net.minecraft.sounds.SoundSource; +import net.minecraft.world.SimpleContainer; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.BlastingRecipe; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.item.crafting.SmeltingRecipe; +import net.minecraft.world.level.Level; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.IFluidHandler; public class GasFiredFurnaceProcessor implements AbstractRecipeProcessor { + private SmeltingRecipe furnaceRecipe; + private BlastingRecipe blastingRecipe; + @Override public void processRecipe(VETileEntity tile) { + if (blastingRecipe != null) processForRecipe(blastingRecipe, tile); + else if (furnaceRecipe != null) processForRecipe(furnaceRecipe, tile); + } + + void processForRecipe(Recipe recipe, VETileEntity tile) { + + int fuelCounter = tile.getData("fuel_counter"); + FluidStack fuel = tile.getFluidStackFromTank(0); + + // Gas processing + if (fuelCounter > 0) { + fuelCounter--; + } else if (!fuel.isFluidEqual(FluidStack.EMPTY)) { + // Drain Input + tile.getRelationalTank(0).getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); + fuelCounter = 400 * CombustibleFluidsData.getEnergyProduced(fuel); + VEItemStackHandler inventory = tile.getInventory(); + if (inventory.getStackInSlot(4).getCount() > 0 && inventory.getStackInSlot(4).getItem() == VEItems.QUARTZ_MULTIPLIER.get()) { + fuelCounter = fuelCounter / (inventory.getStackInSlot(4).getCount() ^ 2); + } else if (!inventory.getStackInSlot(4).isEmpty() && TagUtil.isTaggedMachineUpgradeItem(inventory.getStackInSlot(4))) { + ItemStack upgradeStack = inventory.getStackInSlot(4).copy(); + if (upgradeStack.getTag() != null && !upgradeStack.getTag().isEmpty()) { + float multiplier = upgradeStack.getTag().getFloat("multiplier"); + multiplier = multiplier / 0.5F > 1 ? 1 : multiplier / 0.5F; + fuelCounter = (int) (fuelCounter * multiplier); + } + } + tile.setData("fuel_length", fuelCounter); + tile.setChanged(); + } else { + // No gas? No processing. + return; + } + tile.setData("fuel_counter", fuelCounter); + + + if (!canInsertIntoResult(recipe, tile.getLevel().registryAccess(), tile.getStackInSlot(3))) { + return; + } + int counter = tile.getData("counter"); + if (counter == 1) { + counter--; + tile.getInventory().extractItem(2, 1, false); + ItemStack output = recipe.getResultItem(tile.getLevel().registryAccess()).copy(); + tile.getInventory().insertItem(1, output, false); + } else if (counter > 0) { + counter--; + int soundTick = tile.getData("sound_tick"); + if (++soundTick == 19) { + soundTick = 0; + if (Config.PLAY_MACHINE_SOUNDS.get()) { + tile.getLevel().playSound(null, tile.getBlockPos(), VESounds.GENERAL_MACHINE_NOISE, SoundSource.BLOCKS, 1.0F, 1.0F); + } + } + tile.setData("sound_tick", soundTick); + } else { + counter = tile.updateCounter(200); + } + tile.setData("counter", counter); + tile.setChanged(); } @Override public void validateRecipe(VETileEntity tile) { + Level level = tile.getLevel(); + ItemStack furnaceInput = tile.getStackInSlot(2); + var blastingRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(furnaceInput.copy()), level).orElse(null); + if (blastingRecipeNew != null) { + blastingRecipe = blastingRecipeNew.value(); + tile.updateCounter(200); + tile.setChanged(); + return; + } else blastingRecipe = null; + var furnaceRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(furnaceInput.copy()), level).orElse(null); + if (furnaceRecipeNew != null) { + furnaceRecipe = furnaceRecipeNew.value(); + tile.updateCounter(200); + tile.setChanged(); + return; + } else furnaceRecipe = null; + tile.setData("counter", 0); + tile.setData("length", 0); + tile.setChanged(); } + boolean canInsertIntoResult(Recipe recipe, RegistryAccess access, ItemStack currentStack) { + ItemStack result = recipe.getResultItem(access); + if (!result.is(currentStack.getItem()) && !currentStack.isEmpty()) return false; + return result.getCount() + currentStack.getCount() <= result.getMaxStackSize(); + } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/PumpTileProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/PumpTileProcessor.java index 93f966a8b..cc88dc051 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/PumpTileProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/PumpTileProcessor.java @@ -36,7 +36,7 @@ public void processRecipe(VETileEntity tile) { lY = tile.getData("ly"); lZ = tile.getData("lz"); - VERelationalTank fluidTank = tile.getTank(0); + VERelationalTank fluidTank = tile.getRelationalTank(0); if (fluidTank.getTank().getFluidAmount() + 1000 <= DEFAULT_TANK_CAPACITY) { for (int i = 0; i < 50; i++) { @@ -121,7 +121,7 @@ public boolean fluidPumpMethod(VETileEntity tile) { void addFluidToTank(VETileEntity tile,Fluid fluid) { tile.getLevel().setBlockAndUpdate(tile.getBlockPos().offset(lX, lY, lZ), Blocks.AIR.defaultBlockState()); tile.consumeEnergy(); - tile.getTank(0).getTank() + tile.getRelationalTank(0).getTank() .fill(new FluidStack(fluid, 1000), IFluidHandler.FluidAction.EXECUTE); } } From d86bec4ac69b33dcb886d14d192f4ca1c3b1593b Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Wed, 10 Apr 2024 05:27:21 -0400 Subject: [PATCH 16/27] Renamed some methods, updated the gas furnace. Fixed the battery box --- .../blocks/machines/BatteryBoxBlock.java | 4 +- .../containers/ToolingStationContainer.java | 8 +- .../blocks/containers/VEContainer.java | 4 +- .../blocks/containers/VEContainers.java | 59 +++++------- .../blocks/containers/tank/TankContainer.java | 4 +- .../blocks/inventory/slots/VEOutputSlot.java | 4 +- .../blocks/screens/AirCompressorScreen.java | 2 +- .../blocks/screens/AqueoulizerScreen.java | 2 +- .../blocks/screens/BatteryBoxScreen.java | 57 ++---------- .../blocks/screens/BlastFurnaceScreen.java | 2 +- .../screens/CentrifugalAgitatorScreen.java | 2 +- .../screens/CentrifugalSeparatorScreen.java | 2 +- .../screens/CombustionGeneratorScreen.java | 2 +- .../blocks/screens/CompressorScreen.java | 2 +- .../blocks/screens/CrusherScreen.java | 2 +- .../screens/DimensionalLaserScreen.java | 4 +- .../screens/DistillationUnitScreen.java | 2 +- .../blocks/screens/ElectricFurnaceScreen.java | 2 +- .../blocks/screens/ElectrolyzerScreen.java | 2 +- .../screens/FluidElectrolyzerScreen.java | 2 +- .../blocks/screens/FluidMixerScreen.java | 2 +- .../blocks/screens/GasFiredFurnaceScreen.java | 8 +- .../screens/HydroponicIncubatorScreen.java | 2 +- .../screens/ImplosionCompressorScreen.java | 2 +- .../screens/PrimitiveBlastFurnaceScreen.java | 2 +- .../PrimitiveStirlingGeneratorScreen.java | 2 +- .../blocks/screens/SawmillScreen.java | 2 +- .../screens/StirlingGeneratorScreen.java | 2 +- .../blocks/tiles/BatteryBoxTile.java | 17 +--- .../blocks/tiles/VETileEntities.java | 10 +- .../blocks/tiles/VETileEntity.java | 61 +++++++----- .../blocks/tiles/VETileEntityFactory.java | 2 +- .../BatteryBoxInventoryValidator.java | 12 +++ .../GasFiredFurnaceInventoryValidator.java | 41 +++++++++ .../inventory/GasFiredFurnaceValidator.java | 36 -------- .../blocks/tiles/state/AbstractTileAddon.java | 4 + .../blocks/tiles/state/CustomAddon.java | 5 + .../recipe/parser/AbstractRecipeParser.java | 2 +- .../recipe/processor/BatteryBoxProcessor.java | 92 +++++++++++++++++++ .../processor/GasFiredFurnaceProcessor.java | 14 +-- .../tools/buttons/VEPowerIOManager.java | 29 ------ .../BatteryBoxSendOutPowerButton.java | 15 +-- .../packets/BatteryBoxSendOutPowerPacket.java | 13 ++- .../packets/BatteryBoxSlotPairPacket.java | 9 +- .../tools/sidemanager/VESlotManager.java | 6 +- .../voluminousenergy/util/SlotType.java | 10 +- .../voluminousenergy/util/TextUtil.java | 8 +- .../assets/voluminousenergy/lang/en_us.json | 2 +- 48 files changed, 305 insertions(+), 273 deletions(-) create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/BatteryBoxInventoryValidator.java create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/GasFiredFurnaceInventoryValidator.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/GasFiredFurnaceValidator.java create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/state/AbstractTileAddon.java create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/state/CustomAddon.java create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/BatteryBoxProcessor.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/tools/buttons/VEPowerIOManager.java diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BatteryBoxBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BatteryBoxBlock.java index baa0162bd..ea63a7abf 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BatteryBoxBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BatteryBoxBlock.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.blocks.blocks.machines; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -31,7 +31,7 @@ public BatteryBoxBlock() { @Nullable @Override public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) { // Replaces old createBlockEntity method - return new BatteryBoxTile(pos, state); + return VETileEntities.BATTERY_BOX_FACTORY.create(pos, state); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java index 184d4bc11..8b7faa118 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java @@ -62,9 +62,9 @@ public ToolingStationContainer(int id, Level world, BlockPos pos, Inventory inve @Override protected void addSlotsToGUI(IItemHandler h) { - addSlot(new VEBucketSlot(h, 0, 38, 18)); // Fluid input tilePos + addSlot(new VEBucketSlot(h, 0, 38, 18)); // Fluid input slot addSlot(new VEBucketSlot(h, 1, 38, 49)); // Extract fluid from input - addSlot(new VEInsertSlot(h, 2, 86, 32)); // Main Tool tilePos + addSlot(new VEInsertSlot(h, 2, 86, 32)); // Main Tool slot addSlot(new VEInsertSlot(h, 3, 134, 18)); // Bit Slot addSlot(new VEInsertSlot(h, 4, 134, 49)); // Base Slot addSlot(new VEInsertSlot(h, 5, 154, -14)); // Upgrade Slot @@ -86,8 +86,8 @@ public ItemStack handleCoreQuickMoveStackLogic(final int index, final int contai } } else if (!this.slots.get(3).hasItem() && !this.slots.get(4).hasItem() - && !moveItemStackTo(slotStack, 2, 3, false)) { // Multitool tilePos id is 2 - // Place the main machine in the main result tilePos + && !moveItemStackTo(slotStack, 2, 3, false)) { // Multitool slot id is 2 + // Place the main machine in the main result slot return ItemStack.EMPTY; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java index c1f8d7e46..4897434e8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java @@ -116,8 +116,8 @@ public int getEnergy() { } public int powerScreen(int px) { - int stored = tileEntity.getCapability(ForgeCapabilities.ENERGY).map(IEnergyStorage::getEnergyStored).orElse(0); - int max = tileEntity.getCapability(ForgeCapabilities.ENERGY).map(IEnergyStorage::getMaxEnergyStored).orElse(0); + int stored = tileEntity.getEnergy().getEnergyStored(); + int max = tileEntity.getEnergy().getMaxEnergyStored(); return (((stored * 100 / max * 100) / 100) * px) / 100; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java index 4f6824371..2f64aae30 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java @@ -10,8 +10,8 @@ public class VEContainers { public static final VEContainerFactory AIR_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() .create(AIR_COMPRESSOR_CONTAINER, AIR_COMPRESSOR_BLOCK) - .addSlot(70, 18, new BucketInputSlot(UP, 0)) // Air Compressor bucket input tilePos - .addSlot(70, 49, new BucketOutputSlot(DOWN)) // Air Compressor bucket output tilePos + .addSlot(70, 18, new BucketInputSlot(UP, 0)) // Air Compressor bucket input slot + .addSlot(70, 49, new BucketOutputSlot(DOWN)) // Air Compressor bucket output slot .addUpgradeSlot(154, -14) // Upgrade Slot .build(); @@ -27,29 +27,18 @@ public class VEContainers { public static final VEContainerFactory BATTERY_BOX_FACTORY = new VEContainerFactoryBuilder() .create(BATTERY_BOX_CONTAINER, BATTERY_BOX_BLOCK) - .addSlot(35, 17, new InputSlot(UP)) - .addSlot(53, 17, new InputSlot(UP)) - .addSlot(71, 17, new InputSlot(UP)) - .addSlot(89, 17, new InputSlot(UP)) - .addSlot(107, 17, new InputSlot(UP)) - .addSlot(125, 17, new InputSlot(UP)) - //Bottom Slots - .addSlot(35, 54, new InputSlot(DOWN)) - .addSlot(53, 54, new InputSlot(DOWN)) - .addSlot(71, 54, new InputSlot(DOWN)) - .addSlot(89, 54, new InputSlot(DOWN)) - .addSlot(107, 54, new InputSlot(DOWN)) - .addSlot(125, 54, new InputSlot(DOWN)) + .addSlot(35, 17, new InputSlot(UP)) // Top Slot + .addSlot(35, 54, new ItemOutputSlot(DOWN)) //Bottom Slot .build(); public static final VEContainerFactory BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() .create(BLAST_FURNACE_CONTAINER, BLAST_FURNACE_BLOCK) - .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Fluid input tilePos + .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Fluid input slot .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from heat tank - .addSlot(80, 25, new InputSlot(EAST)) // First input tilePos - .addSlot(80, 43, new InputSlot(WEST)) // Second input tilePos - .addSlot(134, 34, new ItemOutputSlot(NORTH)) // Third input tilePos - .addUpgradeSlot(130, -14) // Upgrade tilePos. + .addSlot(80, 25, new InputSlot(EAST)) // First input slot + .addSlot(80, 43, new InputSlot(WEST)) // Second input slot + .addSlot(134, 34, new ItemOutputSlot(NORTH)) // Third input slot + .addUpgradeSlot(130, -14) // Upgrade slot. .build(); public static final VEContainerFactory CENTRIFUGAL_AGITATOR_FACTORY = new VEContainerFactoryBuilder() @@ -60,13 +49,13 @@ public class VEContainers { .addSlot(96, 49, new BucketOutputSlot(SOUTH)) // Bucket extract; first output tank .addSlot(137, 18, new BucketInputSlot(EAST, 2)) // Bucket insert; second output tank .addSlot(137, 49, new BucketOutputSlot(WEST)) // Bucket extract; second output tank - .addUpgradeSlot(130, -14) // Upgrade tilePos + .addUpgradeSlot(130, -14) // Upgrade slot .build(); public static final VEContainerFactory CENTRIFUGAL_SEPARATOR_FACTORY = new VEContainerFactoryBuilder() .create(CENTRIFUGAL_SEPARATOR_CONTAINER, CENTRIFUGAL_SEPARATOR_BLOCK) - .addSlot(53, 24, new ItemInputSlot(UP)) // Primary input tilePos - .addSlot(53, 42, new ItemInputSlot(WEST)) // Empty Bucket tilePos + .addSlot(53, 24, new ItemInputSlot(UP)) // Primary input slot + .addSlot(53, 42, new ItemInputSlot(WEST)) // Empty Bucket slot .addSlot(99, 33, new ItemOutputSlot(DOWN)) //Main Output .addSlot(117, 15, new ItemOutputSlot(NORTH)) //RNG #1 Slot .addSlot(135, 33, new ItemOutputSlot(SOUTH)) //RNG #2 Slot @@ -76,9 +65,9 @@ public class VEContainers { public static final VEContainerFactory COMBUSTION_GENERATOR_FACTORY = new VEContainerFactoryBuilder() .create(COMBUSTION_GENERATOR_CONTAINER, COMBUSTION_GENERATOR_BLOCK) - .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Oxidizer input tilePos - .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from oxidizer tilePos - .addSlot(138, 18, new BucketInputSlot(NORTH, 1)) // Fuel input tilePos + .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Oxidizer input slot + .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from oxidizer slot + .addSlot(138, 18, new BucketInputSlot(NORTH, 1)) // Fuel input slot .addSlot(138, 49, new BucketOutputSlot(SOUTH)) // Extract fluid from fuel output .build(); @@ -86,7 +75,7 @@ public class VEContainers { .create(COMPRESSOR_CONTAINER, COMPRESSOR_BLOCK) .addSlot(80, 13, new ItemInputSlot(UP)) .addSlot(80, 58, new ItemOutputSlot(DOWN)) //Main Output - .addUpgradeSlot(154, -14) //Upgrade tilePos + .addUpgradeSlot(154, -14) //Upgrade slot .build(); public static final VEContainerFactory CRUSHER_FACTORY = new VEContainerFactoryBuilder() @@ -94,23 +83,23 @@ public class VEContainers { .addSlot(80, 13, new ItemInputSlot(UP)) // Input Slot .addSlot(71, 58, new ItemOutputSlot(DOWN)) //Main Output .addSlot(89, 58, new ItemOutputSlot(NORTH)) // RNG slot - .addUpgradeSlot(154, -14) //Upgrade tilePos + .addUpgradeSlot(154, -14) //Upgrade slot .build(); public static final VEContainerFactory DIMENSIONAL_LASER_FACTORY = new VEContainerFactoryBuilder() .create(DIMENSIONAL_LASER_CONTAINER, DIMENSIONAL_LASER_BLOCK) - .addSlot(138, 18, new BucketInputSlot(UP, 0)) // Bucket top tilePos - .addSlot(138, 49, new BucketOutputSlot(DOWN)) // Bucket bottom tilePos - .addSlot(38, 33, new ItemInputSlot(NORTH)) // RFID chip tilePos - .addUpgradeSlot(130, -14) // Upgrade tilePos + .addSlot(138, 18, new BucketInputSlot(UP, 0)) // Bucket top slot + .addSlot(138, 49, new BucketOutputSlot(DOWN)) // Bucket bottom slot + .addSlot(38, 33, new ItemInputSlot(NORTH)) // RFID chip slot + .addUpgradeSlot(130, -14) // Upgrade slot .build(); public static final VEContainerFactory DISTILLATION_UNIT_FACTORY = new VEContainerFactoryBuilder() .create(DISTILLATION_UNIT_CONTAINER, DISTILLATION_UNIT_BLOCK) - .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Fluid input tilePos + .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Fluid input slot .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from input - .addSlot(96, 11, new BucketInputSlot(UP, 1)) // Top tilePos for first output - .addSlot(96, 42, new BucketOutputSlot(DOWN)) // Bottom tilePos for first output + .addSlot(96, 11, new BucketInputSlot(UP, 1)) // Top slot for first output + .addSlot(96, 42, new BucketOutputSlot(DOWN)) // Bottom slot for first output .addSlot(137, 11, new BucketInputSlot(UP, 2)) // Top tilePos for from second output .addSlot(137, 42, new BucketOutputSlot(DOWN)) // Bottom tilePos for second output .addSlot(122, 64, new ItemOutputSlot(DOWN)) // Item Output Slot diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java index e24fb7089..e9261de16 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java @@ -26,8 +26,8 @@ public TankContainer(int id, Level world, BlockPos pos, Inventory inventory, Pla @Override public void addSlotsToGUI(IItemHandler h) { - addSlot(new VEInsertSlot(h, 0, 70, 19)); // Bucket top tilePos - addSlot(new VEInsertSlot(h, 1, 70, 50)); // Bucket bottom tilePos + addSlot(new VEInsertSlot(h, 0, 70, 19)); // Bucket top slot + addSlot(new VEInsertSlot(h, 1, 70, 50)); // Bucket bottom slot } @Nonnull diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEOutputSlot.java b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEOutputSlot.java index 2a7e866af..6888aec71 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEOutputSlot.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/inventory/slots/VEOutputSlot.java @@ -14,8 +14,8 @@ public VEOutputSlot(IItemHandler itemHandler, int index, int xPos, int yPos) { /* We override this and return false since no item can - be valid in an output tilePos. This is to prevent - users from putting anything in the output tilePos + be valid in an output slot. This is to prevent + users from putting anything in the output slot */ @Override // mayPlace, as in, you may place it if it's valid. (MCP: isItemValid) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java index 185a43e0d..97fe3f30b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java @@ -100,7 +100,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); } catch (Exception e) { } - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java index b9e3c7bed..14f4982ea 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java @@ -125,7 +125,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, } catch (Exception e) { } drawIOSideHelper(); - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java index cb214f222..fcb8063cc 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java @@ -3,9 +3,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.buttons.VEPowerIOManager; import com.veteam.voluminousenergy.tools.buttons.batteryBox.BatteryBoxSendOutPowerButton; import com.veteam.voluminousenergy.tools.buttons.batteryBox.BatteryBoxSlotPairButton; import com.veteam.voluminousenergy.tools.buttons.batteryBox.VEBatterySwitchManager; @@ -23,14 +22,14 @@ public class BatteryBoxScreen extends VEContainerScreen { - private final BatteryBoxTile tileEntity; + private final VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/battery_box_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); public BatteryBoxScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (BatteryBoxTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -52,33 +51,16 @@ protected void init() { })); // Bottom Row - addRenderableWidget(new SlotBoolButton(tileEntity.getSlotManagers().get(8), (this.width / 2) - 198, this.topPos + 20, button -> { + addRenderableWidget(new SlotBoolButton(tileEntity.getSlotManagers().get(1), (this.width / 2) - 198, this.topPos + 20, button -> { // Do nothing })); - addRenderableWidget(new SlotDirectionButton(tileEntity.getSlotManagers().get(8), (this.width / 2) - 184, this.topPos + 20, button -> { + addRenderableWidget(new SlotDirectionButton(tileEntity.getSlotManagers().get(1), (this.width / 2) - 184, this.topPos + 20, button -> { // Do nothing })); - - VEBatterySwitchManager[] switchManagers = this.tileEntity.getSwitchManagers(); - VEPowerIOManager vePowerIOManager = this.tileEntity.getPowerIOManager(); - // Slot arrows - addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[0], (this.width / 2) - 54, topPos + 34, 0, button -> { - })); - addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[1], (this.width / 2) - 36, topPos + 34, 1, button -> { - })); - addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[2], (this.width / 2) - 18, topPos + 34, 2, button -> { - })); - addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[3], (this.width / 2), topPos + 34, 3, button -> { - })); - addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[4], (this.width / 2) + 18, topPos + 34, 4, button -> { - })); - addRenderableWidget(new BatteryBoxSlotPairButton(switchManagers[5], (this.width / 2) + 36, topPos + 34, 5, button -> { - })); - // Send Out Power Button - addRenderableWidget(new BatteryBoxSendOutPowerButton(vePowerIOManager, (this.width / 2) - 79, topPos + 3, tileEntity, button -> { + addRenderableWidget(new BatteryBoxSendOutPowerButton((this.width / 2) - 79, topPos + 3, tileEntity, button -> { })); } @@ -100,19 +82,9 @@ protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mo protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { // Top Row TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 35, 17, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 53, 17, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 71, 17, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 89, 17, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 107, 17, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("0")), 125, 17, WHITE_TEXT_STYLE); // Bottom Row TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 35, 54, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 53, 54, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 71, 54, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 89, 54, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 107, 54, WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, (TextUtil.translateString("gui.voluminousenergy.slot_short").copy().append("1")), 125, 54, WHITE_TEXT_STYLE); } @@ -123,7 +95,7 @@ protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { } if (isHovering(10, 4, 15, 10, mouseX, mouseY)) { - if (tileEntity.getPowerIOManager().isFlipped()) { + if (tileEntity.sendsOutPower()) { matrixStack.renderTooltip(this.font, TextUtil.translateString("text.voluminousenergy.battery_box.sending_out_power"), mouseX, mouseY); } else { matrixStack.renderTooltip(this.font, TextUtil.translateString("text.voluminousenergy.battery_box.receiving_power"), mouseX, mouseY); @@ -155,20 +127,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, //this.blit(matrixStack,i+81,j+31,176,0,progress,17); matrixStack.blit(this.GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); - for (VEBatterySwitchManager switchManager : tileEntity.getSwitchManagers()) { - updateSlotPairButton(switchManager.isFlipped(), switchManager.getSlot()); - } - updateSendOutPowerButton(tileEntity.getPowerIOManager().isFlipped()); - } - } - - public void updateSlotPairButton(boolean status, int id) { - for (Renderable widget : this.renderables) { - if (widget instanceof BatteryBoxSlotPairButton batteryBoxSlotPairButton) { - if (batteryBoxSlotPairButton.getId() == id) { - batteryBoxSlotPairButton.setStatus(status); - } - } + updateSendOutPowerButton(tileEntity.sendsOutPower()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java index f34d5a971..7ff0916b5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java @@ -130,7 +130,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 61, j + 18, 0, 12, 50); drawIOSideHelper(); - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } else { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java index 04c4bb8a1..1e9d476f0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java @@ -139,7 +139,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, } catch (Exception e) { } drawIOSideHelper(); - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java index 843f01a9c..624d13020 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java @@ -103,7 +103,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(this.GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); } - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java index b334890be..ce831e535 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java @@ -112,7 +112,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); if (tileEntity != null) { - int progress = tileEntity.progressProcessingCounterPX(14); + int progress = tileEntity.progressBurnCounterPX(14); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java index 84578a9ec..4e55ae4bc 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java @@ -102,7 +102,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); } - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java index aeb937842..55ec5ef22 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java @@ -102,7 +102,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); } - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java index 80d649390..f4341730c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java @@ -74,7 +74,7 @@ protected void init() { // Do nothing })); - // RFID tilePos + // RFID slot addRenderableWidget(new SlotBoolButton(slotManagers.get(2), (this.width / 2) - 198, this.topPos + 40, button -> { // Do nothing })); @@ -170,7 +170,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), this.getFluidStackFromTank(), tileEntity.getTankCapacity(), i + 119, j + 18, 0, 12, 50); drawIOSideHelper(); - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } else { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java index 289ce7d80..fffe49a6e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java @@ -148,7 +148,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, } catch (Exception e) { } drawIOSideHelper(); - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } else { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java index 85d727526..1caa07110 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java @@ -130,7 +130,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); } - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java index dbb30c1f5..b8c99d711 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java @@ -104,7 +104,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); drawIOSideHelper(); } - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java index affa6f69d..5c610aff1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java @@ -142,7 +142,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, } catch (Exception e) { } drawIOSideHelper(); - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java index a8eac6a2d..c3e6ca9c3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java @@ -144,7 +144,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, } catch (Exception e) { } drawIOSideHelper(); - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 129, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java index fd60029ea..ba824317d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java @@ -81,8 +81,9 @@ public Rect2i getFuelTooltipArea() { public List getFuelTooltips() { return Arrays.asList( - Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.percent_burned").getString() + ": " + tileEntity.progressCounterPercent() + "%"), - Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.getData("counter"))); + Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.percent_burned").getString() + ": " + + tileEntity.progressCounterPercent(tileEntity.getData("fuel_counter"),tileEntity.getData("fuel_length")) + "%"), + Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.getData("fuel_counter"))); } public Rect2i getCounterTooltipArea() { @@ -106,7 +107,8 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, final int flameHeight = 14; if (tileEntity != null) { int progress = tileEntity.progressProcessingCounterPX(9); - int fuelProgress = tileEntity.progressBurnCounterPX(flameHeight); + int fuelProgress = tileEntity.progressBurnCounterPX( + flameHeight,tileEntity.getData("fuel_counter"),tileEntity.getData("fuel_length")); /*Note for this.blit below: p_blit_1_ = starting x for blit on screen diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java index c846dd41d..17a4f4efb 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java @@ -123,7 +123,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, } catch (Exception e) { } drawIOSideHelper(); - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java index 7b96ba945..b4dc53dc3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java @@ -137,7 +137,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, matrixStack.blit(GUI, i + 78, j + 31, 176, 0, progress, 17); matrixStack.blit(GUI, i + 11, j + (16 + (49 - power)), 176, 24 + (49 - power), 12, power); } - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); drawIOSideHelper(); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java index ea0692917..5cdd2164d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java @@ -127,7 +127,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, //this.blit(i,j,180,1,progress,15); drawIOSideHelper(); } - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java index c6c3b62d6..7a8f32c1b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java @@ -48,7 +48,7 @@ protected void init() { })); - // Input tilePos + // Input slot addRenderableWidget(new SlotBoolButton(tileEntity.getSlotManagers().get(0), (this.width / 2) - 198, this.topPos, button -> { // Do nothing })); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java index e2394f480..7f3cad7b0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java @@ -119,7 +119,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getFluidStackFromTank(0), tileEntity.getTankCapacity(), i + 138, j + 18, 0, 12, 50); drawIOSideHelper(); - // Upgrade tilePos + // Upgrade slot RenderSystem.setShaderTexture(0, GUI_TOOLS); matrixStack.blit(GUI_TOOLS, i + 153, j - 16, 0, 0, 18, 18); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java index 6c4a4b2c4..96e2d3a24 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java @@ -102,7 +102,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, int j = (this.height - this.imageHeight) / 2; matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); if (tileEntity != null) { - int progress = tileEntity.progressProcessingCounterPX(14); + int progress = tileEntity.progressBurnCounterPX(14); int power = menu.powerScreen(49); /*Note for this.blit below: diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java index abda287ea..239894224 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java @@ -4,7 +4,6 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.items.batteries.VEEnergyItem; import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.buttons.VEPowerIOManager; import com.veteam.voluminousenergy.tools.buttons.batteryBox.VEBatterySwitchManager; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; import com.veteam.voluminousenergy.util.SlotType; @@ -87,8 +86,6 @@ public void updatePacketFromGui(int direction, int slotId) { private boolean topIsIngress = true; - private final VEPowerIOManager powerIOManager = new VEPowerIOManager(true); - public BatteryBoxTile(BlockPos pos, BlockState state) { super(VEBlocks.BATTERY_BOX_TILE.get(), pos, state, null); } @@ -116,7 +113,6 @@ public ItemStack extractItem(int slot, int amount, boolean simulate) { @Override protected void onContentsChanged(final int slot) { super.onContentsChanged(slot); - BatteryBoxTile.this.setChanged(); } }; @@ -148,7 +144,7 @@ public void tick() { } } } - if (powerIOManager.isFlipped()) { + if (this.sendsOutPower) { sendOutPower(); } } @@ -211,7 +207,7 @@ private void moveItem(int i) { ItemStack itemStack = inventory.getStackInSlot(i).copy(); if (inventory.getStackInSlot(i + 6).isEmpty()) { //VoluminousEnergy.LOGGER.debug("Empty check passed"); - // Remove item in the ith, tilePos and move it to i+6th tilePos indicating it's discharged + // Remove item in the ith, slot and move it to i+6th tilePos indicating it's discharged itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energy -> { //VoluminousEnergy.LOGGER.debug("Item has Energy Capability"); if ((!switchManagers[i].isFlipped() && energy.getEnergyStored() == energy.getMaxEnergyStored()) @@ -267,8 +263,6 @@ public void load(CompoundTag tag) { switchManagers[3].setFlipped(tag.getBoolean("slot_pair_mode_3")); switchManagers[4].setFlipped(tag.getBoolean("slot_pair_mode_4")); switchManagers[5].setFlipped(tag.getBoolean("slot_pair_mode_5")); - - powerIOManager.setFlipped(tag.getBoolean("send_out_power")); super.load(tag); } @@ -281,8 +275,6 @@ public void saveAdditional(@NotNull CompoundTag tag) { tag.putBoolean("slot_pair_mode_3", switchManagers[3].isFlipped()); tag.putBoolean("slot_pair_mode_4", switchManagers[4].isFlipped()); tag.putBoolean("slot_pair_mode_5", switchManagers[5].isFlipped()); - - tag.putBoolean("send_out_power", powerIOManager.isFlipped()); super.saveAdditional(tag); } @@ -307,7 +299,6 @@ public void updateSlotPair(boolean mode, int pairId) { } public void updateSendOutPower(boolean sendOutPower) { - this.powerIOManager.setFlipped(sendOutPower); if (sendOutPower) { energy.setMaxReceive(0); } else { @@ -318,8 +309,4 @@ public void updateSendOutPower(boolean sendOutPower) { public VEBatterySwitchManager[] getSwitchManagers() { return switchManagers; } - - public VEPowerIOManager getPowerIOManager() { - return powerIOManager; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index 67beb60c5..aa49dacf3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -4,9 +4,10 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidInputTank; import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidOutputTank; +import com.veteam.voluminousenergy.blocks.tiles.inventory.BatteryBoxInventoryValidator; import com.veteam.voluminousenergy.blocks.tiles.inventory.DimensionalLaserInventoryValidator; import com.veteam.voluminousenergy.blocks.tiles.inventory.FurnaceInventoryValidator; -import com.veteam.voluminousenergy.blocks.tiles.inventory.GasFiredFurnaceValidator; +import com.veteam.voluminousenergy.blocks.tiles.inventory.GasFiredFurnaceInventoryValidator; import com.veteam.voluminousenergy.recipe.processor.*; import com.veteam.voluminousenergy.tools.Config; @@ -46,7 +47,9 @@ public class VETileEntities { new VETileEntityFactory(VEBlocks.BATTERY_BOX_TILE, VEContainers.BATTERY_BOX_FACTORY) .addEnergyStorage( Config.BATTERY_BOX_MAX_POWER.get(), - Config.BATTERY_BOX_TRANSFER.get()); + Config.BATTERY_BOX_TRANSFER.get()) + .withCustomInventoryValidator(new BatteryBoxInventoryValidator()) + .withCustomRecipeProcessing(new BatteryBoxProcessor()); public static final VETileEntityFactory BLAST_FURNACE_FACTORY = new VETileEntityFactory(VEBlocks.BLAST_FURNACE_TILE, VEContainers.BLAST_FURNACE_FACTORY) @@ -221,7 +224,7 @@ public class VETileEntities { .makesSound() .addDataFlag("fuel_length") .addDataFlag("fuel_counter") - .withCustomInventoryValidator(new GasFiredFurnaceValidator()) + .withCustomInventoryValidator(new GasFiredFurnaceInventoryValidator()) .withCustomRecipeProcessing(new GasFiredFurnaceProcessor()); public static final VETileEntityFactory HYDROPONIC_INCUBATOR_FACTORY = @@ -289,7 +292,6 @@ public class VETileEntities { .withRecipe(STIRLING) .withCustomRecipeProcessing(new GeneratorProcessor(true, 4)); - // TODO make a custom processor public static final VETileEntityFactory PUMP_FACTORY = new VETileEntityFactory(VEBlocks.PUMP_TILE, VEContainers.PUMP_FACTORY) .addEnergyStorage( diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 768f77a56..734c6b1be 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -1,6 +1,8 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.tiles.inventory.VEItemStackHandler; +import com.veteam.voluminousenergy.blocks.tiles.state.AbstractTileAddon; +import com.veteam.voluminousenergy.blocks.tiles.state.CustomAddon; import com.veteam.voluminousenergy.items.VEItems; import com.veteam.voluminousenergy.items.upgrades.MysteriousMultiplier; import com.veteam.voluminousenergy.recipe.VERecipe; @@ -60,6 +62,7 @@ public abstract class VETileEntity extends BlockEntity implements MenuProvider { final List managers = new ArrayList<>(); final HashMap dataMap = new HashMap<>(); final HashMap tagMap = new HashMap<>(); + final HashMap stateManager = new HashMap<>(); AbstractRecipeProcessor recipeProcessor; boolean sendsOutPower; @@ -101,7 +104,7 @@ public void inputFluid(VERelationalTank tank, int slot1, int slot2) { } - //use for when the input and output tilePos are different + //use for when the input and output slot are different public void outputFluid(VERelationalTank tank, int slot1, int slot2) { ItemStack inputSlot = tank.getInput(); ItemStack outputSlot = tank.getOutput(); @@ -266,16 +269,6 @@ protected int consumptionMultiplier(int consumption, int slot) { return consumption; } - - /** - * Quickly get the energy stored in the tile - * - * @return int representing the stored energy of the tile entity - */ - protected int getEnergyStored() { - return this.getCapability(ForgeCapabilities.ENERGY).map(IEnergyStorage::getEnergyStored).orElse(0); - } - @Nonnull @Override public CompoundTag getUpdateTag() { @@ -285,7 +278,7 @@ public CompoundTag getUpdateTag() { } /** - * Loads inventory, energy, tilePos managers, counter, and length. + * Loads inventory, energy, slot managers, counter, and length. * * @param tag CompoundTag */ @@ -318,11 +311,15 @@ public void load(CompoundTag tag) { relationalTank.readGuiProperties(tag); } + if(tag.contains("sends_out_power")) { + this.sendsOutPower = tag.getBoolean("sends_out_power"); + } + super.load(tag); } /** - * Saves inventory, energy, tilePos managers, counter, and length. + * Saves inventory, energy, slot managers, counter, and length. * To save the tile call setChanged(); * * @param tag CompoundTag @@ -356,6 +353,8 @@ public void saveAdditional(@NotNull CompoundTag tag) { relationalTank.writeGuiProperties(tag); } + tag.putBoolean("sends_out_power", sendsOutPower); + super.saveAdditional(tag); } @@ -416,8 +415,8 @@ void sendOutPower() { } /** - * @param status boolean status of the tilePos - * @param slotId int id of the tilePos + * @param status boolean status of the slot + * @param slotId int id of the slot */ public void updatePacketFromGui(boolean status, int slotId) { for (VESlotManager slot : getSlotManagers()) { @@ -450,6 +449,8 @@ public void updatePacketFromGui(int direction, int slotId) { @Nonnull public LazyOptional getCapability(@Nonnull Capability cap, @Nullable Direction side) { + if(this.sendsOutPower && cap == ForgeCapabilities.ENERGY) return LazyOptional.empty(); + ItemStackHandler inventory = getInventoryHandler(); List itemManagers = getSlotManagers(); if (capabilityMap == null) { @@ -460,8 +461,8 @@ public LazyOptional getCapability(@Nonnull Capability cap, @Nullable D /** * Call this to consume energy - * Note that tiles now require an upgrade tilePos and thus an inventory to properly function here - * If you need to consume energy WITHOUT an upgrade tilePos make a new method that does not have this. + * Note that tiles now require an upgrade slot and thus an inventory to properly function here + * If you need to consume energy WITHOUT an upgrade slot make a new method that does not have this. * Throws an error if missing the power consumeEnergy IMPL */ public void consumeEnergy() { @@ -518,7 +519,7 @@ public boolean canConsumeEnergy() { } /** - * Important note. If the entity has no tilePos managers return a new ArrayList otherwise this will crash + * Important note. If the entity has no slot managers return a new ArrayList otherwise this will crash * * @return A not null List list */ @@ -548,7 +549,11 @@ public int progressBurnCounterPX(int px) { int counter = dataMap.get("counter"); int length = dataMap.get("length"); if (counter != 0 && length != 0) return (px * (((counter * 100) / length))) / 100; - ; + return 0; + } + + public int progressBurnCounterPX(int px,int counter, int length) { + if (counter != 0 && length != 0) return (px * (((counter * 100) / length))) / 100; return 0; } @@ -569,6 +574,14 @@ public int progressCounterPercent() { } } + public int progressCounterPercent(int counter, int length) { + if (length != 0) { + return (int) (100 - (((float) counter / (float) length) * 100)); + } else { + return 0; + } + } + public int ticksLeft() { return dataMap.get("counter"); } @@ -629,10 +642,6 @@ public List getManagers() { return managers; } - public boolean isFluidInputDirty() { - return fluidInputDirty; - } - public boolean isRecipeDirty() { return isRecipeDirty; } @@ -682,6 +691,7 @@ public boolean sendsOutPower() { public void setSendsOutPower(boolean sendsOutPower) { this.sendsOutPower = sendsOutPower; + this.setChanged(); } public void setSelectedRecipe(VERecipe recipe) { @@ -732,4 +742,9 @@ public int updateCounter(int defaultProcessTime) { this.setChanged(); return newLength; } + + @Nullable + public AbstractTileAddon getCustomAddon(CustomAddon addon) { + return this.stateManager.get(addon); + } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java index 59197c652..3835b9cd7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java @@ -90,7 +90,7 @@ public AABB getRenderBoundingBox() { newTile.dataMap.putAll(dataMap); newTile.tagMap.putAll(tagMap); - // Set energy before the tilePos count otherwise we'll run into issues with the data tilePos + // Set energy before the slot count otherwise we'll run into issues with the data slot if (storage != null) newTile.energy = storage.copy(); diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/BatteryBoxInventoryValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/BatteryBoxInventoryValidator.java new file mode 100644 index 000000000..b2a773004 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/BatteryBoxInventoryValidator.java @@ -0,0 +1,12 @@ +package com.veteam.voluminousenergy.blocks.tiles.inventory; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.common.capabilities.ForgeCapabilities; + +public class BatteryBoxInventoryValidator implements AbstractItemStackValidator { + @Override + public boolean isItemValid(int slot, ItemStack itemStack, VETileEntity tile) { + return itemStack.getCapability(ForgeCapabilities.ENERGY).isPresent(); + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/GasFiredFurnaceInventoryValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/GasFiredFurnaceInventoryValidator.java new file mode 100644 index 000000000..eff86a53f --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/GasFiredFurnaceInventoryValidator.java @@ -0,0 +1,41 @@ +package com.veteam.voluminousenergy.blocks.tiles.inventory; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.items.data.CombustibleFluidsData; +import com.veteam.voluminousenergy.util.TagUtil; +import net.minecraft.world.SimpleContainer; +import net.minecraft.world.item.BucketItem; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.material.Fluids; + +public class GasFiredFurnaceInventoryValidator extends FurnaceInventoryValidator { + + @Override + public boolean isItemValid(int slot, ItemStack stack, VETileEntity tile) { + if (tile.getEnergy() != null && tile.getEnergy().getUpgradeSlotId() == slot) + return TagUtil.isTaggedMachineUpgradeItem(stack); + + if (slot == 0) { + if (stack.getItem() instanceof BucketItem item) { + return item.getFluid().isSame(Fluids.EMPTY) || CombustibleFluidsData.isCombustible(item.getFluid()); + } + return false; + } + + if (slot == 1) return stack.getItem() instanceof BucketItem; + + if (slot == 2) { + Level level = tile.getLevel(); + var furnaceRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, + new SimpleContainer(stack.copy()), level).orElse(null); + if (furnaceRecipeNew != null) return true; + var blastingRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, + new SimpleContainer(stack.copy()), level).orElse(null); + return blastingRecipeNew != null; + } + return true; + } + +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/GasFiredFurnaceValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/GasFiredFurnaceValidator.java deleted file mode 100644 index a9d43acb6..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/GasFiredFurnaceValidator.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles.inventory; - -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.items.data.CombustibleFluidsData; -import com.veteam.voluminousenergy.util.TagUtil; -import net.minecraft.world.SimpleContainer; -import net.minecraft.world.item.BucketItem; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.material.Fluids; - -public class GasFiredFurnaceValidator extends FurnaceInventoryValidator { - - @Override - public boolean isItemValid(int slot, ItemStack stack, VETileEntity tile) { - if(tile.getEnergy() != null && tile.getEnergy().getUpgradeSlotId() == slot) return TagUtil.isTaggedMachineUpgradeItem(stack); - - if(slot == 0) { - if(stack.getItem() instanceof BucketItem item) { - return item.getFluid().isSame(Fluids.EMPTY) || CombustibleFluidsData.isCombustible(item.getFluid()); - } - return false; - } - if (slot == 1) return stack.getItem() instanceof BucketItem; - if (slot != 2) return true; - Level level = tile.getLevel(); - var furnaceRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, - new SimpleContainer(stack.copy()), level).orElse(null); - if(furnaceRecipeNew != null) return true; - var blastingRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, - new SimpleContainer(stack.copy()), level).orElse(null); - return blastingRecipeNew != null; - } - -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/state/AbstractTileAddon.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/state/AbstractTileAddon.java new file mode 100644 index 000000000..a03b1582c --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/state/AbstractTileAddon.java @@ -0,0 +1,4 @@ +package com.veteam.voluminousenergy.blocks.tiles.state; + +public class AbstractTileAddon { +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/state/CustomAddon.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/state/CustomAddon.java new file mode 100644 index 000000000..c1e1b509a --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/state/CustomAddon.java @@ -0,0 +1,5 @@ +package com.veteam.voluminousenergy.blocks.tiles.state; + +public enum CustomAddon { + POWER_SWITCH +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/AbstractRecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/AbstractRecipeParser.java index 06554304c..67d8a6cc8 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/AbstractRecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/AbstractRecipeParser.java @@ -55,7 +55,7 @@ public interface AbstractRecipeParser { /** * A simple util record to help with readability - * @param tilePos The position of the item/fluid/etc within the tile (ie tank 0) + * @param slot The position of the item/fluid/etc within the tile (ie tank 0) * @param recipePos The position of the item/fluid/etc within the recipe (ie result 0) */ record SlotAndRecipePos(int tilePos, int recipePos) { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/BatteryBoxProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/BatteryBoxProcessor.java new file mode 100644 index 000000000..82360ff39 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/BatteryBoxProcessor.java @@ -0,0 +1,92 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.blocks.tiles.inventory.VEItemStackHandler; +import com.veteam.voluminousenergy.items.batteries.VEEnergyItem; +import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.common.capabilities.ForgeCapabilities; +import net.minecraftforge.energy.IEnergyStorage; + +public class BatteryBoxProcessor implements AbstractRecipeProcessor { + + private final int POWER_MAX_TX = Config.BATTERY_BOX_TRANSFER.get(); + private final int MAX_POWER = Config.BATTERY_BOX_MAX_POWER.get(); + + @Override + public void validateRecipe(VETileEntity tile) { + + } + + @Override + public void processRecipe(VETileEntity tile) { + + ItemStack stack = tile.getStackInSlot(0); + + stack.getCapability(ForgeCapabilities.ENERGY).ifPresent(itemEnergy -> { + VEEnergyStorage storage = tile.getEnergy(); + if (tile.sendsOutPower()) { + if (dischargeItem(stack, itemEnergy, storage)) + moveItem(tile); + } else { + if (chargeItem(stack, itemEnergy, storage)) + moveItem(tile); + } + }); + } + + void moveItem(VETileEntity tile) { + ItemStack stack = tile.getStackInSlot(0); + ItemStack output = tile.getStackInSlot(1); + + if (!output.isEmpty()) return; + + VEItemStackHandler handler = tile.getInventory(); + ItemStack newStack = stack.copy(); + newStack.setCount(1); + handler.insertItem(1, newStack, false); + handler.extractItem(0, 1, false); + tile.setChanged(); + } + + private boolean dischargeItem(ItemStack stack, IEnergyStorage itemEnergy, VEEnergyStorage tileEnergy) { + if (tileEnergy.getEnergyStored() < tileEnergy.getMaxEnergyStored()) { + if (itemEnergy.canExtract()) { + int toExtract; + if (stack.getItem() instanceof VEEnergyItem) { + int maxExtractItem = ((VEEnergyItem) stack.getItem()).getMaxTransfer(); + toExtract = Math.min(itemEnergy.getEnergyStored(), maxExtractItem); + toExtract = Math.min(toExtract, POWER_MAX_TX); + } else toExtract = Math.min(itemEnergy.getEnergyStored(), POWER_MAX_TX); + + int amountExtracted = itemEnergy.extractEnergy(toExtract, false); + tileEnergy.receiveEnergy(amountExtracted, false); + return itemEnergy.getEnergyStored() == 0; + } + } + return false; + } + + private boolean chargeItem(ItemStack stack, IEnergyStorage itemEnergy, VEEnergyStorage tileEnergy) { + if (tileEnergy.getEnergyStored() > 0) { + if (itemEnergy.canReceive()) { + int toReceive; + if (stack.getItem() instanceof VEEnergyItem) { + int maxReceiveItem = ((VEEnergyItem) stack.getItem()).getMaxTransfer(); + toReceive = Math.min( + (itemEnergy.getMaxEnergyStored() - itemEnergy.getEnergyStored()), + maxReceiveItem); + toReceive = Math.min(toReceive, POWER_MAX_TX); + toReceive = Math.min(toReceive, tileEnergy.getEnergyStored()); + } else + toReceive = Math.min((itemEnergy.getMaxEnergyStored() - itemEnergy.getEnergyStored()), POWER_MAX_TX); + + int extracted = tileEnergy.extractEnergy(toReceive, false); + itemEnergy.receiveEnergy(extracted, false); + return itemEnergy.getEnergyStored() == itemEnergy.getMaxEnergyStored(); + } + } + return false; + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java index b2a3cb70d..cdc0104a3 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java @@ -26,12 +26,6 @@ public class GasFiredFurnaceProcessor implements AbstractRecipeProcessor { @Override public void processRecipe(VETileEntity tile) { - if (blastingRecipe != null) processForRecipe(blastingRecipe, tile); - else if (furnaceRecipe != null) processForRecipe(furnaceRecipe, tile); - } - - void processForRecipe(Recipe recipe, VETileEntity tile) { - int fuelCounter = tile.getData("fuel_counter"); FluidStack fuel = tile.getFluidStackFromTank(0); @@ -57,12 +51,14 @@ void processForRecipe(Recipe recipe, VETileEntity tile) { tile.setData("fuel_length", fuelCounter); tile.setChanged(); } else { - // No gas? No processing. return; } tile.setData("fuel_counter", fuelCounter); + if (blastingRecipe != null) processForRecipe(blastingRecipe, tile); + else if (furnaceRecipe != null) processForRecipe(furnaceRecipe, tile); + } - + void processForRecipe(Recipe recipe, VETileEntity tile) { if (!canInsertIntoResult(recipe, tile.getLevel().registryAccess(), tile.getStackInSlot(3))) { return; } @@ -71,7 +67,7 @@ void processForRecipe(Recipe recipe, VETileEntity tile) { counter--; tile.getInventory().extractItem(2, 1, false); ItemStack output = recipe.getResultItem(tile.getLevel().registryAccess()).copy(); - tile.getInventory().insertItem(1, output, false); + tile.getInventory().insertItem(3, output, false); } else if (counter > 0) { counter--; int soundTick = tile.getData("sound_tick"); diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/VEPowerIOManager.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/VEPowerIOManager.java deleted file mode 100644 index 34162e8d2..000000000 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/VEPowerIOManager.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.veteam.voluminousenergy.tools.buttons; - -import net.minecraft.nbt.CompoundTag; - -public class VEPowerIOManager { - - private boolean flipped; - - public VEPowerIOManager(boolean flipped) { - this.flipped = flipped; - } - - public boolean isFlipped() { - return flipped; - } - - public void setFlipped(boolean flipped) { - this.flipped = flipped; - } - - public void write(CompoundTag nbt, String prefix) { - nbt.putBoolean(prefix + "_enabled", isFlipped()); - } - - public void read(CompoundTag nbt, String prefix) { - setFlipped(nbt.getBoolean(prefix + "_enabled")); - } - -} diff --git a/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/BatteryBoxSendOutPowerButton.java b/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/BatteryBoxSendOutPowerButton.java index b21b10581..3ff3442aa 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/BatteryBoxSendOutPowerButton.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/buttons/batteryBox/BatteryBoxSendOutPowerButton.java @@ -2,9 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.buttons.VEIOButton; -import com.veteam.voluminousenergy.tools.buttons.VEPowerIOManager; import com.veteam.voluminousenergy.tools.networking.VENetwork; import com.veteam.voluminousenergy.tools.networking.packets.BatteryBoxSendOutPowerPacket; import net.minecraft.client.gui.GuiGraphics; @@ -16,19 +15,17 @@ public class BatteryBoxSendOutPowerButton extends VEIOButton { private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/battery_box_gui.png"); - private final BatteryBoxTile batteryBoxTile; + private final VETileEntity tile; private boolean sendOutPower; private int u = 0; private int v = 166; - private final VEPowerIOManager powerIOManager; - public BatteryBoxSendOutPowerButton(VEPowerIOManager powerIOManager, int x, int y, BatteryBoxTile batteryBoxTile, OnPress onPress) { + public BatteryBoxSendOutPowerButton(int x, int y, VETileEntity tile, OnPress onPress) { super(x, y, 18, 20, Component.nullToEmpty(""), button -> { ((BatteryBoxSendOutPowerButton) button).cycle(); onPress.onPress(button); }); - this.powerIOManager = powerIOManager; - this.batteryBoxTile = batteryBoxTile; + this.tile = tile; setX(x); setY(y); this.width = 16; @@ -50,8 +47,7 @@ public void renderWidget(GuiGraphics matrixStack, int p_renderButton1, int p_ren private void cycle() { sendOutPower = !sendOutPower; - powerIOManager.setFlipped(true); - this.batteryBoxTile.updateSendOutPower(sendOutPower); + tile.setSendsOutPower(sendOutPower); } @Override @@ -62,6 +58,5 @@ public void onPress() { public void setStatus(boolean status) { sendOutPower = status; - powerIOManager.setFlipped(sendOutPower); } } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java index a734d86e7..6f5c8cdff 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSendOutPowerPacket.java @@ -1,7 +1,7 @@ package com.veteam.voluminousenergy.tools.networking.packets; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.inventory.AbstractContainerMenu; @@ -47,15 +47,14 @@ public static void handle(BatteryBoxSendOutPowerPacket packet, CustomPayloadEven public static void handlePacket(BatteryBoxSendOutPowerPacket packet, AbstractContainerMenu openContainer, boolean onServer) { if (openContainer != null) { - if (openContainer instanceof VEContainer batteryBoxContainer) { + if (openContainer instanceof VEContainer container) { if (onServer) { - BlockEntity tileEntity = batteryBoxContainer.getTileEntity(); - if (tileEntity instanceof BatteryBoxTile batteryBoxTile) { - batteryBoxTile.updateSendOutPower(packet.status); - batteryBoxTile.setChanged(); + BlockEntity tileEntity = container.getTileEntity(); + if(tileEntity instanceof VETileEntity tile) { + tile.setSendsOutPower(packet.status); } } else { - batteryBoxContainer.updateSendOutPowerButton(packet.status); + container.updateSendOutPowerButton(packet.status); } } } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java index 167b19282..91a3cec7e 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BatteryBoxSlotPairPacket.java @@ -1,7 +1,6 @@ package com.veteam.voluminousenergy.tools.networking.packets; import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.inventory.AbstractContainerMenu; @@ -54,10 +53,10 @@ public static void handlePacket(BatteryBoxSlotPairPacket packet, AbstractContain if (openContainer instanceof VEContainer batteryBoxContainer) { if (onServer) { BlockEntity tileEntity = batteryBoxContainer.getTileEntity(); - if (tileEntity instanceof BatteryBoxTile batteryBoxTile) { - batteryBoxTile.updateSlotPair(packet.status, packet.id); - batteryBoxTile.setChanged(); - } +// if (tileEntity instanceof BatteryBoxTile batteryBoxTile) { +// batteryBoxTile.updateSlotPair(packet.status, packet.id); +// batteryBoxTile.setChanged(); +// } } } } diff --git a/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java b/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java index 789977361..54569c763 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/sidemanager/VESlotManager.java @@ -32,12 +32,12 @@ public VESlotManager(int slotNum, Direction direction, boolean status, SlotType } /** - * Use this for when you have an input tilePos type + * Use this for when you have an input slot type * - * @param slotNum The tilePos number is the index in the array of the slotManagers + * @param slotNum The slot number is the index in the array of the slotManagers * @param direction The direction it will be facing by default * @param status The status of the IO - * @param slotType The type of tilePos + * @param slotType The type of slot * @param outputSlot The slotNum of the tank to which a bucket will be placed when this has processed a bucket * @param tankId The index of the tank in the fluidManagers */ diff --git a/src/main/java/com/veteam/voluminousenergy/util/SlotType.java b/src/main/java/com/veteam/voluminousenergy/util/SlotType.java index ac5d097e3..2ea734b97 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/SlotType.java +++ b/src/main/java/com/veteam/voluminousenergy/util/SlotType.java @@ -1,11 +1,11 @@ package com.veteam.voluminousenergy.util; public enum SlotType { - INPUT("tilePos.voluminousenergy.input_slot"), - OUTPUT("tilePos.voluminousenergy.output_slot"), - UPGRADE("tilePos.voluminousenergy.upgrade_slot"), - FLUID_INPUT("tilePos.voluminousenergy.input_slot", true), - FLUID_OUTPUT("tilePos.voluminousenergy.output_slot", true); + INPUT("slot.voluminousenergy.input_slot"), + OUTPUT("slot.voluminousenergy.output_slot"), + UPGRADE("slot.voluminousenergy.upgrade_slot"), + FLUID_INPUT("slot.voluminousenergy.input_slot", true), + FLUID_OUTPUT("slot.voluminousenergy.output_slot", true); private final String translationKey; private boolean isFluidBucketIORelated = false; diff --git a/src/main/java/com/veteam/voluminousenergy/util/TextUtil.java b/src/main/java/com/veteam/voluminousenergy/util/TextUtil.java index 39efcf1ce..4e612cf4b 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/TextUtil.java +++ b/src/main/java/com/veteam/voluminousenergy/util/TextUtil.java @@ -17,10 +17,10 @@ public class TextUtil { // Slots - public static Component TRANSLATED_INPUT_SLOT = TextUtil.translateString("tilePos.voluminousenergy.input_slot"); - public static Component TRANSLATED_OUTPUT_SLOT = TextUtil.translateString("tilePos.voluminousenergy.output_slot"); - public static Component TRANSLATED_RNG_SLOT = TextUtil.translateString("tilePos.voluminousenergy.rng_slot"); - public static Component TRANSLATED_BUCKET_SLOT = TextUtil.translateString("tilePos.voluminousenergy.bucket_slot"); + public static Component TRANSLATED_INPUT_SLOT = TextUtil.translateString("slot.voluminousenergy.input_slot"); + public static Component TRANSLATED_OUTPUT_SLOT = TextUtil.translateString("slot.voluminousenergy.output_slot"); + public static Component TRANSLATED_RNG_SLOT = TextUtil.translateString("slot.voluminousenergy.rng_slot"); + public static Component TRANSLATED_BUCKET_SLOT = TextUtil.translateString("slot.voluminousenergy.bucket_slot"); // Tanks public static Component TRANSLATED_INPUT_TANK = TextUtil.translateString("tank.voluminousenergy.input_tank"); diff --git a/src/main/resources/assets/voluminousenergy/lang/en_us.json b/src/main/resources/assets/voluminousenergy/lang/en_us.json index 8694aebbb..391a3f1b2 100644 --- a/src/main/resources/assets/voluminousenergy/lang/en_us.json +++ b/src/main/resources/assets/voluminousenergy/lang/en_us.json @@ -413,7 +413,7 @@ "advancements.voluminousenergy.machine.obtain.stirling_generator.description": "Upgrade your Primitive Stirling Generator to a Stirling Generator to formally enter the age of coal power!", "advancements.voluminousenergy.machine.obtain.combustion_generator.title": "Fluid Age", "advancements.voluminousenergy.machine.obtain.combustion_generator.description": "Pfft! Solid fuels are so outdated. Fluid-based fuels offer so much more energy!", - "advancements.voluminousenergy.machine.obtain.battery_box.title": "Is this a battery?", + "advancements.voluminousenergy.machine.obtain.battery_box.title": "CHARRRRRGE!!!", "advancements.voluminousenergy.machine.obtain.battery_box.description": "Craft a battery box and figure out what it does!", "advancements.voluminousenergy.machine.obtain.centrifugal_separator.title": "Dizzy dusts unmix", "advancements.voluminousenergy.machine.obtain.centrifugal_separator.description": "Craft a Centrifugal Separator and start spinning those dusts around!", From f08d390699a0997adda87eba50b95c8ae4ad4340 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Wed, 10 Apr 2024 07:21:43 -0400 Subject: [PATCH 17/27] Fixed CombustionGeneratorProcessor --- .../CombustionGeneratorProcessor.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java index 832f5a8f5..bacf42583 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java @@ -1,5 +1,6 @@ package com.veteam.voluminousenergy.recipe.processor; +import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.items.data.CombustibleFluidsData; import com.veteam.voluminousenergy.items.data.OxidizerFluidsData; @@ -7,6 +8,7 @@ import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; +import com.veteam.voluminousenergy.util.VERelationalTank; import net.minecraft.sounds.SoundSource; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; @@ -58,23 +60,34 @@ public void processRecipe(VETileEntity tile) { FluidStack fuel = tile.getFluidStackFromTank(0); FluidStack oxi = tile.getFluidStackFromTank(1); - tile.getRelationalTank(0).getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); - tile.getRelationalTank(1).getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); + VERelationalTank fuelTank = tile.getRelationalTank(0); + VERelationalTank oxiTank = tile.getRelationalTank(1); int powerGeneration = CombustibleFluidsData.getEnergyProduced(fuel); float multiplier = OxidizerFluidsData.getOxidizerMultiplier(oxi); + if(fuelTank.getTank().getFluidAmount() < COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT || oxiTank.getTank().getFluidAmount() < COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT) { + return; + } + + fuelTank.getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); + oxiTank.getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); + if (Config.COMBUSTION_GENERATOR_BALANCED_MODE.get()) { counter = COMBUSTION_GENERATOR_PROCESS_TIME / 4; } else { counter = Config.COMBUSTION_GENERATOR_FIXED_TICK_TIME.get() / 4; } - tile.getEnergy().setProduction((int) (powerGeneration * multiplier)); + int production = (int) (powerGeneration * multiplier); + + VoluminousEnergy.LOGGER.info("Setting production to: " + production); + + storage.setProduction(production); tile.setData("length",counter); tile.setChanged(); } else { - tile.getEnergy().setProduction(0); + storage.setProduction(0); } tile.setData("counter", counter); } From 6f91b3e10765bfc3d9be68c2d900b6219a7bbe60 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Wed, 10 Apr 2024 08:33:24 -0400 Subject: [PATCH 18/27] Renamed some methods. Fixed IndustrialBlastingRecipe --- .../blocks/screens/BlastFurnaceScreen.java | 23 +- .../blocks/tiles/BatteryBoxTile.java | 312 ---------------- .../blocks/tiles/GasFiredFurnaceTile.java | 351 ------------------ .../blocks/tiles/VETileEntities.java | 32 +- .../recipe/AqueoulizerRecipe.java | 6 +- .../recipe/CentrifugalAgitatorRecipe.java | 6 +- .../recipe/CentrifugalSeparatorRecipe.java | 8 +- .../recipe/CombustionGeneratorRecipe.java | 6 +- .../recipe/CompressorRecipe.java | 6 +- .../recipe/CrusherRecipe.java | 8 +- .../recipe/DimensionalLaserRecipe.java | 4 +- .../recipe/DistillationRecipe.java | 8 +- .../recipe/ElectrolyzerRecipe.java | 8 +- .../recipe/FluidElectrolyzerRecipe.java | 6 +- .../recipe/FluidMixerRecipe.java | 6 +- .../recipe/HydroponicIncubatorRecipe.java | 6 +- .../recipe/ImplosionCompressorRecipe.java | 6 +- .../recipe/IndustrialBlastingRecipe.java | 13 +- .../recipe/PrimitiveBlastFurnaceRecipe.java | 7 +- .../recipe/SawmillRecipe.java | 7 +- .../recipe/StirlingGeneratorRecipe.java | 6 +- .../recipe/ToolingRecipe.java | 6 +- .../voluminousenergy/recipe/VERecipe.java | 4 +- .../{RecipeParser.java => BasicParser.java} | 12 +- .../recipe/parser/HydroponicParser.java | 2 +- .../parser/ImplosionCompressorParser.java | 2 +- .../parser/IndustrialBlastFurnaceParser.java | 42 +++ ...GRecipeParser.java => RNGBasicParser.java} | 6 +- .../recipe/parser/SawmillParser.java | 2 +- ...aultProcessor.java => BasicProcessor.java} | 8 +- .../CombustionGeneratorProcessor.java | 3 +- .../recipe/processor/GeneratorProcessor.java | 4 +- .../processor/MultiBlockRecipeProcessor.java | 2 +- 33 files changed, 159 insertions(+), 769 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java rename src/main/java/com/veteam/voluminousenergy/recipe/parser/{RecipeParser.java => BasicParser.java} (94%) create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/parser/IndustrialBlastFurnaceParser.java rename src/main/java/com/veteam/voluminousenergy/recipe/parser/{RNGRecipeParser.java => RNGBasicParser.java} (93%) rename src/main/java/com/veteam/voluminousenergy/recipe/processor/{DefaultProcessor.java => BasicProcessor.java} (88%) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java index 7ff0916b5..594976884 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java @@ -14,6 +14,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.player.Inventory; +import net.minecraftforge.fluids.FluidStack; import org.jetbrains.annotations.NotNull; import java.util.Arrays; @@ -53,11 +54,15 @@ protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mo if (processor.isMultiBlockValid(tileEntity)) { TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("blast_furnace"), 8, 6, WHITE_TEXT_STYLE); + int temperatureKelvin = getTemperatureKelvin(tileEntity.getFluidStackFromTank(0)); + int celsius = getTemperatureCelsius(temperatureKelvin); + int fahrenheit = getTemperatureFahrenheit(temperatureKelvin); + TextUtil.renderShadowedText(matrixStack, this.font, Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.temperature").getString() + ": " + - tileEntity.getData("temperature_kelvin") + " K (" + - tileEntity.getData("temperature_celsius") + " \u00B0C) "), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); + temperatureKelvin + " K (" + + celsius + " \u00B0C) "), 8, (this.imageHeight - 96 + 2), WHITE_TEXT_STYLE); - TextUtil.renderShadowedText(matrixStack, this.font, Component.nullToEmpty(tileEntity.getData("temperature_fahrenheit") + " \u00B0F"), 101, (this.imageHeight - 103), WHITE_TEXT_STYLE); + TextUtil.renderShadowedText(matrixStack, this.font, Component.nullToEmpty(fahrenheit + " \u00B0F"), 101, (this.imageHeight - 103), WHITE_TEXT_STYLE); } super.renderLabels(matrixStack, mouseX, mouseY); @@ -143,4 +148,16 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, } + public int getTemperatureKelvin(FluidStack stack) { + return stack.getRawFluid().getFluidType().getTemperature(); + } + + public int getTemperatureCelsius(int kelvin) { + return kelvin - 273; + } + + public int getTemperatureFahrenheit(int fahrenheit) { + return (int) ((fahrenheit - 273) * 1.8) + 32; + } + } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java deleted file mode 100644 index 239894224..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java +++ /dev/null @@ -1,312 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.items.batteries.VEEnergyItem; -import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.tools.buttons.batteryBox.VEBatterySwitchManager; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.entity.BlockEntity; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import javax.annotation.Nonnull; -import java.util.ArrayList; -import java.util.List; - -public class BatteryBoxTile extends VETileEntity { - - private final int POWER_MAX_TX = Config.BATTERY_BOX_TRANSFER.get(); - private final int MAX_POWER = Config.BATTERY_BOX_MAX_POWER.get(); - - List slotManagers = new ArrayList<>() { - { - add(new VESlotManager(0, Direction.UP, true, SlotType.INPUT)); - add(new VESlotManager(1, Direction.UP, true, SlotType.INPUT)); - add(new VESlotManager(2, Direction.UP, true, SlotType.INPUT)); - add(new VESlotManager(3, Direction.UP, true, SlotType.INPUT)); - add(new VESlotManager(4, Direction.UP, true, SlotType.INPUT)); - add(new VESlotManager(5, Direction.UP, true, SlotType.INPUT)); - add(new VESlotManager(6, Direction.DOWN, true, SlotType.OUTPUT)); - add(new VESlotManager(7, Direction.DOWN, true, SlotType.OUTPUT)); - add(new VESlotManager(8, Direction.DOWN, true, SlotType.OUTPUT)); - add(new VESlotManager(9, Direction.DOWN, true, SlotType.OUTPUT)); - add(new VESlotManager(10, Direction.DOWN, true, SlotType.OUTPUT)); - add(new VESlotManager(11, Direction.DOWN, true, SlotType.OUTPUT)); - } - }; - - @Override - public void updatePacketFromGui(boolean status, int slotId) { - if (slotId < 6) { - for (int i = 0; i < 6; i++) { - slotManagers.get(i).setStatus(status); - } - } else if (slotId < 12) { - for (int i = 6; i < 12; i++) { - slotManagers.get(i).setStatus(status); - } - } - } - - @Override - public void updatePacketFromGui(int direction, int slotId) { - if (slotId < 6) { - for (int i = 0; i < 6; i++) { - this.capabilityMap.moveSlotManagerPos(slotManagers.get(i), direction); - } - } else if (slotId < 12) { - for (int i = 6; i < 12; i++) { - this.capabilityMap.moveSlotManagerPos(slotManagers.get(i), direction); - } - } - } - - // Modes and meta stuff for the battery box - private final VEBatterySwitchManager[] switchManagers = { - new VEBatterySwitchManager(0, true), - new VEBatterySwitchManager(1, true), - new VEBatterySwitchManager(2, true), - new VEBatterySwitchManager(3, true), - new VEBatterySwitchManager(4, true), - new VEBatterySwitchManager(5, true), - }; - - - private boolean topIsIngress = true; - - public BatteryBoxTile(BlockPos pos, BlockState state) { - super(VEBlocks.BATTERY_BOX_TILE.get(), pos, state, null); - } - - public ItemStackHandler inventory = new ItemStackHandler(12) { - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { //IS ITEM VALID PLEASE DO THIS PER SLOT TO SAVE DEBUG HOURS!!!! - return stack.getCapability(ForgeCapabilities.ENERGY).isPresent(); - } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { //ALSO DO THIS PER SLOT BASIS TO SAVE DEBUG HOURS!!! - if (stack.getCapability(ForgeCapabilities.ENERGY).isPresent()) - return super.insertItem(slot, stack, simulate); - return stack; - } - - @Override - @Nonnull - public ItemStack extractItem(int slot, int amount, boolean simulate) { - return super.extractItem(slot, amount, simulate); - } - - @Override - protected void onContentsChanged(final int slot) { - super.onContentsChanged(slot); - } - }; - - @Override - public void tick() { - updateClients(); - for (int i = 0; i < 12; i++) { - if (!inventory.getStackInSlot(i).isEmpty()) { - if (inventory.getStackInSlot(i).getCapability(ForgeCapabilities.ENERGY).isPresent()) { - if (i >= 6) { - int j = i - 6; - if (switchManagers[j].isFlipped()) { - //VoluminousEnergy.LOGGER.debug("Discharging: " + i); - dischargeItem(inventory.getStackInSlot(j)); - } else { - //VoluminousEnergy.LOGGER.debug("Charging: " + i); - chargeItem(inventory.getStackInSlot(j)); - } - } else { - if (switchManagers[i].isFlipped()) { - //VoluminousEnergy.LOGGER.debug("Discharging: " + i); - dischargeItem(inventory.getStackInSlot(i)); - } else { - //VoluminousEnergy.LOGGER.debug("Charging: " + i); - chargeItem(inventory.getStackInSlot(i)); - } - } - moveItem(i); - } - } - } - if (this.sendsOutPower) { - sendOutPower(); - } - } - - private void dischargeItem(ItemStack itemStack) { - if (energy.getEnergyStored() < energy.getMaxEnergyStored()) { - itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energyItem -> { - if (energyItem.canExtract()) { - int toExtract; - if (itemStack.getItem() instanceof VEEnergyItem) { - int maxExtractItem = ((VEEnergyItem) itemStack.getItem()).getMaxTransfer(); - toExtract = Math.min(energyItem.getEnergyStored(), maxExtractItem); - toExtract = Math.min(toExtract, POWER_MAX_TX); - } else toExtract = Math.min(energyItem.getEnergyStored(), POWER_MAX_TX); - - if (energyItem.getEnergyStored() > 0) { - if (toExtract + energy.getEnergyStored() <= MAX_POWER) { - energyItem.extractEnergy(toExtract, false); - energy.receiveEnergy(toExtract, false); - } else if (energy.getEnergyStored() != MAX_POWER) { - energyItem.extractEnergy(MAX_POWER - energy.getEnergyStored(), false); - energy.receiveEnergy(MAX_POWER - energy.getEnergyStored(), false); - } - } - } - }); - } - } - - private void chargeItem(ItemStack itemStack) { - if (energy.getEnergyStored() > 0) { - itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energyItem -> { - if (energyItem.canReceive()) { - int toReceive; - if (itemStack.getItem() instanceof VEEnergyItem) { - int maxReceiveItem = ((VEEnergyItem) itemStack.getItem()).getMaxTransfer(); - toReceive = Math.min( - (energyItem.getMaxEnergyStored() - energyItem.getEnergyStored()), - maxReceiveItem); - toReceive = Math.min(toReceive, POWER_MAX_TX); - toReceive = Math.min(toReceive, energy.getEnergyStored()); - } else - toReceive = Math.min((energyItem.getMaxEnergyStored() - energyItem.getEnergyStored()), POWER_MAX_TX); - - if (toReceive + energy.getEnergyStored() <= energyItem.getMaxEnergyStored()) { - energy.extractEnergy(toReceive, false); - energyItem.receiveEnergy(toReceive, false); - } else if (energyItem.getEnergyStored() != energyItem.getMaxEnergyStored()) { // Actually, this might not be needed - energy.extractEnergy(energyItem.getMaxEnergyStored() - energyItem.getEnergyStored(), false); - energyItem.receiveEnergy(energyItem.getMaxEnergyStored() - energyItem.getEnergyStored(), false); - } - } - }); - } - } - - private void moveItem(int i) { - if (i < 6) { - //VoluminousEnergy.LOGGER.debug("Move Item Called"); - ItemStack itemStack = inventory.getStackInSlot(i).copy(); - if (inventory.getStackInSlot(i + 6).isEmpty()) { - //VoluminousEnergy.LOGGER.debug("Empty check passed"); - // Remove item in the ith, slot and move it to i+6th tilePos indicating it's discharged - itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energy -> { - //VoluminousEnergy.LOGGER.debug("Item has Energy Capability"); - if ((!switchManagers[i].isFlipped() && energy.getEnergyStored() == energy.getMaxEnergyStored()) - || (switchManagers[i].isFlipped() && energy.getEnergyStored() == 0)) { - //VoluminousEnergy.LOGGER.debug("Energy stored is Max energy, or item is drained"); - inventory.extractItem(i, 1, false); - inventory.insertItem(i + 6, itemStack.copy(), false); - } - }); - } - } else if (inventory.getStackInSlot(i - 6).isEmpty()) { - ItemStack itemStack = inventory.getStackInSlot(i).copy(); - itemStack.getCapability(ForgeCapabilities.ENERGY).ifPresent(energy -> { - if ((switchManagers[i - 6].isFlipped() && energy.getEnergyStored() == energy.getMaxEnergyStored()) - || (!switchManagers[i - 6].isFlipped() && energy.getEnergyStored() == 0)) { - inventory.extractItem(i, 1, false); - inventory.insertItem(i - 6, itemStack.copy(), false); - } - }); - } - } - - public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxReceive) { - return tileEntity.getCapability(ForgeCapabilities.ENERGY, from).map(handler -> - handler.receiveEnergy(maxReceive, false)).orElse(0); - } - - void sendOutPower() { - for (Direction dir : Direction.values()) { - BlockEntity tileEntity = level.getBlockEntity(getBlockPos().relative(dir)); - Direction opposite = dir.getOpposite(); - if (tileEntity != null) { - // If less energy stored then max transfer send the all the energy stored rather than the max transfer amount - int smallest = Math.min(this.energy.getMaxTransfer(), energy.getEnergyStored()); - int received = receiveEnergy(tileEntity, opposite, smallest); - energy.consumeEnergy(received); - if (energy.getEnergyStored() <= 0) { - break; - } - } - } - } - - /* - Read and Write on World save - */ - - @Override - public void load(CompoundTag tag) { - switchManagers[0].setFlipped(tag.getBoolean("slot_pair_mode_0")); - switchManagers[1].setFlipped(tag.getBoolean("slot_pair_mode_1")); - switchManagers[2].setFlipped(tag.getBoolean("slot_pair_mode_2")); - switchManagers[3].setFlipped(tag.getBoolean("slot_pair_mode_3")); - switchManagers[4].setFlipped(tag.getBoolean("slot_pair_mode_4")); - switchManagers[5].setFlipped(tag.getBoolean("slot_pair_mode_5")); - super.load(tag); - } - - @Override - public void saveAdditional(@NotNull CompoundTag tag) { - - tag.putBoolean("slot_pair_mode_0", switchManagers[0].isFlipped()); - tag.putBoolean("slot_pair_mode_1", switchManagers[1].isFlipped()); - tag.putBoolean("slot_pair_mode_2", switchManagers[2].isFlipped()); - tag.putBoolean("slot_pair_mode_3", switchManagers[3].isFlipped()); - tag.putBoolean("slot_pair_mode_4", switchManagers[4].isFlipped()); - tag.putBoolean("slot_pair_mode_5", switchManagers[5].isFlipped()); - super.saveAdditional(tag); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.BATTERY_BOX_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @Override - public @Nonnull List getSlotManagers() { - return slotManagers; - } - - public void updateSlotPair(boolean mode, int pairId) { - switchManagers[pairId].setFlipped(mode); - } - - public void updateSendOutPower(boolean sendOutPower) { - if (sendOutPower) { - energy.setMaxReceive(0); - } else { - energy.setMaxReceive(this.energy.getMaxTransfer()); - } - } - - public VEBatterySwitchManager[] getSwitchManagers() { - return switchManagers; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java deleted file mode 100644 index 9b568ebc0..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java +++ /dev/null @@ -1,351 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.items.VEItems; -import com.veteam.voluminousenergy.recipe.CombustionGeneratorRecipe; -import com.veteam.voluminousenergy.recipe.RecipeCache; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TagUtil; -import com.veteam.voluminousenergy.util.TankType; -import com.veteam.voluminousenergy.util.VERelationalTank; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.Connection; -import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; -import net.minecraft.util.Mth; -import net.minecraft.world.SimpleContainer; -import net.minecraft.world.entity.ExperienceOrb; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.BucketItem; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.Items; -import net.minecraft.world.item.crafting.BlastingRecipe; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.item.crafting.SmeltingRecipe; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.material.Fluid; -import net.minecraft.world.level.material.Fluids; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.capability.IFluidHandler; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Objects; -import java.util.concurrent.atomic.AtomicReference; - -public class GasFiredFurnaceTile extends VETileEntity { - - List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); - add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); - add(new VESlotManager(2, Direction.EAST, true, SlotType.INPUT)); - add(new VESlotManager(3, Direction.WEST, true, SlotType.OUTPUT)); - }}; - - VERelationalTank fuelTank = new VERelationalTank(new FluidTank(DEFAULT_TANK_CAPACITY), 0, 0, TankType.INPUT, "fuel_tank:fuel_tank_gui"); - - List fluidManagers = new ArrayList<>() {{ - add(fuelTank); - }}; - - private int fuelCounter; - private int fuelLength; - - private final AtomicReference inputItemStack = new AtomicReference(new ItemStack(Items.AIR, 0)); - private final AtomicReference referenceStack = new AtomicReference(new ItemStack(Items.AIR, 0)); - - public GasFiredFurnaceTile(BlockPos pos, BlockState state) { - super(VEBlocks.GAS_FIRED_FURNACE_TILE.get(), pos, state, null); - } - - public ItemStackHandler inventory = createHandler(); - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } - - private SmeltingRecipe furnaceRecipe; - private BlastingRecipe blastingRecipe; - private CombustionGeneratorRecipe fuelRecipe; - - @Override - public void tick() { - updateClients(); - validateRecipe(); - processFluidIO(); - - ItemStack furnaceInput = inventory.getStackInSlot(2).copy(); - ItemStack furnaceOutput = inventory.getStackInSlot(3).copy(); - - inputItemStack.set(furnaceInput.copy()); // Atomic Reference, use this to query recipes FOR OUTPUT SLOT - - // Main Processing occurs here - if (!fuelTank.getTank().isEmpty()) { - if ((furnaceRecipe != null || blastingRecipe != null) && countChecker(furnaceRecipe, blastingRecipe, furnaceOutput.copy()) && itemChecker(furnaceRecipe, blastingRecipe, furnaceOutput.copy())) { - if (counter == 1) { - inventory.extractItem(2, 1, false); - - // Set output based on recipe - ItemStack newOutputStack; - newOutputStack = Objects.requireNonNullElse(furnaceRecipe, blastingRecipe).getResultItem(level.registryAccess()).copy(); - // Output Item - if (furnaceOutput.getItem() != newOutputStack.getItem() || furnaceOutput.getItem() == Items.AIR) { - if (furnaceOutput.getItem() == Items.AIR) { - furnaceOutput.setCount(1); - } - inventory.insertItem(3, newOutputStack.copy(), false); - } else { - furnaceOutput.setCount(Objects.requireNonNullElse(furnaceRecipe, blastingRecipe).getResultItem(level.registryAccess()).getCount()); - inventory.insertItem(3, furnaceOutput.copy(), false); - } - markRecipeDirty(); - counter--; - this.setChanged(); - } else if (counter > 0) { - counter--; - } else { - counter = updateCounter(200); - length = counter; - this.referenceStack.set(furnaceInput.copy()); - } - // Fuel Management - if (fuelCounter == 1) { - fuelCounter--; - } else if (fuelCounter > 0) { - fuelCounter--; - } else { - if (fuelRecipe != null) { - // Drain Input - fuelTank.getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); - fuelCounter = fuelRecipe.getProcessTime() / 4; - if (inventory.getStackInSlot(4).getCount() > 0 && inventory.getStackInSlot(4).getItem() == VEItems.QUARTZ_MULTIPLIER.get()) { - fuelCounter = fuelCounter / (inventory.getStackInSlot(4).getCount() ^ 2); - } else if (!inventory.getStackInSlot(4).isEmpty() && TagUtil.isTaggedMachineUpgradeItem(inventory.getStackInSlot(4))) { - ItemStack upgradeStack = inventory.getStackInSlot(4).copy(); - if (upgradeStack.getTag() != null && !upgradeStack.getTag().isEmpty()) { - float multiplier = upgradeStack.getTag().getFloat("multiplier"); - multiplier = multiplier / 0.5F > 1 ? 1 : multiplier / 0.5F; - fuelCounter = (int) (fuelCounter * multiplier); - } - } - fuelLength = fuelCounter; - this.setChanged(); - } - } - - } else counter = 0; - - - } else counter = 0; - } - - @Override - public void validateRecipe() { - if (!this.isRecipeDirty) { - return; - } - this.isRecipeDirty = false; - ItemStack furnaceInput = slotManagers.get(2).getItem(this.inventory); - var furnaceRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(furnaceInput.copy()), level).orElse(null); - var blastingRecipeNew = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(furnaceInput.copy()), level).orElse(null); - if (furnaceRecipeNew != null) furnaceRecipe = furnaceRecipeNew.value(); - else furnaceRecipe = null; - if (blastingRecipeNew != null) blastingRecipe = blastingRecipeNew.value(); - else blastingRecipe = null; - fuelRecipe = (CombustionGeneratorRecipe) - RecipeCache.getFluidRecipeFromCache(level, CombustionGeneratorRecipe.RECIPE_TYPE, Collections.singletonList(fuelTank.getTank().getFluid()), new ArrayList<>()); - } - - @Override - public void load(CompoundTag tag) { - fuelCounter = tag.getInt("fuel_counter"); - fuelLength = tag.getInt("fuel_length"); - super.load(tag); - } - - @Override - public void saveAdditional(@NotNull CompoundTag tag) { - tag.putInt("fuel_counter", fuelCounter); - tag.putInt("fuel_length", fuelLength); - super.saveAdditional(tag); - } - - @Override - public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) { - this.load(pkt.getTag()); - super.onDataPacket(net, pkt); - } - - - private ItemStackHandler createHandler() { - GasFiredFurnaceTile tile = this; - return new ItemStackHandler(5) { - @Override - protected void onContentsChanged(int slot) { - setChanged(); - tile.markRecipeDirty(); - tile.markFluidInputDirty(); - } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if ((slot == 0 || slot == 1) && stack.getItem() instanceof BucketItem bucketItem) { - Fluid fluid = bucketItem.getFluid(); - if (fluid.isSame(Fluids.EMPTY)) return true; - FluidStack fluidStack = new FluidStack(bucketItem.getFluid(), 1000); - return VERecipe.getCachedRecipes(CombustionGeneratorRecipe.RECIPE_TYPE) - .stream().anyMatch(r -> r.getFluidIngredient(0).test(fluidStack)); - } else if (slot == 2) { - return level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(stack), level).orElse(null) != null - || level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(stack), level).orElse(null) != null; - } else if (slot == 3) { - var furnaceRecipe = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(inputItemStack.get()), level).orElse(null); - var blastingRecipe = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(inputItemStack.get()), level).orElse(null); - - // If both recipes are null, then don't bother - if (blastingRecipe == null && furnaceRecipe == null) return false; - - return stack.getItem() == Objects.requireNonNullElse(furnaceRecipe, blastingRecipe).value().getResultItem(level.registryAccess()).getItem(); - - } else if (slot == 4) { - return TagUtil.isTaggedMachineUpgradeItem(stack); - } - return false; - } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { //ALSO DO THIS PER SLOT BASIS TO SAVE DEBUG HOURS!!! - if (!isItemValid(slot, stack)) return stack; - return super.insertItem(slot, stack, simulate); - } - - @Override - @Nonnull - public ItemStack extractItem(int slot, int amount, boolean simulate) { - if (level != null && !simulate) { - var furnaceRecipe = level.getRecipeManager().getRecipeFor(RecipeType.SMELTING, new SimpleContainer(referenceStack.get()), level).orElse(null); - var blastingRecipe = level.getRecipeManager().getRecipeFor(RecipeType.BLASTING, new SimpleContainer(referenceStack.get()), level).orElse(null); - if (blastingRecipe != null) { - if (inventory.getStackInSlot(slot).getItem() == blastingRecipe.value().getResultItem(level.registryAccess()).getItem()) { - if (blastingRecipe.value().getExperience() > 0) { - generateXP(amount, blastingRecipe.value().getExperience()); - } - } - } else if (furnaceRecipe != null) { - if (inventory.getStackInSlot(slot).getItem() == furnaceRecipe.value().getResultItem(level.registryAccess()).getItem()) { - if (furnaceRecipe.value().getExperience() > 0) { - generateXP(amount, furnaceRecipe.value().getExperience()); - } - } - } - } - return super.extractItem(slot, amount, simulate); - } - }; - } - - private void generateXP(int craftedAmount, float experience) { - if (level == null) return; - int i = Mth.floor((float) craftedAmount * experience); - float f = Mth.frac((float) craftedAmount * experience); - if (f != 0.0F && Math.random() < (double) f) ++i; - - while (i > 0) { - int j = ExperienceOrb.getExperienceValue(i); - i -= j; - level.addFreshEntity(new ExperienceOrb(level, worldPosition.getX(), worldPosition.getY(), worldPosition.getZ(), j)); - } - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return VEContainers.GAS_FIRED_FURNACE_FACTORY.create(i, level, worldPosition, playerInventory, playerEntity); - } - - public int progressFuelCounterPX(int px) { - if (fuelCounter == 0) { - return 0; - } else { - return (px * (((fuelCounter * 100) / fuelLength))) / 100; - } - } - - @Deprecated // Use method that doesn't take in an int instead - public FluidStack getFluidStackFromTank(int num) { - if (num == 0) { - return fuelTank.getTank().getFluid(); - } - return FluidStack.EMPTY; - } - - public FluidStack getFluidFromTank() { - return fuelTank.getTank().getFluid(); - } - - @Override - public @NotNull List getRelationalTanks() { - return fluidManagers; - } - - public int getFuelCounter() { - return fuelCounter; - } - - public int getCounter() { - return counter; - } - - - public int progressFuelCounterPercent() { - if (length != 0) { - return (int) (100 - (((float) fuelCounter / (float) fuelLength) * 100)); - } else { - return 0; - } - } - - public boolean countChecker(SmeltingRecipe furnaceRecipe, BlastingRecipe blastingRecipe, ItemStack itemStack) { - if (furnaceRecipe != null) { - return (itemStack.getCount() + furnaceRecipe.getResultItem(level.registryAccess()).getCount()) <= 64; - } else if (blastingRecipe != null) { - return (itemStack.getCount() + blastingRecipe.getResultItem(level.registryAccess()).getCount()) <= 64; - } - return false; - } - - public boolean itemChecker(SmeltingRecipe furnaceRecipe, BlastingRecipe blastingRecipe, ItemStack itemStack) { - if (furnaceRecipe != null) { - if (itemStack.getItem() == Items.AIR || itemStack.isEmpty()) return true; - return furnaceRecipe.getResultItem(level.registryAccess()).getItem() == itemStack.getItem(); - } else if (blastingRecipe != null) { - if (itemStack.getItem() == Items.AIR || itemStack.isEmpty()) return true; - return blastingRecipe.getResultItem(level.registryAccess()).getItem() == itemStack.getItem(); - } - return false; - } - - public VERelationalTank getFuelTank() { - return fuelTank; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index aa49dacf3..29d00f0ec 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -39,10 +39,8 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(AQUEOULIZING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); - - // TODO processing public static final VETileEntityFactory BATTERY_BOX_FACTORY = new VETileEntityFactory(VEBlocks.BATTERY_BOX_TILE, VEContainers.BATTERY_BOX_FACTORY) .addEnergyStorage( @@ -82,7 +80,7 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(CENTRIFUGAL_AGITATING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory CENTRIFUGAL_SEPARATOR_FACTORY = new VETileEntityFactory(VEBlocks.CENTRIFUGAL_SEPARATOR_TILE, VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY) @@ -93,7 +91,7 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(CENTRIFUGAL_SEPARATION) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory COMBUSTION_GENERATOR_FACTORY = new VETileEntityFactory(VEBlocks.COMBUSTION_GENERATOR_TILE, VEContainers.COMBUSTION_GENERATOR_FACTORY) @@ -118,7 +116,7 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(COMPRESSING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory CRUSHER_FACTORY = new VETileEntityFactory(VEBlocks.CRUSHER_TILE, VEContainers.CRUSHER_FACTORY) @@ -129,7 +127,7 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(CRUSHING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory DIMENSIONAL_LASER_FACTORY = new VETileEntityFactory(VEBlocks.DIMENSIONAL_LASER_TILE, VEContainers.DIMENSIONAL_LASER_FACTORY) @@ -182,7 +180,7 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(ELECTROLYZING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory FLUID_ELECTROLYZER_FACTORY = new VETileEntityFactory(VEBlocks.FLUID_ELECTROLYZER_TILE, VEContainers.FLUID_ELECTROLYZER_FACTORY) @@ -194,7 +192,7 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(ELECTROLYZING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory FLUID_MIXER_FACTORY = new VETileEntityFactory(VEBlocks.FLUID_MIXER_TILE, VEContainers.FLUID_MIXER_FACTORY) @@ -211,7 +209,7 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(FLUID_MIXING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory GAS_FIRED_FURNACE = new VETileEntityFactory(VEBlocks.GAS_FIRED_FURNACE_TILE, VEContainers.GAS_FIRED_FURNACE_FACTORY) @@ -240,7 +238,7 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(HYDROPONIC_INCUBATING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory IMPLOSION_COMPRESSOR_FACTORY = new VETileEntityFactory(VEBlocks.IMPLOSION_COMPRESSOR_TILE, VEContainers.IMPLOSION_COMPRESSOR_FACTORY) @@ -252,14 +250,14 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(IMPLOSION_COMPRESSING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory PRIMITIVE_BLAST_FURNACE_FACTORY = new VETileEntityFactory(VEBlocks.PRIMITIVE_BLAST_FURNACE_TILE, VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY) .countable() .makesSound() .withRecipe(PRIMITIVE_BLAST_FURNACING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); // TODO needs custom processor public static final VETileEntityFactory PRIMITIVE_SOLAR_PANEL_FACTORY = @@ -269,7 +267,7 @@ public class VETileEntities { Config.PRIMITIVE_SOLAR_PANEL_SEND.get() ) .sendsOutPower() - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); // TODO needs a custom processor public static final VETileEntityFactory SOLAR_PANEL_FACTORY = @@ -279,7 +277,7 @@ public class VETileEntities { Config.SOLAR_PANEL_SEND.get() ) .sendsOutPower() - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY = new VETileEntityFactory(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_TILE, VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY) @@ -318,7 +316,7 @@ public class VETileEntities { .countable() .makesSound() .withRecipe(SAWMILLING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory STIRLING_GENERATOR_FACTORY = new VETileEntityFactory(VEBlocks.STIRLING_GENERATOR_TILE, VEContainers.STIRLING_GENERATOR_FACTORY) @@ -335,5 +333,5 @@ public class VETileEntities { public static final VETileEntityFactory TOOLING_STATION_FACTORY = new VETileEntityFactory(VEBlocks.TOOLING_STATION_TILE, VEContainers.TOOLING_STATION_FACTORY) .withRecipe(TOOLING) - .withCustomRecipeProcessing(new DefaultProcessor()); + .withCustomRecipeProcessing(new BasicProcessor()); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java index 7f2a18a73..f7ea83446 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -20,7 +20,7 @@ public class AqueoulizerRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.AQUEOULIZING.get(); - private final RecipeParser parser = new RecipeParser(this) + private final BasicParser parser = new BasicParser(this) .addIngredient(4, 0) .addFluidIngredient(0, 0) .addFluidResult(1, 0); @@ -77,7 +77,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull AqueoulizerRecip } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java index 718ef0bf5..371a3704c 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -19,7 +19,7 @@ public class CentrifugalAgitatorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_AGITATING.get(); - private final RecipeParser parser = new RecipeParser(this) + private final BasicParser parser = new BasicParser(this) .addFluidIngredient(0, 0) .addFluidResult(1, 0) .addFluidResult(2, 1); @@ -75,7 +75,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull VERecipe recipe) } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java index 9d314902c..c703cfbda 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java @@ -3,8 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RNGRecipeParser; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.RNGBasicParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -21,7 +21,7 @@ public class CentrifugalSeparatorRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_SEPARATION.get(); - private final RecipeParser parser = new RNGRecipeParser(this) + private final BasicParser parser = new RNGBasicParser(this) .addChancedItemResult(2, 0) .addChancedItemResult(3, 1) .addChancedItemResult(4, 2) @@ -71,7 +71,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CentrifugalSepar } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java index eaa96ef9c..6577fd7c6 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java @@ -2,7 +2,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; @@ -18,7 +18,7 @@ public class CombustionGeneratorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FUEL_COMBUSTION.get(); - private final RecipeParser parser = new RecipeParser(this) + private final BasicParser parser = new BasicParser(this) .addFluidIngredient(0, 0) .addFluidIngredient(1, 1); @@ -60,7 +60,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CombustionGenera } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java index fda4d4af5..0cde3ed32 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -19,7 +19,7 @@ public class CompressorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.COMPRESSING.get(); - private final RecipeParser parser = new RecipeParser(this) + private final BasicParser parser = new BasicParser(this) .addIngredient(0, 0) .addItemResult(1, 0); @@ -63,7 +63,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CompressorRecipe } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java index 9efc7335d..0e78740eb 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java @@ -3,8 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RNGRecipeParser; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.RNGBasicParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -20,7 +20,7 @@ public class CrusherRecipe extends VERNGExperienceRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CRUSHING.get(); - private final RecipeParser parser = new RNGRecipeParser(this) + private final BasicParser parser = new RNGBasicParser(this) .addChancedItemResult(1, 0) .addChancedItemResult(2, 1) .addIngredient(0, 0); @@ -67,7 +67,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CrusherRecipe re } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java index e5d3d698e..91efe5aea 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.ServerSideOnly; import com.veteam.voluminousenergy.util.climate.FluidClimateSpawn; @@ -249,7 +249,7 @@ public FluidStack getOutputFluid(int slot) { This is null because we want it to explode if someone tries to pull a parser from here. */ @Override - public RecipeParser getParser() { + public BasicParser getParser() { return null; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java index cd39ff77d..4fbd4870e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java @@ -3,8 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RNGRecipeParser; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.RNGBasicParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -20,7 +20,7 @@ public class DistillationRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.DISTILLING.get(); - private final RecipeParser parser = new RNGRecipeParser(this) + private final BasicParser parser = new RNGBasicParser(this) .addChancedItemResult(6, 0) .addFluidIngredient(0, 0) .addFluidResult(1, 0) @@ -67,7 +67,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull DistillationReci } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java index 3fce72d66..2ad0cef96 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java @@ -3,8 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RNGRecipeParser; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; +import com.veteam.voluminousenergy.recipe.parser.RNGBasicParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -21,7 +21,7 @@ public class ElectrolyzerRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.ELECTROLYZING.get(); - private final RecipeParser parser = new RNGRecipeParser(this) + private final BasicParser parser = new RNGBasicParser(this) .addChancedItemResult(2, 0) .addChancedItemResult(3, 1) .addChancedItemResult(4, 2) @@ -69,7 +69,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ElectrolyzerReci } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java index 0b62aaa62..e6e2aac3f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -19,7 +19,7 @@ public class FluidElectrolyzerRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FLUID_ELECTROLYZING.get(); - private final RecipeParser parser = new RecipeParser(this) + private final BasicParser parser = new BasicParser(this) .addFluidIngredient(0, 0) .addFluidResult(1, 0) .addFluidResult(2, 1); @@ -64,7 +64,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull FluidElectrolyze } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java index 8ee9fb81f..131206165 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -19,7 +19,7 @@ public class FluidMixerRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.FLUID_MIXING.get(); - private final RecipeParser parser = new RecipeParser(this) + private final BasicParser parser = new BasicParser(this) .addFluidIngredient(0, 0) .addFluidResult(1, 0) .addFluidResult(2, 1); @@ -64,7 +64,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull FluidMixerRecipe } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java index 581766690..ad78202d1 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java @@ -3,8 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.parser.HydroponicParser; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -19,7 +19,7 @@ public class HydroponicIncubatorRecipe extends VERNGRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.HYDROPONIC_INCUBATING.get(); - private final RecipeParser parser = new HydroponicParser(this) + private final BasicParser parser = new HydroponicParser(this) .addChancedItemResult(2, 0) .addChancedItemResult(3, 1) .addChancedItemResult(4, 2) @@ -68,7 +68,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull HydroponicIncuba } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java index cdcaa483e..d8dcef40e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java @@ -3,8 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.parser.ImplosionCompressorParser; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -20,7 +20,7 @@ public class ImplosionCompressorRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.IMPLOSION_COMPRESSING.get(); - private final RecipeParser parser = new ImplosionCompressorParser(this) + private final BasicParser parser = new ImplosionCompressorParser(this) .addIngredient(0, 0) .addItemResult(2, 0); @@ -64,7 +64,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ImplosionCompres } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java index 96698dce1..47256ea24 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java @@ -3,7 +3,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; +import com.veteam.voluminousenergy.recipe.parser.IndustrialBlastFurnaceParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.recipe.FluidIngredient; @@ -27,10 +28,10 @@ public class IndustrialBlastingRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.INDUSTRIAL_BLASTING.get(); - private final RecipeParser parser = new RecipeParser(this) - .addFluidIngredient(0, 0) - .addIngredient(0, 0) - .addItemResult(1, 0); + private final BasicParser parser = new IndustrialBlastFurnaceParser(this) + .addIngredient(2, 0) + .addIngredient(3,1) + .addItemResult(4, 0); private static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { @@ -124,7 +125,7 @@ public List getFluidIngredients() { } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java index 3fde503ec..b797da88d 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java @@ -2,9 +2,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -22,7 +21,7 @@ public class PrimitiveBlastFurnaceRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.PRIMITIVE_BLAST_FURNACING.get(); - private final RecipeParser parser = new RecipeParser(this) + private final BasicParser parser = new BasicParser(this) .addIngredient(0, 0) .addItemResult(1, 0); @@ -66,7 +65,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull PrimitiveBlastFu } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java index 82215eff0..a5258a410 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java @@ -2,9 +2,8 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; -import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.parser.SawmillParser; import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.tools.Config; @@ -28,7 +27,7 @@ public class SawmillRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.SAWMILLING.get(); private boolean isLogRecipe; - private final RecipeParser parser = + private final BasicParser parser = new SawmillParser(this) .addIngredient(0,0) .addFluidResult(0,0) @@ -106,7 +105,7 @@ public List getOutputFluids() { } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java index 288875d8a..cf83ea328 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -19,7 +19,7 @@ public class StirlingGeneratorRecipe extends VEEnergyRecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.STIRLING.get(); - private final RecipeParser parser = new RecipeParser(this) + private final BasicParser parser = new BasicParser(this) .addIngredient(0, 0); public StirlingGeneratorRecipe() { @@ -75,7 +75,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull StirlingGenerato } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java index 41b3782c6..93138e72b 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java @@ -5,7 +5,7 @@ import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.items.tools.multitool.Multitool; import com.veteam.voluminousenergy.items.tools.multitool.bits.BitItem; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; @@ -25,7 +25,7 @@ public class ToolingRecipe extends VERecipe { public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.TOOLING.get(); - private final RecipeParser parser = new RecipeParser(this); + private final BasicParser parser = new BasicParser(this); public ToolingRecipe() { @@ -138,7 +138,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ToolingRecipe re } @Override - public RecipeParser getParser() { + public BasicParser getParser() { return parser; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java index 91002d570..1acd855fe 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERecipe.java @@ -2,7 +2,7 @@ import com.veteam.voluminousenergy.VoluminousEnergy; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.util.recipe.FluidIngredient; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.core.NonNullList; @@ -244,5 +244,5 @@ public static VERecipe getCompleteRecipe(VETileEntity tile) { return null; } - public abstract RecipeParser getParser(); + public abstract BasicParser getParser(); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/BasicParser.java similarity index 94% rename from src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java rename to src/main/java/com/veteam/voluminousenergy/recipe/parser/BasicParser.java index 8877990fe..7c657eeae 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/BasicParser.java @@ -13,7 +13,7 @@ import java.util.ArrayList; import java.util.List; -public class RecipeParser { +public class BasicParser { List ingredientPositions = new ArrayList<>(); List itemResultPositions = new ArrayList<>(); @@ -22,26 +22,26 @@ public class RecipeParser { final VERecipe recipe; - public RecipeParser(VERecipe recipe) { + public BasicParser(VERecipe recipe) { this.recipe = recipe; } - public RecipeParser addIngredient(int tilePos, int recipePos) { + public BasicParser addIngredient(int tilePos, int recipePos) { this.ingredientPositions.add(new SlotAndRecipePos(tilePos, recipePos)); return this; } - public RecipeParser addFluidIngredient(int tilePos, int recipePos) { + public BasicParser addFluidIngredient(int tilePos, int recipePos) { this.fluidIngredientPositions.add(new SlotAndRecipePos(tilePos, recipePos)); return this; } - public RecipeParser addItemResult(int tilePos, int recipePos) { + public BasicParser addItemResult(int tilePos, int recipePos) { this.itemResultPositions.add(new SlotAndRecipePos(tilePos, recipePos)); return this; } - public RecipeParser addFluidResult(int tilePos, int recipePos) { + public BasicParser addFluidResult(int tilePos, int recipePos) { this.fluidResultPositions.add(new SlotAndRecipePos(tilePos, recipePos)); return this; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java index 871190a6d..2331f2781 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java @@ -12,7 +12,7 @@ import static net.minecraft.util.Mth.abs; -public class HydroponicParser extends RNGRecipeParser { +public class HydroponicParser extends RNGBasicParser { public HydroponicParser(VERecipe recipe) { super(recipe); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java index 31b06b24d..281f86c04 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java @@ -5,7 +5,7 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; -public class ImplosionCompressorParser extends RecipeParser { +public class ImplosionCompressorParser extends BasicParser { public ImplosionCompressorParser(VERecipe recipe) { super(recipe); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/IndustrialBlastFurnaceParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/IndustrialBlastFurnaceParser.java new file mode 100644 index 000000000..46b628002 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/IndustrialBlastFurnaceParser.java @@ -0,0 +1,42 @@ +package com.veteam.voluminousenergy.recipe.parser; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import com.veteam.voluminousenergy.recipe.IndustrialBlastingRecipe; +import net.minecraft.world.item.BucketItem; +import net.minecraft.world.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.capability.IFluidHandler; + +public class IndustrialBlastFurnaceParser extends BasicParser { + + + private IndustrialBlastingRecipe blastingRecipe; + + public IndustrialBlastFurnaceParser(IndustrialBlastingRecipe recipe) { + super(recipe); + this.blastingRecipe = recipe; + } + + @Override + public boolean isCompleteRecipe(VETileEntity tile) { + FluidStack tankFluid = tile.getFluidStackFromTank(0); + if(tankFluid.getFluid().getFluidType().getTemperature() < blastingRecipe.getMinimumHeat()) { + return false; + } + return super.isCompleteRecipe(tile); + } + + @Override + public void completeRecipe(VETileEntity tile) { + tile.getRelationalTank(0).getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); + super.completeRecipe(tile); + } + + @Override + public boolean canInsertItem(int slot, ItemStack stack) { + if (slot == 0 || slot == 1) { + return stack.getItem() instanceof BucketItem; + } + return super.canInsertItem(slot, stack); + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGBasicParser.java similarity index 93% rename from src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java rename to src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGBasicParser.java index c5939232b..763073654 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGRecipeParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGBasicParser.java @@ -13,14 +13,14 @@ import static net.minecraft.util.Mth.abs; -public class RNGRecipeParser extends RecipeParser { - public RNGRecipeParser(VERecipe recipe) { +public class RNGBasicParser extends BasicParser { + public RNGBasicParser(VERecipe recipe) { super(recipe); } List randomItemResultPositions = new ArrayList<>(); - public RNGRecipeParser addChancedItemResult(int tilePos, int recipePos) { + public RNGBasicParser addChancedItemResult(int tilePos, int recipePos) { this.randomItemResultPositions.add(new SlotAndRecipePos(tilePos, recipePos)); return this; } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java index d9f87f5c1..d796975e8 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java @@ -12,7 +12,7 @@ import java.util.HashMap; -public class SawmillParser extends RecipeParser { +public class SawmillParser extends BasicParser { private final HashMap cache = new HashMap<>(); private final SawmillRecipe recipe; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/BasicProcessor.java similarity index 88% rename from src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java rename to src/main/java/com/veteam/voluminousenergy/recipe/processor/BasicProcessor.java index 02f31ca78..7e35c95f2 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DefaultProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/BasicProcessor.java @@ -2,14 +2,12 @@ import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import net.minecraft.sounds.SoundSource; -import net.minecraft.world.item.ItemStack; -import net.minecraftforge.items.ItemStackHandler; -public class DefaultProcessor implements AbstractRecipeProcessor { +public class BasicProcessor implements AbstractRecipeProcessor { @Override public void validateRecipe(VETileEntity tile) { @@ -47,7 +45,7 @@ public void processRecipe(VETileEntity tile) { if (counter == 1) { - RecipeParser parser = recipe.getParser(); + BasicParser parser = recipe.getParser(); if (!parser.canCompleteRecipe(tile)) return; parser.completeRecipe(tile); tile.markRecipeDirty(); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java index bacf42583..21ce365b6 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java @@ -14,11 +14,10 @@ import net.minecraftforge.fluids.capability.IFluidHandler; -public class CombustionGeneratorProcessor extends DefaultProcessor { +public class CombustionGeneratorProcessor extends BasicProcessor { public static final int COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT = 250; public static final int COMBUSTION_GENERATOR_PROCESS_TIME = 1600; - // TODO Make sure it doesn't do an extra "empty" process when it's finished processing @Override public void validateRecipe(VETileEntity tile) { tile.setPotentialRecipes(VERecipe.getPotentialRecipes(tile)); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java index c94343a0e..36e0af22f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java @@ -3,7 +3,7 @@ import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.recipe.VEEnergyRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.parser.RecipeParser; +import com.veteam.voluminousenergy.recipe.parser.BasicParser; import com.veteam.voluminousenergy.sounds.VESounds; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.tools.energy.VEEnergyStorage; @@ -66,7 +66,7 @@ public void processRecipe(VETileEntity tile) { tile.setChanged(); } else if (counter == 0) { if (tile.getSelectedRecipe() instanceof VEEnergyRecipe veEnergyRecipe) { - RecipeParser parser = veEnergyRecipe.getParser(); + BasicParser parser = veEnergyRecipe.getParser(); if (!parser.canCompleteRecipe(tile)) return; // Check to see if the energy produced will overflow the tile if (tile.getEnergy().isFullyCharged()) return; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java index 44c195c2f..ae947c1dd 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java @@ -7,7 +7,7 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraftforge.registries.RegistryObject; -public class MultiBlockRecipeProcessor extends DefaultProcessor { +public class MultiBlockRecipeProcessor extends BasicProcessor { private RegistryObject blockRegistry; private Block block; From 88d97817e660eefcce09f6273552ee5b3cdd3122 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Wed, 10 Apr 2024 08:43:56 -0400 Subject: [PATCH 19/27] Fixed solar panels --- .../blocks/tiles/VETileEntities.java | 6 +-- .../recipe/processor/SolarPanelProcessor.java | 54 +++++++++++++++++++ 2 files changed, 56 insertions(+), 4 deletions(-) create mode 100644 src/main/java/com/veteam/voluminousenergy/recipe/processor/SolarPanelProcessor.java diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index 29d00f0ec..e92f78e00 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -259,7 +259,6 @@ public class VETileEntities { .withRecipe(PRIMITIVE_BLAST_FURNACING) .withCustomRecipeProcessing(new BasicProcessor()); - // TODO needs custom processor public static final VETileEntityFactory PRIMITIVE_SOLAR_PANEL_FACTORY = new VETileEntityFactory(VEBlocks.PRIMITIVE_SOLAR_PANEL_TILE, VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY) .addEnergyStorage( @@ -267,9 +266,8 @@ public class VETileEntities { Config.PRIMITIVE_SOLAR_PANEL_SEND.get() ) .sendsOutPower() - .withCustomRecipeProcessing(new BasicProcessor()); + .withCustomRecipeProcessing(new SolarPanelProcessor(Config.PRIMITIVE_SOLAR_PANEL_GENERATE.get())); - // TODO needs a custom processor public static final VETileEntityFactory SOLAR_PANEL_FACTORY = new VETileEntityFactory(VEBlocks.SOLAR_PANEL_TILE, VEContainers.SOLAR_PANEL_FACTORY) .addEnergyStorage( @@ -277,7 +275,7 @@ public class VETileEntities { Config.SOLAR_PANEL_SEND.get() ) .sendsOutPower() - .withCustomRecipeProcessing(new BasicProcessor()); + .withCustomRecipeProcessing(new SolarPanelProcessor(Config.SOLAR_PANEL_GENERATE.get())); public static final VETileEntityFactory PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY = new VETileEntityFactory(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_TILE, VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY) diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/SolarPanelProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/SolarPanelProcessor.java new file mode 100644 index 000000000..4bed403e7 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/SolarPanelProcessor.java @@ -0,0 +1,54 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import net.minecraft.util.Mth; +import net.minecraft.world.level.Level; + +public class SolarPanelProcessor implements AbstractRecipeProcessor{ + + int generationAmount; + + public SolarPanelProcessor(int generationAmount) { + this.generationAmount = generationAmount; + } + + @Override + public void validateRecipe(VETileEntity tile) { + + } + + @Override + public void processRecipe(VETileEntity tile) { + + int generation = (int) (generationAmount * solarIntensity(tile.getLevel())); + tile.getEnergy().setProduction(generation); + tile.getEnergy().addEnergy(generation); + } + + /** + * Cosine curve based off the location of the Sun(? I think, at least it looks like that) + * Noon is the Zenith, hence why we use a cosine curve, since cosine curves start at a max + * amplitude, which of course is Noon/Zenith. We do manipulate the curve a bit to make it more "reasonable" + */ + protected float solarIntensity(Level level) { + + float celestialAngle = level.getSunAngle(1.0f); // Zenith = 0rad + + if(celestialAngle > Math.PI) celestialAngle = (2 * ((float) Math.PI) - celestialAngle); + + float intensity = Mth.cos(0.2f + (celestialAngle / 1.2f)); + intensity = Mth.clamp(intensity, 0, 1); + + if(intensity > 0.1f) { + intensity = intensity * 1.5f; + if(intensity > 1f) intensity = 1f; + } + + if(intensity > 0){ + if(level.isRaining()) return intensity * 0.6f; + if(level.isThundering()) return intensity * 0.2f; + } + + return intensity; + } +} From 33ce24b2e3996ea60f2c3378e02a94fa43e33107 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Wed, 10 Apr 2024 22:16:35 -0400 Subject: [PATCH 20/27] Added custom fluid validator for edge cases --- .../blocks/tiles/VETileEntities.java | 6 +- .../blocks/tiles/VETileEntityFactory.java | 20 ++++- .../tiles/fluids/AbstractFluidValidator.java | 10 +++ .../tiles/inventory/VEItemStackHandler.java | 1 - .../util/MultiFluidSlotWrapper.java | 26 ++---- .../util/VERelationalTank.java | 81 ++++--------------- 6 files changed, 55 insertions(+), 89 deletions(-) create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/fluids/AbstractFluidValidator.java diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index e92f78e00..7fc6dfc74 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -4,12 +4,15 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidInputTank; import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidOutputTank; +import com.veteam.voluminousenergy.blocks.tiles.fluids.AbstractFluidValidator; import com.veteam.voluminousenergy.blocks.tiles.inventory.BatteryBoxInventoryValidator; import com.veteam.voluminousenergy.blocks.tiles.inventory.DimensionalLaserInventoryValidator; import com.veteam.voluminousenergy.blocks.tiles.inventory.FurnaceInventoryValidator; import com.veteam.voluminousenergy.blocks.tiles.inventory.GasFiredFurnaceInventoryValidator; +import com.veteam.voluminousenergy.items.data.CombustibleFluidsData; import com.veteam.voluminousenergy.recipe.processor.*; import com.veteam.voluminousenergy.tools.Config; +import net.minecraftforge.fluids.FluidStack; import static com.veteam.voluminousenergy.recipe.VERecipes.VERecipeTypes.*; @@ -216,7 +219,8 @@ public class VETileEntities { // We have an upgrade slot, so we add an empty energy storage. Less than ideal. .addEnergyStorage(0,0) .addTanks( - new FluidInputTank(0, DEFAULT_TANK_CAPACITY) + new FluidInputTank(0, DEFAULT_TANK_CAPACITY, + (fluid, tile) -> CombustibleFluidsData.isCombustible(fluid)) ) .countable() .makesSound() diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java index 3835b9cd7..742866a1e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java @@ -1,6 +1,7 @@ package com.veteam.voluminousenergy.blocks.tiles; import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory; +import com.veteam.voluminousenergy.blocks.tiles.fluids.AbstractFluidValidator; import com.veteam.voluminousenergy.blocks.tiles.inventory.AbstractItemStackValidator; import com.veteam.voluminousenergy.blocks.tiles.inventory.VEItemStackHandler; import com.veteam.voluminousenergy.recipe.VERecipe; @@ -222,10 +223,15 @@ public VESlotManager asManager(int id) { } } - public record FluidInputTank(int recipePos, int capacity) implements TileTank { + public record FluidInputTank(int recipePos, int capacity, @Nullable AbstractFluidValidator fluidValidator) implements TileTank { + + public FluidInputTank(int recipePos, int capacity) { + this(recipePos, capacity, null); + } + @Override public VERelationalTank asTank(int id) { - return new VERelationalTank(new FluidTank(capacity), id, recipePos, TankType.INPUT, "input_tank_" + id + ":input_tank_gui"); + return new VERelationalTank(new FluidTank(capacity), id, recipePos, TankType.INPUT, "input_tank_" + id + ":input_tank_gui",fluidValidator); } } @@ -236,12 +242,20 @@ public VERelationalTank asTank(int id) { } } + public record FluidInputOutputTank(int recipePos, int capacity) implements TileTank { + @Override + public VERelationalTank asTank(int id) { + VERelationalTank tank = new VERelationalTank(new FluidTank(capacity), id, recipePos, TankType.BOTH, "both_tank_" + id + ":output_tank_gui"); + tank.setAllowAny(true); + return tank; + } + } + public interface TileSlot { VESlotManager asManager(int id); } public interface TileTank { - VERelationalTank asTank(int id); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/fluids/AbstractFluidValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/fluids/AbstractFluidValidator.java new file mode 100644 index 000000000..00a78adc1 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/fluids/AbstractFluidValidator.java @@ -0,0 +1,10 @@ +package com.veteam.voluminousenergy.blocks.tiles.fluids; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import net.minecraftforge.fluids.FluidStack; + +public interface AbstractFluidValidator { + + boolean validateFluid(FluidStack fluid, VETileEntity tile); + +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/VEItemStackHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/VEItemStackHandler.java index 7d3ec3170..824c3ec46 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/VEItemStackHandler.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/VEItemStackHandler.java @@ -89,5 +89,4 @@ public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate if (!isItemValid(slot, stack)) return stack; return super.insertItem(slot, stack, simulate); } - } diff --git a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java index 9b649db84..5ea07529f 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java +++ b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java @@ -8,19 +8,15 @@ import net.minecraftforge.fluids.capability.IFluidHandler; import javax.annotation.Nonnull; -import java.util.HashMap; import java.util.List; public class MultiFluidSlotWrapper implements IFluidHandler { - - HashMap tankHashMap = new HashMap<>(); List tanks; VETileEntity tileEntity; public MultiFluidSlotWrapper(List tanks, VETileEntity tileEntity) { this.tanks = tanks; this.tileEntity = tileEntity; - tanks.forEach(m -> tankHashMap.put(m.getSlotNum(), m)); } @Override @@ -31,26 +27,22 @@ public int getTanks() { @Nonnull @Override public FluidStack getFluidInTank(int tank) { - if (tankHashMap.containsKey(tank)) { - VERelationalTank fluidTank = tankHashMap.get(tank); - return fluidTank.getTank() == null ? FluidStack.EMPTY : fluidTank.getTank().getFluid(); - } - return FluidStack.EMPTY; + + if(tank < 0 || tank >= tanks.size()) return FluidStack.EMPTY; + return tanks.get(tank).getTank().getFluid(); } @Override public int getTankCapacity(int tank) { - if (tankHashMap.containsKey(tank)) { - VERelationalTank fluidTank = tankHashMap.get(tank); - return fluidTank.getTank() == null ? 0 : fluidTank.getTank().getCapacity(); - } - return 0; + if(tank < 0 || tank >= tanks.size()) return 0; + return this.tanks.get(tank).getTank().getCapacity(); } @Override public boolean isFluidValid(int tank, @Nonnull FluidStack stack) { - VERelationalTank relationalTank = tankHashMap.get(tank); - if (relationalTank.isAllowAny()) return true; + VERelationalTank relationalTank = tanks.get(tank); + if (relationalTank.isAllowAny() || + (relationalTank.getValidator() != null && relationalTank.getValidator().validateFluid(stack,tileEntity))) return true; for (VERecipe recipe : tileEntity.getPotentialRecipes()) { if (recipe.getFluidIngredient(relationalTank.getRecipePos()).test(stack)) { return true; @@ -109,12 +101,10 @@ public FluidStack drain(int maxDrain, FluidAction action) { } public void addRelationalTank(VERelationalTank tank) { - tankHashMap.put(tank.getSlotNum(), tank); tanks.add(tank); } public void removeRelationalTank(VERelationalTank tank) { - tankHashMap.remove(tank.getSlotNum()); tanks.remove(tank); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java b/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java index 7878ec734..ee4093cda 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java +++ b/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java @@ -1,17 +1,13 @@ package com.veteam.voluminousenergy.util; +import com.veteam.voluminousenergy.blocks.tiles.fluids.AbstractFluidValidator; import com.veteam.voluminousenergy.recipe.VERecipe; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.material.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.fluids.capability.templates.FluidTank; -import org.apache.commons.lang3.NotImplementedException; - -import java.util.ArrayList; -import java.util.List; public class VERelationalTank { @@ -21,12 +17,13 @@ public class VERelationalTank { ItemStack input; ItemStack output; TankType tankType; - List validFluids = new ArrayList<>(); private boolean sideStatus = false; private Direction sideDirection = Direction.DOWN; private boolean allowAny = false; private boolean ignoreDirection = false; private int recipePos; + private AbstractFluidValidator validator; + /** * nbtName follows the format TANKNAME:ENABLEDNAME */ @@ -65,16 +62,20 @@ public VERelationalTank(FluidTank tank, int slotNum, int recipePos, TankType tan this.nbt = nbt; } - public VERelationalTank(FluidTank tank, int slotNum, TankType tankType, String nbt) { + public VERelationalTank(FluidTank tank, int slotNum, int recipePos, TankType tankType, String nbt, AbstractFluidValidator validator) { this.tank = tank; this.slotNum = slotNum; this.tankType = tankType; + this.recipePos = recipePos; this.nbt = nbt; + this.validator = validator; } - public void setIOItemstack(ItemStack input, ItemStack output) { - this.input = input; - this.output = output; + public VERelationalTank(FluidTank tank, int slotNum, TankType tankType, String nbt) { + this.tank = tank; + this.slotNum = slotNum; + this.tankType = tankType; + this.nbt = nbt; } /** @@ -87,22 +88,6 @@ public boolean canInsertOutputFluid(VERecipe recipe, int id) { && this.getTank().getFluidAmount() + recipe.getOutputFluids().get(id).getAmount() <= this.tank.getCapacity(); } - /** - * @param recipe The fluid recipe to use - * @param id The recipe ingredient ID to fill. Should be first checked with canInsertFluid separately - * especially if there are multiple outputs - */ - public void fillOutput(VERecipe recipe, int id) { - - FluidStack stack = recipe.getOutputFluid(id); - - if (this.getTank().getFluid().getRawFluid() != stack.getRawFluid()) { - this.getTank().setFluid(stack); - } else { - this.getTank().fill(stack, IFluidHandler.FluidAction.EXECUTE); - } - } - public void fillTank(FluidStack stack) { this.getTank().fill(stack, IFluidHandler.FluidAction.EXECUTE); } @@ -111,18 +96,6 @@ public int testFillTank(FluidStack stack) { return this.getTank().fill(stack, IFluidHandler.FluidAction.SIMULATE); } - /** - * The id will be located in the Recipe file itself. - * To find the id the easiest way is to go to the fromJson in a recipe's serializer. - * From there look at the fluidInputList being built and check for the position of - * the fluid you're looking to subtract. - * - * @param recipe The recipe to pull the input from - * @param id The id of the input fluid - */ - public void drainInput(VERecipe recipe, int id) { - this.tank.drain(recipe.getFluidIngredients().get(id).getFluids()[0].getAmount(), IFluidHandler.FluidAction.EXECUTE); - } public boolean isIgnoreDirection() { return ignoreDirection; @@ -140,28 +113,10 @@ public boolean isAllowAny() { return allowAny; } - public List getValidFluids() { - return validFluids; - } - - @Deprecated - public void setValidFluids(List validFluids) { - this.validFluids = validFluids; - } - - public boolean isFluidValid(Fluid fluid) { - if (this.allowAny) return true; - return this.validFluids.contains(fluid); - } - public TankType getTankType() { return tankType; } - public void setTankType(TankType tankType) { - this.tankType = tankType; - } - public FluidTank getTank() { return tank; } @@ -174,10 +129,6 @@ public int getSlotNum() { return slotNum; } - public void setSlotNum(int slotNum) { - this.slotNum = slotNum; - } - public ItemStack getInput() { return input; } @@ -222,14 +173,16 @@ public int getRecipePos() { return recipePos; } + public AbstractFluidValidator getValidator() { + return validator; + } + public String getTranslationKey() { if (tankType != null) { return switch (tankType) { case INPUT -> "tank.voluminousenergy.input_tank"; case OUTPUT -> "tank.voluminousenergy.output_tank"; case BOTH -> "tank.voluminousenergy.both_tank"; - default -> - throw new NotImplementedException("Warning! Tank type " + tankType + " does not have a valid key!"); }; } return "tank.voluminousenergy.null"; @@ -245,8 +198,4 @@ public void readGuiProperties(CompoundTag nbt) { int sideInt = nbt.getInt(getNBTPrefix() + "_direction"); setSideDirection(IntToDirection.IntegerToDirection(sideInt)); } - - public boolean isValidFluidsSet() { - return allowAny || !this.validFluids.isEmpty(); - } } From 1ac33fa78e995b061ea0120885c12edd14d8ffcc Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Thu, 11 Apr 2024 02:24:58 -0400 Subject: [PATCH 21/27] Added network logic for FluidData --- .../blocks/tiles/VETileEntity.java | 4 + .../events/VEClientSideListener.java | 1 - .../events/VEServerSideListener.java | 34 +++++++-- .../items/data/CombustibleFluidsData.java | 11 ++- .../items/data/OxidizerFluidsData.java | 11 ++- .../processor/GasFiredFurnaceProcessor.java | 5 +- .../tools/networking/VENetwork.java | 6 ++ .../packets/ClientBoundFluidDataPacket.java | 76 +++++++++++++++++++ 8 files changed, 135 insertions(+), 13 deletions(-) create mode 100644 src/main/java/com/veteam/voluminousenergy/tools/networking/packets/ClientBoundFluidDataPacket.java diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 734c6b1be..13b1b0e36 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -211,6 +211,10 @@ public void updateClients() { level.sendBlockUpdated(this.worldPosition, this.getBlockState(), this.getBlockState(), 1); } + public int getEnergyCostMultiplier() { + return this.consumptionMultiplier(this.energy.getConsumption(),this.energy.getUpgradeSlotId()); + } + /** * This is for internal use only. Call this outside at your own peril * @param processTime The base time it takes to process diff --git a/src/main/java/com/veteam/voluminousenergy/events/VEClientSideListener.java b/src/main/java/com/veteam/voluminousenergy/events/VEClientSideListener.java index 0daa63669..960b2a5eb 100644 --- a/src/main/java/com/veteam/voluminousenergy/events/VEClientSideListener.java +++ b/src/main/java/com/veteam/voluminousenergy/events/VEClientSideListener.java @@ -46,6 +46,5 @@ private static void doDataProcess(MinecraftServer server) { ResourceManager manager = server.getResourceManager(); CombustibleFluidsData.loadData(manager); OxidizerFluidsData.loadData(manager); - VoluminousEnergy.LOGGER.info("Finished data processing!"); } } diff --git a/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java b/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java index f580f8209..74c3deb55 100644 --- a/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java +++ b/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java @@ -5,8 +5,11 @@ import com.veteam.voluminousenergy.items.data.OxidizerFluidsData; import com.veteam.voluminousenergy.persistence.ChunkFluids; import com.veteam.voluminousenergy.recipe.VERecipe; +import com.veteam.voluminousenergy.tools.networking.VENetwork; +import com.veteam.voluminousenergy.tools.networking.packets.ClientBoundFluidDataPacket; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.ServerLevel; +import net.minecraft.server.level.ServerPlayer; import net.minecraft.server.packs.resources.ResourceManager; import net.minecraft.world.level.Level; import net.minecraftforge.api.distmarker.Dist; @@ -15,6 +18,7 @@ import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; +import net.minecraftforge.network.PacketDistributor; @Mod.EventBusSubscriber(modid = VoluminousEnergy.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE, value = Dist.DEDICATED_SERVER) public class VEServerSideListener { @@ -23,15 +27,16 @@ public class VEServerSideListener { public static void onDataPackSync(OnDatapackSyncEvent event) { MinecraftServer server; + ServerPlayer player = event.getPlayer(); // When event.getPlayer() != null it's a player joining, so we check to make sure it's a group reload - if (event.getPlayer() == null) { - server = event.getPlayer().getServer(); - VERecipe.updateCache(); - } else { - server = event.getPlayerList().getServer(); + if (event.getPlayer() != null) { + updateOnePlayer(event.getPlayer()); + return; } - + server = event.getPlayerList().getServer(); + VERecipe.updateCache(); doDataProcess(server); + updateAllPlayers(); } @SubscribeEvent @@ -43,13 +48,26 @@ public static void onServerStart(ServerStartedEvent event) { } /** - * Register our data processors here for the server + * Register our data processors here for the server. + * Whenever a user joins we must first sync + * * @param server The minecraft server to process with */ private static void doDataProcess(MinecraftServer server) { ResourceManager manager = server.getResourceManager(); CombustibleFluidsData.loadData(manager); OxidizerFluidsData.loadData(manager); - VoluminousEnergy.LOGGER.info("Finished data processing!"); + } + + private static void updateAllPlayers() { + ClientBoundFluidDataPacket + packet = new ClientBoundFluidDataPacket(CombustibleFluidsData.getDataForNetworkTransfer(),OxidizerFluidsData.getDataForNetworkTransfer()); + VENetwork.channel.send(packet, PacketDistributor.ALL.noArg()); + } + + private static void updateOnePlayer(ServerPlayer player) { + ClientBoundFluidDataPacket + packet = new ClientBoundFluidDataPacket(CombustibleFluidsData.getDataForNetworkTransfer(),OxidizerFluidsData.getDataForNetworkTransfer()); + VENetwork.channel.send(packet, player.connection.getConnection()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java b/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java index 3a779d125..a580c4175 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java +++ b/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java @@ -24,7 +24,7 @@ public class CombustibleFluidsData { static final List rawData = new ArrayList<>(); - static final HashMap combustibleFluidData = new HashMap<>(); + static HashMap combustibleFluidData = new HashMap<>(); public static void loadData(ResourceManager manager) { resetCache(); @@ -77,6 +77,15 @@ private static void buildCache() { } } + public static HashMap getDataForNetworkTransfer() { + buildCache(); + return combustibleFluidData; + } + + public static void updateFromPacket(HashMap data) { + combustibleFluidData = data; + } + private static void resetCache() { combustibleFluidData.clear(); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/data/OxidizerFluidsData.java b/src/main/java/com/veteam/voluminousenergy/items/data/OxidizerFluidsData.java index c2543d798..8fdabf279 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/data/OxidizerFluidsData.java +++ b/src/main/java/com/veteam/voluminousenergy/items/data/OxidizerFluidsData.java @@ -24,7 +24,7 @@ public class OxidizerFluidsData { static final List rawData = new ArrayList<>(); - static final HashMap oxidizerFluidData = new HashMap<>(); + static HashMap oxidizerFluidData = new HashMap<>(); public static void loadData(ResourceManager manager) { resetCache(); @@ -76,6 +76,15 @@ private static void buildCache() { } } + public static HashMap getDataForNetworkTransfer() { + buildCache(); + return oxidizerFluidData; + } + + public static void updateFromPacket(HashMap data) { + oxidizerFluidData = data; + } + private static void resetCache() { oxidizerFluidData.clear(); } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java index cdc0104a3..b35e681b0 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java @@ -29,14 +29,15 @@ public void processRecipe(VETileEntity tile) { int fuelCounter = tile.getData("fuel_counter"); FluidStack fuel = tile.getFluidStackFromTank(0); + ItemStack stack = tile.getStackInSlot(2); // Gas processing if (fuelCounter > 0) { fuelCounter--; - } else if (!fuel.isFluidEqual(FluidStack.EMPTY)) { + } else if (!fuel.isFluidEqual(FluidStack.EMPTY) && !stack.isEmpty()) { // Drain Input tile.getRelationalTank(0).getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); - fuelCounter = 400 * CombustibleFluidsData.getEnergyProduced(fuel); + fuelCounter = 400 * CombustibleFluidsData.getEnergyProduced(fuel) / 4; VEItemStackHandler inventory = tile.getInventory(); if (inventory.getStackInSlot(4).getCount() > 0 && inventory.getStackInSlot(4).getItem() == VEItems.QUARTZ_MULTIPLIER.get()) { fuelCounter = fuelCounter / (inventory.getStackInSlot(4).getCount() ^ 2); diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/VENetwork.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/VENetwork.java index 6183792f4..ddaf10933 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/networking/VENetwork.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/VENetwork.java @@ -61,6 +61,12 @@ public class VENetwork { .encoder(BatteryBoxSendOutPowerPacket::toBytes) .consumerMainThread(BatteryBoxSendOutPowerPacket::handle) .add(); + + channel.messageBuilder(ClientBoundFluidDataPacket.class,8) + .decoder(ClientBoundFluidDataPacket::fromBytes) + .encoder(ClientBoundFluidDataPacket::toBytes) + .consumerMainThread(ClientBoundFluidDataPacket::handle) + .add(); } private VENetwork() { diff --git a/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/ClientBoundFluidDataPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/ClientBoundFluidDataPacket.java new file mode 100644 index 000000000..514510a85 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/ClientBoundFluidDataPacket.java @@ -0,0 +1,76 @@ +package com.veteam.voluminousenergy.tools.networking.packets; +import com.veteam.voluminousenergy.items.data.CombustibleFluidsData; +import com.veteam.voluminousenergy.items.data.OxidizerFluidsData; +import net.minecraft.network.FriendlyByteBuf; +import net.minecraft.world.level.material.Fluid; +import net.minecraftforge.event.network.CustomPayloadEvent; +import net.minecraftforge.network.NetworkDirection; +import net.minecraftforge.registries.ForgeRegistries; + +import java.util.HashMap; + +/** + * Update the client(s) with server-side fluid information. + */ +public class ClientBoundFluidDataPacket { + + final HashMap combustibleFluids; + final HashMap oxidizerFluids; + + public ClientBoundFluidDataPacket(HashMap combustibleFluids, HashMap oxidizerFluids) { + this.combustibleFluids = combustibleFluids; + this.oxidizerFluids = oxidizerFluids; + } + + + /** + * We write a size and then the data to make it easier to decode it + * @param buffer The friendly buffer + */ + public void toBytes(FriendlyByteBuf buffer) { + + var combustibleSet = CombustibleFluidsData.getDataForNetworkTransfer().entrySet(); + buffer.writeInt(combustibleSet.size()); + for(var data: combustibleSet) { + buffer.writeRegistryId(ForgeRegistries.FLUIDS, data.getKey()); + buffer.writeVarInt(data.getValue()); + } + + var oxidizerSet = OxidizerFluidsData.getDataForNetworkTransfer().entrySet(); + buffer.writeInt(oxidizerSet.size()); + for(var data : oxidizerSet) { + buffer.writeRegistryId(ForgeRegistries.FLUIDS, data.getKey()); + buffer.writeFloat(data.getValue()); + } + } + + public static ClientBoundFluidDataPacket fromBytes(FriendlyByteBuf buffer) { + HashMap combustibleFluids = new HashMap<>(); + HashMap oxidizerFluids = new HashMap<>(); + int combustibleSize = buffer.readInt(); + for(int i = 0;i < combustibleSize; i++) { + Fluid fluid = ForgeRegistries.FLUIDS.getValue(buffer.readRegistryId()); + combustibleFluids.put(fluid, buffer.readVarInt()); + } + int oxidizerSize = buffer.readInt(); + for(int i = 0;i < oxidizerSize; i++) { + Fluid fluid = ForgeRegistries.FLUIDS.getValue(buffer.readRegistryId()); + oxidizerFluids.put(fluid, buffer.readFloat()); + } + return new ClientBoundFluidDataPacket(combustibleFluids, oxidizerFluids); + } + + public static void handle(ClientBoundFluidDataPacket packet, CustomPayloadEvent.Context contextSupplier) { + NetworkDirection packetDirection = contextSupplier.getDirection(); + switch (packetDirection) { + case PLAY_TO_CLIENT: // Packet is received on client + CombustibleFluidsData.updateFromPacket(packet.combustibleFluids); + OxidizerFluidsData.updateFromPacket(packet.oxidizerFluids); + contextSupplier.setPacketHandled(true); + break; + default: + throw new IllegalStateException("ClientBoundFluidDataPacket must only be sent to clients!"); + } + } + +} From 9d255aac61f205c813534784937fb8103ad2748c Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Thu, 11 Apr 2024 04:17:42 -0400 Subject: [PATCH 22/27] Fixed issue with PrimitiveBlastFurnace missing upgrade slot in Tile --- .../com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index 7fc6dfc74..e99e99eea 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -258,6 +258,7 @@ public class VETileEntities { public static final VETileEntityFactory PRIMITIVE_BLAST_FURNACE_FACTORY = new VETileEntityFactory(VEBlocks.PRIMITIVE_BLAST_FURNACE_TILE, VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY) + .addEnergyStorage(0,0) .countable() .makesSound() .withRecipe(PRIMITIVE_BLAST_FURNACING) From 12ac01c95433fdf5b9970282d590f5f99c9ff7d3 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Thu, 11 Apr 2024 06:28:34 -0400 Subject: [PATCH 23/27] Reworked block,tile,container registry. Fixed Tanks. --- .../voluminousenergy/VoluminousEnergy.java | 4 +- .../blocks/blocks/DimensionalLaserBlock.java | 2 +- .../blocks/blocks/VEBlocks.java | 455 ++++++++---------- .../blocks/machines/AirCompressorBlock.java | 2 +- .../blocks/machines/AqueoulizerBlock.java | 2 +- .../blocks/machines/BatteryBoxBlock.java | 2 +- .../blocks/machines/BlastFurnaceBlock.java | 2 +- .../machines/CentrifugalAgitatorBlock.java | 2 +- .../machines/CentrifugalSeparatorBlock.java | 2 +- .../machines/CombustionGeneratorBlock.java | 2 +- .../blocks/machines/CompressorBlock.java | 2 +- .../blocks/blocks/machines/CrusherBlock.java | 2 +- .../machines/DistillationUnitBlock.java | 2 +- .../blocks/machines/ElectricFurnaceBlock.java | 2 +- .../blocks/machines/ElectrolyzerBlock.java | 2 +- .../machines/FluidElectrolyzerBlock.java | 2 +- .../blocks/machines/FluidMixerBlock.java | 2 +- .../blocks/machines/GasFiredFurnaceBlock.java | 2 +- .../machines/HydroponicIncubatorBlock.java | 2 +- .../machines/ImplosionCompressorBlock.java | 2 +- .../machines/PrimitiveBlastFurnaceBlock.java | 2 +- .../machines/PrimitiveSolarPanelBlock.java | 2 +- .../PrimitiveStirlingGeneratorBlock.java | 2 +- .../blocks/blocks/machines/PumpBlock.java | 2 +- .../blocks/blocks/machines/SawmillBlock.java | 2 +- .../blocks/machines/SolarPanelBlock.java | 2 +- .../machines/StirlingGeneratorBlock.java | 2 +- .../blocks/machines/ToolingStationBlock.java | 2 +- .../machines/tanks/AluminumTankBlock.java | 14 +- .../machines/tanks/EighzoTankBlock.java | 14 +- .../machines/tanks/NetheriteTankBlock.java | 14 +- .../machines/tanks/NighaliteTankBlock.java | 14 +- .../machines/tanks/SolariumTankBlock.java | 14 +- .../machines/tanks/TitaniumTankBlock.java | 14 +- .../containers/ToolingStationContainer.java | 5 +- .../blocks/containers/VEContainers.java | 88 +++- .../tank/AluminumTankContainer.java | 14 - .../containers/tank/EighzoTankContainer.java | 15 - .../tank/NetheriteTankContainer.java | 14 - .../tank/NighaliteTankContainer.java | 14 - .../tank/SolariumTankContainer.java | 14 - .../blocks/containers/tank/TankContainer.java | 56 --- .../tank/TitaniumTankContainer.java | 14 - .../screens/tank/AluminumTankScreen.java | 4 +- .../blocks/screens/tank/EighzoTankScreen.java | 4 +- .../screens/tank/NetheriteTankScreen.java | 4 +- .../screens/tank/NighaliteTankScreen.java | 4 +- .../screens/tank/SolariumTankScreen.java | 4 +- .../blocks/screens/tank/TankScreen.java | 20 +- .../screens/tank/TitaniumTankScreen.java | 4 +- .../blocks/tiles/ToolingStationTile.java | 2 +- .../blocks/tiles/VETileEntities.java | 90 ++-- .../inventory/TankInventoryValidator.java | 12 + .../blocks/tiles/tank/AluminumTankTile.java | 25 - .../blocks/tiles/tank/EighzoTankTile.java | 25 - .../blocks/tiles/tank/NetheriteTankTile.java | 25 - .../blocks/tiles/tank/NighaliteTankTile.java | 25 - .../blocks/tiles/tank/SolariumTankTile.java | 25 - .../blocks/tiles/tank/TankTile.java | 181 ------- .../blocks/tiles/tank/TitaniumTankTile.java | 25 - .../compat/jei/VoluminousEnergyPlugin.java | 70 +-- .../jei/category/AqueoulizingCategory.java | 2 +- .../CentrifugalAgitationCategory.java | 2 +- .../CentrifugalSeparationCategory.java | 2 +- .../jei/category/CombustionCategory.java | 2 +- .../jei/category/CompressingCategory.java | 2 +- .../compat/jei/category/CrushingCategory.java | 2 +- .../category/DimensionalLasingCategory.java | 2 +- .../jei/category/DistillingCategory.java | 2 +- .../jei/category/ElectrolyzingCategory.java | 2 +- .../category/FluidElectrolyzingCategory.java | 2 +- .../jei/category/FluidMixingCategory.java | 2 +- .../category/HydroponicIncubatorCategory.java | 2 +- .../ImplosionCompressionCategory.java | 2 +- .../category/IndustrialBlastingCategory.java | 2 +- .../category/PrimitiveBlastingCategory.java | 2 +- .../compat/jei/category/SawmillCategory.java | 2 +- .../compat/jei/category/StirlingCategory.java | 2 +- .../voluminousenergy/items/VEBlockItems.java | 64 +-- .../recipe/AqueoulizerRecipe.java | 2 +- .../recipe/CentrifugalAgitatorRecipe.java | 2 +- .../recipe/CentrifugalSeparatorRecipe.java | 2 +- .../recipe/CompressorRecipe.java | 2 +- .../recipe/CrusherRecipe.java | 2 +- .../recipe/DimensionalLaserRecipe.java | 2 +- .../recipe/DistillationRecipe.java | 2 +- .../recipe/ElectrolyzerRecipe.java | 2 +- .../recipe/FluidElectrolyzerRecipe.java | 2 +- .../recipe/FluidMixerRecipe.java | 2 +- .../recipe/HydroponicIncubatorRecipe.java | 2 +- .../recipe/ImplosionCompressorRecipe.java | 2 +- .../recipe/IndustrialBlastingRecipe.java | 2 +- .../recipe/PrimitiveBlastFurnaceRecipe.java | 2 +- .../recipe/SawmillRecipe.java | 2 +- .../recipe/StirlingGeneratorRecipe.java | 2 +- .../recipe/ToolingRecipe.java | 2 +- .../voluminousenergy/setup/ClientProxy.java | 64 +-- .../util/MultiFluidSlotWrapper.java | 3 - 98 files changed, 556 insertions(+), 1021 deletions(-) delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/AluminumTankContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/EighzoTankContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NetheriteTankContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NighaliteTankContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/SolariumTankContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TitaniumTankContainer.java create mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/TankInventoryValidator.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/AluminumTankTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/EighzoTankTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NetheriteTankTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NighaliteTankTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/SolariumTankTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java delete mode 100644 src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TitaniumTankTile.java diff --git a/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java b/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java index c54634434..490705b80 100644 --- a/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java +++ b/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java @@ -174,7 +174,7 @@ private void setup(final FMLCommonSetupEvent event) { } private void registerRenderers(EntityRenderersEvent.RegisterRenderers event) { - event.registerBlockEntityRenderer(VEBlocks.DIMENSIONAL_LASER_TILE.get(), LaserBlockEntityRenderer::new); + event.registerBlockEntityRenderer(VEBlocks.DIMENSIONAL_LASER.tile().get(), LaserBlockEntityRenderer::new); } private void setupWhenLoadingComplete(final FMLLoadCompleteEvent event) { @@ -196,7 +196,7 @@ public static class ClientRegister { @SubscribeEvent public static void RegisterClientOnSetupEvent(FMLClientSetupEvent event) { event.enqueueWork(() -> ItemBlockRenderTypes.setRenderLayer(VEBlocks.RICE_CROP.get(), RenderType.cutout())); - event.enqueueWork(() -> ItemBlockRenderTypes.setRenderLayer(VEBlocks.SAWMILL_BLOCK.get(), RenderType.cutout())); + event.enqueueWork(() -> ItemBlockRenderTypes.setRenderLayer(VEBlocks.SAWMILL.block().get(), RenderType.cutout())); event.enqueueWork(() -> ItemBlockRenderTypes.setRenderLayer(VEBlocks.PRESSURE_LADDER.get(), RenderType.cutout())); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java index a2766cfd0..8c22f774e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java @@ -43,7 +43,7 @@ public BlockEntity newBlockEntity(@Nonnull BlockPos blockPos, @Nonnull BlockStat @Nullable public BlockEntityTicker getTicker(@Nonnull Level level, @Nonnull BlockState state, @Nonnull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.DIMENSIONAL_LASER_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.DIMENSIONAL_LASER.tile().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java index 8274f36fa..3bf96a483 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java @@ -12,13 +12,12 @@ import com.veteam.voluminousenergy.blocks.blocks.ores.red_sand.RedSaltpeterOre; import com.veteam.voluminousenergy.blocks.blocks.storage.materials.*; import com.veteam.voluminousenergy.blocks.blocks.storage.raw.*; -import com.veteam.voluminousenergy.blocks.containers.ToolingStationContainer; import com.veteam.voluminousenergy.blocks.containers.VEContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory; import com.veteam.voluminousenergy.blocks.containers.VEContainers; -import com.veteam.voluminousenergy.blocks.containers.tank.*; import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.blocks.tiles.tank.*; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory; import net.minecraft.core.BlockPos; import net.minecraft.world.inventory.MenuType; import net.minecraft.world.level.block.Block; @@ -29,6 +28,8 @@ import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; +import java.util.function.Supplier; + @Mod(VoluminousEnergy.MODID) public class VEBlocks { @@ -50,326 +51,232 @@ public class VEBlocks { public static RegistryObject SOLARIUM_MACHINE_CASING_BLOCK = VE_BLOCKS_REGISTRY.register("solarium_machine_casing", SolariumMachineCasingBlock::new); //Primitive Blast - public static RegistryObject PRIMITIVE_BLAST_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("primitiveblastfurnace", PrimitiveBlastFurnaceBlock::new); - public static RegistryObject> PRIMITIVE_BLAST_FURNACE_TILE = VE_TILE_REGISTRY.register("primitiveblastfurnace", - () -> BlockEntityType.Builder.of(VETileEntities.PRIMITIVE_BLAST_FURNACE_FACTORY::create, VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get()).build(null)); - public static RegistryObject> PRIMITIVE_BLAST_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("primitiveblastfurnace", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry PRIMITIVE_BLAST_FURNACE = + new BlockTileMenuRegistry("primitiveblastfurnace", + PrimitiveBlastFurnaceBlock::new, + () -> VETileEntities.PRIMITIVE_BLAST_FURNACE_FACTORY, + () -> VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY); //Primitive Stirling - public static RegistryObject PRIMITIVE_STIRLING_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("primitivestirlinggenerator", PrimitiveStirlingGeneratorBlock::new); - public static RegistryObject> PRIMITIVE_STIRLING_GENERATOR_TILE = VE_TILE_REGISTRY.register("primitivestirlinggenerator", - () -> BlockEntityType.Builder.of(VETileEntities.PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY::create, VEBlocks.PRIMITIVE_STIRLING_GENERATOR_BLOCK.get()).build(null)); - public static RegistryObject> PRIMITIVE_STIRLING_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("primitivestirlinggenerator", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry PRIMITIVE_STIRLING_GENERATOR = + new BlockTileMenuRegistry("primitivestirlinggenerator", + PrimitiveStirlingGeneratorBlock::new, + () -> VETileEntities.PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY, + () -> VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY); //Crusher - public static RegistryObject CRUSHER_BLOCK = VE_BLOCKS_REGISTRY.register("crusher", CrusherBlock::new); - public static RegistryObject> CRUSHER_TILE = VE_TILE_REGISTRY.register("crusher", - () -> BlockEntityType.Builder.of(VETileEntities.CRUSHER_FACTORY::create, VEBlocks.CRUSHER_BLOCK.get()).build(null)); - public static RegistryObject> CRUSHER_CONTAINER = VE_CONTAINER_REGISTRY.register("crusher", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.CRUSHER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry CRUSHER = + new BlockTileMenuRegistry("crusher", + CrusherBlock::new, + () -> VETileEntities.CRUSHER_FACTORY, + () -> VEContainers.CRUSHER_FACTORY); //Electrolyzer - public static RegistryObject ELECTROLYZER_BLOCK = VE_BLOCKS_REGISTRY.register("electrolyzer", ElectrolyzerBlock::new); - public static RegistryObject> ELECTROLYZER_TILE = VE_TILE_REGISTRY.register("electrolyzer", - () -> BlockEntityType.Builder.of(VETileEntities.ELECTROLYZER_FACTORY::create, VEBlocks.ELECTROLYZER_BLOCK.get()).build(null)); - public static RegistryObject> ELECTROLYZER_CONTAINER = VE_CONTAINER_REGISTRY.register("electrolyzer", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.ELECTROLYZER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry ELECTROLYZER = + new BlockTileMenuRegistry("electrolyzer", + ElectrolyzerBlock::new, + () -> VETileEntities.ELECTROLYZER_FACTORY, + () -> VEContainers.ELECTROLYZER_FACTORY); // Centrifugal Agitator - public static RegistryObject CENTRIFUGAL_AGITATOR_BLOCK = VE_BLOCKS_REGISTRY.register("centrifugal_agitator", CentrifugalAgitatorBlock::new); - public static RegistryObject> CENTRIFUGAL_AGITATOR_TILE = VE_TILE_REGISTRY.register("centrifugal_agitator", - () -> BlockEntityType.Builder.of(VETileEntities.CENTRIFUGAL_AGITATOR_FACTORY::create, VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get()).build(null)); - public static RegistryObject> CENTRIFUGAL_AGITATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("centrifugal_agitator", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.CENTRIFUGAL_AGITATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry CENTRIFUGAL_AGITATOR = + new BlockTileMenuRegistry("centrifugal_agitator", + CentrifugalAgitatorBlock::new, + () -> VETileEntities.CENTRIFUGAL_AGITATOR_FACTORY, + () -> VEContainers.CENTRIFUGAL_AGITATOR_FACTORY); // Compressor - public static RegistryObject COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("compressor", CompressorBlock::new); - public static RegistryObject> COMPRESSOR_TILE = VE_TILE_REGISTRY.register("compressor", - () -> BlockEntityType.Builder.of(VETileEntities.COMPRESSOR_FACTORY::create, VEBlocks.COMPRESSOR_BLOCK.get()).build(null)); - public static RegistryObject> COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("compressor", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.COMPRESSOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry COMPRESSOR = + new BlockTileMenuRegistry("compressor", + CompressorBlock::new, + () -> VETileEntities.COMPRESSOR_FACTORY, + () -> VEContainers.COMPRESSOR_FACTORY); // Stirling Generator - public static RegistryObject STIRLING_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("stirling_generator", StirlingGeneratorBlock::new); - public static RegistryObject> STIRLING_GENERATOR_TILE = VE_TILE_REGISTRY.register("stirling_generator", - () -> BlockEntityType.Builder.of(VETileEntities.STIRLING_GENERATOR_FACTORY::create, VEBlocks.STIRLING_GENERATOR_BLOCK.get()).build(null)); - public static RegistryObject> STIRLING_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("stirling_generator", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.STIRLING_GENERATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry STIRLING_GENERATOR = + new BlockTileMenuRegistry("stirling_generator", + StirlingGeneratorBlock::new, + () -> VETileEntities.STIRLING_GENERATOR_FACTORY, + () -> VEContainers.STIRLING_GENERATOR_FACTORY); // Combustion Generator - public static RegistryObject COMBUSTION_GENERATOR_BLOCK = VE_BLOCKS_REGISTRY.register("combustion_generator", CombustionGeneratorBlock::new); - public static RegistryObject> COMBUSTION_GENERATOR_TILE = VE_TILE_REGISTRY.register("combustion_generator", - () -> BlockEntityType.Builder.of(VETileEntities.COMBUSTION_GENERATOR_FACTORY::create, VEBlocks.COMBUSTION_GENERATOR_BLOCK.get()).build(null)); - public static RegistryObject> COMBUSTION_GENERATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("combustion_generator", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.COMBUSTION_GENERATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry COMBUSTION_GENERATOR = + new BlockTileMenuRegistry("combustion_generator", + CombustionGeneratorBlock::new, + () -> VETileEntities.COMBUSTION_GENERATOR_FACTORY, + () -> VEContainers.COMBUSTION_GENERATOR_FACTORY); // Aqueoulizer - public static RegistryObject AQUEOULIZER_BLOCK = VE_BLOCKS_REGISTRY.register("aqueoulizer", AqueoulizerBlock::new); - public static RegistryObject> AQUEOULIZER_TILE = VE_TILE_REGISTRY.register("aqueoulizer", - () -> BlockEntityType.Builder.of(VETileEntities.AQUEOULIZER_TILE_FACTORY::create, VEBlocks.AQUEOULIZER_BLOCK.get()).build(null)); - public static RegistryObject> AQUEOULIZER_CONTAINER = VE_CONTAINER_REGISTRY.register("aqueoulizer", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.AQUEOULIZER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry AQUEOULIZER = + new BlockTileMenuRegistry("aqueoulizer", + AqueoulizerBlock::new, + () -> VETileEntities.AQUEOULIZER_TILE_FACTORY, + () -> VEContainers.AQUEOULIZER_FACTORY); // Air Compressor - public static RegistryObject AIR_COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("air_compressor", AirCompressorBlock::new); - public static RegistryObject> AIR_COMPRESSOR_TILE = VE_TILE_REGISTRY.register("air_compressor", - () -> BlockEntityType.Builder.of(VETileEntities.AIR_COMPRESSOR_FACTORY::create, VEBlocks.AIR_COMPRESSOR_BLOCK.get()).build(null)); - public static RegistryObject> AIR_COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("air_compressor", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.AIR_COMPRESSOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry AIR_COMPRESSOR = + new BlockTileMenuRegistry("air_compressor", + AirCompressorBlock::new, + () -> VETileEntities.AIR_COMPRESSOR_FACTORY, + () -> VEContainers.AIR_COMPRESSOR_FACTORY); // Distillation Unit - public static RegistryObject DISTILLATION_UNIT_BLOCK = VE_BLOCKS_REGISTRY.register("distillation_unit", DistillationUnitBlock::new); - public static RegistryObject> DISTILLATION_UNIT_TILE = VE_TILE_REGISTRY.register("distillation_unit", - () -> BlockEntityType.Builder.of(VETileEntities.DISTILLATION_UNIT_FACTORY::create, VEBlocks.DISTILLATION_UNIT_BLOCK.get()).build(null)); - public static RegistryObject> DISTILLATION_UNIT_CONTAINER = VE_CONTAINER_REGISTRY.register("distillation_unit", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.DISTILLATION_UNIT_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry DISTILLATION_UNIT = + new BlockTileMenuRegistry("distillation_unit", + DistillationUnitBlock::new, + () -> VETileEntities.DISTILLATION_UNIT_FACTORY, + () -> VEContainers.DISTILLATION_UNIT_FACTORY); // Pump - public static RegistryObject PUMP_BLOCK = VE_BLOCKS_REGISTRY.register("pump", PumpBlock::new); - public static RegistryObject> PUMP_TILE = VE_TILE_REGISTRY.register("pump", - () -> BlockEntityType.Builder.of(VETileEntities.PUMP_FACTORY::create, VEBlocks.PUMP_BLOCK.get()).build(null)); - public static RegistryObject> PUMP_CONTAINER = VE_CONTAINER_REGISTRY.register("pump", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.PUMP_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry PUMP = + new BlockTileMenuRegistry("pump", + PumpBlock::new, + () -> VETileEntities.PUMP_FACTORY, + () -> VEContainers.PUMP_FACTORY); // Gas Fired Furnace - public static RegistryObject GAS_FIRED_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("gas_fired_furnace", GasFiredFurnaceBlock::new); - public static RegistryObject> GAS_FIRED_FURNACE_TILE = VE_TILE_REGISTRY.register("gas_fired_furnace", - () -> BlockEntityType.Builder.of(VETileEntities.GAS_FIRED_FURNACE::create, VEBlocks.GAS_FIRED_FURNACE_BLOCK.get()).build(null)); - public static RegistryObject> GAS_FIRED_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("gas_fired_furnace", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.GAS_FIRED_FURNACE_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry GAS_FIRED_FURNACE = + new BlockTileMenuRegistry("gas_fired_furnace", + GasFiredFurnaceBlock::new, + () -> VETileEntities.GAS_FIRED_FURNACE, + () -> VEContainers.GAS_FIRED_FURNACE_FACTORY); // Electric Furnace - public static RegistryObject ELECTRIC_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("electric_furnace", ElectricFurnaceBlock::new); - public static RegistryObject> ELECTRIC_FURNACE_TILE = VE_TILE_REGISTRY.register("electric_furnace", - () -> BlockEntityType.Builder.of(VETileEntities.ELECTRIC_FURNACE_FACTORY::create, VEBlocks.ELECTRIC_FURNACE_BLOCK.get()).build(null)); - public static RegistryObject> ELECTRIC_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("electric_furnace", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.ELECTRIC_FURNACE_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry ELECTRIC_FURNACE = + new BlockTileMenuRegistry("electric_furnace", + ElectricFurnaceBlock::new, + () -> VETileEntities.ELECTRIC_FURNACE_FACTORY, + () -> VEContainers.ELECTRIC_FURNACE_FACTORY); // Battery Box - public static RegistryObject BATTERY_BOX_BLOCK = VE_BLOCKS_REGISTRY.register("battery_box", BatteryBoxBlock::new); - public static RegistryObject> BATTERY_BOX_TILE = VE_TILE_REGISTRY.register("battery_box", - () -> BlockEntityType.Builder.of(VETileEntities.BATTERY_BOX_FACTORY::create, VEBlocks.BATTERY_BOX_BLOCK.get()).build(null)); - public static RegistryObject> BATTERY_BOX_CONTAINER = VE_CONTAINER_REGISTRY.register("battery_box", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.BATTERY_BOX_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry BATTERY_BOX = + new BlockTileMenuRegistry("battery_box", + BatteryBoxBlock::new, + () -> VETileEntities.BATTERY_BOX_FACTORY, + () -> VEContainers.BATTERY_BOX_FACTORY); // Primitive Solar Panel - public static RegistryObject PRIMITIVE_SOLAR_PANEL_BLOCK = VE_BLOCKS_REGISTRY.register("primitive_solar_panel", PrimitiveSolarPanelBlock::new); - public static RegistryObject> PRIMITIVE_SOLAR_PANEL_TILE = VE_TILE_REGISTRY.register("primitive_solar_panel", - () -> BlockEntityType.Builder.of(VETileEntities.PRIMITIVE_SOLAR_PANEL_FACTORY::create, VEBlocks.PRIMITIVE_SOLAR_PANEL_BLOCK.get()).build(null)); - public static RegistryObject> PRIMITIVE_SOLAR_PANEL_CONTAINER = VE_CONTAINER_REGISTRY.register("primitive_solar_panel", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry PRIMITIVE_SOLAR_PANEL = + new BlockTileMenuRegistry("primitive_solar_panel", + PrimitiveSolarPanelBlock::new, + () -> VETileEntities.PRIMITIVE_SOLAR_PANEL_FACTORY, + () -> VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY); // Solar Panel - public static RegistryObject SOLAR_PANEL_BLOCK = VE_BLOCKS_REGISTRY.register("solar_panel", SolarPanelBlock::new); - public static RegistryObject> SOLAR_PANEL_TILE = VE_TILE_REGISTRY.register("solar_panel", - () -> BlockEntityType.Builder.of(VETileEntities.SOLAR_PANEL_FACTORY::create, VEBlocks.SOLAR_PANEL_BLOCK.get()).build(null)); - public static RegistryObject> SOLAR_PANEL_CONTAINER = VE_CONTAINER_REGISTRY.register("solar_panel", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.SOLAR_PANEL_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry SOLAR_PANEL = + new BlockTileMenuRegistry("solar_panel", + SolarPanelBlock::new, + () -> VETileEntities.SOLAR_PANEL_FACTORY, + () -> VEContainers.SOLAR_PANEL_FACTORY); // Centrifugal Separator - public static RegistryObject CENTRIFUGAL_SEPARATOR_BLOCK = VE_BLOCKS_REGISTRY.register("centrifugal_separator", CentrifugalSeparatorBlock::new); - public static RegistryObject> CENTRIFUGAL_SEPARATOR_TILE = VE_TILE_REGISTRY.register("centrifugal_separator", - () -> BlockEntityType.Builder.of(VETileEntities.CENTRIFUGAL_SEPARATOR_FACTORY::create, VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get()).build(null)); - public static RegistryObject> CENTRIFUGAL_SEPARATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("centrifugal_separator", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry CENTRIFUGAL_SEPARATOR = + new BlockTileMenuRegistry("centrifugal_separator", + CentrifugalSeparatorBlock::new, + () -> VETileEntities.CENTRIFUGAL_SEPARATOR_FACTORY, + () -> VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY); // Implosion Compressor - public static RegistryObject IMPLOSION_COMPRESSOR_BLOCK = VE_BLOCKS_REGISTRY.register("implosion_compressor", ImplosionCompressorBlock::new); - public static RegistryObject> IMPLOSION_COMPRESSOR_TILE = VE_TILE_REGISTRY.register("implosion_compressor", - () -> BlockEntityType.Builder.of(VETileEntities.IMPLOSION_COMPRESSOR_FACTORY::create, VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get()).build(null)); - public static RegistryObject> IMPLOSION_COMPRESSOR_CONTAINER = VE_CONTAINER_REGISTRY.register("implosion_compressor", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.IMPLOSION_COMPRESSOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry IMPLOSION_COMPRESSOR = + new BlockTileMenuRegistry("implosion_compressor", + ImplosionCompressorBlock::new, + () -> VETileEntities.IMPLOSION_COMPRESSOR_FACTORY, + () -> VEContainers.IMPLOSION_COMPRESSOR_FACTORY); // Blast Furnace - public static RegistryObject BLAST_FURNACE_BLOCK = VE_BLOCKS_REGISTRY.register("blast_furnace", BlastFurnaceBlock::new); - public static RegistryObject> BLAST_FURNACE_TILE = VE_TILE_REGISTRY.register("blast_furnace", - () -> BlockEntityType.Builder.of(VETileEntities.BLAST_FURNACE_FACTORY::create, VEBlocks.BLAST_FURNACE_BLOCK.get()).build(null)); - public static RegistryObject> BLAST_FURNACE_CONTAINER = VE_CONTAINER_REGISTRY.register("blast_furnace", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.BLAST_FURNACE_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry BLAST_FURNACE = + new BlockTileMenuRegistry("blast_furnace", + BlastFurnaceBlock::new, + () -> VETileEntities.BLAST_FURNACE_FACTORY, + () -> VEContainers.BLAST_FURNACE_FACTORY); // Tooling Station - public static RegistryObject TOOLING_STATION_BLOCK = VE_BLOCKS_REGISTRY.register("tooling_station", ToolingStationBlock::new); - public static RegistryObject> TOOLING_STATION_TILE = VE_TILE_REGISTRY.register("tooling_station", - () -> BlockEntityType.Builder.of(VETileEntities.TOOLING_STATION_FACTORY::create, VEBlocks.TOOLING_STATION_BLOCK.get()).build(null)); - public static RegistryObject> TOOLING_STATION_CONTAINER = VE_CONTAINER_REGISTRY.register("tooling_station", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return new ToolingStationContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry TOOLING_STATION = + new BlockTileMenuRegistry("tooling_station", + ToolingStationBlock::new, + () -> VETileEntities.TOOLING_STATION_FACTORY, + () -> VEContainers.TOOLING_STATION_FACTORY); // Sawmill - public static RegistryObject SAWMILL_BLOCK = VE_BLOCKS_REGISTRY.register("sawmill", SawmillBlock::new); - public static RegistryObject> SAWMILL_TILE = VE_TILE_REGISTRY.register("sawmill", - () -> BlockEntityType.Builder.of(VETileEntities.SAWMILL_FACTORY::create, VEBlocks.SAWMILL_BLOCK.get()).build(null)); - public static RegistryObject> SAWMILL_CONTAINER = VE_CONTAINER_REGISTRY.register("sawmill", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.SAWMILL_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry SAWMILL = + new BlockTileMenuRegistry("sawmill", + SawmillBlock::new, + () -> VETileEntities.SAWMILL_FACTORY, + () -> VEContainers.SAWMILL_FACTORY); // Dimensional Laser - public static RegistryObject DIMENSIONAL_LASER_BLOCK = VE_BLOCKS_REGISTRY.register("dimensional_laser", DimensionalLaserBlock::new); - public static RegistryObject> DIMENSIONAL_LASER_TILE = VE_TILE_REGISTRY.register("dimensional_laser", - () -> BlockEntityType.Builder.of(VETileEntities.DIMENSIONAL_LASER_FACTORY::create, VEBlocks.DIMENSIONAL_LASER_BLOCK.get()).build(null)); - public static RegistryObject> DIMENSIONAL_LASER_CONTAINER = VE_CONTAINER_REGISTRY.register("dimensional_laser", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.DIMENSIONAL_LASER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry DIMENSIONAL_LASER = + new BlockTileMenuRegistry("dimensional_laser", + DimensionalLaserBlock::new, + () -> VETileEntities.DIMENSIONAL_LASER_FACTORY, + () -> VEContainers.DIMENSIONAL_LASER_FACTORY); // Fluid Electrolyzer - public static RegistryObject FLUID_ELECTROLYZER_BLOCK = VE_BLOCKS_REGISTRY.register("fluid_electrolyzer", FluidElectrolyzerBlock::new); - public static RegistryObject> FLUID_ELECTROLYZER_TILE = VE_TILE_REGISTRY.register("fluid_electrolyzer", - () -> BlockEntityType.Builder.of(VETileEntities.FLUID_ELECTROLYZER_FACTORY::create, VEBlocks.FLUID_ELECTROLYZER_BLOCK.get()).build(null)); - public static RegistryObject> FLUID_ELECTROLYZER_CONTAINER = VE_CONTAINER_REGISTRY.register("fluid_electrolyzer", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.FLUID_ELECTROLYZER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry FLUID_ELECTROLYZER = + new BlockTileMenuRegistry("fluid_electrolyzer", + FluidElectrolyzerBlock::new, + () -> VETileEntities.FLUID_ELECTROLYZER_FACTORY, + () -> VEContainers.FLUID_ELECTROLYZER_FACTORY); // Fluid Mixer - public static RegistryObject FLUID_MIXER_BLOCK = VE_BLOCKS_REGISTRY.register("fluid_mixer", FluidMixerBlock::new); - public static RegistryObject> FLUID_MIXER_TILE = VE_TILE_REGISTRY.register("fluid_mixer", - () -> BlockEntityType.Builder.of(VETileEntities.FLUID_MIXER_FACTORY::create, VEBlocks.FLUID_MIXER_BLOCK.get()).build(null)); - public static RegistryObject> FLUID_MIXER_CONTAINER = VE_CONTAINER_REGISTRY.register("fluid_mixer", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.FLUID_MIXER_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry FLUID_MIXER = + new BlockTileMenuRegistry("fluid_mixer", + FluidMixerBlock::new, + () -> VETileEntities.FLUID_MIXER_FACTORY, + () -> VEContainers.FLUID_MIXER_FACTORY); // Hydroponic Incubator - public static RegistryObject HYDROPONIC_INCUBATOR_BLOCK = VE_BLOCKS_REGISTRY.register("hydroponic_incubator", HydroponicIncubatorBlock::new); - public static RegistryObject> HYDROPONIC_INCUBATOR_TILE = VE_TILE_REGISTRY.register("hydroponic_incubator", - () -> BlockEntityType.Builder.of(VETileEntities.HYDROPONIC_INCUBATOR_FACTORY::create, VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get()).build(null)); - public static RegistryObject> HYDROPONIC_INCUBATOR_CONTAINER = VE_CONTAINER_REGISTRY.register("hydroponic_incubator", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return VEContainers.HYDROPONIC_INCUBATOR_FACTORY.create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry HYDROPONIC_INCUBATOR = + new BlockTileMenuRegistry("hydroponic_incubator", + HydroponicIncubatorBlock::new, + () -> VETileEntities.HYDROPONIC_INCUBATOR_FACTORY, + () -> VEContainers.HYDROPONIC_INCUBATOR_FACTORY); + // Tanks (Tile/Block) // Aluminum Tank - public static RegistryObject ALUMINUM_TANK_BLOCK = VE_BLOCKS_REGISTRY.register("aluminum_tank", AluminumTankBlock::new); - public static RegistryObject> ALUMINUM_TANK_TILE = VE_TILE_REGISTRY.register("aluminum_tank", - () -> BlockEntityType.Builder.of(AluminumTankTile::new, VEBlocks.ALUMINUM_TANK_BLOCK.get()).build(null)); - public static RegistryObject> ALUMINUM_TANK_CONTAINER = VE_CONTAINER_REGISTRY.register("aluminum_tank", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return new AluminumTankContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry ALUMINUM_TANK = + new BlockTileMenuRegistry("aluminum_tank", + AluminumTankBlock::new, + () -> VETileEntities.ALUMINUM_TANK_FACTORY, + () -> VEContainers.ALUMINUM_TANK_FACTORY); // Titanium Tank - public static RegistryObject TITANIUM_TANK_BLOCK = VE_BLOCKS_REGISTRY.register("titanium_tank", TitaniumTankBlock::new); - public static RegistryObject> TITANIUM_TANK_TILE = VE_TILE_REGISTRY.register("titanium_tank", - () -> BlockEntityType.Builder.of(TitaniumTankTile::new, VEBlocks.TITANIUM_TANK_BLOCK.get()).build(null)); - public static RegistryObject> TITANIUM_TANK_CONTAINER = VE_CONTAINER_REGISTRY.register("titanium_tank", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return new TitaniumTankContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry TITANIUM_TANK = + new BlockTileMenuRegistry("titanium_tank", + TitaniumTankBlock::new, + () -> VETileEntities.TITANIUM_TANK_FACTORY, + () -> VEContainers.TITANIUM_TANK_FACTORY); // Netherite Tank - public static RegistryObject NETHERITE_TANK_BLOCK = VE_BLOCKS_REGISTRY.register("netherite_tank", NetheriteTankBlock::new); - public static RegistryObject> NETHERITE_TANK_TILE = VE_TILE_REGISTRY.register("netherite_tank", - () -> BlockEntityType.Builder.of(NetheriteTankTile::new, VEBlocks.NETHERITE_TANK_BLOCK.get()).build(null)); - public static RegistryObject> NETHERITE_TANK_CONTAINER = VE_CONTAINER_REGISTRY.register("netherite_tank", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return new NetheriteTankContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry NETHERITE_TANK = + new BlockTileMenuRegistry("netherite_tank", + NetheriteTankBlock::new, + () -> VETileEntities.NETHERITE_TANK_FACTORY, + () -> VEContainers.NETHERITE_TANK_FACTORY); // Nighalite Tank - public static RegistryObject NIGHALITE_TANK_BLOCK = VE_BLOCKS_REGISTRY.register("nighalite_tank", NighaliteTankBlock::new); - public static RegistryObject> NIGHALITE_TANK_TILE = VE_TILE_REGISTRY.register("nighalite_tank", - () -> BlockEntityType.Builder.of(NighaliteTankTile::new, VEBlocks.NIGHALITE_TANK_BLOCK.get()).build(null)); - public static RegistryObject> NIGHALITE_TANK_CONTAINER = VE_CONTAINER_REGISTRY.register("nighalite_tank", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return new NighaliteTankContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry NIGHALITE_TANK = + new BlockTileMenuRegistry("nighalite_tank", + NighaliteTankBlock::new, + () -> VETileEntities.NIGHALITE_TANK_FACTORY, + () -> VEContainers.NIGHALITE_TANK_FACTORY); // Eighzo Tank - public static RegistryObject EIGHZO_TANK_BLOCK = VE_BLOCKS_REGISTRY.register("eighzo_tank", EighzoTankBlock::new); - public static RegistryObject> EIGHZO_TANK_TILE = VE_TILE_REGISTRY.register("eighzo_tank", - () -> BlockEntityType.Builder.of(EighzoTankTile::new, VEBlocks.EIGHZO_TANK_BLOCK.get()).build(null)); - public static RegistryObject> EIGHZO_TANK_CONTAINER = VE_CONTAINER_REGISTRY.register("eighzo_tank", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return new EighzoTankContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry EIGHZO_TANK = + new BlockTileMenuRegistry("eighzo_tank", + EighzoTankBlock::new, + () -> VETileEntities.EIGHZO_TANK_FACTORY, + () -> VEContainers.EIGHZO_TANK_FACTORY); // Solarium Tank - public static RegistryObject SOLARIUM_TANK_BLOCK = VE_BLOCKS_REGISTRY.register("solarium_tank", SolariumTankBlock::new); - public static RegistryObject> SOLARIUM_TANK_TILE = VE_TILE_REGISTRY.register("solarium_tank", - () -> BlockEntityType.Builder.of(SolariumTankTile::new, VEBlocks.SOLARIUM_TANK_BLOCK.get()).build(null)); - public static RegistryObject> SOLARIUM_TANK_CONTAINER = VE_CONTAINER_REGISTRY.register("solarium_tank", () -> - IForgeMenuType.create((id, inv, data) -> { - BlockPos pos = data.readBlockPos(); - return new SolariumTankContainer(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); - })); + public static final BlockTileMenuRegistry SOLARIUM_TANK = + new BlockTileMenuRegistry("solarium_tank", + SolariumTankBlock::new, + () -> VETileEntities.SOLARIUM_TANK_FACTORY, + () -> VEContainers.SOLARIUM_TANK_FACTORY); + //Ores public static RegistryObject SALTPETER_ORE = VE_BLOCKS_REGISTRY.register("saltpeterore", SaltpeterOre::new); @@ -436,4 +343,34 @@ public class VEBlocks { public static RegistryObject RAW_BONE_BLOCK = VE_BLOCKS_REGISTRY.register("raw_bone_block", RawBoneBlock::new); // Unused public static RegistryObject PRESSURE_LADDER = VE_BLOCKS_REGISTRY.register("pressure_ladder", PressureLadder::new); + + public static class BlockTileMenuRegistry { + + RegistryObject block; + RegistryObject> tile; + RegistryObject> container; + + public BlockTileMenuRegistry(String name, Supplier blockSupplier, Supplier tileEntityFactory, Supplier containerFactory) { + block = VE_BLOCKS_REGISTRY.register(name, blockSupplier); + tile = VE_TILE_REGISTRY.register(name, + () -> BlockEntityType.Builder.of(tileEntityFactory.get()::create, block.get()).build(null)); + container = VE_CONTAINER_REGISTRY.register(name, () -> + IForgeMenuType.create((id, inv, data) -> { + BlockPos pos = data.readBlockPos(); + return containerFactory.get().create(id, VoluminousEnergy.proxy.getClientWorld(), pos, inv, VoluminousEnergy.proxy.getClientPlayer()); + })); + } + + public RegistryObject block() { + return this.block; + } + + public RegistryObject> tile() { + return this.tile; + } + + public RegistryObject> container() { + return this.container; + } + } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AirCompressorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AirCompressorBlock.java index 0afce8c63..6bfe45a28 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AirCompressorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AirCompressorBlock.java @@ -36,6 +36,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta // NEW TICK SYSTEM @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.AIR_COMPRESSOR_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.AIR_COMPRESSOR.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AqueoulizerBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AqueoulizerBlock.java index 9f58c9069..77d416d71 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AqueoulizerBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/AqueoulizerBlock.java @@ -36,6 +36,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.AQUEOULIZER_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.AQUEOULIZER.tile().get()); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BatteryBoxBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BatteryBoxBlock.java index ea63a7abf..9ce076f42 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BatteryBoxBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BatteryBoxBlock.java @@ -36,7 +36,7 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.BATTERY_BOX_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.BATTERY_BOX.tile().get()); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BlastFurnaceBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BlastFurnaceBlock.java index 048732c71..79cc59d38 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BlastFurnaceBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/BlastFurnaceBlock.java @@ -36,6 +36,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.BLAST_FURNACE_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.BLAST_FURNACE.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalAgitatorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalAgitatorBlock.java index 7de94479f..b8a2ca17f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalAgitatorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalAgitatorBlock.java @@ -36,6 +36,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.CENTRIFUGAL_AGITATOR_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.CENTRIFUGAL_AGITATOR.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalSeparatorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalSeparatorBlock.java index d50cc3f45..82f36e6a5 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalSeparatorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CentrifugalSeparatorBlock.java @@ -36,6 +36,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.CENTRIFUGAL_SEPARATOR_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.CENTRIFUGAL_SEPARATOR.tile().get()); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CombustionGeneratorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CombustionGeneratorBlock.java index 9dd72c1b0..c118fa92b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CombustionGeneratorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CombustionGeneratorBlock.java @@ -35,7 +35,7 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.COMBUSTION_GENERATOR_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.COMBUSTION_GENERATOR.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CompressorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CompressorBlock.java index 5fdfe3a73..4275e23c6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CompressorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CompressorBlock.java @@ -35,6 +35,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.COMPRESSOR_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.COMPRESSOR.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java index bb7d81743..4436a82b8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/CrusherBlock.java @@ -36,6 +36,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.CRUSHER_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.CRUSHER.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/DistillationUnitBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/DistillationUnitBlock.java index 32cb33489..7ac8f1224 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/DistillationUnitBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/DistillationUnitBlock.java @@ -36,6 +36,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.DISTILLATION_UNIT_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.DISTILLATION_UNIT.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectricFurnaceBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectricFurnaceBlock.java index 499570f57..02a32edd2 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectricFurnaceBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectricFurnaceBlock.java @@ -36,6 +36,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.ELECTRIC_FURNACE_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.ELECTRIC_FURNACE.tile().get()); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectrolyzerBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectrolyzerBlock.java index 8423be9e6..eb745f1b8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectrolyzerBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ElectrolyzerBlock.java @@ -36,7 +36,7 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.ELECTROLYZER_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.ELECTROLYZER.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidElectrolyzerBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidElectrolyzerBlock.java index e9d3e399c..dcc6fb89a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidElectrolyzerBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidElectrolyzerBlock.java @@ -36,6 +36,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.FLUID_ELECTROLYZER_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.FLUID_ELECTROLYZER.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidMixerBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidMixerBlock.java index dcdcf8902..51039dbec 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidMixerBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/FluidMixerBlock.java @@ -35,6 +35,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.FLUID_MIXER_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.FLUID_MIXER.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/GasFiredFurnaceBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/GasFiredFurnaceBlock.java index 326bec66f..537d931fd 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/GasFiredFurnaceBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/GasFiredFurnaceBlock.java @@ -37,6 +37,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.GAS_FIRED_FURNACE_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.GAS_FIRED_FURNACE.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/HydroponicIncubatorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/HydroponicIncubatorBlock.java index 6dc5b7f08..42fcb90db 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/HydroponicIncubatorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/HydroponicIncubatorBlock.java @@ -35,6 +35,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.HYDROPONIC_INCUBATOR_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.HYDROPONIC_INCUBATOR.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ImplosionCompressorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ImplosionCompressorBlock.java index f1193c9e4..59fd59872 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ImplosionCompressorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ImplosionCompressorBlock.java @@ -35,6 +35,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.IMPLOSION_COMPRESSOR_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.IMPLOSION_COMPRESSOR.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveBlastFurnaceBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveBlastFurnaceBlock.java index aa5ce9894..6a7536f3d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveBlastFurnaceBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveBlastFurnaceBlock.java @@ -42,7 +42,7 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.PRIMITIVE_BLAST_FURNACE_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.PRIMITIVE_BLAST_FURNACE.tile().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveSolarPanelBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveSolarPanelBlock.java index 6a451432f..76539e44d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveSolarPanelBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveSolarPanelBlock.java @@ -35,6 +35,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.PRIMITIVE_SOLAR_PANEL_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.PRIMITIVE_SOLAR_PANEL.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveStirlingGeneratorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveStirlingGeneratorBlock.java index dd0bdca40..04e11f150 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveStirlingGeneratorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveStirlingGeneratorBlock.java @@ -37,6 +37,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.PRIMITIVE_STIRLING_GENERATOR_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.PRIMITIVE_STIRLING_GENERATOR.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PumpBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PumpBlock.java index 8f75edd95..f4fc1143d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PumpBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PumpBlock.java @@ -30,7 +30,7 @@ public PumpBlock() { @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.PUMP_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.PUMP.tile().get()); } @Nullable diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java index 71038e9ca..2397bdf4d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java @@ -90,7 +90,7 @@ public static BlockEntityTicker BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.SAWMILL_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.SAWMILL.tile().get()); } public VoxelShape getShape(BlockState blockState, BlockGetter blockGetter, BlockPos blockPos, CollisionContext collisionContext) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SolarPanelBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SolarPanelBlock.java index 81e892ed6..0b564baa2 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SolarPanelBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SolarPanelBlock.java @@ -35,6 +35,6 @@ public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState sta @Nullable public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.SOLAR_PANEL_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.SOLAR_PANEL.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java index 6a228abda..4dd0b08b8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/StirlingGeneratorBlock.java @@ -34,6 +34,6 @@ public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { // Replaces @Nullable public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.STIRLING_GENERATOR_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.STIRLING_GENERATOR.tile().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ToolingStationBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ToolingStationBlock.java index 25583c195..e9d6c1903 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ToolingStationBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/ToolingStationBlock.java @@ -54,7 +54,7 @@ public static BlockEntityTicker BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.TOOLING_STATION_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.TOOLING_STATION.tile().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/AluminumTankBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/AluminumTankBlock.java index 1c6c0d5f1..4ac75b900 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/AluminumTankBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/AluminumTankBlock.java @@ -1,8 +1,8 @@ package com.veteam.voluminousenergy.blocks.blocks.machines.tanks; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.tank.AluminumTankTile; -import com.veteam.voluminousenergy.blocks.tiles.tank.TankTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import com.veteam.voluminousenergy.tools.Config; import net.minecraft.core.BlockPos; @@ -33,21 +33,21 @@ public AluminumTankBlock() { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return new AluminumTankTile(pos, state); + return VETileEntities.ALUMINUM_TANK_FACTORY.create(pos, state); } @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { - return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, TankTile::serverTick); + protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { + return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, VETileEntity::serverTick); } - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { + public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { return blockEntityType == tile ? (BlockEntityTicker) serverTick : null; } @Nullable public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.ALUMINUM_TANK_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.ALUMINUM_TANK.tile().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/EighzoTankBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/EighzoTankBlock.java index 71cdedc73..7d77b9937 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/EighzoTankBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/EighzoTankBlock.java @@ -1,8 +1,8 @@ package com.veteam.voluminousenergy.blocks.blocks.machines.tanks; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.tank.EighzoTankTile; -import com.veteam.voluminousenergy.blocks.tiles.tank.TankTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import com.veteam.voluminousenergy.tools.Config; import net.minecraft.core.BlockPos; @@ -33,21 +33,21 @@ public EighzoTankBlock() { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return new EighzoTankTile(pos, state); + return VETileEntities.EIGHZO_TANK_FACTORY.create(pos, state); } @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { - return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, TankTile::serverTick); + protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { + return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, VETileEntity::serverTick); } - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { + public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { return blockEntityType == tile ? (BlockEntityTicker) serverTick : null; } @Nullable public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.EIGHZO_TANK_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.EIGHZO_TANK.tile().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/NetheriteTankBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/NetheriteTankBlock.java index ae55ea0da..d0f8ba7d2 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/NetheriteTankBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/NetheriteTankBlock.java @@ -1,8 +1,8 @@ package com.veteam.voluminousenergy.blocks.blocks.machines.tanks; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.tank.NetheriteTankTile; -import com.veteam.voluminousenergy.blocks.tiles.tank.TankTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import com.veteam.voluminousenergy.tools.Config; import net.minecraft.core.BlockPos; @@ -33,21 +33,21 @@ public NetheriteTankBlock() { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return new NetheriteTankTile(pos, state); + return VETileEntities.NETHERITE_TANK_FACTORY.create(pos, state); } @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { - return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, TankTile::serverTick); + protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { + return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, VETileEntity::serverTick); } - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { + public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { return blockEntityType == tile ? (BlockEntityTicker) serverTick : null; } @Nullable public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.NETHERITE_TANK_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.NETHERITE_TANK.tile().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/NighaliteTankBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/NighaliteTankBlock.java index 636a7a9b3..e9bfb2c2a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/NighaliteTankBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/NighaliteTankBlock.java @@ -1,8 +1,8 @@ package com.veteam.voluminousenergy.blocks.blocks.machines.tanks; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.tank.NighaliteTankTile; -import com.veteam.voluminousenergy.blocks.tiles.tank.TankTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import com.veteam.voluminousenergy.tools.Config; import net.minecraft.core.BlockPos; @@ -33,21 +33,21 @@ public NighaliteTankBlock() { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return new NighaliteTankTile(pos, state); + return VETileEntities.NIGHALITE_TANK_FACTORY.create(pos, state); } @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { - return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, TankTile::serverTick); + protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { + return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, VETileEntity::serverTick); } - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { + public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { return blockEntityType == tile ? (BlockEntityTicker) serverTick : null; } @Nullable public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.NIGHALITE_TANK_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.NIGHALITE_TANK.tile().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/SolariumTankBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/SolariumTankBlock.java index e48005493..b39b552f3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/SolariumTankBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/SolariumTankBlock.java @@ -1,8 +1,8 @@ package com.veteam.voluminousenergy.blocks.blocks.machines.tanks; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.tank.SolariumTankTile; -import com.veteam.voluminousenergy.blocks.tiles.tank.TankTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import com.veteam.voluminousenergy.tools.Config; import net.minecraft.core.BlockPos; @@ -33,21 +33,21 @@ public SolariumTankBlock() { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return new SolariumTankTile(pos, state); + return VETileEntities.SOLARIUM_TANK_FACTORY.create(pos, state); } @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { - return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, TankTile::serverTick); + protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { + return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, VETileEntity::serverTick); } - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { + public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { return blockEntityType == tile ? (BlockEntityTicker) serverTick : null; } @Nullable public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.SOLARIUM_TANK_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.SOLARIUM_TANK.tile().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/TitaniumTankBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/TitaniumTankBlock.java index 6f0c1dcca..b8a1ed9c8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/TitaniumTankBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/tanks/TitaniumTankBlock.java @@ -1,8 +1,8 @@ package com.veteam.voluminousenergy.blocks.blocks.machines.tanks; import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.tiles.tank.TankTile; -import com.veteam.voluminousenergy.blocks.tiles.tank.TitaniumTankTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.datagen.VETagDataGenerator; import com.veteam.voluminousenergy.tools.Config; import net.minecraft.core.BlockPos; @@ -33,21 +33,21 @@ public TitaniumTankBlock() { @Nullable @Override public BlockEntity newBlockEntity(BlockPos pos, BlockState state) { - return new TitaniumTankTile(pos, state); + return VETileEntities.TITANIUM_TANK_FACTORY.create(pos, state); } @Nullable - protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { - return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, TankTile::serverTick); + protected static BlockEntityTicker createTicker(Level level, BlockEntityType passedBlockEntity, BlockEntityType tile) { + return level.isClientSide ? null : createTickerHelper(passedBlockEntity, tile, VETileEntity::serverTick); } - public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { + public static BlockEntityTicker createTickerHelper(BlockEntityType blockEntityType, BlockEntityType tile, BlockEntityTicker serverTick) { return blockEntityType == tile ? (BlockEntityTicker) serverTick : null; } @Nullable public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.TITANIUM_TANK_TILE.get()); + return createTicker(level, blockEntityType, VEBlocks.TITANIUM_TANK.tile().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java index 8b7faa118..cffe03601 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java @@ -1,7 +1,6 @@ package com.veteam.voluminousenergy.blocks.containers; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; import com.veteam.voluminousenergy.blocks.inventory.slots.VEBucketSlot; import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; import com.veteam.voluminousenergy.items.tools.multitool.CombustionMultitool; @@ -22,14 +21,14 @@ import javax.annotation.Nonnull; -import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.TOOLING_STATION_CONTAINER; +import static com.veteam.voluminousenergy.blocks.blocks.VEBlocks.TOOLING_STATION; public class ToolingStationContainer extends VEContainer { public static final int NUMBER_OF_SLOTS = 6; public ToolingStationContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(TOOLING_STATION_CONTAINER.get(), id, world, pos, inventory, player, VEBlocks.TOOLING_STATION_BLOCK.get()); + super(TOOLING_STATION.container().get(), id, world, pos, inventory, player, TOOLING_STATION.block().get()); } @Nonnull diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java index 2f64aae30..67bc0cd1f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java @@ -9,14 +9,14 @@ public class VEContainers { public static final VEContainerFactory AIR_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() - .create(AIR_COMPRESSOR_CONTAINER, AIR_COMPRESSOR_BLOCK) + .create(AIR_COMPRESSOR.container(), AIR_COMPRESSOR.block()) .addSlot(70, 18, new BucketInputSlot(UP, 0)) // Air Compressor bucket input slot .addSlot(70, 49, new BucketOutputSlot(DOWN)) // Air Compressor bucket output slot .addUpgradeSlot(154, -14) // Upgrade Slot .build(); public static final VEContainerFactory AQUEOULIZER_FACTORY = new VEContainerFactoryBuilder() - .create(AQUEOULIZER_CONTAINER, AQUEOULIZER_BLOCK) + .create(AQUEOULIZER.container(), AQUEOULIZER.block()) .addSlot(38, 18, new BucketInputSlot(UP, 0)) .addSlot(38, 49, new BucketOutputSlot(DOWN)) .addSlot(137, 18, new BucketInputSlot(NORTH, 1)) @@ -26,13 +26,13 @@ public class VEContainers { .build(); public static final VEContainerFactory BATTERY_BOX_FACTORY = new VEContainerFactoryBuilder() - .create(BATTERY_BOX_CONTAINER, BATTERY_BOX_BLOCK) + .create(BATTERY_BOX.container(), BATTERY_BOX.block()) .addSlot(35, 17, new InputSlot(UP)) // Top Slot .addSlot(35, 54, new ItemOutputSlot(DOWN)) //Bottom Slot .build(); public static final VEContainerFactory BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() - .create(BLAST_FURNACE_CONTAINER, BLAST_FURNACE_BLOCK) + .create(BLAST_FURNACE.container(), BLAST_FURNACE.block()) .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Fluid input slot .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from heat tank .addSlot(80, 25, new InputSlot(EAST)) // First input slot @@ -42,7 +42,7 @@ public class VEContainers { .build(); public static final VEContainerFactory CENTRIFUGAL_AGITATOR_FACTORY = new VEContainerFactoryBuilder() - .create(CENTRIFUGAL_AGITATOR_CONTAINER, CENTRIFUGAL_AGITATOR_BLOCK) + .create(CENTRIFUGAL_AGITATOR.container(), CENTRIFUGAL_AGITATOR.block()) .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Bucket insert; input tank .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Bucket extract; input tank .addSlot(96, 18, new BucketInputSlot(NORTH, 1)) // Bucket insert; first output tank @@ -53,7 +53,7 @@ public class VEContainers { .build(); public static final VEContainerFactory CENTRIFUGAL_SEPARATOR_FACTORY = new VEContainerFactoryBuilder() - .create(CENTRIFUGAL_SEPARATOR_CONTAINER, CENTRIFUGAL_SEPARATOR_BLOCK) + .create(CENTRIFUGAL_SEPARATOR.container(), CENTRIFUGAL_SEPARATOR.block()) .addSlot(53, 24, new ItemInputSlot(UP)) // Primary input slot .addSlot(53, 42, new ItemInputSlot(WEST)) // Empty Bucket slot .addSlot(99, 33, new ItemOutputSlot(DOWN)) //Main Output @@ -64,7 +64,7 @@ public class VEContainers { .build(); public static final VEContainerFactory COMBUSTION_GENERATOR_FACTORY = new VEContainerFactoryBuilder() - .create(COMBUSTION_GENERATOR_CONTAINER, COMBUSTION_GENERATOR_BLOCK) + .create(COMBUSTION_GENERATOR.container(), COMBUSTION_GENERATOR.block()) .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Oxidizer input slot .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from oxidizer slot .addSlot(138, 18, new BucketInputSlot(NORTH, 1)) // Fuel input slot @@ -72,14 +72,14 @@ public class VEContainers { .build(); public static final VEContainerFactory COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() - .create(COMPRESSOR_CONTAINER, COMPRESSOR_BLOCK) + .create(COMPRESSOR.container(), COMPRESSOR.block()) .addSlot(80, 13, new ItemInputSlot(UP)) .addSlot(80, 58, new ItemOutputSlot(DOWN)) //Main Output .addUpgradeSlot(154, -14) //Upgrade slot .build(); public static final VEContainerFactory CRUSHER_FACTORY = new VEContainerFactoryBuilder() - .create(CRUSHER_CONTAINER, CRUSHER_BLOCK) + .create(CRUSHER.container(), CRUSHER.block()) .addSlot(80, 13, new ItemInputSlot(UP)) // Input Slot .addSlot(71, 58, new ItemOutputSlot(DOWN)) //Main Output .addSlot(89, 58, new ItemOutputSlot(NORTH)) // RNG slot @@ -87,7 +87,7 @@ public class VEContainers { .build(); public static final VEContainerFactory DIMENSIONAL_LASER_FACTORY = new VEContainerFactoryBuilder() - .create(DIMENSIONAL_LASER_CONTAINER, DIMENSIONAL_LASER_BLOCK) + .create(DIMENSIONAL_LASER.container(), DIMENSIONAL_LASER.block()) .addSlot(138, 18, new BucketInputSlot(UP, 0)) // Bucket top slot .addSlot(138, 49, new BucketOutputSlot(DOWN)) // Bucket bottom slot .addSlot(38, 33, new ItemInputSlot(NORTH)) // RFID chip slot @@ -95,7 +95,7 @@ public class VEContainers { .build(); public static final VEContainerFactory DISTILLATION_UNIT_FACTORY = new VEContainerFactoryBuilder() - .create(DISTILLATION_UNIT_CONTAINER, DISTILLATION_UNIT_BLOCK) + .create(DISTILLATION_UNIT.container(), DISTILLATION_UNIT.block()) .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Fluid input slot .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from input .addSlot(96, 11, new BucketInputSlot(UP, 1)) // Top slot for first output @@ -107,14 +107,14 @@ public class VEContainers { .build(); public static final VEContainerFactory ELECTRIC_FURNACE_FACTORY = new VEContainerFactoryBuilder() - .create(ELECTRIC_FURNACE_CONTAINER, ELECTRIC_FURNACE_BLOCK) + .create(ELECTRIC_FURNACE.container(), ELECTRIC_FURNACE.block()) .addSlot(53, 33, new ItemInputSlot(UP)) // Furnace Input Slot .addSlot(116, 33, new ItemOutputSlot(DOWN)) // Furnace Output Slot .addUpgradeSlot(154, -14)// Upgrade Slot .build(); public static final VEContainerFactory ELECTROLYZER_FACTORY = new VEContainerFactoryBuilder() - .create(ELECTROLYZER_CONTAINER, ELECTROLYZER_BLOCK) + .create(ELECTROLYZER.container(), ELECTROLYZER.block()) .addSlot(71, 13, new ItemInputSlot(UP)) .addSlot(89, 13, new ItemInputSlot(WEST)) // Empty Bucket tilePos .addSlot(53, 57, new ItemOutputSlot(DOWN)) //Main Output @@ -125,7 +125,7 @@ public class VEContainers { .build(); public static final VEContainerFactory FLUID_ELECTROLYZER_FACTORY = new VEContainerFactoryBuilder() - .create(FLUID_ELECTROLYZER_CONTAINER, FLUID_ELECTROLYZER_BLOCK) + .create(FLUID_ELECTROLYZER.container(), FLUID_ELECTROLYZER.block()) .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Top input bucket .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Bottom input bucket .addSlot(96, 18, new BucketInputSlot(EAST, 1)) // Top output0 bucket @@ -136,7 +136,7 @@ public class VEContainers { .build(); public static final VEContainerFactory FLUID_MIXER_FACTORY = new VEContainerFactoryBuilder() - .create(FLUID_MIXER_CONTAINER, FLUID_MIXER_BLOCK) + .create(FLUID_MIXER.container(), FLUID_MIXER.block()) .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Top input0 bucket .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Bottom input0 bucket .addSlot(86, 18, new BucketInputSlot(EAST, 1)) // Top input1 bucket @@ -147,7 +147,7 @@ public class VEContainers { .build(); public static final VEContainerFactory GAS_FIRED_FURNACE_FACTORY = new VEContainerFactoryBuilder() - .create(GAS_FIRED_FURNACE_CONTAINER, GAS_FIRED_FURNACE_BLOCK) + .create(GAS_FIRED_FURNACE.container(), GAS_FIRED_FURNACE.block()) .addSlot(8, 18, new BucketInputSlot(UP, 0)) // Fluid input tilePos .addSlot(8, 49, new BucketOutputSlot(DOWN)) // Extract fluid from input .addSlot(53, 33, new ItemInputSlot(EAST)) // Item input tilePos @@ -156,7 +156,7 @@ public class VEContainers { .build(); public static final VEContainerFactory HYDROPONIC_INCUBATOR_FACTORY = new VEContainerFactoryBuilder() - .create(HYDROPONIC_INCUBATOR_CONTAINER, HYDROPONIC_INCUBATOR_BLOCK) + .create(HYDROPONIC_INCUBATOR.container(), HYDROPONIC_INCUBATOR.block()) .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Bucket top tilePos .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Bucket bottom tilePos .addSlot(83, 34, new ItemInputSlot(NORTH)) // Primary input @@ -168,7 +168,7 @@ public class VEContainers { .build(); public static final VEContainerFactory IMPLOSION_COMPRESSOR_FACTORY = new VEContainerFactoryBuilder() - .create(IMPLOSION_COMPRESSOR_CONTAINER, IMPLOSION_COMPRESSOR_BLOCK) + .create(IMPLOSION_COMPRESSOR.container(), IMPLOSION_COMPRESSOR.block()) .addSlot(53, 23, new ItemInputSlot(UP)) // Main input .addSlot(53, 41, new ItemInputSlot(EAST)) // Gunpowder tilePos .addSlot(116, 33, new ItemOutputSlot(DOWN)) //Main Output @@ -176,29 +176,29 @@ public class VEContainers { .build(); public static final VEContainerFactory PRIMITIVE_BLAST_FURNACE_FACTORY = new VEContainerFactoryBuilder() - .create(PRIMITIVE_BLAST_FURNACE_CONTAINER, PRIMITIVE_BLAST_FURNACE_BLOCK) + .create(PRIMITIVE_BLAST_FURNACE.container(), PRIMITIVE_BLAST_FURNACE.block()) .addSlot(53, 33, new ItemInputSlot(UP)) .addSlot(116, 33, new ItemOutputSlot(DOWN)) .addUpgradeSlot(154, -14) .build(); public static final VEContainerFactory PRIMITIVE_SOLAR_PANEL_FACTORY = new VEContainerFactoryBuilder() - .create(PRIMITIVE_SOLAR_PANEL_CONTAINER, PRIMITIVE_SOLAR_PANEL_BLOCK) + .create(PRIMITIVE_SOLAR_PANEL.container(), PRIMITIVE_SOLAR_PANEL.block()) .build(); public static final VEContainerFactory PRIMITIVE_STIRLING_GENERATOR_FACTORY = new VEContainerFactoryBuilder() - .create(PRIMITIVE_STIRLING_GENERATOR_CONTAINER, PRIMITIVE_STIRLING_GENERATOR_BLOCK) + .create(PRIMITIVE_STIRLING_GENERATOR.container(), PRIMITIVE_STIRLING_GENERATOR.block()) .addSlot(80, 35, new ItemInputSlot(UP)) .build(); public static final VEContainerFactory PUMP_FACTORY = new VEContainerFactoryBuilder() - .create(PUMP_CONTAINER, PUMP_BLOCK) + .create(PUMP.container(), PUMP.block()) .addSlot(70, 18, new BucketInputSlot(UP, 0)) // Pump bucket input tilePos .addSlot(70, 49, new BucketOutputSlot(DOWN)) // Pump bucket output tilePos .build(); public static final VEContainerFactory SAWMILL_FACTORY = new VEContainerFactoryBuilder() - .create(SAWMILL_CONTAINER, SAWMILL_BLOCK) + .create(SAWMILL.container(), SAWMILL.block()) .addSlot(44, 32, new ItemInputSlot(UP)) // Log input tilePos .addSlot(80, 24, new ItemOutputSlot(DOWN)) // Plank Output .addSlot(80, 42, new ItemOutputSlot(NORTH)) // Secondary Output @@ -208,17 +208,17 @@ public class VEContainers { .build(); public static final VEContainerFactory SOLAR_PANEL_FACTORY = new VEContainerFactoryBuilder() - .create(SOLAR_PANEL_CONTAINER, SOLAR_PANEL_BLOCK) + .create(SOLAR_PANEL.container(), SOLAR_PANEL.block()) .build(); public static final VEContainerFactory STIRLING_GENERATOR_FACTORY = new VEContainerFactoryBuilder() - .create(STIRLING_GENERATOR_CONTAINER, STIRLING_GENERATOR_BLOCK) + .create(STIRLING_GENERATOR.container(), STIRLING_GENERATOR.block()) .addSlot(80, 35, new ItemInputSlot(UP)) .build(); // TOOLING STATION UNUSED public static final VEContainerFactory TOOLING_STATION_FACTORY = new VEContainerFactoryBuilder() - .create(TOOLING_STATION_CONTAINER, TOOLING_STATION_BLOCK) + .create(TOOLING_STATION.container(), TOOLING_STATION.block()) .addSlot(38, 18, new BucketInputSlot(UP, 0)) // Fluid input tilePos .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from input .addSlot(86, 32, new ItemInputSlot(NORTH)) // Main Tool tilePos @@ -226,4 +226,40 @@ public class VEContainers { .addSlot(134, 49, new ItemInputSlot(EAST)) // Base Slot .addUpgradeSlot(154, -14) // Upgrade Slot .build(); + + public static final VEContainerFactory ALUMINUM_TANK_FACTORY = new VEContainerFactoryBuilder() + .create(ALUMINUM_TANK.container(),ALUMINUM_TANK.block()) + .addSlot(70,19,new BucketInputSlot(UP,0)) + .addSlot(70,50,new BucketOutputSlot(DOWN)) + .build(); + + public static final VEContainerFactory EIGHZO_TANK_FACTORY = new VEContainerFactoryBuilder() + .create(EIGHZO_TANK.container(),EIGHZO_TANK.block()) + .addSlot(70,19,new BucketInputSlot(UP,0)) + .addSlot(70,50,new BucketOutputSlot(DOWN)) + .build(); + + public static final VEContainerFactory NETHERITE_TANK_FACTORY = new VEContainerFactoryBuilder() + .create(NETHERITE_TANK.container(),NETHERITE_TANK.block()) + .addSlot(70,19,new BucketInputSlot(UP,0)) + .addSlot(70,50,new BucketOutputSlot(DOWN)) + .build(); + + public static final VEContainerFactory NIGHALITE_TANK_FACTORY = new VEContainerFactoryBuilder() + .create(NIGHALITE_TANK.container(),NIGHALITE_TANK.block()) + .addSlot(70,19,new BucketInputSlot(UP,0)) + .addSlot(70,50,new BucketOutputSlot(DOWN)) + .build(); + + public static final VEContainerFactory SOLARIUM_TANK_FACTORY = new VEContainerFactoryBuilder() + .create(SOLARIUM_TANK.container(),SOLARIUM_TANK.block()) + .addSlot(70,19,new BucketInputSlot(UP,0)) + .addSlot(70,50,new BucketOutputSlot(DOWN)) + .build(); + + public static final VEContainerFactory TITANIUM_TANK_FACTORY = new VEContainerFactoryBuilder() + .create(TITANIUM_TANK.container(),TITANIUM_TANK.block()) + .addSlot(70,19,new BucketInputSlot(UP,0)) + .addSlot(70,50,new BucketOutputSlot(DOWN)) + .build(); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/AluminumTankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/AluminumTankContainer.java deleted file mode 100644 index d18444288..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/AluminumTankContainer.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers.tank; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; - -public class AluminumTankContainer extends TankContainer { - - public AluminumTankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(id, world, pos, inventory, player, VEBlocks.ALUMINUM_TANK_CONTAINER.get(), VEBlocks.ALUMINUM_TANK_BLOCK.get()); - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/EighzoTankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/EighzoTankContainer.java deleted file mode 100644 index c42c7655a..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/EighzoTankContainer.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers.tank; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; - -public class EighzoTankContainer extends TankContainer { - - public EighzoTankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(id, world, pos, inventory, player, VEBlocks.EIGHZO_TANK_CONTAINER.get(), VEBlocks.EIGHZO_TANK_BLOCK.get()); - } - -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NetheriteTankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NetheriteTankContainer.java deleted file mode 100644 index 385a1bbf3..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NetheriteTankContainer.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers.tank; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; - -public class NetheriteTankContainer extends TankContainer { - - public NetheriteTankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(id, world, pos, inventory, player, VEBlocks.NETHERITE_TANK_CONTAINER.get(), VEBlocks.NETHERITE_TANK_BLOCK.get()); - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NighaliteTankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NighaliteTankContainer.java deleted file mode 100644 index f8b855a86..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/NighaliteTankContainer.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers.tank; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; - -public class NighaliteTankContainer extends TankContainer { - - public NighaliteTankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(id, world, pos, inventory, player, VEBlocks.NIGHALITE_TANK_CONTAINER.get(), VEBlocks.NIGHALITE_TANK_BLOCK.get()); - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/SolariumTankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/SolariumTankContainer.java deleted file mode 100644 index 2e7966c45..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/SolariumTankContainer.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers.tank; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; - -public class SolariumTankContainer extends TankContainer { - - public SolariumTankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(id, world, pos, inventory, player, VEBlocks.SOLARIUM_TANK_CONTAINER.get(), VEBlocks.SOLARIUM_TANK_BLOCK.get()); - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java deleted file mode 100644 index e9261de16..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TankContainer.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers.tank; - -import com.veteam.voluminousenergy.blocks.containers.VEContainer; -import com.veteam.voluminousenergy.blocks.inventory.slots.VEInsertSlot; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.inventory.Slot; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.Block; -import net.minecraftforge.items.IItemHandler; -import org.jetbrains.annotations.NotNull; - -import javax.annotation.Nonnull; - -public class TankContainer extends VEContainer { - - //private Player playerEntity; - private static final int NUMBER_OF_SLOTS = 2; - - public TankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player, MenuType menuType, Block block) { - super(menuType, id, world, pos, inventory, player, block); - } - - @Override - public void addSlotsToGUI(IItemHandler h) { - addSlot(new VEInsertSlot(h, 0, 70, 19)); // Bucket top slot - addSlot(new VEInsertSlot(h, 1, 70, 50)); // Bucket bottom slot - } - - @Nonnull - @Override - public @NotNull ItemStack quickMoveStack(final @NotNull Player player, final int index) { - ItemStack returnStack = ItemStack.EMPTY; - final Slot slot = this.slots.get(index); - if (slot != null && slot.hasItem()) { - final ItemStack slotStack = slot.getItem(); - returnStack = slotStack.copy(); - - if (handleCoreQuickMoveStackLogic(index, NUMBER_OF_SLOTS, slotStack) != null) return ItemStack.EMPTY; - - if (slotStack.getCount() == 0) { - slot.set(ItemStack.EMPTY); - } else { - slot.setChanged(); - } - if (slotStack.getCount() == returnStack.getCount()) { - return ItemStack.EMPTY; - } - slot.onTake(player, slotStack); - } - return returnStack; - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TitaniumTankContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TitaniumTankContainer.java deleted file mode 100644 index bdad15b3f..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/tank/TitaniumTankContainer.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.veteam.voluminousenergy.blocks.containers.tank; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.level.Level; - -public class TitaniumTankContainer extends TankContainer { - - public TitaniumTankContainer(int id, Level world, BlockPos pos, Inventory inventory, Player player) { - super(id, world, pos, inventory, player, VEBlocks.TITANIUM_TANK_CONTAINER.get(), VEBlocks.TITANIUM_TANK_BLOCK.get()); - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/AluminumTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/AluminumTankScreen.java index d5f265356..d5831cf49 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/AluminumTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/AluminumTankScreen.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.blocks.screens.tank; -import com.veteam.voluminousenergy.blocks.containers.tank.TankContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; public class AluminumTankScreen extends TankScreen { - public AluminumTankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { + public AluminumTankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/EighzoTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/EighzoTankScreen.java index f69bc1efe..6241fbaba 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/EighzoTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/EighzoTankScreen.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.blocks.screens.tank; -import com.veteam.voluminousenergy.blocks.containers.tank.TankContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; public class EighzoTankScreen extends TankScreen { - public EighzoTankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { + public EighzoTankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NetheriteTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NetheriteTankScreen.java index 02f7a0298..e28c791bb 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NetheriteTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NetheriteTankScreen.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.blocks.screens.tank; -import com.veteam.voluminousenergy.blocks.containers.tank.TankContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; public class NetheriteTankScreen extends TankScreen { - public NetheriteTankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { + public NetheriteTankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NighaliteTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NighaliteTankScreen.java index 8ce4ef146..b6d5ca20f 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NighaliteTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/NighaliteTankScreen.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.blocks.screens.tank; -import com.veteam.voluminousenergy.blocks.containers.tank.TankContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; public class NighaliteTankScreen extends TankScreen { - public NighaliteTankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { + public NighaliteTankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/SolariumTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/SolariumTankScreen.java index cd58bd317..899429aa7 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/SolariumTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/SolariumTankScreen.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.blocks.screens.tank; -import com.veteam.voluminousenergy.blocks.containers.tank.TankContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; public class SolariumTankScreen extends TankScreen { - public SolariumTankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { + public SolariumTankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TankScreen.java index 1af90626a..57fd00c06 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TankScreen.java @@ -2,9 +2,9 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.tank.TankContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.screens.VEContainerScreen; -import com.veteam.voluminousenergy.blocks.tiles.tank.TankTile; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.VERender; import com.veteam.voluminousenergy.tools.buttons.slots.SlotBoolButton; import com.veteam.voluminousenergy.tools.buttons.slots.SlotDirectionButton; @@ -25,15 +25,15 @@ import java.util.UUID; -public class TankScreen extends VEContainerScreen { - private TankTile tileEntity; +public class TankScreen extends VEContainerScreen { + private VETileEntity tileEntity; private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/tank_gui.png"); private static final ResourceLocation GUI_TOOLS = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/guitools.png"); - public TankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { + public TankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (TankTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -70,9 +70,9 @@ protected void renderSlotAndTankLabels(GuiGraphics matrixStack, int mouseX, int @Override protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { if (isHovering(93, 18, 12, 50, mouseX, mouseY)) { - int amount = tileEntity.getTank().getTank().getFluid().getAmount(); - String name = tileEntity.getTank().getTank().getFluid().getTranslationKey(); - matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getTankCapacity()), mouseX, mouseY); + int amount = tileEntity.getRelationalTank(0).getTank().getFluid().getAmount(); + String name = tileEntity.getRelationalTank(0).getTank().getFluid().getTranslationKey(); + matrixStack.renderTooltip(this.font, TextUtil.tankTooltip(name, amount, tileEntity.getRelationalTank(0).getTank().getCapacity()), mouseX, mouseY); } super.renderTooltip(matrixStack, mouseX, mouseY); @@ -90,7 +90,7 @@ protected void renderBg(GuiGraphics matrixStack, float partialTicks, int mouseX, if (tileEntity != null) { // Tank render try { - VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getTank().getTank(), tileEntity.getTankCapacity(), i + 93, j + 18, 0, 12, 50); + VERender.renderGuiTank(tileEntity.getLevel(), tileEntity.getBlockPos(), tileEntity.getRelationalTank(0).getTank(), tileEntity.getRelationalTank(0).getTank().getCapacity(), i + 93, j + 18, 0, 12, 50); } catch (Exception e) { } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TitaniumTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TitaniumTankScreen.java index 3ad66a9a5..a4047f9b1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TitaniumTankScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/TitaniumTankScreen.java @@ -1,6 +1,6 @@ package com.veteam.voluminousenergy.blocks.screens.tank; -import com.veteam.voluminousenergy.blocks.containers.tank.TankContainer; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.network.chat.Component; @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; public class TitaniumTankScreen extends TankScreen { - public TitaniumTankScreen(TankContainer screenContainer, Inventory inv, Component titleIn) { + public TitaniumTankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java index 1229b9761..d02cd02a3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java @@ -69,7 +69,7 @@ public List getSlotManagers() { } public ToolingStationTile(BlockPos pos, BlockState state) { - super(VEBlocks.TOOLING_STATION_TILE.get(), pos, state, null); + super(VEBlocks.TOOLING_STATION.tile().get(), pos, state, null); } VERecipe fuelRecipe; diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java index e99e99eea..b700856dd 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -4,15 +4,10 @@ import com.veteam.voluminousenergy.blocks.containers.VEContainers; import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidInputTank; import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidOutputTank; -import com.veteam.voluminousenergy.blocks.tiles.fluids.AbstractFluidValidator; -import com.veteam.voluminousenergy.blocks.tiles.inventory.BatteryBoxInventoryValidator; -import com.veteam.voluminousenergy.blocks.tiles.inventory.DimensionalLaserInventoryValidator; -import com.veteam.voluminousenergy.blocks.tiles.inventory.FurnaceInventoryValidator; -import com.veteam.voluminousenergy.blocks.tiles.inventory.GasFiredFurnaceInventoryValidator; +import com.veteam.voluminousenergy.blocks.tiles.inventory.*; import com.veteam.voluminousenergy.items.data.CombustibleFluidsData; import com.veteam.voluminousenergy.recipe.processor.*; import com.veteam.voluminousenergy.tools.Config; -import net.minecraftforge.fluids.FluidStack; import static com.veteam.voluminousenergy.recipe.VERecipes.VERecipeTypes.*; @@ -21,7 +16,7 @@ public class VETileEntities { static final int DEFAULT_TANK_CAPACITY = 4000; public static final VETileEntityFactory AIR_COMPRESSOR_FACTORY = - new VETileEntityFactory(VEBlocks.AIR_COMPRESSOR_TILE, VEContainers.AIR_COMPRESSOR_FACTORY) + new VETileEntityFactory(VEBlocks.AIR_COMPRESSOR.tile(), VEContainers.AIR_COMPRESSOR_FACTORY) .addEnergyStorageWithConsumption( Config.AIR_COMPRESSOR_MAX_POWER.get(), Config.AIR_COMPRESSOR_TRANSFER.get(), @@ -32,7 +27,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new AirCompressorProcessor()); public static final VETileEntityFactory AQUEOULIZER_TILE_FACTORY = - new VETileEntityFactory(VEBlocks.AQUEOULIZER_TILE, VEContainers.AQUEOULIZER_FACTORY) + new VETileEntityFactory(VEBlocks.AQUEOULIZER.tile(), VEContainers.AQUEOULIZER_FACTORY) .addEnergyStorageWithConsumption( Config.AQUEOULIZER_MAX_POWER.get(), Config.AQUEOULIZER_TRANSFER.get(), @@ -45,7 +40,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory BATTERY_BOX_FACTORY = - new VETileEntityFactory(VEBlocks.BATTERY_BOX_TILE, VEContainers.BATTERY_BOX_FACTORY) + new VETileEntityFactory(VEBlocks.BATTERY_BOX.tile(), VEContainers.BATTERY_BOX_FACTORY) .addEnergyStorage( Config.BATTERY_BOX_MAX_POWER.get(), Config.BATTERY_BOX_TRANSFER.get()) @@ -53,7 +48,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BatteryBoxProcessor()); public static final VETileEntityFactory BLAST_FURNACE_FACTORY = - new VETileEntityFactory(VEBlocks.BLAST_FURNACE_TILE, VEContainers.BLAST_FURNACE_FACTORY) + new VETileEntityFactory(VEBlocks.BLAST_FURNACE.tile(), VEContainers.BLAST_FURNACE_FACTORY) .addEnergyStorageWithConsumption( Config.BLAST_FURNACE_MAX_POWER.get(), Config.BLAST_FURNACE_TRANSFER.get(), @@ -70,7 +65,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new MultiBlockRecipeProcessor(VEBlocks.TITANIUM_MACHINE_CASING_BLOCK)); public static final VETileEntityFactory CENTRIFUGAL_AGITATOR_FACTORY = - new VETileEntityFactory(VEBlocks.CENTRIFUGAL_AGITATOR_TILE, VEContainers.CENTRIFUGAL_AGITATOR_FACTORY) + new VETileEntityFactory(VEBlocks.CENTRIFUGAL_AGITATOR.tile(), VEContainers.CENTRIFUGAL_AGITATOR_FACTORY) .addEnergyStorageWithConsumption( Config.CENTRIFUGAL_AGITATOR_MAX_POWER.get(), Config.CENTRIFUGAL_AGITATOR_TRANSFER.get(), @@ -86,7 +81,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory CENTRIFUGAL_SEPARATOR_FACTORY = - new VETileEntityFactory(VEBlocks.CENTRIFUGAL_SEPARATOR_TILE, VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY) + new VETileEntityFactory(VEBlocks.CENTRIFUGAL_SEPARATOR.tile(), VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY) .addEnergyStorageWithConsumption( Config.CENTRIFUGAL_SEPARATOR_MAX_POWER.get(), Config.CENTRIFUGAL_SEPARATOR_TRANSFER.get(), @@ -97,7 +92,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory COMBUSTION_GENERATOR_FACTORY = - new VETileEntityFactory(VEBlocks.COMBUSTION_GENERATOR_TILE, VEContainers.COMBUSTION_GENERATOR_FACTORY) + new VETileEntityFactory(VEBlocks.COMBUSTION_GENERATOR.tile(), VEContainers.COMBUSTION_GENERATOR_FACTORY) .addEnergyStorage( Config.COMBUSTION_GENERATOR_MAX_POWER.get(), Config.COMBUSTION_GENERATOR_SEND.get()) @@ -111,7 +106,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new CombustionGeneratorProcessor()); public static final VETileEntityFactory COMPRESSOR_FACTORY = - new VETileEntityFactory(VEBlocks.COMPRESSOR_TILE, VEContainers.COMPRESSOR_FACTORY) + new VETileEntityFactory(VEBlocks.COMPRESSOR.tile(), VEContainers.COMPRESSOR_FACTORY) .addEnergyStorageWithConsumption( Config.COMPRESSOR_MAX_POWER.get(), Config.COMPRESSOR_TRANSFER.get(), @@ -122,7 +117,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory CRUSHER_FACTORY = - new VETileEntityFactory(VEBlocks.CRUSHER_TILE, VEContainers.CRUSHER_FACTORY) + new VETileEntityFactory(VEBlocks.CRUSHER.tile(), VEContainers.CRUSHER_FACTORY) .addEnergyStorageWithConsumption( Config.CRUSHER_MAX_POWER.get(), Config.CRUSHER_TRANSFER.get(), @@ -133,7 +128,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory DIMENSIONAL_LASER_FACTORY = - new VETileEntityFactory(VEBlocks.DIMENSIONAL_LASER_TILE, VEContainers.DIMENSIONAL_LASER_FACTORY) + new VETileEntityFactory(VEBlocks.DIMENSIONAL_LASER.tile(), VEContainers.DIMENSIONAL_LASER_FACTORY) .addEnergyStorageWithConsumption( Config.DIMENSIONAL_LASER_MAX_POWER.get(), Config.DIMENSIONAL_LASER_TRANSFER.get(), @@ -150,7 +145,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new DimensionalLaserRecipeProcessor(VEBlocks.SOLARIUM_MACHINE_CASING_BLOCK)); public static final VETileEntityFactory DISTILLATION_UNIT_FACTORY = - new VETileEntityFactory(VEBlocks.DISTILLATION_UNIT_TILE, VEContainers.DISTILLATION_UNIT_FACTORY) + new VETileEntityFactory(VEBlocks.DISTILLATION_UNIT.tile(), VEContainers.DISTILLATION_UNIT_FACTORY) .addEnergyStorageWithConsumption( Config.DISTILLATION_UNIT_MAX_POWER.get(), Config.DISTILLATION_UNIT_TRANSFER.get(), @@ -166,7 +161,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new MultiBlockRecipeProcessor(VEBlocks.ALUMINUM_MACHINE_CASING_BLOCK)); public static final VETileEntityFactory ELECTRIC_FURNACE_FACTORY = - new VETileEntityFactory(VEBlocks.ELECTRIC_FURNACE_TILE, VEContainers.ELECTRIC_FURNACE_FACTORY) + new VETileEntityFactory(VEBlocks.ELECTRIC_FURNACE.tile(), VEContainers.ELECTRIC_FURNACE_FACTORY) .addEnergyStorageWithConsumption(Config.ELECTROLYZER_MAX_POWER.get(), Config.ELECTRIC_FURNACE_TRANSFER.get(), Config.ELECTRIC_FURNACE_POWER_USAGE.get()) @@ -176,7 +171,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new ElectricFurnaceProcessor()); public static final VETileEntityFactory ELECTROLYZER_FACTORY = - new VETileEntityFactory(VEBlocks.ELECTROLYZER_TILE, VEContainers.ELECTROLYZER_FACTORY) + new VETileEntityFactory(VEBlocks.ELECTROLYZER.tile(), VEContainers.ELECTROLYZER_FACTORY) .addEnergyStorageWithConsumption(Config.ELECTROLYZER_MAX_POWER.get(), Config.ELECTRIC_FURNACE_TRANSFER.get(), Config.ELECTRIC_FURNACE_POWER_USAGE.get()) @@ -186,7 +181,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory FLUID_ELECTROLYZER_FACTORY = - new VETileEntityFactory(VEBlocks.FLUID_ELECTROLYZER_TILE, VEContainers.FLUID_ELECTROLYZER_FACTORY) + new VETileEntityFactory(VEBlocks.FLUID_ELECTROLYZER.tile(), VEContainers.FLUID_ELECTROLYZER_FACTORY) .addEnergyStorageWithConsumption( Config.FLUID_ELECTROLYZER_MAX_POWER.get(), Config.FLUID_ELECTROLYZER_TRANSFER.get(), @@ -198,7 +193,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory FLUID_MIXER_FACTORY = - new VETileEntityFactory(VEBlocks.FLUID_MIXER_TILE, VEContainers.FLUID_MIXER_FACTORY) + new VETileEntityFactory(VEBlocks.FLUID_MIXER.tile(), VEContainers.FLUID_MIXER_FACTORY) .addEnergyStorageWithConsumption( Config.FLUID_MIXER_MAX_POWER.get(), Config.FLUID_MIXER_TRANSFER.get(), @@ -215,7 +210,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory GAS_FIRED_FURNACE = - new VETileEntityFactory(VEBlocks.GAS_FIRED_FURNACE_TILE, VEContainers.GAS_FIRED_FURNACE_FACTORY) + new VETileEntityFactory(VEBlocks.GAS_FIRED_FURNACE.tile(), VEContainers.GAS_FIRED_FURNACE_FACTORY) // We have an upgrade slot, so we add an empty energy storage. Less than ideal. .addEnergyStorage(0,0) .addTanks( @@ -230,7 +225,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new GasFiredFurnaceProcessor()); public static final VETileEntityFactory HYDROPONIC_INCUBATOR_FACTORY = - new VETileEntityFactory(VEBlocks.HYDROPONIC_INCUBATOR_TILE, VEContainers.HYDROPONIC_INCUBATOR_FACTORY) + new VETileEntityFactory(VEBlocks.HYDROPONIC_INCUBATOR.tile(), VEContainers.HYDROPONIC_INCUBATOR_FACTORY) .addEnergyStorageWithConsumption( Config.HYDROPONIC_INCUBATOR_MAX_POWER.get(), Config.HYDROPONIC_INCUBATOR_TRANSFER.get(), @@ -245,7 +240,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory IMPLOSION_COMPRESSOR_FACTORY = - new VETileEntityFactory(VEBlocks.IMPLOSION_COMPRESSOR_TILE, VEContainers.IMPLOSION_COMPRESSOR_FACTORY) + new VETileEntityFactory(VEBlocks.IMPLOSION_COMPRESSOR.tile(), VEContainers.IMPLOSION_COMPRESSOR_FACTORY) .addEnergyStorageWithConsumption( Config.IMPLOSION_COMPRESSOR_MAX_POWER.get(), Config.IMPLOSION_COMPRESSOR_TRANSFER.get(), @@ -257,7 +252,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory PRIMITIVE_BLAST_FURNACE_FACTORY = - new VETileEntityFactory(VEBlocks.PRIMITIVE_BLAST_FURNACE_TILE, VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY) + new VETileEntityFactory(VEBlocks.PRIMITIVE_BLAST_FURNACE.tile(), VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY) .addEnergyStorage(0,0) .countable() .makesSound() @@ -265,7 +260,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory PRIMITIVE_SOLAR_PANEL_FACTORY = - new VETileEntityFactory(VEBlocks.PRIMITIVE_SOLAR_PANEL_TILE, VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY) + new VETileEntityFactory(VEBlocks.PRIMITIVE_SOLAR_PANEL.tile(), VEContainers.PRIMITIVE_SOLAR_PANEL_FACTORY) .addEnergyStorage( Config.PRIMITIVE_SOLAR_PANEL_MAX_POWER.get(), Config.PRIMITIVE_SOLAR_PANEL_SEND.get() @@ -274,7 +269,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new SolarPanelProcessor(Config.PRIMITIVE_SOLAR_PANEL_GENERATE.get())); public static final VETileEntityFactory SOLAR_PANEL_FACTORY = - new VETileEntityFactory(VEBlocks.SOLAR_PANEL_TILE, VEContainers.SOLAR_PANEL_FACTORY) + new VETileEntityFactory(VEBlocks.SOLAR_PANEL.tile(), VEContainers.SOLAR_PANEL_FACTORY) .addEnergyStorage( Config.SOLAR_PANEL_MAX_POWER.get(), Config.SOLAR_PANEL_SEND.get() @@ -283,7 +278,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new SolarPanelProcessor(Config.SOLAR_PANEL_GENERATE.get())); public static final VETileEntityFactory PRIMITIVE_STIRLING_GENERATOR_TILE_FACTORY = - new VETileEntityFactory(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_TILE, VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY) + new VETileEntityFactory(VEBlocks.PRIMITIVE_STIRLING_GENERATOR.tile(), VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY) .addEnergyStorage( Config.PRIMITIVE_STIRLING_GENERATOR_MAX_POWER.get(), Config.PRIMITIVE_STIRLING_GENERATOR_SEND.get()) @@ -294,7 +289,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new GeneratorProcessor(true, 4)); public static final VETileEntityFactory PUMP_FACTORY = - new VETileEntityFactory(VEBlocks.PUMP_TILE, VEContainers.PUMP_FACTORY) + new VETileEntityFactory(VEBlocks.PUMP.tile(), VEContainers.PUMP_FACTORY) .addEnergyStorage( Config.PUMP_MAX_POWER.get(), Config.PUMP_TRANSFER.get() @@ -309,7 +304,7 @@ public class VETileEntities { .makesSound(); public static final VETileEntityFactory SAWMILL_FACTORY = - new VETileEntityFactory(VEBlocks.SAWMILL_TILE, VEContainers.SAWMILL_FACTORY) + new VETileEntityFactory(VEBlocks.SAWMILL.tile(), VEContainers.SAWMILL_FACTORY) .addEnergyStorage( Config.SAWMILL_MAX_POWER.get(), Config.SAWMILL_TRANSFER.get() @@ -322,7 +317,7 @@ public class VETileEntities { .withCustomRecipeProcessing(new BasicProcessor()); public static final VETileEntityFactory STIRLING_GENERATOR_FACTORY = - new VETileEntityFactory(VEBlocks.STIRLING_GENERATOR_TILE, VEContainers.STIRLING_GENERATOR_FACTORY) + new VETileEntityFactory(VEBlocks.STIRLING_GENERATOR.tile(), VEContainers.STIRLING_GENERATOR_FACTORY) .addEnergyStorage( Config.STIRLING_GENERATOR_MAX_POWER.get(), Config.STIRLING_GENERATOR_SEND.get() @@ -334,7 +329,38 @@ public class VETileEntities { // TODO needs a custom processor public static final VETileEntityFactory TOOLING_STATION_FACTORY = - new VETileEntityFactory(VEBlocks.TOOLING_STATION_TILE, VEContainers.TOOLING_STATION_FACTORY) + new VETileEntityFactory(VEBlocks.TOOLING_STATION.tile(), VEContainers.TOOLING_STATION_FACTORY) .withRecipe(TOOLING) .withCustomRecipeProcessing(new BasicProcessor()); + + // Tanks + public static final VETileEntityFactory ALUMINUM_TANK_FACTORY = + new VETileEntityFactory(VEBlocks.ALUMINUM_TANK.tile(),VEContainers.ALUMINUM_TANK_FACTORY) + .withCustomInventoryValidator(new TankInventoryValidator()) + .addTanks(new VETileEntityFactory.FluidInputOutputTank(0,Config.ALUMINUM_TANK_CAPACITY.get() * 1000)); + + public static final VETileEntityFactory EIGHZO_TANK_FACTORY = + new VETileEntityFactory(VEBlocks.EIGHZO_TANK.tile(),VEContainers.EIGHZO_TANK_FACTORY) + .withCustomInventoryValidator(new TankInventoryValidator()) + .addTanks(new VETileEntityFactory.FluidInputOutputTank(0,Config.EIGHZO_TANK_CAPACITY.get() * 1000)); + + public static final VETileEntityFactory NETHERITE_TANK_FACTORY = + new VETileEntityFactory(VEBlocks.NETHERITE_TANK.tile(),VEContainers.NETHERITE_TANK_FACTORY) + .withCustomInventoryValidator(new TankInventoryValidator()) + .addTanks(new VETileEntityFactory.FluidInputOutputTank(0,Config.NETHERITE_TANK_CAPACITY.get() * 1000)); + + public static final VETileEntityFactory NIGHALITE_TANK_FACTORY = + new VETileEntityFactory(VEBlocks.NIGHALITE_TANK.tile(),VEContainers.NIGHALITE_TANK_FACTORY) + .withCustomInventoryValidator(new TankInventoryValidator()) + .addTanks(new VETileEntityFactory.FluidInputOutputTank(0,Config.NIGHALITE_TANK_CAPACITY.get() * 1000)); + + public static final VETileEntityFactory SOLARIUM_TANK_FACTORY = + new VETileEntityFactory(VEBlocks.SOLARIUM_TANK.tile(),VEContainers.SOLARIUM_TANK_FACTORY) + .withCustomInventoryValidator(new TankInventoryValidator()) + .addTanks(new VETileEntityFactory.FluidInputOutputTank(0,Config.SOLARIUM_TANK_CAPACITY.get() * 1000)); + + public static final VETileEntityFactory TITANIUM_TANK_FACTORY = + new VETileEntityFactory(VEBlocks.TITANIUM_TANK.tile(),VEContainers.TITANIUM_TANK_FACTORY) + .withCustomInventoryValidator(new TankInventoryValidator()) + .addTanks(new VETileEntityFactory.FluidInputOutputTank(0,Config.TITANIUM_TANK_CAPACITY.get() * 1000)); } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/TankInventoryValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/TankInventoryValidator.java new file mode 100644 index 000000000..bb6368fae --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/TankInventoryValidator.java @@ -0,0 +1,12 @@ +package com.veteam.voluminousenergy.blocks.tiles.inventory; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import net.minecraft.world.item.BucketItem; +import net.minecraft.world.item.ItemStack; + +public class TankInventoryValidator implements AbstractItemStackValidator { + @Override + public boolean isItemValid(int slot, ItemStack itemStack, VETileEntity tile) { + return itemStack.getItem() instanceof BucketItem; + } +} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/AluminumTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/AluminumTankTile.java deleted file mode 100644 index 596b4104c..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/AluminumTankTile.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles.tank; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.tank.AluminumTankContainer; -import com.veteam.voluminousenergy.tools.Config; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class AluminumTankTile extends TankTile { - - public AluminumTankTile(BlockPos pos, BlockState state) { - super(VEBlocks.ALUMINUM_TANK_TILE.get(), pos, state, Config.ALUMINUM_TANK_CAPACITY.get()); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return new AluminumTankContainer(i, level, this.worldPosition, playerInventory, player); - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/EighzoTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/EighzoTankTile.java deleted file mode 100644 index 55ae5a3a8..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/EighzoTankTile.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles.tank; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.tank.EighzoTankContainer; -import com.veteam.voluminousenergy.tools.Config; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class EighzoTankTile extends TankTile { - - public EighzoTankTile(BlockPos pos, BlockState state) { - super(VEBlocks.EIGHZO_TANK_TILE.get(), pos, state, Config.EIGHZO_TANK_CAPACITY.get()); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return new EighzoTankContainer(i, level, this.worldPosition, playerInventory, player); - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NetheriteTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NetheriteTankTile.java deleted file mode 100644 index f94908827..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NetheriteTankTile.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles.tank; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.tank.NetheriteTankContainer; -import com.veteam.voluminousenergy.tools.Config; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class NetheriteTankTile extends TankTile { - - public NetheriteTankTile(BlockPos pos, BlockState state) { - super(VEBlocks.NETHERITE_TANK_TILE.get(), pos, state, Config.NETHERITE_TANK_CAPACITY.get()); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return new NetheriteTankContainer(i, level, this.worldPosition, playerInventory, player); - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NighaliteTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NighaliteTankTile.java deleted file mode 100644 index 95f37aae6..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/NighaliteTankTile.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles.tank; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.tank.NighaliteTankContainer; -import com.veteam.voluminousenergy.tools.Config; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class NighaliteTankTile extends TankTile { - - public NighaliteTankTile(BlockPos pos, BlockState state) { - super(VEBlocks.NIGHALITE_TANK_TILE.get(), pos, state, Config.NIGHALITE_TANK_CAPACITY.get()); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return new NighaliteTankContainer(i, level, this.worldPosition, playerInventory, player); - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/SolariumTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/SolariumTankTile.java deleted file mode 100644 index 990145643..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/SolariumTankTile.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles.tank; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.tank.SolariumTankContainer; -import com.veteam.voluminousenergy.tools.Config; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class SolariumTankTile extends TankTile { - - public SolariumTankTile(BlockPos pos, BlockState state) { - super(VEBlocks.SOLARIUM_TANK_TILE.get(), pos, state, Config.SOLARIUM_TANK_CAPACITY.get()); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return new SolariumTankContainer(i, level, this.worldPosition, playerInventory, player); - } -} \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java deleted file mode 100644 index e9ca4726f..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java +++ /dev/null @@ -1,181 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles.tank; - -import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.MultiFluidSlotWrapper; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -import com.veteam.voluminousenergy.util.VERelationalTank; -import net.minecraft.core.BlockPos; -import net.minecraft.core.Direction; -import net.minecraft.nbt.CompoundTag; -import net.minecraft.network.Connection; -import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.item.BucketItem; -import net.minecraft.world.item.ItemStack; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ForgeCapabilities; -import net.minecraftforge.common.util.LazyOptional; -import net.minecraftforge.fluids.capability.templates.FluidTank; -import net.minecraftforge.items.ItemStackHandler; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import javax.annotation.Nonnull; -import java.util.ArrayList; -import java.util.List; - -public class TankTile extends VETileEntity { - private final VERelationalTank tank = new VERelationalTank(new FluidTank(0), 0, TankType.BOTH, "tank:tank_gui"); - - List slotManagers = new ArrayList<>() {{ - add(new VESlotManager(0, Direction.UP, true, SlotType.FLUID_INPUT, 1, 0)); - add(new VESlotManager(1, Direction.DOWN, true, SlotType.FLUID_OUTPUT)); - }}; - - List fluidManagers = new ArrayList<>() {{ - add(tank); - }}; - - private final ItemStackHandler inventory = createHandler(); - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } - - List surroundingBlocks = new ArrayList<>(); - - public TankTile(BlockEntityType blockEntityType, BlockPos pos, BlockState state, int capacity) { - super(blockEntityType, pos, state, null); - capacity = capacity * 1000; - tank.getTank().setCapacity(capacity); - tank.setAllowAny(true); - tank.setIgnoreDirection(true); - surroundingBlocks.add(new PosPair(pos.above(), Direction.DOWN)); - surroundingBlocks.add(new PosPair(pos.below(), Direction.UP)); - surroundingBlocks.add(new PosPair(pos.east(), Direction.WEST)); - surroundingBlocks.add(new PosPair(pos.west(), Direction.EAST)); - surroundingBlocks.add(new PosPair(pos.north(), Direction.SOUTH)); - surroundingBlocks.add(new PosPair(pos.south(), Direction.NORTH)); - } - - @Override - public void tick() { - updateClients(); - processFluidIO(); - - if (!tank.getSideStatus() || tank.getTank().getFluidAmount() == tank.getTank().getCapacity()) return; - -// Direction side = tank.getSideDirection(); -// BlockPos pos = getBlockPos().relative(side); -// BlockEntity entity = level.getBlockEntity(pos); -// if (entity == null) return; -// var capability = entity.getCapability(ForgeCapabilities.FLUID_HANDLER, side.getOpposite()); -// capability.ifPresent(fluidHandler -> { -// -// int tanks = fluidHandler.getTanks(); -// -// for (int i = 0; i < tanks; i++) { -// FluidStack outsideAmount = fluidHandler.getFluidInTank(i); -// if (outsideAmount.isEmpty()) continue; -// FluidTank fluidTank = this.tank.getTank(); -// FluidStack currentFluid = fluidTank.getFluid(); -// if (!currentFluid.isEmpty() && !outsideAmount.getFluid().isSame(currentFluid.getFluid())) continue; -// int amountToTake = Math.min(outsideAmount.getAmount(), 1000); -// amountToTake = Math.min(amountToTake, fluidTank.getCapacity() - fluidTank.getFluidAmount()); -// if (amountToTake == 0) return; -// Fluid outsideFluid = outsideAmount.getFluid(); // if we don't extract this it will get modified below when extracted and potentially be set to AIR -// int filled = fluidTank.fill(new FluidStack(outsideFluid, amountToTake), IFluidHandler.FluidAction.EXECUTE); -// if(filled == 0) return; -// fluidHandler.drain(amountToTake, IFluidHandler.FluidAction.EXECUTE); -// } -// }); - } - - private ItemStackHandler createHandler() { - return new ItemStackHandler(2) { - @Override - protected void onContentsChanged(int slot) { - markFluidInputDirty(); - setChanged(); - } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) { //IS ITEM VALID PLEASE DO THIS PER SLOT TO SAVE DEBUG HOURS!!!! - return (stack.getItem() instanceof BucketItem); - } - - @Nonnull - @Override - public ItemStack insertItem(int slot, @Nonnull ItemStack stack, boolean simulate) { - if (!isItemValid(slot, stack)) return stack; - return super.insertItem(slot, stack, simulate); - } - }; - } - - public VERelationalTank getTank() { - return this.tank; - } - - @Override - public @Nonnull CompoundTag getUpdateTag() { - CompoundTag compoundTag = new CompoundTag(); - this.saveAdditional(compoundTag); - return compoundTag; - } - - @Override - public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) { - this.load(pkt.getTag()); - super.onDataPacket(net, pkt); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return null; - } - - @Override - public int getTankCapacity() { - return this.tank.getTank().getCapacity(); - } - - private LazyOptional multiFluidSlotWrapperLazyOptional = null; - - @NotNull - @Override - public LazyOptional getCapability(@NotNull Capability cap, @Nullable Direction side) { - - if (cap == ForgeCapabilities.FLUID_HANDLER) { - if (multiFluidSlotWrapperLazyOptional == null) { - multiFluidSlotWrapperLazyOptional = LazyOptional.of(() -> new MultiFluidSlotWrapper(getRelationalTanks(), this)); - } - return multiFluidSlotWrapperLazyOptional.cast(); - } - - return super.getCapability(cap, side); - } - - @Override - public @NotNull List getRelationalTanks() { - return fluidManagers; - } - - private record PosPair(BlockPos pos, Direction direction) { - - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TitaniumTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TitaniumTankTile.java deleted file mode 100644 index 4390f99a8..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TitaniumTankTile.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles.tank; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.tank.TitaniumTankContainer; -import com.veteam.voluminousenergy.tools.Config; -import net.minecraft.core.BlockPos; -import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.entity.player.Player; -import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.level.block.state.BlockState; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class TitaniumTankTile extends TankTile { - - public TitaniumTankTile(BlockPos pos, BlockState state) { - super(VEBlocks.TITANIUM_TANK_TILE.get(), pos, state, Config.TITANIUM_TANK_CAPACITY.get()); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @NotNull Inventory playerInventory, @NotNull Player player) { - return new TitaniumTankContainer(i, level, this.worldPosition, playerInventory, player); - } -} diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java index 138bdf8a0..b3ac0bb90 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/VoluminousEnergyPlugin.java @@ -116,7 +116,7 @@ private void registerInfo(IRecipeRegistration registration) { registration.addIngredientInfo(new FluidStack(VEFluids.COMPRESSED_AIR_REG.get(), 1000), ForgeTypes.FLUID_STACK, TextUtil.translateString("jei.voluminousenergy.air_compressor_fluid_info")); List compressedAirInfo = List.of( - new ItemStack(VEBlocks.AIR_COMPRESSOR_BLOCK.get().asItem()), + new ItemStack(VEBlocks.AIR_COMPRESSOR.block().get().asItem()), new ItemStack(VEFluids.COMPRESSED_AIR_BUCKET_REG.get()) ); registration.addIngredientInfo(compressedAirInfo, VanillaTypes.ITEM_STACK, TextUtil.translateString("jei.voluminousenergy.air_compressor_item_info")); @@ -141,7 +141,7 @@ private void registerInfo(IRecipeRegistration registration) { ArrayList fluidScannerDimensionalLaserInfo = new ArrayList<>(); fluidScannerDimensionalLaserInfo.add(new ItemStack(VEItems.FLUID_SCANNER.get())); fluidScannerDimensionalLaserInfo.add(new ItemStack(VEItems.RFID_CHIP.get())); - fluidScannerDimensionalLaserInfo.add(new ItemStack(VEBlocks.DIMENSIONAL_LASER_BLOCK.get())); + fluidScannerDimensionalLaserInfo.add(new ItemStack(VEBlocks.DIMENSIONAL_LASER.block().get())); registration.addIngredientInfo(fluidScannerDimensionalLaserInfo, VanillaTypes.ITEM_STACK, TextUtil.translateString("jei.voluminousenergy.fluid_scanner_info")); } @@ -183,18 +183,18 @@ public void registerGuiHandlers(IGuiHandlerRegistration registration) { @Override public void registerRecipeTransferHandlers(IRecipeTransferRegistration registration) { - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.CRUSHER_CONTAINER.get(), CrushingCategory.RECIPE_TYPE, 0, 1, VEContainers.CRUSHER_FACTORY.getNumberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.ELECTROLYZER_CONTAINER.get(), ElectrolyzingCategory.RECIPE_TYPE, 0, 2, VEContainers.ELECTROLYZER_FACTORY.getNumberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.COMPRESSOR_CONTAINER.get(), CompressingCategory.RECIPE_TYPE, 0, 1, VEContainers.COMPRESSOR_FACTORY.getNumberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.PRIMITIVE_STIRLING_GENERATOR_CONTAINER.get(), StirlingCategory.RECIPE_TYPE, 0, 1, VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY.getNumberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.STIRLING_GENERATOR_CONTAINER.get(), StirlingCategory.RECIPE_TYPE, 0, 1, VEContainers.STIRLING_GENERATOR_FACTORY.getNumberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.AQUEOULIZER_CONTAINER.get(), AqueoulizingCategory.RECIPE_TYPE, 3, 2, VEContainers.AQUEOULIZER_FACTORY.getNumberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.CENTRIFUGAL_SEPARATOR_CONTAINER.get(), CentrifugalSeparationCategory.RECIPE_TYPE, 0, 2, VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY.getNumberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.IMPLOSION_COMPRESSOR_CONTAINER.get(), ImplosionCompressionCategory.RECIPE_TYPE, 0, 2, VEContainers.IMPLOSION_COMPRESSOR_FACTORY.getNumberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.BLAST_FURNACE_CONTAINER.get(), IndustrialBlastingCategory.RECIPE_TYPE, 2, 3, VEContainers.BLAST_FURNACE_FACTORY.getNumberOfSlots(), 36); - registration.addRecipeTransferHandler(ToolingStationContainer.class, VEBlocks.TOOLING_STATION_CONTAINER.get(), ToolingCategory.RECIPE_TYPE, 3, 2, ToolingStationContainer.NUMBER_OF_SLOTS, 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.SAWMILL_CONTAINER.get(), SawmillCategory.RECIPE_TYPE, 0, 3, VEContainers.SAWMILL_FACTORY.getNumberOfSlots(), 36); - registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.PRIMITIVE_BLAST_FURNACE_CONTAINER.get(), PrimitiveBlastingCategory.RECIPE_TYPE, 0, 2, VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.CRUSHER.container().get(), CrushingCategory.RECIPE_TYPE, 0, 1, VEContainers.CRUSHER_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.ELECTROLYZER.container().get(), ElectrolyzingCategory.RECIPE_TYPE, 0, 2, VEContainers.ELECTROLYZER_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.COMPRESSOR.container().get(), CompressingCategory.RECIPE_TYPE, 0, 1, VEContainers.COMPRESSOR_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.PRIMITIVE_STIRLING_GENERATOR.container().get(), StirlingCategory.RECIPE_TYPE, 0, 1, VEContainers.PRIMITIVE_STIRLING_GENERATOR_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.STIRLING_GENERATOR.container().get(), StirlingCategory.RECIPE_TYPE, 0, 1, VEContainers.STIRLING_GENERATOR_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.AQUEOULIZER.container().get(), AqueoulizingCategory.RECIPE_TYPE, 3, 2, VEContainers.AQUEOULIZER_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.CENTRIFUGAL_SEPARATOR.container().get(), CentrifugalSeparationCategory.RECIPE_TYPE, 0, 2, VEContainers.CENTRIFUGAL_SEPARATOR_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.IMPLOSION_COMPRESSOR.container().get(), ImplosionCompressionCategory.RECIPE_TYPE, 0, 2, VEContainers.IMPLOSION_COMPRESSOR_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.BLAST_FURNACE.container().get(), IndustrialBlastingCategory.RECIPE_TYPE, 2, 3, VEContainers.BLAST_FURNACE_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(ToolingStationContainer.class, VEBlocks.TOOLING_STATION.container().get(), ToolingCategory.RECIPE_TYPE, 3, 2, ToolingStationContainer.NUMBER_OF_SLOTS, 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.SAWMILL.container().get(), SawmillCategory.RECIPE_TYPE, 0, 3, VEContainers.SAWMILL_FACTORY.getNumberOfSlots(), 36); + registration.addRecipeTransferHandler(VEContainer.class, VEBlocks.PRIMITIVE_BLAST_FURNACE.container().get(), PrimitiveBlastingCategory.RECIPE_TYPE, 0, 2, VEContainers.PRIMITIVE_BLAST_FURNACE_FACTORY.getNumberOfSlots(), 36); // TODO: Transfer helper for the Fluid Electrolyzer // TODO: Fluid Mixer // TODO: Hydroponic Incubator @@ -203,26 +203,26 @@ public void registerRecipeTransferHandlers(IRecipeTransferRegistration registrat @Override public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) { - registration.addRecipeCatalyst(new ItemStack(VEBlocks.CRUSHER_BLOCK.get()).copy(), CrushingCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.ELECTROLYZER_BLOCK.get()).copy(), ElectrolyzingCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.COMPRESSOR_BLOCK.get()).copy(), CompressingCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get()).copy(), CentrifugalAgitationCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.AQUEOULIZER_BLOCK.get()).copy(), AqueoulizingCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.STIRLING_GENERATOR_BLOCK.get()).copy(), StirlingCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_BLOCK.get()).copy(), StirlingCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.COMBUSTION_GENERATOR_BLOCK.get()).copy(), CombustionCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.DISTILLATION_UNIT_BLOCK.get()).copy(), DistillingCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.GAS_FIRED_FURNACE_BLOCK.get()).copy(), RecipeTypes.SMELTING, RecipeTypes.BLASTING, CombustionCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.ELECTRIC_FURNACE_BLOCK.get()).copy(), RecipeTypes.SMELTING, RecipeTypes.BLASTING); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get()).copy(), CentrifugalSeparationCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get()).copy(), ImplosionCompressionCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.BLAST_FURNACE_BLOCK.get()).copy(), IndustrialBlastingCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.TOOLING_STATION_BLOCK.get()).copy(), ToolingCategory.RECIPE_TYPE, CombustionCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.SAWMILL_BLOCK.get()).copy(), SawmillCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.FLUID_ELECTROLYZER_BLOCK.get()).copy(), FluidElectrolyzingCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.FLUID_MIXER_BLOCK.get()).copy(), FluidMixingCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get()).copy(), PrimitiveBlastingCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get()).copy(), HydroponicIncubatorCategory.RECIPE_TYPE); - registration.addRecipeCatalyst(new ItemStack(VEBlocks.DIMENSIONAL_LASER_BLOCK.get()).copy(), DimensionalLasingCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.CRUSHER.block().get()).copy(), CrushingCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.ELECTROLYZER.block().get()).copy(), ElectrolyzingCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.COMPRESSOR.block().get()).copy(), CompressingCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.CENTRIFUGAL_AGITATOR.block().get()).copy(), CentrifugalAgitationCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.AQUEOULIZER.block().get()).copy(), AqueoulizingCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.STIRLING_GENERATOR.block().get()).copy(), StirlingCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.PRIMITIVE_STIRLING_GENERATOR.block().get()).copy(), StirlingCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.COMBUSTION_GENERATOR.block().get()).copy(), CombustionCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.DISTILLATION_UNIT.block().get()).copy(), DistillingCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.GAS_FIRED_FURNACE.block().get()).copy(), RecipeTypes.SMELTING, RecipeTypes.BLASTING, CombustionCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.ELECTRIC_FURNACE.block().get()).copy(), RecipeTypes.SMELTING, RecipeTypes.BLASTING); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.CENTRIFUGAL_SEPARATOR.block().get()).copy(), CentrifugalSeparationCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.IMPLOSION_COMPRESSOR.block().get()).copy(), ImplosionCompressionCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.BLAST_FURNACE.block().get()).copy(), IndustrialBlastingCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.TOOLING_STATION.block().get()).copy(), ToolingCategory.RECIPE_TYPE, CombustionCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.SAWMILL.block().get()).copy(), SawmillCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.FLUID_ELECTROLYZER.block().get()).copy(), FluidElectrolyzingCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.FLUID_MIXER.block().get()).copy(), FluidMixingCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.PRIMITIVE_BLAST_FURNACE.block().get()).copy(), PrimitiveBlastingCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.HYDROPONIC_INCUBATOR.block().get()).copy(), HydroponicIncubatorCategory.RECIPE_TYPE); + registration.addRecipeCatalyst(new ItemStack(VEBlocks.DIMENSIONAL_LASER.block().get()).copy(), DimensionalLasingCategory.RECIPE_TYPE); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/AqueoulizingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/AqueoulizingCategory.java index 1724f2108..e9b72b9a3 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/AqueoulizingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/AqueoulizingCategory.java @@ -41,7 +41,7 @@ public AqueoulizingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 90, 40).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.AQUEOULIZER_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.AQUEOULIZER.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17) diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalAgitationCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalAgitationCategory.java index 6b609e1a5..7d8611e06 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalAgitationCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalAgitationCategory.java @@ -40,7 +40,7 @@ public CentrifugalAgitationCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 90, 40).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.CENTRIFUGAL_AGITATOR.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalSeparationCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalSeparationCategory.java index 09fbc409f..42e03e1af 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalSeparationCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CentrifugalSeparationCategory.java @@ -42,7 +42,7 @@ public CentrifugalSeparationCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 52, 5, 120, 78).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.CENTRIFUGAL_SEPARATOR.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java index 68d57de57..4a56d6958 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CombustionCategory.java @@ -47,7 +47,7 @@ public CombustionCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/combustion_generator.png"); background = guiHelper.drawableBuilder(GUI, 52, 5, 120, 64).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.COMBUSTION_GENERATOR_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.COMBUSTION_GENERATOR.block().get())); slotDrawable = guiHelper.getSlotDrawable(); } diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CompressingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CompressingCategory.java index a5ddef813..c9f8e4e22 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CompressingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CompressingCategory.java @@ -38,7 +38,7 @@ public CompressingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 70, 40).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.COMPRESSOR_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.COMPRESSOR.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CrushingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CrushingCategory.java index 5841fcd91..b31ef903b 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CrushingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CrushingCategory.java @@ -39,7 +39,7 @@ public class CrushingCategory implements IRecipeCategory { public CrushingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance background = guiHelper.drawableBuilder(CrusherScreen.getGUI(), 68, 12, 40, 70).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.CRUSHER_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.CRUSHER.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(CrusherScreen.getGUI(), 176, 0, 17, 24).buildAnimated(200, IDrawableAnimated.StartDirection.TOP, false); } diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DimensionalLasingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DimensionalLasingCategory.java index 81c4a3f79..d32d4add5 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DimensionalLasingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DimensionalLasingCategory.java @@ -40,7 +40,7 @@ public DimensionalLasingCategory(IGuiHelper guiHelper) { ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); ResourceLocation dimensionalLaserGUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/dimensional_laser_gui.png"); background = guiHelper.drawableBuilder(GUI, 42, 5, 128, 40).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.DIMENSIONAL_LASER_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.DIMENSIONAL_LASER.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(dimensionalLaserGUI, 97, 34, 15, 16).build(); emptyArrow = guiHelper.drawableBuilder(dimensionalLaserGUI, 176, 0, 15, 17).buildAnimated(200, IDrawableAnimated.StartDirection.TOP, false); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DistillingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DistillingCategory.java index b11cae0a1..c2e8aece3 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DistillingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/DistillingCategory.java @@ -40,7 +40,7 @@ public DistillingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 42, 5, 128, 40).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.DISTILLATION_UNIT_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.DISTILLATION_UNIT.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ElectrolyzingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ElectrolyzingCategory.java index 4101db64e..8275c6e41 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ElectrolyzingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ElectrolyzingCategory.java @@ -42,7 +42,7 @@ public ElectrolyzingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 52, 5, 120, 78).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.ELECTROLYZER_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.ELECTROLYZER.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidElectrolyzingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidElectrolyzingCategory.java index aea57c759..74a7166d9 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidElectrolyzingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidElectrolyzingCategory.java @@ -40,7 +40,7 @@ public FluidElectrolyzingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 90, 40).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.FLUID_ELECTROLYZER_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.FLUID_ELECTROLYZER.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidMixingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidMixingCategory.java index 8dbaead9d..bc76a28af 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidMixingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/FluidMixingCategory.java @@ -40,7 +40,7 @@ public FluidMixingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 90, 40).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.FLUID_MIXER_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.FLUID_MIXER.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/HydroponicIncubatorCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/HydroponicIncubatorCategory.java index cbfd24f7f..4385e584f 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/HydroponicIncubatorCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/HydroponicIncubatorCategory.java @@ -41,7 +41,7 @@ public HydroponicIncubatorCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 4, 4, 156, 40).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.HYDROPONIC_INCUBATOR.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ImplosionCompressionCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ImplosionCompressionCategory.java index ea7750732..d5b1a4e47 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ImplosionCompressionCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ImplosionCompressionCategory.java @@ -39,7 +39,7 @@ public ImplosionCompressionCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 70, 40).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.IMPLOSION_COMPRESSOR.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/IndustrialBlastingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/IndustrialBlastingCategory.java index 943a70727..38aba7140 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/IndustrialBlastingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/IndustrialBlastingCategory.java @@ -45,7 +45,7 @@ public IndustrialBlastingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 42, 5, 120, 60).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.BLAST_FURNACE_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.BLAST_FURNACE.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); // 176, 0, 23, 17 emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); // 199,0,23,17 diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/PrimitiveBlastingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/PrimitiveBlastingCategory.java index 24cedda57..f2105c0a8 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/PrimitiveBlastingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/PrimitiveBlastingCategory.java @@ -39,7 +39,7 @@ public PrimitiveBlastingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 70, 40).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.PRIMITIVE_BLAST_FURNACE.block().get())); slotDrawable = guiHelper.getSlotDrawable(); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/SawmillCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/SawmillCategory.java index 3297f0f15..0cd653afc 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/SawmillCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/SawmillCategory.java @@ -49,7 +49,7 @@ public SawmillCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/jei.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 86, 40).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.SAWMILL_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.SAWMILL.block().get())); arrow = guiHelper.drawableBuilder(GUI, 176, 0, 23, 17).build(); emptyArrow = guiHelper.drawableBuilder(GUI, 199, 0, 23, 17).buildAnimated(200, IDrawableAnimated.StartDirection.LEFT, true); slotDrawable = guiHelper.getSlotDrawable(); diff --git a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/StirlingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/StirlingCategory.java index d1f285035..5dbeabffe 100644 --- a/src/main/java/com/veteam/voluminousenergy/compat/jei/category/StirlingCategory.java +++ b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/StirlingCategory.java @@ -37,7 +37,7 @@ public StirlingCategory(IGuiHelper guiHelper) { // 68, 12 | 40, 65 -> 10 px added for chance ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID, "textures/gui/jei/combustion_generator.png"); background = guiHelper.drawableBuilder(GUI, 68, 12, 40, 44).build(); - icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.STIRLING_GENERATOR_BLOCK.get())); + icon = guiHelper.createDrawableIngredient(VanillaTypes.ITEM_STACK, new ItemStack(VEBlocks.STIRLING_GENERATOR.block().get())); slotDrawable = guiHelper.getSlotDrawable(); } diff --git a/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java b/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java index c1dfe205f..c9e8a7308 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java +++ b/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java @@ -14,40 +14,40 @@ public class VEBlockItems { //Block Items //Tile Entities - public static RegistryObject PRIMITIVE_BLAST_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitiveblastfurnace", () -> new BlockItem(VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get(), PROPERTIES)); - public static RegistryObject PRIMITIVE_STIRLING_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitivestirlinggenerator", () -> new BlockItem(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject CRUSHER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("crusher", () -> new BlockItem(VEBlocks.CRUSHER_BLOCK.get(), PROPERTIES)); - public static RegistryObject ELECTROLYZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("electrolyzer", () -> new BlockItem(VEBlocks.ELECTROLYZER_BLOCK.get(), PROPERTIES)); - public static RegistryObject CENTRIFUGAL_AGITATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("centrifugal_agitator", () -> new BlockItem(VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("compressor", () -> new BlockItem(VEBlocks.COMPRESSOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject STIRLING_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("stirling_generator", () -> new BlockItem(VEBlocks.STIRLING_GENERATOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject COMBUSTION_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("combustion_generator", () -> new BlockItem(VEBlocks.COMBUSTION_GENERATOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject AQUEOULIZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aqueoulizer", () -> new BlockItem(VEBlocks.AQUEOULIZER_BLOCK.get(), PROPERTIES)); - public static RegistryObject AIR_COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("air_compressor", () -> new BlockItem(VEBlocks.AIR_COMPRESSOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject DISTILLATION_UNIT_ITEM = VE_BLOCK_ITEM_REGISTRY.register("distillation_unit", () -> new BlockItem(VEBlocks.DISTILLATION_UNIT_BLOCK.get(), PROPERTIES)); - public static RegistryObject PUMP_ITEM = VE_BLOCK_ITEM_REGISTRY.register("pump", () -> new BlockItem(VEBlocks.PUMP_BLOCK.get(), PROPERTIES)); - public static RegistryObject GAS_FIRED_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("gas_fired_furnace", () -> new BlockItem(VEBlocks.GAS_FIRED_FURNACE_BLOCK.get(), PROPERTIES)); - public static RegistryObject ELECTRIC_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("electric_furnace", () -> new BlockItem(VEBlocks.ELECTRIC_FURNACE_BLOCK.get(), PROPERTIES)); - public static RegistryObject BATTERY_BOX_ITEM = VE_BLOCK_ITEM_REGISTRY.register("battery_box", () -> new BlockItem(VEBlocks.BATTERY_BOX_BLOCK.get(), PROPERTIES)); - public static RegistryObject PRIMITIVE_SOLAR_PANEL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitive_solar_panel", () -> new BlockItem(VEBlocks.PRIMITIVE_SOLAR_PANEL_BLOCK.get(), PROPERTIES)); - public static RegistryObject SOLAR_PANEL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solar_panel", () -> new BlockItem(VEBlocks.SOLAR_PANEL_BLOCK.get(), PROPERTIES)); - public static RegistryObject CENTRIFUGAL_SEPARATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("centrifugal_separator", () -> new BlockItem(VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject IMPLOSION_COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("implosion_compressor", () -> new BlockItem(VEBlocks.IMPLOSION_COMPRESSOR_BLOCK.get(), PROPERTIES)); - public static RegistryObject BLAST_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("blast_furnace", () -> new BlockItem(VEBlocks.BLAST_FURNACE_BLOCK.get(), PROPERTIES)); - public static RegistryObject TOOLING_STATION_ITEM = VE_BLOCK_ITEM_REGISTRY.register("tooling_station", () -> new BlockItem(VEBlocks.TOOLING_STATION_BLOCK.get(), PROPERTIES)); - public static RegistryObject SAWMILL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("sawmill", () -> new BlockItem(VEBlocks.SAWMILL_BLOCK.get(), PROPERTIES)); - public static RegistryObject DIMENSIONAL_LASER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("dimensional_laser", () -> new BlockItem(VEBlocks.DIMENSIONAL_LASER_BLOCK.get(), PROPERTIES)); - public static RegistryObject FLUID_ELECTROLYZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("fluid_electrolyzer", () -> new BlockItem(VEBlocks.FLUID_ELECTROLYZER_BLOCK.get(), PROPERTIES)); - public static RegistryObject FLUID_MIXER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("fluid_mixer", () -> new BlockItem(VEBlocks.FLUID_MIXER_BLOCK.get(), PROPERTIES)); - public static RegistryObject HYDROPONIC_INCUBATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("hydroponic_incubator", () -> new BlockItem(VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get(), PROPERTIES)); + public static RegistryObject PRIMITIVE_BLAST_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitiveblastfurnace", () -> new BlockItem(VEBlocks.PRIMITIVE_BLAST_FURNACE.block().get(), PROPERTIES)); + public static RegistryObject PRIMITIVE_STIRLING_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitivestirlinggenerator", () -> new BlockItem(VEBlocks.PRIMITIVE_STIRLING_GENERATOR.block().get(), PROPERTIES)); + public static RegistryObject CRUSHER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("crusher", () -> new BlockItem(VEBlocks.CRUSHER.block().get(), PROPERTIES)); + public static RegistryObject ELECTROLYZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("electrolyzer", () -> new BlockItem(VEBlocks.ELECTROLYZER.block().get(), PROPERTIES)); + public static RegistryObject CENTRIFUGAL_AGITATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("centrifugal_agitator", () -> new BlockItem(VEBlocks.CENTRIFUGAL_AGITATOR.block().get(), PROPERTIES)); + public static RegistryObject COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("compressor", () -> new BlockItem(VEBlocks.COMPRESSOR.block().get(), PROPERTIES)); + public static RegistryObject STIRLING_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("stirling_generator", () -> new BlockItem(VEBlocks.STIRLING_GENERATOR.block().get(), PROPERTIES)); + public static RegistryObject COMBUSTION_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("combustion_generator", () -> new BlockItem(VEBlocks.COMBUSTION_GENERATOR.block().get(), PROPERTIES)); + public static RegistryObject AQUEOULIZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aqueoulizer", () -> new BlockItem(VEBlocks.AQUEOULIZER.block().get(), PROPERTIES)); + public static RegistryObject AIR_COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("air_compressor", () -> new BlockItem(VEBlocks.AIR_COMPRESSOR.block().get(), PROPERTIES)); + public static RegistryObject DISTILLATION_UNIT_ITEM = VE_BLOCK_ITEM_REGISTRY.register("distillation_unit", () -> new BlockItem(VEBlocks.DISTILLATION_UNIT.block().get(), PROPERTIES)); + public static RegistryObject PUMP_ITEM = VE_BLOCK_ITEM_REGISTRY.register("pump", () -> new BlockItem(VEBlocks.PUMP.block().get(), PROPERTIES)); + public static RegistryObject GAS_FIRED_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("gas_fired_furnace", () -> new BlockItem(VEBlocks.GAS_FIRED_FURNACE.block().get(), PROPERTIES)); + public static RegistryObject ELECTRIC_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("electric_furnace", () -> new BlockItem(VEBlocks.ELECTRIC_FURNACE.block().get(), PROPERTIES)); + public static RegistryObject BATTERY_BOX_ITEM = VE_BLOCK_ITEM_REGISTRY.register("battery_box", () -> new BlockItem(VEBlocks.BATTERY_BOX.block().get(), PROPERTIES)); + public static RegistryObject PRIMITIVE_SOLAR_PANEL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitive_solar_panel", () -> new BlockItem(VEBlocks.PRIMITIVE_SOLAR_PANEL.block().get(), PROPERTIES)); + public static RegistryObject SOLAR_PANEL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solar_panel", () -> new BlockItem(VEBlocks.SOLAR_PANEL.block().get(), PROPERTIES)); + public static RegistryObject CENTRIFUGAL_SEPARATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("centrifugal_separator", () -> new BlockItem(VEBlocks.CENTRIFUGAL_SEPARATOR.block().get(), PROPERTIES)); + public static RegistryObject IMPLOSION_COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("implosion_compressor", () -> new BlockItem(VEBlocks.IMPLOSION_COMPRESSOR.block().get(), PROPERTIES)); + public static RegistryObject BLAST_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("blast_furnace", () -> new BlockItem(VEBlocks.BLAST_FURNACE.block().get(), PROPERTIES)); + public static RegistryObject TOOLING_STATION_ITEM = VE_BLOCK_ITEM_REGISTRY.register("tooling_station", () -> new BlockItem(VEBlocks.TOOLING_STATION.block().get(), PROPERTIES)); + public static RegistryObject SAWMILL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("sawmill", () -> new BlockItem(VEBlocks.SAWMILL.block().get(), PROPERTIES)); + public static RegistryObject DIMENSIONAL_LASER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("dimensional_laser", () -> new BlockItem(VEBlocks.DIMENSIONAL_LASER.block().get(), PROPERTIES)); + public static RegistryObject FLUID_ELECTROLYZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("fluid_electrolyzer", () -> new BlockItem(VEBlocks.FLUID_ELECTROLYZER.block().get(), PROPERTIES)); + public static RegistryObject FLUID_MIXER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("fluid_mixer", () -> new BlockItem(VEBlocks.FLUID_MIXER.block().get(), PROPERTIES)); + public static RegistryObject HYDROPONIC_INCUBATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("hydroponic_incubator", () -> new BlockItem(VEBlocks.HYDROPONIC_INCUBATOR.block().get(), PROPERTIES)); // Tanks - public static RegistryObject ALUMINUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_tank", () -> new BlockItem(VEBlocks.ALUMINUM_TANK_BLOCK.get(), PROPERTIES)); - public static RegistryObject TITANIUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("titanium_tank", () -> new BlockItem(VEBlocks.TITANIUM_TANK_BLOCK.get(), PROPERTIES)); - public static RegistryObject NETHERITE_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("netherite_tank", () -> new BlockItem(VEBlocks.NETHERITE_TANK_BLOCK.get(), PROPERTIES)); - public static RegistryObject NIGHALITE_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("nighalite_tank", () -> new BlockItem(VEBlocks.NIGHALITE_TANK_BLOCK.get(), PROPERTIES)); - public static RegistryObject EIGHZO_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("eighzo_tank", () -> new BlockItem(VEBlocks.EIGHZO_TANK_BLOCK.get(), PROPERTIES)); - public static RegistryObject SOLARIUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_tank", () -> new BlockItem(VEBlocks.SOLARIUM_TANK_BLOCK.get(), PROPERTIES)); + public static RegistryObject ALUMINUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_tank", () -> new BlockItem(VEBlocks.ALUMINUM_TANK.block().get(), PROPERTIES)); + public static RegistryObject TITANIUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("titanium_tank", () -> new BlockItem(VEBlocks.TITANIUM_TANK.block().get(), PROPERTIES)); + public static RegistryObject NETHERITE_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("netherite_tank", () -> new BlockItem(VEBlocks.NETHERITE_TANK.block().get(), PROPERTIES)); + public static RegistryObject NIGHALITE_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("nighalite_tank", () -> new BlockItem(VEBlocks.NIGHALITE_TANK.block().get(), PROPERTIES)); + public static RegistryObject EIGHZO_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("eighzo_tank", () -> new BlockItem(VEBlocks.EIGHZO_TANK.block().get(), PROPERTIES)); + public static RegistryObject SOLARIUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_tank", () -> new BlockItem(VEBlocks.SOLARIUM_TANK.block().get(), PROPERTIES)); // Crops //public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.LAND_CROP,properties).setRegistryName("land_crop")); diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java index f7ea83446..a17cfa840 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java @@ -73,7 +73,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull AqueoulizerRecip @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.AQUEOULIZER_BLOCK.get()); + return new ItemStack(VEBlocks.AQUEOULIZER.block().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java index 371a3704c..586f132a3 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java @@ -71,7 +71,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull VERecipe recipe) @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get()); + return new ItemStack(VEBlocks.CENTRIFUGAL_AGITATOR.block().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java index c703cfbda..043fafff1 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java @@ -82,6 +82,6 @@ public BasicParser getParser() { @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.CENTRIFUGAL_SEPARATOR_BLOCK.get()); + return new ItemStack(VEBlocks.CENTRIFUGAL_SEPARATOR.block().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java index 0cde3ed32..70bd9c02a 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java @@ -74,6 +74,6 @@ public BasicParser getParser() { @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.COMPRESSOR_BLOCK.get()); + return new ItemStack(VEBlocks.COMPRESSOR.block().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java index 0e78740eb..d29d9cb1f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java @@ -78,7 +78,7 @@ public BasicParser getParser() { @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.CRUSHER_BLOCK.get()); + return new ItemStack(VEBlocks.CRUSHER.block().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java index 91efe5aea..8f7b821e5 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java @@ -255,6 +255,6 @@ public BasicParser getParser() { @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.DIMENSIONAL_LASER_BLOCK.get()); + return new ItemStack(VEBlocks.DIMENSIONAL_LASER.block().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java index 4fbd4870e..222a9aed0 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java @@ -73,7 +73,7 @@ public BasicParser getParser() { @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.DISTILLATION_UNIT_BLOCK.get()); + return new ItemStack(VEBlocks.DISTILLATION_UNIT.block().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java index 2ad0cef96..8c5ae1282 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java @@ -80,7 +80,7 @@ public BasicParser getParser() { @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.ELECTROLYZER_BLOCK.get()); + return new ItemStack(VEBlocks.ELECTROLYZER.block().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java index e6e2aac3f..e69a81903 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java @@ -75,6 +75,6 @@ public BasicParser getParser() { @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.FLUID_ELECTROLYZER_BLOCK.get()); + return new ItemStack(VEBlocks.FLUID_ELECTROLYZER.block().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java index 131206165..53dd9e40e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java @@ -75,6 +75,6 @@ public BasicParser getParser() { @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.FLUID_MIXER_BLOCK.get()); + return new ItemStack(VEBlocks.FLUID_MIXER.block().get()); } } \ No newline at end of file diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java index ad78202d1..fae09df86 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java @@ -80,6 +80,6 @@ public BasicParser getParser() { @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.HYDROPONIC_INCUBATOR_BLOCK.get()); + return new ItemStack(VEBlocks.HYDROPONIC_INCUBATOR.block().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java index d8dcef40e..a25a22fb1 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java @@ -75,6 +75,6 @@ public BasicParser getParser() { @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.COMPRESSOR_BLOCK.get()); + return new ItemStack(VEBlocks.COMPRESSOR.block().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java index 47256ea24..4bca7c47e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java @@ -88,7 +88,7 @@ public IndustrialBlastingRecipe(List i, List< @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.BLAST_FURNACE_BLOCK.get()); + return new ItemStack(VEBlocks.BLAST_FURNACE.block().get()); } public void setMinimumHeat(int minimumHeat) { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java index b797da88d..52dec7acd 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java @@ -76,7 +76,7 @@ public BasicParser getParser() { @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.PRIMITIVE_BLAST_FURNACE_BLOCK.get()); + return new ItemStack(VEBlocks.PRIMITIVE_BLAST_FURNACE.block().get()); } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java index a5258a410..09538afad 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java @@ -87,7 +87,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull SawmillRecipe re @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.SAWMILL_BLOCK.get()); + return new ItemStack(VEBlocks.SAWMILL.block().get()); } public boolean isLogRecipe() { diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java index cf83ea328..a3197c3cb 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java @@ -71,7 +71,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull StirlingGenerato @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.STIRLING_GENERATOR_BLOCK.get()); + return new ItemStack(VEBlocks.STIRLING_GENERATOR.block().get()); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java index 93138e72b..b65a6e2e4 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java @@ -156,7 +156,7 @@ public BasicParser getParser() { @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.TOOLING_STATION_BLOCK.get()); + return new ItemStack(VEBlocks.TOOLING_STATION.block().get()); } public ArrayList getBits() { diff --git a/src/main/java/com/veteam/voluminousenergy/setup/ClientProxy.java b/src/main/java/com/veteam/voluminousenergy/setup/ClientProxy.java index 285300279..7b19cc42e 100644 --- a/src/main/java/com/veteam/voluminousenergy/setup/ClientProxy.java +++ b/src/main/java/com/veteam/voluminousenergy/setup/ClientProxy.java @@ -12,38 +12,38 @@ public class ClientProxy implements IProxy { @Override public void init() { - MenuScreens.register(VEBlocks.PRIMITIVE_BLAST_FURNACE_CONTAINER.get(), PrimitiveBlastFurnaceScreen::new); - MenuScreens.register(VEBlocks.PRIMITIVE_STIRLING_GENERATOR_CONTAINER.get(), PrimitiveStirlingGeneratorScreen::new); - MenuScreens.register(VEBlocks.CRUSHER_CONTAINER.get(), CrusherScreen::new); - MenuScreens.register(VEBlocks.ELECTROLYZER_CONTAINER.get(), ElectrolyzerScreen::new); - MenuScreens.register(VEBlocks.CENTRIFUGAL_AGITATOR_CONTAINER.get(), CentrifugalAgitatorScreen::new); - MenuScreens.register(VEBlocks.COMPRESSOR_CONTAINER.get(), CompressorScreen::new); - MenuScreens.register(VEBlocks.STIRLING_GENERATOR_CONTAINER.get(), StirlingGeneratorScreen::new); - MenuScreens.register(VEBlocks.COMBUSTION_GENERATOR_CONTAINER.get(), CombustionGeneratorScreen::new); - MenuScreens.register(VEBlocks.AQUEOULIZER_CONTAINER.get(), AqueoulizerScreen::new); - MenuScreens.register(VEBlocks.AIR_COMPRESSOR_CONTAINER.get(), AirCompressorScreen::new); - MenuScreens.register(VEBlocks.DISTILLATION_UNIT_CONTAINER.get(), DistillationUnitScreen::new); - MenuScreens.register(VEBlocks.PUMP_CONTAINER.get(), PumpScreen::new); - MenuScreens.register(VEBlocks.GAS_FIRED_FURNACE_CONTAINER.get(), GasFiredFurnaceScreen::new); - MenuScreens.register(VEBlocks.ELECTRIC_FURNACE_CONTAINER.get(), ElectricFurnaceScreen::new); - MenuScreens.register(VEBlocks.BATTERY_BOX_CONTAINER.get(), BatteryBoxScreen::new); - MenuScreens.register(VEBlocks.PRIMITIVE_SOLAR_PANEL_CONTAINER.get(), PrimitiveSolarPanelScreen::new); - MenuScreens.register(VEBlocks.SOLAR_PANEL_CONTAINER.get(), SolarPanelScreen::new); - MenuScreens.register(VEBlocks.CENTRIFUGAL_SEPARATOR_CONTAINER.get(), CentrifugalSeparatorScreen::new); - MenuScreens.register(VEBlocks.IMPLOSION_COMPRESSOR_CONTAINER.get(), ImplosionCompressorScreen::new); - MenuScreens.register(VEBlocks.BLAST_FURNACE_CONTAINER.get(), BlastFurnaceScreen::new); - MenuScreens.register(VEBlocks.TOOLING_STATION_CONTAINER.get(), ToolingStationScreen::new); - MenuScreens.register(VEBlocks.SAWMILL_CONTAINER.get(), SawmillScreen::new); - MenuScreens.register(VEBlocks.ALUMINUM_TANK_CONTAINER.get(), AluminumTankScreen::new); - MenuScreens.register(VEBlocks.TITANIUM_TANK_CONTAINER.get(), TitaniumTankScreen::new); - MenuScreens.register(VEBlocks.NETHERITE_TANK_CONTAINER.get(), NetheriteTankScreen::new); - MenuScreens.register(VEBlocks.NIGHALITE_TANK_CONTAINER.get(), NighaliteTankScreen::new); - MenuScreens.register(VEBlocks.EIGHZO_TANK_CONTAINER.get(), EighzoTankScreen::new); - MenuScreens.register(VEBlocks.SOLARIUM_TANK_CONTAINER.get(), SolariumTankScreen::new); - MenuScreens.register(VEBlocks.DIMENSIONAL_LASER_CONTAINER.get(), DimensionalLaserScreen::new); - MenuScreens.register(VEBlocks.FLUID_ELECTROLYZER_CONTAINER.get(), FluidElectrolyzerScreen::new); - MenuScreens.register(VEBlocks.FLUID_MIXER_CONTAINER.get(), FluidMixerScreen::new); - MenuScreens.register(VEBlocks.HYDROPONIC_INCUBATOR_CONTAINER.get(), HydroponicIncubatorScreen::new); + MenuScreens.register(VEBlocks.PRIMITIVE_BLAST_FURNACE.container().get(), PrimitiveBlastFurnaceScreen::new); + MenuScreens.register(VEBlocks.PRIMITIVE_STIRLING_GENERATOR.container().get(), PrimitiveStirlingGeneratorScreen::new); + MenuScreens.register(VEBlocks.CRUSHER.container().get(), CrusherScreen::new); + MenuScreens.register(VEBlocks.ELECTROLYZER.container().get(), ElectrolyzerScreen::new); + MenuScreens.register(VEBlocks.CENTRIFUGAL_AGITATOR.container().get(), CentrifugalAgitatorScreen::new); + MenuScreens.register(VEBlocks.COMPRESSOR.container().get(), CompressorScreen::new); + MenuScreens.register(VEBlocks.STIRLING_GENERATOR.container().get(), StirlingGeneratorScreen::new); + MenuScreens.register(VEBlocks.COMBUSTION_GENERATOR.container().get(), CombustionGeneratorScreen::new); + MenuScreens.register(VEBlocks.AQUEOULIZER.container().get(), AqueoulizerScreen::new); + MenuScreens.register(VEBlocks.AIR_COMPRESSOR.container().get(), AirCompressorScreen::new); + MenuScreens.register(VEBlocks.DISTILLATION_UNIT.container().get(), DistillationUnitScreen::new); + MenuScreens.register(VEBlocks.PUMP.container().get(), PumpScreen::new); + MenuScreens.register(VEBlocks.GAS_FIRED_FURNACE.container().get(), GasFiredFurnaceScreen::new); + MenuScreens.register(VEBlocks.ELECTRIC_FURNACE.container().get(), ElectricFurnaceScreen::new); + MenuScreens.register(VEBlocks.BATTERY_BOX.container().get(), BatteryBoxScreen::new); + MenuScreens.register(VEBlocks.PRIMITIVE_SOLAR_PANEL.container().get(), PrimitiveSolarPanelScreen::new); + MenuScreens.register(VEBlocks.SOLAR_PANEL.container().get(), SolarPanelScreen::new); + MenuScreens.register(VEBlocks.CENTRIFUGAL_SEPARATOR.container().get(), CentrifugalSeparatorScreen::new); + MenuScreens.register(VEBlocks.IMPLOSION_COMPRESSOR.container().get(), ImplosionCompressorScreen::new); + MenuScreens.register(VEBlocks.BLAST_FURNACE.container().get(), BlastFurnaceScreen::new); + MenuScreens.register(VEBlocks.TOOLING_STATION.container().get(), ToolingStationScreen::new); + MenuScreens.register(VEBlocks.SAWMILL.container().get(), SawmillScreen::new); + MenuScreens.register(VEBlocks.ALUMINUM_TANK.container().get(), AluminumTankScreen::new); + MenuScreens.register(VEBlocks.TITANIUM_TANK.container().get(), TitaniumTankScreen::new); + MenuScreens.register(VEBlocks.NETHERITE_TANK.container().get(), NetheriteTankScreen::new); + MenuScreens.register(VEBlocks.NIGHALITE_TANK.container().get(), NighaliteTankScreen::new); + MenuScreens.register(VEBlocks.EIGHZO_TANK.container().get(), EighzoTankScreen::new); + MenuScreens.register(VEBlocks.SOLARIUM_TANK.container().get(), SolariumTankScreen::new); + MenuScreens.register(VEBlocks.DIMENSIONAL_LASER.container().get(), DimensionalLaserScreen::new); + MenuScreens.register(VEBlocks.FLUID_ELECTROLYZER.container().get(), FluidElectrolyzerScreen::new); + MenuScreens.register(VEBlocks.FLUID_MIXER.container().get(), FluidMixerScreen::new); + MenuScreens.register(VEBlocks.HYDROPONIC_INCUBATOR.container().get(), HydroponicIncubatorScreen::new); } @Override diff --git a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java index 5ea07529f..f657c6bf7 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java +++ b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java @@ -1,7 +1,6 @@ package com.veteam.voluminousenergy.util; import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; -import com.veteam.voluminousenergy.blocks.tiles.tank.TankTile; import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.Config; import net.minecraftforge.fluids.FluidStack; @@ -57,7 +56,6 @@ public int fill(FluidStack resource, FluidAction action) { for (VERelationalTank tank : tanks) { if (tank.getTankType() == TankType.OUTPUT) continue; if (isFluidValid(tank.getSlotNum(), resource) && (tank.getTank().isEmpty() || resource.isFluidEqual(tank.getTank().getFluid()))) { - if (!tank.getSideStatus() && !(tileEntity instanceof TankTile)) return 0; if (tank.getTank().getFluid().getAmount() != tank.getTank().getCapacity()) tileEntity.markRecipeDirty(); return tank.getTank().fill(resource.copy(), action); } @@ -88,7 +86,6 @@ public FluidStack drain(FluidStack resource, FluidAction action) { @Override public FluidStack drain(int maxDrain, FluidAction action) { for (VERelationalTank tank : tanks) { - if (!tank.getSideStatus() && !(tileEntity instanceof TankTile)) continue; if (!Config.ALLOW_EXTRACTION_FROM_INPUT_TANKS.get()) { if (tank.getTankType() != TankType.OUTPUT && tank.getTankType() != TankType.BOTH) continue; } From 7ae2775fa6da7d1676b31735710b1f1e78a37b00 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Thu, 11 Apr 2024 19:27:06 -0400 Subject: [PATCH 24/27] Made blocks auto-register --- .../blocks/blocks/VEBlocks.java | 80 +++++---- .../voluminousenergy/items/VEBlockItems.java | 158 +++++++++--------- .../items/crops/RiceItem.java | 2 +- 3 files changed, 129 insertions(+), 111 deletions(-) diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java index 3bf96a483..637ac417b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java @@ -28,27 +28,31 @@ import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; +import java.util.ArrayList; +import java.util.List; import java.util.function.Supplier; @Mod(VoluminousEnergy.MODID) public class VEBlocks { + public static final List REGISTERED_BLOCKS = new ArrayList<>(); + public static final DeferredRegister VE_BLOCKS_REGISTRY = DeferredRegister.create(ForgeRegistries.BLOCKS, VoluminousEnergy.MODID); public static final DeferredRegister> VE_TILE_REGISTRY = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, VoluminousEnergy.MODID); public static final DeferredRegister> VE_CONTAINER_REGISTRY = DeferredRegister.create(ForgeRegistries.MENU_TYPES, VoluminousEnergy.MODID); // Shells - public static RegistryObject ALUMINUM_SHELL = VE_BLOCKS_REGISTRY.register("aluminum_shell", AluminumShellBlock::new); + public static RegistryObject ALUMINUM_SHELL = registerWithBlockItemSupport("aluminum_shell", AluminumShellBlock::new); // Machine Frames - public static RegistryObject CARBON_SHIELDED_ALUMINUM_MACHINE_FRAME = VE_BLOCKS_REGISTRY.register("carbon_shielded_aluminum_machine_frame", CarbonShieldedAluminumMachineFrame::new); + public static RegistryObject CARBON_SHIELDED_ALUMINUM_MACHINE_FRAME = registerWithBlockItemSupport("carbon_shielded_aluminum_machine_frame", CarbonShieldedAluminumMachineFrame::new); // Casings (For multiblocks) - public static RegistryObject ALUMINUM_MACHINE_CASING_BLOCK = VE_BLOCKS_REGISTRY.register("aluminum_machine_casing", AluminumMachineCasingBlock::new); + public static RegistryObject ALUMINUM_MACHINE_CASING_BLOCK = registerWithBlockItemSupport("aluminum_machine_casing", AluminumMachineCasingBlock::new); - public static RegistryObject TITANIUM_MACHINE_CASING_BLOCK = VE_BLOCKS_REGISTRY.register("titanium_machine_casing", TitaniumMachineCasingBlock::new); + public static RegistryObject TITANIUM_MACHINE_CASING_BLOCK = registerWithBlockItemSupport("titanium_machine_casing", TitaniumMachineCasingBlock::new); - public static RegistryObject SOLARIUM_MACHINE_CASING_BLOCK = VE_BLOCKS_REGISTRY.register("solarium_machine_casing", SolariumMachineCasingBlock::new); + public static RegistryObject SOLARIUM_MACHINE_CASING_BLOCK = registerWithBlockItemSupport("solarium_machine_casing", SolariumMachineCasingBlock::new); //Primitive Blast public static final BlockTileMenuRegistry PRIMITIVE_BLAST_FURNACE = @@ -279,70 +283,70 @@ public class VEBlocks { //Ores - public static RegistryObject SALTPETER_ORE = VE_BLOCKS_REGISTRY.register("saltpeterore", SaltpeterOre::new); + public static RegistryObject SALTPETER_ORE = registerWithBlockItemSupport("saltpeterore", SaltpeterOre::new); - public static RegistryObject BAUXITE_ORE = VE_BLOCKS_REGISTRY.register("bauxiteore", BauxiteOre::new); + public static RegistryObject BAUXITE_ORE = registerWithBlockItemSupport("bauxiteore", BauxiteOre::new); - public static RegistryObject CINNABAR_ORE = VE_BLOCKS_REGISTRY.register("cinnabarore", CinnabarOre::new); + public static RegistryObject CINNABAR_ORE = registerWithBlockItemSupport("cinnabarore", CinnabarOre::new); - public static RegistryObject RUTILE_ORE = VE_BLOCKS_REGISTRY.register("rutileore", RutileOre::new); + public static RegistryObject RUTILE_ORE = registerWithBlockItemSupport("rutileore", RutileOre::new); - public static RegistryObject GALENA_ORE = VE_BLOCKS_REGISTRY.register("galena_ore", GalenaOre::new); + public static RegistryObject GALENA_ORE = registerWithBlockItemSupport("galena_ore", GalenaOre::new); - public static RegistryObject EIGHZO_ORE = VE_BLOCKS_REGISTRY.register("eighzo_ore", EighzoOre::new); + public static RegistryObject EIGHZO_ORE = registerWithBlockItemSupport("eighzo_ore", EighzoOre::new); // Deepslate ores - public static RegistryObject DEEPSLATE_BAUXITE_ORE = VE_BLOCKS_REGISTRY.register("deepslate_bauxite_ore", DeepslateBauxiteOre::new); + public static RegistryObject DEEPSLATE_BAUXITE_ORE = registerWithBlockItemSupport("deepslate_bauxite_ore", DeepslateBauxiteOre::new); - public static RegistryObject DEEPSLATE_CINNABAR_ORE = VE_BLOCKS_REGISTRY.register("deepslate_cinnabar_ore", DeepslateCinnabarOre::new); + public static RegistryObject DEEPSLATE_CINNABAR_ORE = registerWithBlockItemSupport("deepslate_cinnabar_ore", DeepslateCinnabarOre::new); - public static RegistryObject DEEPSLATE_RUTILE_ORE = VE_BLOCKS_REGISTRY.register("deepslate_rutile_ore", DeepslateRutileOre::new); + public static RegistryObject DEEPSLATE_RUTILE_ORE = registerWithBlockItemSupport("deepslate_rutile_ore", DeepslateRutileOre::new); - public static RegistryObject DEEPSLATE_GALENA_ORE = VE_BLOCKS_REGISTRY.register("deepslate_galena_ore", DeepslateGalenaOre::new); + public static RegistryObject DEEPSLATE_GALENA_ORE = registerWithBlockItemSupport("deepslate_galena_ore", DeepslateGalenaOre::new); - public static RegistryObject RED_SALTPETER_ORE = VE_BLOCKS_REGISTRY.register("red_saltpeter_ore", RedSaltpeterOre::new); + public static RegistryObject RED_SALTPETER_ORE = registerWithBlockItemSupport("red_saltpeter_ore", RedSaltpeterOre::new); //Crops //public static VEWaterCrop WATER_CROP; //public static VELandCrop LAND_CROP; - public static RegistryObject RICE_CROP = VE_BLOCKS_REGISTRY.register("rice_crop", RiceCrop::new); + public static RegistryObject RICE_CROP = registerWithBlockItemSupport("rice_crop", RiceCrop::new); // Material Storage Blocks - public static RegistryObject SOLARIUM_BLOCK = VE_BLOCKS_REGISTRY.register("solarium_block", SolariumBlock::new); + public static RegistryObject SOLARIUM_BLOCK = registerWithBlockItemSupport("solarium_block", SolariumBlock::new); - public static RegistryObject ALUMINUM_BLOCK = VE_BLOCKS_REGISTRY.register("aluminum_block", AluminumBlock::new); + public static RegistryObject ALUMINUM_BLOCK = registerWithBlockItemSupport("aluminum_block", AluminumBlock::new); - public static RegistryObject CARBON_BLOCK = VE_BLOCKS_REGISTRY.register("carbon_block", CarbonBlock::new); + public static RegistryObject CARBON_BLOCK = registerWithBlockItemSupport("carbon_block", CarbonBlock::new); - public static RegistryObject EIGHZO_BLOCK = VE_BLOCKS_REGISTRY.register("eighzo_block", EighzoBlock::new); + public static RegistryObject EIGHZO_BLOCK = registerWithBlockItemSupport("eighzo_block", EighzoBlock::new); - public static RegistryObject NIGHALITE_BLOCK = VE_BLOCKS_REGISTRY.register("nighalite_block", NighaliteBlock::new); + public static RegistryObject NIGHALITE_BLOCK = registerWithBlockItemSupport("nighalite_block", NighaliteBlock::new); - public static RegistryObject SALTPETER_BLOCK = VE_BLOCKS_REGISTRY.register("saltpeter_block", SaltpeterBlock::new); + public static RegistryObject SALTPETER_BLOCK = registerWithBlockItemSupport("saltpeter_block", SaltpeterBlock::new); - public static RegistryObject TITANIUM_BLOCK = VE_BLOCKS_REGISTRY.register("titanium_block", TitaniumBlock::new); + public static RegistryObject TITANIUM_BLOCK = registerWithBlockItemSupport("titanium_block", TitaniumBlock::new); - public static RegistryObject TUNGSTEN_BLOCK = VE_BLOCKS_REGISTRY.register("tungsten_block", TungstenBlock::new); + public static RegistryObject TUNGSTEN_BLOCK = registerWithBlockItemSupport("tungsten_block", TungstenBlock::new); - public static RegistryObject TUNGSTEN_STEEL_BLOCK = VE_BLOCKS_REGISTRY.register("tungsten_steel_block", TungstenSteelBlock::new); + public static RegistryObject TUNGSTEN_STEEL_BLOCK = registerWithBlockItemSupport("tungsten_steel_block", TungstenSteelBlock::new); // Raw Material Storage Blocks - public static RegistryObject RAW_BAUXITE_BLOCK = VE_BLOCKS_REGISTRY.register("raw_bauxite_block", RawBauxiteBlock::new); + public static RegistryObject RAW_BAUXITE_BLOCK = registerWithBlockItemSupport("raw_bauxite_block", RawBauxiteBlock::new); - public static RegistryObject RAW_CINNABAR_BLOCK = VE_BLOCKS_REGISTRY.register("raw_cinnabar_block", RawCinnabarBlock::new); + public static RegistryObject RAW_CINNABAR_BLOCK = registerWithBlockItemSupport("raw_cinnabar_block", RawCinnabarBlock::new); - public static RegistryObject RAW_EIGHZO_BLOCK = VE_BLOCKS_REGISTRY.register("raw_eighzo_block", RawEighzoBlock::new); + public static RegistryObject RAW_EIGHZO_BLOCK = registerWithBlockItemSupport("raw_eighzo_block", RawEighzoBlock::new); - public static RegistryObject RAW_GALENA_BLOCK = VE_BLOCKS_REGISTRY.register("raw_galena_block", RawGalenaBlock::new); + public static RegistryObject RAW_GALENA_BLOCK = registerWithBlockItemSupport("raw_galena_block", RawGalenaBlock::new); - public static RegistryObject RAW_RUTILE_BLOCK = VE_BLOCKS_REGISTRY.register("raw_rutile_block", RawRutileBlock::new); + public static RegistryObject RAW_RUTILE_BLOCK = registerWithBlockItemSupport("raw_rutile_block", RawRutileBlock::new); @Deprecated - public static RegistryObject RAW_BONE_BLOCK = VE_BLOCKS_REGISTRY.register("raw_bone_block", RawBoneBlock::new); // Unused + public static RegistryObject RAW_BONE_BLOCK = registerWithBlockItemSupport("raw_bone_block", RawBoneBlock::new); // Unused - public static RegistryObject PRESSURE_LADDER = VE_BLOCKS_REGISTRY.register("pressure_ladder", PressureLadder::new); + public static RegistryObject PRESSURE_LADDER = registerWithBlockItemSupport("pressure_ladder", PressureLadder::new); public static class BlockTileMenuRegistry { @@ -351,7 +355,7 @@ public static class BlockTileMenuRegistry { RegistryObject> container; public BlockTileMenuRegistry(String name, Supplier blockSupplier, Supplier tileEntityFactory, Supplier containerFactory) { - block = VE_BLOCKS_REGISTRY.register(name, blockSupplier); + block = registerWithBlockItemSupport(name, blockSupplier); tile = VE_TILE_REGISTRY.register(name, () -> BlockEntityType.Builder.of(tileEntityFactory.get()::create, block.get()).build(null)); container = VE_CONTAINER_REGISTRY.register(name, () -> @@ -373,4 +377,12 @@ public RegistryObject> container() { return this.container; } } + + public record RegistryWithName(String name, RegistryObject block){} + + public static RegistryObject registerWithBlockItemSupport(String name,Supplier blockSupplier) { + RegistryObject registryObject = VE_BLOCKS_REGISTRY.register(name,blockSupplier); + REGISTERED_BLOCKS.add(new RegistryWithName(name,registryObject)); + return registryObject; + } } diff --git a/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java b/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java index c9e8a7308..0537b3427 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java +++ b/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java @@ -12,84 +12,90 @@ public class VEBlockItems { public static final DeferredRegister VE_BLOCK_ITEM_REGISTRY = DeferredRegister.create(ForgeRegistries.ITEMS, VoluminousEnergy.MODID); protected static final Item.Properties PROPERTIES = new Item.Properties(); + static { + for(VEBlocks.RegistryWithName registryWithName : VEBlocks.REGISTERED_BLOCKS) { + VE_BLOCK_ITEM_REGISTRY.register(registryWithName.name(),() -> new BlockItem(registryWithName.block().get(), PROPERTIES)); + } + } + //Block Items //Tile Entities - public static RegistryObject PRIMITIVE_BLAST_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitiveblastfurnace", () -> new BlockItem(VEBlocks.PRIMITIVE_BLAST_FURNACE.block().get(), PROPERTIES)); - public static RegistryObject PRIMITIVE_STIRLING_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitivestirlinggenerator", () -> new BlockItem(VEBlocks.PRIMITIVE_STIRLING_GENERATOR.block().get(), PROPERTIES)); - public static RegistryObject CRUSHER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("crusher", () -> new BlockItem(VEBlocks.CRUSHER.block().get(), PROPERTIES)); - public static RegistryObject ELECTROLYZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("electrolyzer", () -> new BlockItem(VEBlocks.ELECTROLYZER.block().get(), PROPERTIES)); - public static RegistryObject CENTRIFUGAL_AGITATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("centrifugal_agitator", () -> new BlockItem(VEBlocks.CENTRIFUGAL_AGITATOR.block().get(), PROPERTIES)); - public static RegistryObject COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("compressor", () -> new BlockItem(VEBlocks.COMPRESSOR.block().get(), PROPERTIES)); - public static RegistryObject STIRLING_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("stirling_generator", () -> new BlockItem(VEBlocks.STIRLING_GENERATOR.block().get(), PROPERTIES)); - public static RegistryObject COMBUSTION_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("combustion_generator", () -> new BlockItem(VEBlocks.COMBUSTION_GENERATOR.block().get(), PROPERTIES)); - public static RegistryObject AQUEOULIZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aqueoulizer", () -> new BlockItem(VEBlocks.AQUEOULIZER.block().get(), PROPERTIES)); - public static RegistryObject AIR_COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("air_compressor", () -> new BlockItem(VEBlocks.AIR_COMPRESSOR.block().get(), PROPERTIES)); - public static RegistryObject DISTILLATION_UNIT_ITEM = VE_BLOCK_ITEM_REGISTRY.register("distillation_unit", () -> new BlockItem(VEBlocks.DISTILLATION_UNIT.block().get(), PROPERTIES)); - public static RegistryObject PUMP_ITEM = VE_BLOCK_ITEM_REGISTRY.register("pump", () -> new BlockItem(VEBlocks.PUMP.block().get(), PROPERTIES)); - public static RegistryObject GAS_FIRED_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("gas_fired_furnace", () -> new BlockItem(VEBlocks.GAS_FIRED_FURNACE.block().get(), PROPERTIES)); - public static RegistryObject ELECTRIC_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("electric_furnace", () -> new BlockItem(VEBlocks.ELECTRIC_FURNACE.block().get(), PROPERTIES)); - public static RegistryObject BATTERY_BOX_ITEM = VE_BLOCK_ITEM_REGISTRY.register("battery_box", () -> new BlockItem(VEBlocks.BATTERY_BOX.block().get(), PROPERTIES)); - public static RegistryObject PRIMITIVE_SOLAR_PANEL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitive_solar_panel", () -> new BlockItem(VEBlocks.PRIMITIVE_SOLAR_PANEL.block().get(), PROPERTIES)); - public static RegistryObject SOLAR_PANEL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solar_panel", () -> new BlockItem(VEBlocks.SOLAR_PANEL.block().get(), PROPERTIES)); - public static RegistryObject CENTRIFUGAL_SEPARATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("centrifugal_separator", () -> new BlockItem(VEBlocks.CENTRIFUGAL_SEPARATOR.block().get(), PROPERTIES)); - public static RegistryObject IMPLOSION_COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("implosion_compressor", () -> new BlockItem(VEBlocks.IMPLOSION_COMPRESSOR.block().get(), PROPERTIES)); - public static RegistryObject BLAST_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("blast_furnace", () -> new BlockItem(VEBlocks.BLAST_FURNACE.block().get(), PROPERTIES)); - public static RegistryObject TOOLING_STATION_ITEM = VE_BLOCK_ITEM_REGISTRY.register("tooling_station", () -> new BlockItem(VEBlocks.TOOLING_STATION.block().get(), PROPERTIES)); - public static RegistryObject SAWMILL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("sawmill", () -> new BlockItem(VEBlocks.SAWMILL.block().get(), PROPERTIES)); - public static RegistryObject DIMENSIONAL_LASER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("dimensional_laser", () -> new BlockItem(VEBlocks.DIMENSIONAL_LASER.block().get(), PROPERTIES)); - public static RegistryObject FLUID_ELECTROLYZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("fluid_electrolyzer", () -> new BlockItem(VEBlocks.FLUID_ELECTROLYZER.block().get(), PROPERTIES)); - public static RegistryObject FLUID_MIXER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("fluid_mixer", () -> new BlockItem(VEBlocks.FLUID_MIXER.block().get(), PROPERTIES)); - public static RegistryObject HYDROPONIC_INCUBATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("hydroponic_incubator", () -> new BlockItem(VEBlocks.HYDROPONIC_INCUBATOR.block().get(), PROPERTIES)); - - // Tanks - public static RegistryObject ALUMINUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_tank", () -> new BlockItem(VEBlocks.ALUMINUM_TANK.block().get(), PROPERTIES)); - public static RegistryObject TITANIUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("titanium_tank", () -> new BlockItem(VEBlocks.TITANIUM_TANK.block().get(), PROPERTIES)); - public static RegistryObject NETHERITE_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("netherite_tank", () -> new BlockItem(VEBlocks.NETHERITE_TANK.block().get(), PROPERTIES)); - public static RegistryObject NIGHALITE_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("nighalite_tank", () -> new BlockItem(VEBlocks.NIGHALITE_TANK.block().get(), PROPERTIES)); - public static RegistryObject EIGHZO_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("eighzo_tank", () -> new BlockItem(VEBlocks.EIGHZO_TANK.block().get(), PROPERTIES)); - public static RegistryObject SOLARIUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_tank", () -> new BlockItem(VEBlocks.SOLARIUM_TANK.block().get(), PROPERTIES)); - - // Crops - //public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.LAND_CROP,properties).setRegistryName("land_crop")); - //@Deprecated // I think the rice registration here is deprecated, as it's now in VEItems - //public static RegistryObject RICE_CROP_ITEM = VE_BLOCK_ITEM_REGISTRY.register("rice_grain", VEItems.RICE_GRAIN.get()); - - //True Blocks - //Ores - public static RegistryObject SALTPETER_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("saltpeterore", () -> new BlockItem(VEBlocks.SALTPETER_ORE.get(), PROPERTIES)); - public static RegistryObject BAUXITE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("bauxiteore", () -> new BlockItem(VEBlocks.BAUXITE_ORE.get(), PROPERTIES)); - public static RegistryObject CINNABAR_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("cinnabarore", () -> new BlockItem(VEBlocks.CINNABAR_ORE.get(), PROPERTIES)); - public static RegistryObject RUTILE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("rutileore", () -> new BlockItem(VEBlocks.RUTILE_ORE.get(), PROPERTIES)); - public static RegistryObject GALENA_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("galena_ore", () -> new BlockItem(VEBlocks.GALENA_ORE.get(), PROPERTIES)); - public static RegistryObject EIGHZO_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("eighzo_ore", () -> new BlockItem(VEBlocks.EIGHZO_ORE.get(), PROPERTIES)); - - //Deepslate ores - public static RegistryObject DEEPSLATE_BAUXITE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_bauxite_ore", () -> new BlockItem(VEBlocks.DEEPSLATE_BAUXITE_ORE.get(), PROPERTIES)); - public static RegistryObject DEEPSLATE_CINNABAR_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_cinnabar_ore", () -> new BlockItem(VEBlocks.DEEPSLATE_CINNABAR_ORE.get(), PROPERTIES)); - public static RegistryObject DEEPSLATE_RUTILE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_rutile_ore", () -> new BlockItem(VEBlocks.DEEPSLATE_RUTILE_ORE.get(), PROPERTIES)); - public static RegistryObject DEEPSLATE_GALENA_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_galena_ore", () -> new BlockItem(VEBlocks.DEEPSLATE_GALENA_ORE.get(), PROPERTIES)); - - public static RegistryObject RED_SALTPETER_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("red_saltpeter_ore", () -> new BlockItem(VEBlocks.RED_SALTPETER_ORE.get(), PROPERTIES)); - - //Shells - public static RegistryObject ALUMINUM_SHELL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_shell", () -> new BlockItem(VEBlocks.ALUMINUM_SHELL.get(), PROPERTIES)); - public static RegistryObject CARBON_SHIELDED_ALUMINUM_MACHINE_FRAME_ITEM = VE_BLOCK_ITEM_REGISTRY.register("carbon_shielded_aluminum_machine_frame", () -> new BlockItem(VEBlocks.CARBON_SHIELDED_ALUMINUM_MACHINE_FRAME.get(), PROPERTIES)); - public static RegistryObject ALUMINUM_MACHINE_CASING_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_machine_casing", () -> new BlockItem(VEBlocks.ALUMINUM_MACHINE_CASING_BLOCK.get(), PROPERTIES)); - public static RegistryObject TITANIUM_MACHINE_CASING_ITEM = VE_BLOCK_ITEM_REGISTRY.register("titanium_machine_casing", () -> new BlockItem(VEBlocks.TITANIUM_MACHINE_CASING_BLOCK.get(), PROPERTIES)); - public static RegistryObject SOLARIUM_MACHINE_CASING_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_machine_casing", () -> new BlockItem(VEBlocks.SOLARIUM_MACHINE_CASING_BLOCK.get(), PROPERTIES)); - - // Raw Material Storage Blocks - public static RegistryObject RAW_BAUXITE_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_bauxite_block", () -> new BlockItem(VEBlocks.RAW_BAUXITE_BLOCK.get(), PROPERTIES)); - public static RegistryObject RAW_CINNABAR_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_cinnabar_block", () -> new BlockItem(VEBlocks.RAW_CINNABAR_BLOCK.get(), PROPERTIES)); - public static RegistryObject RAW_EIGHZO_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_eighzo_block", () -> new BlockItem(VEBlocks.RAW_EIGHZO_BLOCK.get(), PROPERTIES)); - public static RegistryObject RAW_GALENA_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_galena_block", () -> new BlockItem(VEBlocks.RAW_GALENA_BLOCK.get(), PROPERTIES)); - public static RegistryObject RAW_RUTILE_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_rutile_block", () -> new BlockItem(VEBlocks.RAW_RUTILE_BLOCK.get(), PROPERTIES)); - //public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.RAW_BONE_BLOCK.get(), properties).setRegistryName("raw_bone_block")); - - public static RegistryObject PRESSURE_LADDER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("pressure_ladder", () -> new BlockItem(VEBlocks.PRESSURE_LADDER.get(), PROPERTIES)); - - // Material Storage Blocks - public static RegistryObject SOLARIUM_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_block", () -> new BlockItem(VEBlocks.SOLARIUM_BLOCK.get(), PROPERTIES)); +// public static RegistryObject PRIMITIVE_BLAST_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitiveblastfurnace", () -> new BlockItem(VEBlocks.PRIMITIVE_BLAST_FURNACE.block().get(), PROPERTIES)); +// public static RegistryObject PRIMITIVE_STIRLING_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitivestirlinggenerator", () -> new BlockItem(VEBlocks.PRIMITIVE_STIRLING_GENERATOR.block().get(), PROPERTIES)); +// public static RegistryObject CRUSHER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("crusher", () -> new BlockItem(VEBlocks.CRUSHER.block().get(), PROPERTIES)); +// public static RegistryObject ELECTROLYZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("electrolyzer", () -> new BlockItem(VEBlocks.ELECTROLYZER.block().get(), PROPERTIES)); +// public static RegistryObject CENTRIFUGAL_AGITATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("centrifugal_agitator", () -> new BlockItem(VEBlocks.CENTRIFUGAL_AGITATOR.block().get(), PROPERTIES)); +// public static RegistryObject COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("compressor", () -> new BlockItem(VEBlocks.COMPRESSOR.block().get(), PROPERTIES)); +// public static RegistryObject STIRLING_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("stirling_generator", () -> new BlockItem(VEBlocks.STIRLING_GENERATOR.block().get(), PROPERTIES)); +// public static RegistryObject COMBUSTION_GENERATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("combustion_generator", () -> new BlockItem(VEBlocks.COMBUSTION_GENERATOR.block().get(), PROPERTIES)); +// public static RegistryObject AQUEOULIZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aqueoulizer", () -> new BlockItem(VEBlocks.AQUEOULIZER.block().get(), PROPERTIES)); +// public static RegistryObject AIR_COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("air_compressor", () -> new BlockItem(VEBlocks.AIR_COMPRESSOR.block().get(), PROPERTIES)); +// public static RegistryObject DISTILLATION_UNIT_ITEM = VE_BLOCK_ITEM_REGISTRY.register("distillation_unit", () -> new BlockItem(VEBlocks.DISTILLATION_UNIT.block().get(), PROPERTIES)); +// public static RegistryObject PUMP_ITEM = VE_BLOCK_ITEM_REGISTRY.register("pump", () -> new BlockItem(VEBlocks.PUMP.block().get(), PROPERTIES)); +// public static RegistryObject GAS_FIRED_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("gas_fired_furnace", () -> new BlockItem(VEBlocks.GAS_FIRED_FURNACE.block().get(), PROPERTIES)); +// public static RegistryObject ELECTRIC_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("electric_furnace", () -> new BlockItem(VEBlocks.ELECTRIC_FURNACE.block().get(), PROPERTIES)); +// public static RegistryObject BATTERY_BOX_ITEM = VE_BLOCK_ITEM_REGISTRY.register("battery_box", () -> new BlockItem(VEBlocks.BATTERY_BOX.block().get(), PROPERTIES)); +// public static RegistryObject PRIMITIVE_SOLAR_PANEL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("primitive_solar_panel", () -> new BlockItem(VEBlocks.PRIMITIVE_SOLAR_PANEL.block().get(), PROPERTIES)); +// public static RegistryObject SOLAR_PANEL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solar_panel", () -> new BlockItem(VEBlocks.SOLAR_PANEL.block().get(), PROPERTIES)); +// public static RegistryObject CENTRIFUGAL_SEPARATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("centrifugal_separator", () -> new BlockItem(VEBlocks.CENTRIFUGAL_SEPARATOR.block().get(), PROPERTIES)); +// public static RegistryObject IMPLOSION_COMPRESSOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("implosion_compressor", () -> new BlockItem(VEBlocks.IMPLOSION_COMPRESSOR.block().get(), PROPERTIES)); +// public static RegistryObject BLAST_FURNACE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("blast_furnace", () -> new BlockItem(VEBlocks.BLAST_FURNACE.block().get(), PROPERTIES)); +// public static RegistryObject TOOLING_STATION_ITEM = VE_BLOCK_ITEM_REGISTRY.register("tooling_station", () -> new BlockItem(VEBlocks.TOOLING_STATION.block().get(), PROPERTIES)); +// public static RegistryObject SAWMILL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("sawmill", () -> new BlockItem(VEBlocks.SAWMILL.block().get(), PROPERTIES)); +// public static RegistryObject DIMENSIONAL_LASER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("dimensional_laser", () -> new BlockItem(VEBlocks.DIMENSIONAL_LASER.block().get(), PROPERTIES)); +// public static RegistryObject FLUID_ELECTROLYZER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("fluid_electrolyzer", () -> new BlockItem(VEBlocks.FLUID_ELECTROLYZER.block().get(), PROPERTIES)); +// public static RegistryObject FLUID_MIXER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("fluid_mixer", () -> new BlockItem(VEBlocks.FLUID_MIXER.block().get(), PROPERTIES)); +// public static RegistryObject HYDROPONIC_INCUBATOR_ITEM = VE_BLOCK_ITEM_REGISTRY.register("hydroponic_incubator", () -> new BlockItem(VEBlocks.HYDROPONIC_INCUBATOR.block().get(), PROPERTIES)); +// +// // Tanks +// public static RegistryObject ALUMINUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_tank", () -> new BlockItem(VEBlocks.ALUMINUM_TANK.block().get(), PROPERTIES)); +// public static RegistryObject TITANIUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("titanium_tank", () -> new BlockItem(VEBlocks.TITANIUM_TANK.block().get(), PROPERTIES)); +// public static RegistryObject NETHERITE_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("netherite_tank", () -> new BlockItem(VEBlocks.NETHERITE_TANK.block().get(), PROPERTIES)); +// public static RegistryObject NIGHALITE_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("nighalite_tank", () -> new BlockItem(VEBlocks.NIGHALITE_TANK.block().get(), PROPERTIES)); +// public static RegistryObject EIGHZO_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("eighzo_tank", () -> new BlockItem(VEBlocks.EIGHZO_TANK.block().get(), PROPERTIES)); +// public static RegistryObject SOLARIUM_TANK_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_tank", () -> new BlockItem(VEBlocks.SOLARIUM_TANK.block().get(), PROPERTIES)); +// +// // Crops +// //public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.LAND_CROP,properties).setRegistryName("land_crop")); +// //@Deprecated // I think the rice registration here is deprecated, as it's now in VEItems +// //public static RegistryObject RICE_CROP_ITEM = VE_BLOCK_ITEM_REGISTRY.register("rice_grain", VEItems.RICE_GRAIN.get()); +// +// //True Blocks +// //Ores +// public static RegistryObject SALTPETER_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("saltpeterore", () -> new BlockItem(VEBlocks.SALTPETER_ORE.get(), PROPERTIES)); +// public static RegistryObject BAUXITE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("bauxiteore", () -> new BlockItem(VEBlocks.BAUXITE_ORE.get(), PROPERTIES)); +// public static RegistryObject CINNABAR_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("cinnabarore", () -> new BlockItem(VEBlocks.CINNABAR_ORE.get(), PROPERTIES)); +// public static RegistryObject RUTILE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("rutileore", () -> new BlockItem(VEBlocks.RUTILE_ORE.get(), PROPERTIES)); +// public static RegistryObject GALENA_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("galena_ore", () -> new BlockItem(VEBlocks.GALENA_ORE.get(), PROPERTIES)); +// public static RegistryObject EIGHZO_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("eighzo_ore", () -> new BlockItem(VEBlocks.EIGHZO_ORE.get(), PROPERTIES)); +// +// //Deepslate ores +// public static RegistryObject DEEPSLATE_BAUXITE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_bauxite_ore", () -> new BlockItem(VEBlocks.DEEPSLATE_BAUXITE_ORE.get(), PROPERTIES)); +// public static RegistryObject DEEPSLATE_CINNABAR_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_cinnabar_ore", () -> new BlockItem(VEBlocks.DEEPSLATE_CINNABAR_ORE.get(), PROPERTIES)); +// public static RegistryObject DEEPSLATE_RUTILE_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_rutile_ore", () -> new BlockItem(VEBlocks.DEEPSLATE_RUTILE_ORE.get(), PROPERTIES)); +// public static RegistryObject DEEPSLATE_GALENA_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("deepslate_galena_ore", () -> new BlockItem(VEBlocks.DEEPSLATE_GALENA_ORE.get(), PROPERTIES)); +// +// public static RegistryObject RED_SALTPETER_ORE_ITEM = VE_BLOCK_ITEM_REGISTRY.register("red_saltpeter_ore", () -> new BlockItem(VEBlocks.RED_SALTPETER_ORE.get(), PROPERTIES)); +// +// //Shells +// public static RegistryObject ALUMINUM_SHELL_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_shell", () -> new BlockItem(VEBlocks.ALUMINUM_SHELL.get(), PROPERTIES)); +// public static RegistryObject CARBON_SHIELDED_ALUMINUM_MACHINE_FRAME_ITEM = VE_BLOCK_ITEM_REGISTRY.register("carbon_shielded_aluminum_machine_frame", () -> new BlockItem(VEBlocks.CARBON_SHIELDED_ALUMINUM_MACHINE_FRAME.get(), PROPERTIES)); +// public static RegistryObject ALUMINUM_MACHINE_CASING_ITEM = VE_BLOCK_ITEM_REGISTRY.register("aluminum_machine_casing", () -> new BlockItem(VEBlocks.ALUMINUM_MACHINE_CASING_BLOCK.get(), PROPERTIES)); +// public static RegistryObject TITANIUM_MACHINE_CASING_ITEM = VE_BLOCK_ITEM_REGISTRY.register("titanium_machine_casing", () -> new BlockItem(VEBlocks.TITANIUM_MACHINE_CASING_BLOCK.get(), PROPERTIES)); +// public static RegistryObject SOLARIUM_MACHINE_CASING_ITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_machine_casing", () -> new BlockItem(VEBlocks.SOLARIUM_MACHINE_CASING_BLOCK.get(), PROPERTIES)); +// +// // Raw Material Storage Blocks +// public static RegistryObject RAW_BAUXITE_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_bauxite_block", () -> new BlockItem(VEBlocks.RAW_BAUXITE_BLOCK.get(), PROPERTIES)); +// public static RegistryObject RAW_CINNABAR_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_cinnabar_block", () -> new BlockItem(VEBlocks.RAW_CINNABAR_BLOCK.get(), PROPERTIES)); +// public static RegistryObject RAW_EIGHZO_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_eighzo_block", () -> new BlockItem(VEBlocks.RAW_EIGHZO_BLOCK.get(), PROPERTIES)); +// public static RegistryObject RAW_GALENA_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_galena_block", () -> new BlockItem(VEBlocks.RAW_GALENA_BLOCK.get(), PROPERTIES)); +// public static RegistryObject RAW_RUTILE_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("raw_rutile_block", () -> new BlockItem(VEBlocks.RAW_RUTILE_BLOCK.get(), PROPERTIES)); +// //public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.RAW_BONE_BLOCK.get(), properties).setRegistryName("raw_bone_block")); +// +// public static RegistryObject PRESSURE_LADDER_ITEM = VE_BLOCK_ITEM_REGISTRY.register("pressure_ladder", () -> new BlockItem(VEBlocks.PRESSURE_LADDER.get(), PROPERTIES)); +// +// // Material Storage Blocks +// public static RegistryObject SOLARIUM_BLOCKITEM = VE_BLOCK_ITEM_REGISTRY.register("solarium_block", () -> new BlockItem(VEBlocks.SOLARIUM_BLOCK.get(), PROPERTIES)); /*public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.ALUMINUM_BLOCK.get(),properties).setRegistryName("aluminum_block")); public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.CARBON_BLOCK.get(),properties).setRegistryName("carbon_block")); public static RegistryObject VE_BLOCK_ITEM_REGISTRY.register(() -> new BlockItem(VEBlocks.EIGHZO_BLOCK.get(),properties).setRegistryName("eighzo_block")); diff --git a/src/main/java/com/veteam/voluminousenergy/items/crops/RiceItem.java b/src/main/java/com/veteam/voluminousenergy/items/crops/RiceItem.java index 0c8de5492..042ebdcfa 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/crops/RiceItem.java +++ b/src/main/java/com/veteam/voluminousenergy/items/crops/RiceItem.java @@ -11,7 +11,7 @@ public RiceItem(Properties properties) { @Override public VEWaterCrop getWaterCrop() { - return VEBlocks.RICE_CROP.get(); + return (VEWaterCrop) VEBlocks.RICE_CROP.get(); } } From 4838fa0c07310ee8e78ac787328db58a4526b565 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Thu, 11 Apr 2024 20:14:33 -0400 Subject: [PATCH 25/27] Fixed PressureLadder. Added the laser pylon --- .../blocks/blocks/VEBlock.java | 7 +- .../blocks/blocks/VEBlocks.java | 24 +- .../blocks/machines/PressureLadder.java | 113 +++---- .../blocks/blocks/util/FaceableBlock.java | 5 + .../blockstates/laser_pylon.json | 19 ++ .../assets/voluminousenergy/lang/en_us.json | 1 + .../models/block/laser_pylon.json | 299 ++++++++++++++++++ .../models/item/laser_pylon.json | 3 + .../textures/block/laser_pylon.png | Bin 0 -> 13176 bytes 9 files changed, 396 insertions(+), 75 deletions(-) create mode 100644 src/main/resources/assets/voluminousenergy/blockstates/laser_pylon.json create mode 100644 src/main/resources/assets/voluminousenergy/models/block/laser_pylon.json create mode 100644 src/main/resources/assets/voluminousenergy/models/item/laser_pylon.json create mode 100644 src/main/resources/assets/voluminousenergy/textures/block/laser_pylon.png diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlock.java index c9840a87c..44574b153 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlock.java @@ -3,13 +3,18 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; -public abstract class VEBlock extends Block { +public class VEBlock extends Block { private String rName; public VEBlock(BlockBehaviour.Properties properties) { super(properties); } + public VEBlock(BlockBehaviour.Properties properties, String rName) { + super(properties); + this.rName = rName; + } + public void setRName(String rName) { this.rName = rName; } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java index 637ac417b..5c82254a8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/VEBlocks.java @@ -12,6 +12,7 @@ import com.veteam.voluminousenergy.blocks.blocks.ores.red_sand.RedSaltpeterOre; import com.veteam.voluminousenergy.blocks.blocks.storage.materials.*; import com.veteam.voluminousenergy.blocks.blocks.storage.raw.*; +import com.veteam.voluminousenergy.blocks.blocks.util.FaceableBlock; import com.veteam.voluminousenergy.blocks.containers.VEContainer; import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory; import com.veteam.voluminousenergy.blocks.containers.VEContainers; @@ -21,7 +22,9 @@ import net.minecraft.core.BlockPos; import net.minecraft.world.inventory.MenuType; import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraftforge.common.extensions.IForgeMenuType; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.registries.DeferredRegister; @@ -281,6 +284,18 @@ public class VEBlocks { () -> VETileEntities.SOLARIUM_TANK_FACTORY, () -> VEContainers.SOLARIUM_TANK_FACTORY); + // Dimensional Laser Stuff + + public static RegistryObject DIMENSIONAL_LASER_PYLON = registerWithBlockItemSupport("laser_pylon", () -> new FaceableBlock( + BlockBehaviour.Properties.of() + .sound(SoundType.METAL) + .strength(2.0f) + .lightLevel(l -> 0) + .requiresCorrectToolForDrops() + .noOcclusion() + , "laser_pylon") { + } + ); //Ores public static RegistryObject SALTPETER_ORE = registerWithBlockItemSupport("saltpeterore", SaltpeterOre::new); @@ -378,11 +393,12 @@ public RegistryObject> container() { } } - public record RegistryWithName(String name, RegistryObject block){} + public record RegistryWithName(String name, RegistryObject block) { + } - public static RegistryObject registerWithBlockItemSupport(String name,Supplier blockSupplier) { - RegistryObject registryObject = VE_BLOCKS_REGISTRY.register(name,blockSupplier); - REGISTERED_BLOCKS.add(new RegistryWithName(name,registryObject)); + public static RegistryObject registerWithBlockItemSupport(String name, Supplier blockSupplier) { + RegistryObject registryObject = VE_BLOCKS_REGISTRY.register(name, blockSupplier); + REGISTERED_BLOCKS.add(new RegistryWithName(name, registryObject)); return registryObject; } } diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PressureLadder.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PressureLadder.java index 98502c710..b7973a5ec 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PressureLadder.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PressureLadder.java @@ -27,7 +27,9 @@ import net.minecraft.world.level.gameevent.GameEvent; import net.minecraft.world.level.material.PushReaction; import net.minecraft.world.phys.AABB; +import org.jetbrains.annotations.NotNull; +import javax.annotation.Nullable; import java.util.List; public class PressureLadder extends LadderBlock { @@ -64,7 +66,7 @@ public boolean isLadder(BlockState blockState, LevelReader levelReader, BlockPos // Pressure plate methods protected int getPressedTime() { - return 20; + return 60; } public boolean isPossibleToRespawnInThis() { @@ -113,104 +115,75 @@ protected int getSignalStrength(Level level, BlockPos blockPos) { } - @Override - public void tick(BlockState blockState, ServerLevel serverLevel, BlockPos blockPos, RandomSource random) { - Player player = serverLevel.getNearestPlayer(blockPos.getX(), blockPos.getY(), blockPos.getZ(), 2, EntitySelector.NO_SPECTATORS); - if ((player == null || player.isSpectator()) && blockState.getValue(POWERED)) { - VoluminousEnergy.LOGGER.info("Pressure Ladder active with no player! Might be jammed! Deactivating to unjam!"); - powerOff(serverLevel, blockState, blockPos, player); + public void tick(@NotNull BlockState blockState, @NotNull ServerLevel serverLevel, @NotNull BlockPos blockPos, @NotNull RandomSource randomSource) { + int i = this.getSignalForState(blockState); + if (i > 0) { + this.checkPressed(null, serverLevel, blockPos, blockState, i); } + } - public void entityInside(BlockState blockState, Level level, BlockPos blockPos, Entity entity) { + public void entityInside(@NotNull BlockState blockState, Level level, @NotNull BlockPos blockPos, @NotNull Entity entity) { if (!level.isClientSide) { - if (entity instanceof LivingEntity) { - // Calculate float differences from entity entering the ladder (double) to the actual blockPos (int) - // NOTE: blockPos is the VERY TOP of the block (ie ceil rounded) - double deltaX = entity.getX() - blockPos.getX(); - double deltaY = entity.getY() - blockPos.getY(); - double deltaZ = entity.getZ() - blockPos.getZ(); - - // Vertical (Y) checks - if (((deltaY > 0.91F) || (deltaY < -0.92F)) && blockState.getValue(POWERED)) { // If entity too high or low, deactivate - powerOff(level, blockState, blockPos, entity); - } else if (((deltaY > -0.90F) && (deltaY < 0.9F)) && !blockState.getValue(POWERED)) { // If between target delta values, activate - powerOn(level, blockState, blockPos, entity); - } - - // If entity too far to the sides, deactivate - if ((deltaZ > 0.9F || deltaZ < -0.9F) || (deltaX > 0.9F || deltaX < -0.9F) && blockState.getValue(POWERED)) { - powerOff(level, blockState, blockPos, entity); - } - + int i = this.getSignalForState(blockState); + if (i == 0) { + this.checkPressed(entity, level, blockPos, blockState, i); } + } } - private void powerOff(Level level, BlockState blockState, BlockPos blockPos, Entity entity) { - BlockState newState = blockState.setValue(POWERED, false); - this.setSignalForState(newState, 0); - level.setBlock(blockPos, newState, 3); - level.setBlocksDirty(blockPos, blockState, newState); - this.updateNeighbours(level, blockPos); + private void checkPressed(@Nullable Entity entity, Level level, BlockPos blockPos, BlockState blockState, int strength) { + int i = this.getSignalStrength(level, blockPos); + boolean flag = strength > 0; + boolean flag1 = i > 0; + if (strength != i) { + BlockState blockstate = this.setSignalForState(blockState, i); + level.setBlock(blockPos, blockstate, 2); + this.updateNeighbours(level, blockPos); + level.setBlocksDirty(blockPos, blockState, blockstate); + } - // Play sound - this.playOffSound(level, blockPos); - level.gameEvent(entity, GameEvent.BLOCK_DEACTIVATE, blockPos); - } + if (!flag1 && flag) { + this.playOffSound(level, blockPos); + level.gameEvent(entity, GameEvent.BLOCK_DEACTIVATE, blockPos); + } else if (flag1 && !flag) { + this.playOffSound(level, blockPos); + level.gameEvent(entity, GameEvent.BLOCK_ACTIVATE, blockPos); + } - private void powerOn(Level level, BlockState blockState, BlockPos blockPos, Entity entity) { - BlockState newState = blockState.setValue(POWERED, true); - this.setSignalForState(newState, 15); - level.setBlock(blockPos, newState, 3); - level.setBlocksDirty(blockPos, blockState, newState); - this.updateNeighbours(level, blockPos); + if (flag1) { + level.scheduleTick(new BlockPos(blockPos), this, this.getPressedTime()); + } - // Play sound - this.playOnSound(level, blockPos); - level.gameEvent(entity, GameEvent.BLOCK_ACTIVATE, blockPos); } - - public void onRemove(BlockState blockState, Level level, BlockPos blockPos, BlockState blockState1, boolean flag) { - if (!flag && !blockState.is(blockState1.getBlock())) { + public void onRemove(@NotNull BlockState blockState, @NotNull Level level, @NotNull BlockPos blockPos, @NotNull BlockState state, boolean b) { + if (!b && !blockState.is(state.getBlock())) { if (this.getSignalForState(blockState) > 0) { this.updateNeighbours(level, blockPos); } - - super.onRemove(blockState, level, blockPos, blockState1, flag); + super.onRemove(blockState, level, blockPos, state, b); } } - protected void updateNeighbours(Level level, BlockPos pos) { - level.updateNeighborsAt(pos, this); - level.updateNeighborsAt(pos.below(), this); - level.updateNeighborsAt(pos.above(), this); - level.updateNeighborsAt(pos.east(), this); - level.updateNeighborsAt(pos.west(), this); - level.updateNeighborsAt(pos.north(), this); - level.updateNeighborsAt(pos.south(), this); + protected void updateNeighbours(Level p_49292_, BlockPos p_49293_) { + p_49292_.updateNeighborsAt(p_49293_, this); + p_49292_.updateNeighborsAt(p_49293_.below(), this); } - @Override - public int getSignal(BlockState blockState, BlockGetter blockGetter, BlockPos pos, Direction direction) { + public int getSignal(@NotNull BlockState blockState, @NotNull BlockGetter blockGetter, @NotNull BlockPos blockPos, @NotNull Direction direction) { return this.getSignalForState(blockState); } - @Override - public int getDirectSignal(BlockState blockState, BlockGetter blockGetter, BlockPos pos, Direction direction) { - return direction == Direction.UP ? this.getSignalForState(blockState) : 0; + public int getDirectSignal(BlockState p_49346_, BlockGetter p_49347_, BlockPos p_49348_, Direction p_49349_) { + return p_49349_ == Direction.UP ? this.getSignalForState(p_49346_) : 0; } - @Override - public boolean isSignalSource(BlockState blockState) { + public boolean isSignalSource(BlockState p_49351_) { return true; } -// @Override -// public PushReaction getPistonPushReaction(BlockState blockState) { -// return PushReaction.DESTROY; -// } // Voluminous Energy 1.19 port public void setRegistryName(String registryName) { diff --git a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/FaceableBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/FaceableBlock.java index 950a5f597..e1758a41b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/FaceableBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/FaceableBlock.java @@ -19,6 +19,11 @@ public FaceableBlock(Properties properties) { this.registerDefaultState(this.stateDefinition.any().setValue(LIT, Boolean.FALSE)); } + public FaceableBlock(Properties properties, String rName) { + super(properties, rName); + this.registerDefaultState(this.stateDefinition.any().setValue(LIT, Boolean.FALSE)); + } + @Override public BlockState getStateForPlacement(BlockPlaceContext blockPlaceContext) { return this.defaultBlockState().setValue(FACING, blockPlaceContext.getHorizontalDirection().getOpposite()); diff --git a/src/main/resources/assets/voluminousenergy/blockstates/laser_pylon.json b/src/main/resources/assets/voluminousenergy/blockstates/laser_pylon.json new file mode 100644 index 000000000..defef4b5c --- /dev/null +++ b/src/main/resources/assets/voluminousenergy/blockstates/laser_pylon.json @@ -0,0 +1,19 @@ +{ + "variants": { + "facing=north": { + "model": "voluminousenergy:block/laser_pylon" + }, + "facing=south": { + "model": "voluminousenergy:block/laser_pylon", + "y": 180 + }, + "facing=west": { + "model": "voluminousenergy:block/laser_pylon", + "y": 270 + }, + "facing=east": { + "model": "voluminousenergy:block/laser_pylon", + "y": 90 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/lang/en_us.json b/src/main/resources/assets/voluminousenergy/lang/en_us.json index 391a3f1b2..88e325729 100644 --- a/src/main/resources/assets/voluminousenergy/lang/en_us.json +++ b/src/main/resources/assets/voluminousenergy/lang/en_us.json @@ -120,6 +120,7 @@ "block.voluminousenergy.fluid_mixer": "Fluid Mixer", "block.voluminousenergy.hydroponic_incubator": "Hydroponic Incubator", "block.voluminousenergy.solarium_machine_casing": "Solarium Machine Casing", + "block.voluminousenergy.laser_pylon": "Laser Pylon", "_comment": "Creative Tabs", "tab.voluminousenergy.voluminousenergy": "Voluminous Energy", "_comment": "Fluids", diff --git a/src/main/resources/assets/voluminousenergy/models/block/laser_pylon.json b/src/main/resources/assets/voluminousenergy/models/block/laser_pylon.json new file mode 100644 index 000000000..4ecc6b07e --- /dev/null +++ b/src/main/resources/assets/voluminousenergy/models/block/laser_pylon.json @@ -0,0 +1,299 @@ +{ + "credit": "Made with Blockbench", + "texture_size": [64, 64], + "textures": { + "0": "voluminousenergy:block/laser_pylon", + "particle": "voluminousenergy:block/laser_pylon" + }, + "elements": [ + { + "name": "second_base", + "from": [2, 1.25, 2], + "to": [14, 2.25, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0.25, -2]}, + "faces": { + "north": {"uv": [9.5, 2.5, 12.5, 2.75], "texture": "#0"}, + "east": {"uv": [9.5, 2.75, 12.5, 3], "texture": "#0"}, + "south": {"uv": [10, 7.5, 13, 7.75], "texture": "#0"}, + "west": {"uv": [10, 7.75, 13, 8], "texture": "#0"}, + "up": {"uv": [7, 3, 4, 0], "texture": "#0"}, + "down": {"uv": [7, 3, 4, 6], "texture": "#0"} + } + }, + { + "name": "base", + "from": [0, 0, 0], + "to": [16, 1.25, 16], + "faces": { + "north": {"uv": [9, 6, 13, 6.375], "texture": "#0"}, + "east": {"uv": [9, 6.5, 13, 6.875], "texture": "#0"}, + "south": {"uv": [9, 7, 13, 7.375], "texture": "#0"}, + "west": {"uv": [0, 9.25, 4, 9.625], "texture": "#0"}, + "up": {"uv": [4, 4, 0, 0], "texture": "#0"}, + "down": {"uv": [4, 4, 0, 8], "texture": "#0"} + } + }, + { + "name": "left_pincher", + "from": [4, 2.25, 3], + "to": [5, 8.25, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0.25, 0]}, + "faces": { + "north": {"uv": [10.25, 9.75, 10.5, 11.25], "texture": "#0"}, + "east": {"uv": [4, 6, 6.5, 7.5], "texture": "#0"}, + "south": {"uv": [10, 10.25, 10.25, 11.75], "texture": "#0"}, + "west": {"uv": [6.5, 6, 9, 7.5], "texture": "#0"}, + "up": {"uv": [2.25, 12.25, 2, 9.75], "texture": "#0"}, + "down": {"uv": [2.5, 9.75, 2.25, 12.25], "texture": "#0"} + } + }, + { + "name": "left_pincher_outside", + "from": [3, 2.25, 4], + "to": [4, 7.25, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0.25, 0]}, + "faces": { + "north": {"uv": [10.75, 4.5, 11, 5.75], "texture": "#0"}, + "east": {"uv": [0, 8, 2, 9.25], "texture": "#0"}, + "south": {"uv": [4, 11, 4.25, 12.25], "texture": "#0"}, + "west": {"uv": [2, 8, 4, 9.25], "texture": "#0"}, + "up": {"uv": [9.25, 12.25, 9, 10.25], "texture": "#0"}, + "down": {"uv": [9.5, 10.25, 9.25, 12.25], "texture": "#0"} + } + }, + { + "name": "right_pincher", + "from": [11, 2.25, 3], + "to": [12, 8.25, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0.25, 0]}, + "faces": { + "north": {"uv": [10.5, 3, 10.75, 4.5], "texture": "#0"}, + "east": {"uv": [7, 0, 9.5, 1.5], "texture": "#0"}, + "south": {"uv": [10.5, 4.5, 10.75, 6], "texture": "#0"}, + "west": {"uv": [7, 1.5, 9.5, 3], "texture": "#0"}, + "up": {"uv": [2.75, 12.25, 2.5, 9.75], "texture": "#0"}, + "down": {"uv": [3, 9.75, 2.75, 12.25], "texture": "#0"} + } + }, + { + "name": "right_pincher_outside", + "from": [12, 2.25, 4], + "to": [13, 7.25, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0.25, 0]}, + "faces": { + "north": {"uv": [4.25, 11, 4.5, 12.25], "texture": "#0"}, + "east": {"uv": [8, 7.5, 10, 8.75], "texture": "#0"}, + "south": {"uv": [4.5, 11, 4.75, 12.25], "texture": "#0"}, + "west": {"uv": [8, 8.75, 10, 10], "texture": "#0"}, + "up": {"uv": [9.75, 12.25, 9.5, 10.25], "texture": "#0"}, + "down": {"uv": [10, 10.25, 9.75, 12.25], "texture": "#0"} + } + }, + { + "name": "left_gear", + "from": [5, 5, 5], + "to": [6, 7, 7], + "faces": { + "north": {"uv": [6, 11.25, 6.25, 11.75], "texture": "#0"}, + "east": {"uv": [11, 4.5, 11.5, 5], "texture": "#0"}, + "south": {"uv": [6.25, 11.25, 6.5, 11.75], "texture": "#0"}, + "west": {"uv": [4.75, 11, 5.25, 11.5], "texture": "#0"}, + "up": {"uv": [6.75, 11.75, 6.5, 11.25], "texture": "#0"}, + "down": {"uv": [7, 11.25, 6.75, 11.75], "texture": "#0"} + } + }, + { + "name": "right_gear", + "from": [10, 5, 5], + "to": [11, 7, 7], + "faces": { + "north": {"uv": [7, 11.25, 7.25, 11.75], "texture": "#0"}, + "east": {"uv": [11, 5, 11.5, 5.5], "texture": "#0"}, + "south": {"uv": [7.25, 11.25, 7.5, 11.75], "texture": "#0"}, + "west": {"uv": [5.25, 11, 5.75, 11.5], "texture": "#0"}, + "up": {"uv": [7.75, 11.75, 7.5, 11.25], "texture": "#0"}, + "down": {"uv": [11.5, 9.75, 11.25, 10.25], "texture": "#0"} + } + }, + { + "name": "left_rail", + "from": [6, -1, 6], + "to": [7, 2, 20], + "rotation": {"angle": -45, "axis": "x", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [7.75, 11, 8, 11.75], "texture": "#0"}, + "east": {"uv": [7, 3, 10.5, 3.75], "texture": "#0"}, + "south": {"uv": [11, 9.75, 11.25, 10.5], "texture": "#0"}, + "west": {"uv": [7, 3.75, 10.5, 4.5], "texture": "#0"}, + "up": {"uv": [1.25, 13.25, 1, 9.75], "texture": "#0"}, + "down": {"uv": [1.5, 9.75, 1.25, 13.25], "texture": "#0"} + } + }, + { + "name": "right_rail", + "from": [9, -1, 6], + "to": [10, 2, 20], + "rotation": {"angle": -45, "axis": "x", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [11, 10.5, 11.25, 11.25], "texture": "#0"}, + "east": {"uv": [7, 4.5, 10.5, 5.25], "texture": "#0"}, + "south": {"uv": [11.25, 3, 11.5, 3.75], "texture": "#0"}, + "west": {"uv": [7, 5.25, 10.5, 6], "texture": "#0"}, + "up": {"uv": [1.75, 13.25, 1.5, 9.75], "texture": "#0"}, + "down": {"uv": [2, 9.75, 1.75, 13.25], "texture": "#0"} + } + }, + { + "name": "top_rail", + "from": [6, 2, 6], + "to": [10, 3, 20], + "rotation": {"angle": -45, "axis": "x", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [10.75, 5.75, 11.75, 6], "texture": "#0"}, + "east": {"uv": [9.5, 1.5, 13, 1.75], "texture": "#0"}, + "south": {"uv": [11, 5.5, 12, 5.75], "texture": "#0"}, + "west": {"uv": [9.5, 1.75, 13, 2], "texture": "#0"}, + "up": {"uv": [5, 11, 4, 7.5], "texture": "#0"}, + "down": {"uv": [6, 7.5, 5, 11], "texture": "#0"} + } + }, + { + "name": "bottom_rail", + "from": [6, -2, 6], + "to": [10, -1, 20], + "rotation": {"angle": -45, "axis": "x", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [5.75, 11, 6.75, 11.25], "texture": "#0"}, + "east": {"uv": [9.5, 2, 13, 2.25], "texture": "#0"}, + "south": {"uv": [6.75, 11, 7.75, 11.25], "texture": "#0"}, + "west": {"uv": [9.5, 2.25, 13, 2.5], "texture": "#0"}, + "up": {"uv": [7, 11, 6, 7.5], "texture": "#0"}, + "down": {"uv": [8, 7.5, 7, 11], "texture": "#0"} + } + }, + { + "name": "rail_back", + "from": [7, -1, 5], + "to": [9, 2, 6], + "rotation": {"angle": -45, "axis": "x", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [10.5, 9.75, 11, 10.5], "texture": "#0"}, + "east": {"uv": [11.25, 3.75, 11.5, 4.5], "texture": "#0"}, + "south": {"uv": [10.5, 10.5, 11, 11.25], "texture": "#0"}, + "west": {"uv": [5.75, 11.25, 6, 12], "texture": "#0"}, + "up": {"uv": [10.75, 11.5, 10.25, 11.25], "texture": "#0"}, + "down": {"uv": [11.75, 10.25, 11.25, 10.5], "texture": "#0"} + } + }, + { + "name": "front_beam", + "from": [7, -1, 19], + "to": [9, 2, 27], + "rotation": {"angle": -45, "axis": "x", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [10.75, 3, 11.25, 3.75], "texture": "#0"}, + "east": {"uv": [9.5, 0, 11.5, 0.75], "texture": "#0"}, + "south": {"uv": [10.75, 3.75, 11.25, 4.5], "texture": "#0"}, + "west": {"uv": [9.5, 0.75, 11.5, 1.5], "texture": "#0"}, + "up": {"uv": [0.5, 11.75, 0, 9.75], "texture": "#0"}, + "down": {"uv": [1, 9.75, 0.5, 11.75], "texture": "#0"} + } + }, + { + "name": "top_left", + "from": [6, 2, 20], + "to": [7, 3, 29], + "rotation": {"angle": -45, "axis": "x", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [10, 9.75, 10.25, 10], "texture": "#0"}, + "east": {"uv": [8, 10, 10.25, 10.25], "texture": "#0"}, + "south": {"uv": [11.25, 10.5, 11.5, 10.75], "texture": "#0"}, + "west": {"uv": [10, 8, 12.25, 8.25], "texture": "#0"}, + "up": {"uv": [3.25, 12, 3, 9.75], "texture": "#0"}, + "down": {"uv": [3.5, 9.75, 3.25, 12], "texture": "#0"} + } + }, + { + "name": "top_right", + "from": [9, 2, 20], + "to": [10, 3, 29], + "rotation": {"angle": -45, "axis": "x", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [10.75, 11.25, 11, 11.5], "texture": "#0"}, + "east": {"uv": [10, 8.25, 12.25, 8.5], "texture": "#0"}, + "south": {"uv": [11.25, 10.75, 11.5, 11], "texture": "#0"}, + "west": {"uv": [10, 8.5, 12.25, 8.75], "texture": "#0"}, + "up": {"uv": [3.75, 12, 3.5, 9.75], "texture": "#0"}, + "down": {"uv": [4, 9.75, 3.75, 12], "texture": "#0"} + } + }, + { + "name": "bottom_left", + "from": [6, -2, 20], + "to": [7, -1, 29], + "rotation": {"angle": -45, "axis": "x", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [11, 11.25, 11.25, 11.5], "texture": "#0"}, + "east": {"uv": [10, 8.75, 12.25, 9], "texture": "#0"}, + "south": {"uv": [11.25, 11, 11.5, 11.25], "texture": "#0"}, + "west": {"uv": [10, 9, 12.25, 9.25], "texture": "#0"}, + "up": {"uv": [8.25, 12.5, 8, 10.25], "texture": "#0"}, + "down": {"uv": [8.5, 10.25, 8.25, 12.5], "texture": "#0"} + } + }, + { + "name": "bottom_right", + "from": [9, -2, 20], + "to": [10, -1, 29], + "rotation": {"angle": -45, "axis": "x", "origin": [0, 0, 0]}, + "faces": { + "north": {"uv": [11.25, 11.25, 11.5, 11.5], "texture": "#0"}, + "east": {"uv": [10, 9.25, 12.25, 9.5], "texture": "#0"}, + "south": {"uv": [11.5, 0, 11.75, 0.25], "texture": "#0"}, + "west": {"uv": [10, 9.5, 12.25, 9.75], "texture": "#0"}, + "up": {"uv": [8.75, 12.5, 8.5, 10.25], "texture": "#0"}, + "down": {"uv": [9, 10.25, 8.75, 12.5], "texture": "#0"} + } + } + ], + "display": { + "fixed": { + "rotation": [0, 180, 0] + } + }, + "groups": [ + { + "name": "base", + "origin": [0, 0.25, -2], + "color": 0, + "children": [ + 0, + 1, + { + "name": "rotation", + "origin": [8, 8, 8], + "color": 0, + "children": [2, 3, 4, 5, 6, 7] + } + ] + }, + { + "name": "beam", + "origin": [8, 8, 8], + "color": 0, + "children": [ + 8, + 9, + 10, + 11, + 12, + { + "name": "beam", + "origin": [8, 8, 8], + "color": 0, + "children": [13, 14, 15, 16, 17] + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/models/item/laser_pylon.json b/src/main/resources/assets/voluminousenergy/models/item/laser_pylon.json new file mode 100644 index 000000000..4513aa986 --- /dev/null +++ b/src/main/resources/assets/voluminousenergy/models/item/laser_pylon.json @@ -0,0 +1,3 @@ +{ + "parent": "voluminousenergy:block/laser_pylon" +} \ No newline at end of file diff --git a/src/main/resources/assets/voluminousenergy/textures/block/laser_pylon.png b/src/main/resources/assets/voluminousenergy/textures/block/laser_pylon.png new file mode 100644 index 0000000000000000000000000000000000000000..f7d5bbbcd23f6809721ba714e6a0600fd8d7c37f GIT binary patch literal 13176 zcmb_jRa0C|x5nLqOK=?^IDx?-1lNJ!?h@SH-QC>@g9c}CcV65HG7uoR>*4zkr>f^0Ruw?BP%Jc?wR`!q91Fg z>%M(Uc5Mo7KFOW;dv+I$!udokM0<$@NBw>GOA-zhbx>l60)@${+=EO=lqq95-r84p zvQxURN~a> zAa2v`2O5}F_L~Afnr-WN4@q5O-yag*6GfkfMD4#J(@0EbS?9NRcuNAp=Ko5{q2kFT zuPmX1v88NtXDnOnzKs;#D~(54XIC|YBrMDBqFV#u5h{3nig1UO=vU|3$Fw#LV4RDc_!guP!$>+n%XDjtAwn%&^kBL~b&RW#Paj$$)>>%}ocz)gMI*J2kq z*D6I8w?zsh@^@UP(5pKMntIAy+XuP0PH7{w)Vj?DIl*lb3 z2NQ`Ri(96iT>ARoe6*4j%nOpc*;hU*?-x@3?M8b5cj=!m zYS>405c^jQWE?AH8#3otq~pO}xGAioZAyz05fQ^an*3_a_pXEBtW=rh&^0$eMhx)? zIJZFQF66b}>E#Q7CBH}bB2sWUbrHLn(YyV&{(cYfyz*cHG7|e6m*LaVJG1R4SCzG$ z{0jlwp@dh1c2Nf~rm{qM>>Z01KH?>p(VOgMOJ=M9{S)1Z`6Ws|OAk#J z7m%;i$Jg)O{qXoRd>@~Uk3)DncW%(>at<;9L$vgE~-f5yXB2B3bfJr5Be0Te}l&3c6)muaCFbE$EDv)h|Y8sX7bT&vvm^Vqv#rkD!*z;r?l~FXb&^-l<2hK1^)nWe7xzuSSIz6uX&u@ z+=`X(WVy-+hlxj~v}$Wd>E}lZ9ir^y{X|eJ*SsPG|oK zFh=<{6T7qtZ+1^pJ`m8Vkqlt3t^4HEDxxm#>$FZBn51?YfD=`MJ}5L5GtfJ8z#lC| zS(=&&&C+3(<(jZ&$cU=i$epa1kJ8~fyoG}r5{gmBTGE-j^8)XNGuqlXcf0Kl7JK%B8TYPpAG@)%@S{=T9yjUUE>9Ng@Yb zKIcKgZ+=d6UKhNIh_Y!*nv?sUr1E*2rh~R7vm;dWmwVbTOEHlnL}QRh=@(oBt6f(C zuW_4j%(7M`_PCJ>y!kGblfj`e0+ zF-lU=VD*fLkA$~6MfVXztOz9IYk%(+ zznk1S!1!~F`DItXrt~y}LyEBs1Nt}pE*|S1rh54N-S7QnWZLlku;;C3=#A^Q?f!B| zt=zhXvs?owQo9*wx)N2ER96>ZZW0@hnpzc1+On+#%Sj!@F=z$$8FcXU2AVr7?StSF zaGWoP3ZP;0i;MpXxqgb|#s8FS9AU84k%fdjdTn1SQhC<)NWTh;+>|ZnTqrj9gg#pw z+@<8v5JplBvx?+)fDJyFTitX}NYD_D^x`pusP zrezvmwgEm)3{vlkvAVFGH7@FVijUH}WHXi@TN?oo7abtAAg(W77kun7qK`m9tU&gM zeALr3KkOU)d!#?;L1e5udCIQH+g$|Wl|g^bsbA4~aCl%e-c zq?ZAl@J&LC9bHsU9y*XfF1=S%DDvgFL$zZ39Eof|_&+0~;~X8uhN7gPpu1_6gVp&8 z2Yeu_TlGw0o&|lZ)Z?^@#7`&z!3H>f(dTd0lp8v$@fhL*@d?6%2 z&0}@zZ?B*02)xahN+{i8lH~^TqA?SY%d3);6O)NT-4% zPM`8Q4dj5Q3)2aqcD37|7HiZFYKf;Yoy%w(xL6t3qnabj9n7Ut0BXwMfg`|1QEy+sS@@fhjkv1o*_9ogW04S)(X6Kby3R^7}?Qy7k`Bl zNK^ClfiLvwDQpj}Wd2#|JVdx{8=XJDi73KgXzx?twO7eB9_n{lE!JYhmmFt{SPDey z1J@3dn==E3uh~emh=~X-Q{?h;sJ!n!Z-WV*!4OG3x#%#;_!tC>!jcqck-#cW{3Har zdZ(S9WHfUnEzKH)QFA!gVHJ#TYQ3Tvev&uLK@ghgy20Nm)j;q}##PyCweGMry!ghW~Gw7k$d7hW{k)PPrgLtD6r0Dc9 zK>hY&V=J7qrUY$XeIqZX(|vBxyZr$!+ovg)3($^C-99q^U?4{lO{tr{;DN5ahi4R`miC7TSI1Iescqo+FpLR7>UH~Lsu_UnC$CnEl>NsjSvw-QKLhq2e? z3km)68TdN(?hM#&Mqwyiti*kV`ZcinKX21@Qe9g;HkOlv$qsuh1edB9O~NS?RpAPv z&;_HDshJOQ7it_#S7H~J+Lg;f|ENvM1a;Nn5IPe}wR6F-RQ|`*U6k^}%yyJ6Rfnm) zzLurbbpcyaC`J6`TsNO89v*X6&W8T34B5eAHiD>r65CHz+&L88BGGrgkcyu6f!B() z&D2m;H()@6&YTz%PDNV@y};|xg>^#WBu_wbUl|AfW=^>JUx?i%F=Sq+;vO1 zq$)|CiAvh5M(OjHt_YGOM;%j`O!I4YQ`uyIgM8oI!u60yEATr6`47EZuheG;fulMFfV?Ixo7*NT7eTInt@px;Le@#0q&g&-n=YdJ zFq_D(F&y(TXm_ydz`}12^!mIo6h0E4v znJ6k?d?*4Lr-(2jD8dcYrm)HBhcI>qn@w7#LGufaTzrY624Cl7G9{yY1Z7sn9!{P+ z0Z3jv|w!k%*(78%Tiqx zZ?@ZPtMNb8XEQ(r&kyoUO-`J0!g5TuV^dTx1)Q;nzG;wrqdy46V6VF?T4}j_S>^tC ziowU1;1T6~-(n(-gwq$HnXFXjTqh^O^Bvzr@lqClac#q&`naZ0rj17dY86pM12em<3tW$I1b>cQO?1hwPj^5i5QZLK?iqdQ965r_d&7saijAixd)*v;0s|Q(g063Q&wJjt z`a<)eS?1ag{Y2fpja{$Ks+Sc*@?aaJ5@~}?V8IM5SgEEZIXGEZ!TOVag2+(^vK!#P z4zbaV7`0uC)Li3y_^)nAs$c>#e<9Buek`maWTX6iS?B4ZjCAhUc+9?J#LqY^4bZ zq`x#p?xFVo`GL9LwRCm&SUj|Fy~+791*K9~npd!80V|$KAwCJra%!~_ z{4n3lB{2&sE~DFzoRyC@sf0}?->AYfh45o@5Z)@k_EP%HYraBVsxnR!{4Yh3KKVl# z{co1sAlK7}7(0-A|C4`pSEBvV$0!VOUN#FaHLg2!P4>1ppL2IBp>zp$y6{J+9rx4M z6RUg}QqlOoZZTy6ZI2}3$li|zS7zrHU_Y|85s1zm8H+w9i7tor?&o1EKgaIw@&$$U zr4SwAg`<)N{m+Y?r>>Vp7;5P{oR`ivU&KFSI!cH9%u4ZzaaDF0*RMf_JUe}BZDgFd|buP)x4nPn( zXsxJ9uTU?-eC+uEr>$%2m1ll>ENjxGV!<~3N0B7D)01Vh&D;mxlDE1ZJ0B@(#rhqbROekw4%l*`NykQQ2KBTH}x6GJaPHBCy@S9lE(n4bi{@~6`H)MNH&2Z#by?LM2EAsr8YdgID%R^Lkry~=kCx7XOewiA zukq>NsPGt5wNyz;erO&SfIx0csbz9ZzR+QXE{e|qiPq}oh#SXvT?a>vIwAURp+bn= ziPm||?&rP+yZxgi^)L`Fc@bUxCv&r|Ka1M3b3zlCpLh>mggm;x$o8%sD=B!Ktab852*yMaLzO<8dV8FDz(E^mSEkIlby%;itVpj-gykC zQ?#nh-&DEAVn4gV*G<^AS&2(uo3gAF0RQAE?20K-o(T-0ze=wXsmfIu^z4+|dcri* zi6EBV(}GX!JC#zJoER;q(}h&a<&?r)91IBAw)B4u=nh8HNjX=#$HrHx$P4H+fC#G< zN*(jGF76^`FD0gPzA`3w|K*oOy~Fx#wZX2f>gK(46f${GNuLVJ`&qr^x|=4foPsBr zBwwPoCc13B#>;SbhUkFtX_>LjK|^kA!OK{G#-J*jkv(xip$ZR3zZ8Sun==MzGBE67 zV2AHJfkS{_@$%}kO&L_j)khvfm^hP?{!CqvYWL#Ax;I4&hk9<~tVvh08Y>X*5iUUdd9HE!z$M9^4wd*;FjKw`S=Ef$(e5AWVh%>L2 zSl|Oxs#XD%Y&_I5vcFrr6DayNP_x}}*<(+8lcF6$^$=7Otr_gdO3E^1C>^Hp;qh2e zf&8A~%M>~e`#KGrDo)wnxYWyGHFC_e(zMH2tRJQqv!L-%k}^3tZ#+$AsiaiAe;`D5 zq5pb=kEKk5ErZ)lJGVGDv?wl_y9~dhiq?bXr=O#U;V3<~!dwISLK%hRRFL!#;DBE> z4#YT!A7k={1p~n(7Q<0Ws1tf1%hSWA`6Mp_8^xu3_SQ7JHhjclR0F2m7-})lE2-?@ zmzoOGi($!OQn((p3b8yFr9Ye$y=U}CX#3mzVu=X#f=&cnA#eBp=;=sfjru@Djw!~q z15zBhtWn~Re4j7cEOgab6n>b(ORvPpPCwAtT%rACvzN|2+9W&e1BG zT?oF}xmG&Ub4v^LK#Yk`NzLb)oo5fEhbjXu1O$ywMf4KS(&t*jwgY_jU#-)j9 z8TYZY+^R7_XFA3VTTZHqN~H9oOFqVkzCoW`#qg8plZr2 zU5f3cjDKJx;u9G_eR}1{tO|of$p0$y`nDNaIGvbfj^M9#GE1PRN~Ysk&OI6$82fM< z5{7ajR@Fh&GU;fIu>HX6iO1%A zpm|>saIC!1GxA2yBDI^d{qiOKSJ}V@=zsuWE3M+;75Ls=Wxj{ zM!hBOiN(bUMF-e>td^xr+k-AJ>%4*kEGDCIth;9xpY?i&>T#%zM{9xf!q+Z5>8V+> z6=oSyi^&$d+p>+K5n>F^hgX*yhf@JSf3R{W$E zJnKyD910}*`XqGbps~K8oP_bMEn~H-W1;7*s%up85ZNz0k!Zyf{MB7~zmNF3->=%&sK)5Vt9TEDYS@6MQ|h|7G6 zV*;3ppSu6w#r5} zFXRL?%!FguToVKRR(t>2B7C)-HM#?dNEUi>V29N|_kX*F?rOX_`u$rD_-AnX1_$t- zPjlPMERQmi`?A;>9Bq65_h{6&7->`f!p0aJ77sGp?Si!Z-H0Nr^2$G|R&Xn>kc=58 zMYFh91)dX}($BaxA#adPUdKi)tN+&~>w;~V*ru6ZS7Ybm$Y3ei<)Gxuu!yl92daoP z@|zvv*I!iGJxx__D4)Cf_ivq)YV5=R>YVo;R`E`h!IjWq`2Bu&2eWO{&%<8n?!S-x zMojmo(|_c=QF!Uc?eLs`0v&BirN9>UT*m>^sutfkkJogKoGf6x11rab<3Pb7FZpE7 zKd<;(`L9O1EmHGP*2yjA#L$Ub^kZGB&@RmN9IdX!pNt)&s%#?uRv9hr(nUeOe;MD< z1q)`(g7lcHJWUbcstBK!iWNH=ZSS$wY`|N<-(T6*R}sru=hmc7$OK{q6px5=>kLC@ zcWVib6mze+)a3v8c60ou4cA;*gWCOtYgR%rFu$((PzJU;1U?zbzp^pa{AWZTeMrC& zJKs`mO4O`)&Zpb;dW;)_0NGL>bZ@+gn3N7kM@mY(qgXZO6It&+pJ zD*fm3?V&GFYYT0QaxY_T!d}jxt?ccLC9P!wZcWpSUWL22F_D*BX)FButw#s{%fsy> zFV&^nUAP!GsZYtw`hoz0YSf9nkw06Iq{aj*I?1-&8MbqVuzBa*r>E>kR|&SL!xL_d zbE@M_UKF3B7sgLaco`?$Ee{NHR2d)No)TjZ?0~tU9NSh}2yIHSk}e+^HS3%exCC;2 zy2>qezJJ;T2U=V2*UxP{-y9n)VpNyMoN=2kOBpfJ_sbkA${>El?j*eQZ|nq-%%PpV zjDKRLc~-VA?H82G1WAB!zTZ#T@Hz85Gx*GFD8O%$)`m#mErD6tPP@L(^zuyA9Hyz` zX(muy?yhn}y`1VTwfPHXVq30uhnkF{rCJjsGxSpsM0QyF8ocI8?R=iwT9Yf1|DKE| z?u#`C(zt@fnVS>S3A_`;u}nWF-}T&1Ie6P@$jMBb$$kJ67dy}Gat8D~Okk5Wd}IGM zoIF1a|JbnaWmUGmlN?|aDfD=L9-4T>I2Z$}{e70GGyS$IiADX-cqFEqpaoxS3@+N^ zT*10uy}diPYL!F`ptx1^Ydl3dp-rT~>u&40G?~A^P^BVj>+3oDAlVAhm6-zom9AfH9Xs z--~;~5u3*_>?QVB*IWr-{h>eWvB3dLyHRhzU74s?fW#f2(Rb$}!&+G{=ldlHV$I)Z zZTgDAJ;nrms5!(_oQ@F}RX#is*weF77EP} z0AgF9hCqcRdh60-B#`YV+8;JrGs+8(U}bV&VSy z<4dj%qeB4JkHoF7&f~euyllRSC5k^|p*hqU-#TaL_4+aKAP9eCPI%grSK7*zc(uC1 zhqXH61d9p6D^_92+|Qsh>5CuoIBNOWI)(`vS0ais9W+s) z6hX+oTli$C9Zm=)I6+1@{0ny^(o&+Ox)Qzuk5YRm%z1d!K6gY-L@iS$2Fa~~=Qb5v zW=#(K#`*tI)BJgYb;$o}_~a--w+hf(^FG=dOv%B8IB0PnmoAw1;fLGTLKx3>?J%5W zbJ^LD*Vm5W650#DR`M=%Uyz~HCIZv?m!9O&|Io=R3!_8aeAyC5FxpdT9s3J0>0^eb zW=_9kCez8y^Q}P8CEGS2)vYx-Ql_?7Kq}I<(XGAv5>e-#iFS`>8nlH|UO!s}HR00T z?}4e-1B`w(x-LVCpEPfAi+Nk_~=8#*9(az#hG?+orUIXPWXG*}g@Ap%_EWfAeqCdsFZyGjl zIeWs#WR{TctSG;<7qor^DVW#0?S)fd9a^l(ZVLM~SM@Zq!V=>Hrzbzy$5__baaDt| zfp$sW#(`G_@j!|^>X-f~(d%!b7Z#>4?r#Qnf%eEWgNFm(T^OkgHvmA@69vk%CxY8C z1Ar>%qtb`$xYx)mzbNn(1_qD&f4uvGfmdjEFn8vEtM?~ z4?F0V@p_9D^0nzCe2+eGFuo)31a{L`7>=C@SfnGi#>x4GaT#eEC~X)FNlO+Vqferr z8!1fP?+QG^K81v|udCnM7*po?|D%h_MfX#K3IO}*5%}R5wn+5khkyG(RnSOKox{CS zyK}L|G9~xNWZ@JpogBZJ{3jDBf0!x5F!mV!){W#+m8*pQCi!TU;|ISW;I#)up7eQK z2%+T7$y?J8G`&mE9ZF(w^`ba$7Ffp~? zIx7qE_L$qNvKUvlULV%e2Y04Nu}-512n#eAEDl!$;Y)6Mn05AJe!!mL^X#Fu<_A1crEg^o^AkQJzipmBPshXl#OU~$h~7am z-7@&v{|psmBB; z5`Nm|2qm585&ALiA`B<|BSKuUi*e>$UkbGI8d1-?Te1}t-Sl~w zqjZ0V_u+YJ^)^vz#H()3Y~M7 zZ~1o1oC5hS=I<{tVpn88p(b;|GiVpFCW&$fH(AoYQ0@ZrXy47j0@5)bw^)9OGYen_ zu~ai(DUvZKo-#yy2Sa~7sh^yO{Ur5i^m|1K{J6=fe%`U7hwAyyDMtA8HV1b3w{fL# z4xcd=es!nRni8xApUl=i0BZm=qT92A8(QIi$F4&rY!ookJ`$-7dlFW0-s4f4E?wnv zPK2U9!xyki3{0RkZQpoB9i{iWRk`8}Ar>;ZZ%1VNzP<+Cj*0uPlQ!{MXgXC8t@~C98Gw+3kq!#8ug8JZi#0Bfw{9gX8=asM`o9ih%wtgBYyNwK|HHdUYM+E(0`&$7b3Iz7Q@^Ie0!)OA0z z>EzU3a5NRPl?pyOY6N`(Pl%R9Y!2v;{+rRn)R~`}+89bRu24gkm(dTPbxH9$nqB^n z*9eNwHHJ!O<~U>;kN>^Y4^2Dze!tHI#W05Gw{tJV0Hdk$RuG3*aXyKyq;TnPPE+b# z`5Y&bS4S55Z@!72;)2h=Pp8SmiYJeo?F17$^r=7~{4g`hOM7We#b})ub>y*b zEag_$d$N*hCHNSCA@n^m3)`uBh+ybGdw`9^@>40?!mLWRjd`VNbwVjYly_9*{Bdv9 zZ4jd5JwM^W#T*j73@ux&b?Y%nLHMRHQYIrKcO{=1RFCOoW}UCKJO%s& z{I2mw2+eE;X$o1^YL_=upkU>!3)Xr1=TwEK;`|g7{zXm?w?TYU0n>K69C#Y%N;?co z4Dj$mAscagq|b`@?OU=bW-ziVo4VUQBfB(5CeP^SB0`Y7aG`5d;7n^z!Rr?Fze3!* zzktXsFZhST5e2Y;6an=O0t;SH+N9|Nx#K-&tjg#?AcMi0i?}VpkoMKnS zDtQdf4x^_};t&rRiS3tNAut@=7a{#T{=8Zmhhc)j$%(PDr(R1kj~-6oKLm9kbDSXK zg`4Y_D z{qec8aZUFa?ukR*XR|ZaS$!IGp7u(9#P~-z})?L76gc$dxY|JJ5}62w9f==DVWH( z`~*d{BUX>|`Cs#$$?&%~sz;lW1ObT?7pw#-#ZO4ZDV6C>H;GGBD@cWr^W0ujqs8A9 zz#2g$9-Hire(Ry=h3`{$3Hipa2L(?}NS`Ou3f|b?S-4{Z&VAk!VSMlMJQOhVMg1rP z8I|*mP)@v2&l^oI#-}T5VK+l1}_w>&`PY(k=U#F+2M0U(GqqLSSm}?Vm;; zC(Lx`8{G|d7DUZ^b$dd;sF^xkn!FiHdpm+Zfhs`*&Ft5^+Y=%YGP@4tbNV%$^vPR} zd%j3>o5F!{6zVMOy$>=%MGWkkhWh%eTTA-EpKWLqRwK;CP4bxm1k)L|I7JRDev+^X zFm6+Dcfl!WRT|6R{i`Z(2p`BP*U@?rMuPD-Zqe&BnDv&|%_nc2%a!=PD6;ME@BluF zy*5$O&o(|OGL|b_wnpL=9X_eutpRDDWpW>(Tt5c85GT{bN-%yJRFj(+MwJg2YJ>+Tut?wD{cJ z&(BYO%j|S+&;WIEbqHsW(ZAI#E(=~H3|{Da%Rfecj)IzS;2+h1Wjx>r*0J@ODLOx76VL2DTt<^*e z`Z}+-Jb7Cp`J^`aKOVemQzG(=#1|jImbh@;VZ#F;q+F;Ju5?+i2v1~ByPX~`zwv0vt{RbjA?c0 zcneti_R8F>={xrR#Ii2a%Swj-sNwsisoKudqYLaqM9aQ2QrX92@a zK?#k1JTLawTqCTTugG){9@JSN21%|H@8NLeRnYa(8X}{{Q$%P%v(gs3ikuZZe`S+_ zhK<{w=v0tU6d!!{TFdvP z{}&sNr+l5Pi!cv^TJ|@JU)|$No4O?)*RcPwlcQFiye&p&9!|kqK1UK~#IVGHKit2# zFN8-0Z^zqhuZIDr4jWHbn==7@3X^4f&QRZOciHx(e)yrf35t@3fC_5?;&I$wMK&c8 zP3rhk{a6Vs*yzph7TtV*U>=8BtzlQ&vhq`FQ{#;Hn&^3AeIHAl03~H+v&RDqJF3~tNf4{?0j^{Mh)OUC@#6U0x( zz`WeGrJNDGp!M_AuXdXigXGwsOwyYZ9DQ z@mB-*@B~jPYWRL@*mL{bj_>m7o1va}IFthv>Cf-J-?H_(Vr3*I)e{l_esmJf`CJ$a zivN??OMUp1XY!$*uDQ0+2rK?d?Ogu&sZBV^k1wQKV926&SfViE*k^;QmOZ-^EPR@z z@^Q6F7@Zf3>G^iL-{H>#Wvc`V(FRTdVA-hA=NF*9e$Yn2Ujv8nZkLuT#@{Voj}sL^ rV(auLAdx{jiqpRT_i+~U`tIVIvO Date: Wed, 12 Jun 2024 20:12:53 -0400 Subject: [PATCH 26/27] Update Forge to 49.1.0 --- gradle.properties | 2 +- src/main/java/com/veteam/voluminousenergy/tools/Config.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5f13a3013..04ac5c5fb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ jei_version=17.3.0.47 minecraft_version_range=[1.20.4,1.21) # The Forge version must agree with the Minecraft version to get a valid artifact -forge_version=49.0.27 +forge_version=49.1.0 # The Forge version range can use any version of Forge as bounds or match the loader version range forge_version_range=[49.0.27,) # The loader version range can only use the major version of Forge/FML as bounds diff --git a/src/main/java/com/veteam/voluminousenergy/tools/Config.java b/src/main/java/com/veteam/voluminousenergy/tools/Config.java index eadbab7c7..745fa04cb 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/Config.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/Config.java @@ -65,8 +65,8 @@ public class Config { // Food Settings public static ForgeConfigSpec.IntValue COOKED_RICE_NUTRITION; - public static ForgeConfigSpec.DoubleValue COOKED_RICE_SATURATION; - public static ForgeConfigSpec.DoubleValue RICE_TICK_CHANCE; + public static ForgeConfigSpec.FloatValue COOKED_RICE_SATURATION; + public static ForgeConfigSpec.FloatValue RICE_TICK_CHANCE; // Ore Settings @@ -78,7 +78,7 @@ public class Config { // General Settings public static ForgeConfigSpec.BooleanValue ALLOW_EXTRACTION_FROM_INPUT_TANKS; - public static ForgeConfigSpec.DoubleValue ACID_DAMAGE; + public static ForgeConfigSpec.FloatValue ACID_DAMAGE; public static ForgeConfigSpec.IntValue ACID_FIRE_DURATION; public static ForgeConfigSpec.IntValue SOLARIUM_PROTECTIVE_SHEATH_HITS; public static ForgeConfigSpec.DoubleValue SOLARIUM_SHEATH_REGENERATION_CHANCE; From 9b8a0dff1fbdcf432faee9e702d6b956201a0eb4 Mon Sep 17 00:00:00 2001 From: MikeTheShadow Date: Mon, 17 Jun 2024 22:02:12 -0400 Subject: [PATCH 27/27] Updated DimensionalLaserRecipeProcessor updated LaserBlockEntityRenderer. Fixed bug with crusher. --- .../entity/LaserBlockEntityRenderer.java | 51 ++++++++++++++++--- .../DimensionalLaserRecipeProcessor.java | 18 +++++-- .../organics/{grass.json => short_grass.json} | 2 +- .../recipes/crushing/organics/tall_grass.json | 2 +- .../shrubbery/grass.json | 4 +- 5 files changed, 63 insertions(+), 14 deletions(-) rename src/main/resources/data/voluminousenergy/recipes/crushing/organics/{grass.json => short_grass.json} (87%) diff --git a/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java b/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java index cb6779f5d..da3feb4af 100644 --- a/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java +++ b/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java @@ -47,7 +47,8 @@ public void render(VETileEntity dimensionalLaserTile, float f1, @NotNull PoseSta public void renderBeaconBeam(VETileEntity tile, PoseStack poseStack, MultiBufferSource multiBufferSource, float p_112188_, long gameTime, int totalHeight, int beaconListSize, float[] beaconColor, int height) { - int buildTick = tile.getData("build_tick"); + int staticBuildTick = tile.getData("build_tick"); + int buildTick = staticBuildTick; boolean fullyBuilt = buildTick == 1000; boolean firstStageBuilt = buildTick >= 400; @@ -58,8 +59,8 @@ public void renderBeaconBeam(VETileEntity tile, PoseStack poseStack, MultiBuffer if (!firstStageBuilt) { height = 1; } + SoundManager manager = Minecraft.getInstance().getSoundManager(); if (buildTick == 0) { - SoundManager manager = Minecraft.getInstance().getSoundManager(); manager.stop(VESounds.ENERGY_BEAM_ACTIVATE.getLocation(), SoundSource.BLOCKS); } @@ -90,6 +91,44 @@ public void renderBeaconBeam(VETileEntity tile, PoseStack poseStack, MultiBuffer PoseStack.Pose pose = poseStack.last(); Matrix4f matrix4f = pose.pose(); + float pylonBeamHeight = 4.5f; + float xzPos = 3.4f; + float yHeight = -1.85f; + + // The 4 laser beams + if (staticBuildTick > 50) { + poseStack.pushPose(); + poseStack.translate(xzPos, yHeight, 0); + poseStack.mulPose(Axis.ZP.rotationDegrees(45.0F)); + poseStack.mulPose(Axis.YP.rotationDegrees(45.0F)); + renderPart(poseStack, multiBufferSource.getBuffer(RenderType.energySwirl(BEAM_RESOURCE_LOCATION, 0, 0)), 5, 5, 5, 1.0F, totalHeight, pylonBeamHeight, 0.0F, static02F, static02F, 0.0F, f9, 0.0F, 0.0F, f12, f16, f15); + poseStack.popPose(); + } + if(staticBuildTick > 150) { + poseStack.pushPose(); + poseStack.translate(0, yHeight, -xzPos); + poseStack.mulPose(Axis.XP.rotationDegrees(45.0F)); + poseStack.mulPose(Axis.YP.rotationDegrees(45.0F)); + renderPart(poseStack, multiBufferSource.getBuffer(RenderType.energySwirl(BEAM_RESOURCE_LOCATION, 0, 0)), 5, 5, 5, 1.0F, totalHeight, pylonBeamHeight, 0.0F, static02F, static02F, 0.0F, f9, 0.0F, 0.0F, f12, f16, f15); + poseStack.popPose(); + } + if(staticBuildTick > 250) { + poseStack.pushPose(); + poseStack.translate(-xzPos, yHeight, 0); + poseStack.mulPose(Axis.ZP.rotationDegrees(135.0F)); + poseStack.mulPose(Axis.YP.rotationDegrees(45.0F)); + renderPart(poseStack, multiBufferSource.getBuffer(RenderType.energySwirl(BEAM_RESOURCE_LOCATION, 0, 0)), 5, 5, 5, 1.0F, totalHeight, -pylonBeamHeight, 0.0F, static02F, static02F, 0.0F, f9, 0.0F, 0.0F, f12, f16, f15); + poseStack.popPose(); + } + if(staticBuildTick > 350) { + poseStack.pushPose(); + poseStack.translate(0, yHeight, xzPos); + poseStack.mulPose(Axis.XP.rotationDegrees(135.0F)); + poseStack.mulPose(Axis.YP.rotationDegrees(45.0F)); + renderPart(poseStack, multiBufferSource.getBuffer(RenderType.energySwirl(BEAM_RESOURCE_LOCATION, 0, 0)), 5, 5, 5, 1.0F, totalHeight, -pylonBeamHeight, 0.0F, static02F, static02F, 0.0F, f9, 0.0F, 0.0F, f12, f16, f15); + poseStack.popPose(); + } + if (!firstStageBuilt) { poseStack.popPose(); return; @@ -249,7 +288,7 @@ public boolean shouldRender(@NotNull VETileEntity veTileEntity, @NotNull Vec3 ve {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, }; - private static void renderPart(PoseStack poseStack, VertexConsumer vertexConsumer, float beaconColorR, float beaconColorG, float beaconColorB, float static0P3F, int totalHeight, int height, float f6, float f7, float nfloat1, float f8, float nfloat2, float nfloat3, float nfloat4, float nfloat5, float f16, float f15) { + private static void renderPart(PoseStack poseStack, VertexConsumer vertexConsumer, float beaconColorR, float beaconColorG, float beaconColorB, float static0P3F, int totalHeight, float height, float f6, float f7, float nfloat1, float f8, float nfloat2, float nfloat3, float nfloat4, float nfloat5, float f16, float f15) { PoseStack.Pose pose = poseStack.last(); Matrix4f matrix4f = pose.pose(); Matrix3f matrix3f = pose.normal(); @@ -259,15 +298,15 @@ private static void renderPart(PoseStack poseStack, VertexConsumer vertexConsume renderQuad(matrix4f, matrix3f, vertexConsumer, beaconColorR, beaconColorG, beaconColorB, static0P3F, totalHeight, height, nfloat2, nfloat3, f6, f7, (float) 0.0, (float) 1.0, f16, f15); } - private static void renderQuad(Matrix4f matrix4f, Matrix3f matrix3f, VertexConsumer vertexConsumer, float beaconColorR, float beaconColorG, float beaconColorB, float staticOP3F, int totalHeight, int height, float point1x, float point1z, float point2x, float point2z, float patternRepeatHorizontalPositive, float patternRepeatHorizontalNegative, float patternLocationYNegative, float patternLocationYNegative2) { + private static void renderQuad(Matrix4f matrix4f, Matrix3f matrix3f, VertexConsumer vertexConsumer, float beaconColorR, float beaconColorG, float beaconColorB, float staticOP3F, int totalHeight, float height, float point1x, float point1z, float point2x, float point2z, float patternRepeatHorizontalPositive, float patternRepeatHorizontalNegative, float patternLocationYNegative, float patternLocationYNegative2) { addVertex(matrix4f, matrix3f, vertexConsumer, beaconColorR, beaconColorG, beaconColorB, staticOP3F, height, point1x, point1z, patternRepeatHorizontalNegative, patternLocationYNegative); addVertex(matrix4f, matrix3f, vertexConsumer, beaconColorR, beaconColorG, beaconColorB, staticOP3F, totalHeight, point1x, point1z, patternRepeatHorizontalNegative, patternLocationYNegative2); addVertex(matrix4f, matrix3f, vertexConsumer, beaconColorR, beaconColorG, beaconColorB, staticOP3F, totalHeight, point2x, point2z, patternRepeatHorizontalPositive, patternLocationYNegative2); addVertex(matrix4f, matrix3f, vertexConsumer, beaconColorR, beaconColorG, beaconColorB, staticOP3F, height, point2x, point2z, patternRepeatHorizontalPositive, patternLocationYNegative); } - private static void addVertex(Matrix4f matrix4f, Matrix3f matrix3f, VertexConsumer vertexConsumer, float beaconColorR, float beaconColorG, float beaconColorB, float staticOP3F, int heightOrTotalHeight, float xPos, float zPos, float patternRepeat, float patternRepeat2) { - vertexConsumer.vertex(matrix4f, xPos, (float) heightOrTotalHeight, zPos).color(beaconColorR, beaconColorG, beaconColorB, staticOP3F).uv(patternRepeat, patternRepeat2).overlayCoords(OverlayTexture.NO_OVERLAY).uv2(15728880).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex(); + private static void addVertex(Matrix4f matrix4f, Matrix3f matrix3f, VertexConsumer vertexConsumer, float beaconColorR, float beaconColorG, float beaconColorB, float staticOP3F, float heightOrTotalHeight, float xPos, float zPos, float patternRepeat, float patternRepeat2) { + vertexConsumer.vertex(matrix4f, xPos, heightOrTotalHeight, zPos).color(beaconColorR, beaconColorG, beaconColorB, staticOP3F).uv(patternRepeat, patternRepeat2).overlayCoords(OverlayTexture.NO_OVERLAY).uv2(15728880).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex(); } static int scale = 4; diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java index 107704f58..ddc8fc0a3 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java @@ -11,6 +11,7 @@ import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerPlayer; +import net.minecraft.sounds.SoundEvents; import net.minecraft.sounds.SoundSource; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.LightningBolt; @@ -39,7 +40,7 @@ public void processRecipe(VETileEntity tile) { int buildTick = tile.getData("build_tick"); if (buildTick != 1000) { - + tile.setChanged(); if(buildTick == 999) { int x = tile.getBlockPos().getX(); int y = tile.getBlockPos().getY(); @@ -49,6 +50,14 @@ public void processRecipe(VETileEntity tile) { } } + // Pylon audio + switch (buildTick) { + case 50, + 150, + 250, + 350 -> tile.getLevel().playSound(null, tile.getBlockPos(), SoundEvents.BEACON_ACTIVATE , SoundSource.BLOCKS, 1.0F, 1.0F); + } + if (buildTick == 1) { tile.getLevel().playSound(null, tile.getBlockPos(), VESounds.ENERGY_BEAM_ACTIVATE, SoundSource.BLOCKS, 1.0F, 1.0F); } @@ -69,14 +78,15 @@ public void processRecipe(VETileEntity tile) { lightningBolt.setVisualOnly(true); lightningBolt.setPos(blockPos.getX(), blockPos.getY(), blockPos.getZ()); tile.getLevel().addFreshEntity(lightningBolt); - } } + // if (!tile.canConsumeEnergy()) { // buildTick = 0; // } else { // tile.consumeEnergy(); // } + tile.setChanged(); tile.setData("build_tick", buildTick + 1); return; } @@ -139,8 +149,8 @@ public boolean isMultiBlockValid(VETileEntity tile) { lastReading = true; // Tweak box based on direction -- This is the search range to ensure this is a valid multiblock before operation for (final BlockPos blockPos : BlockPos.betweenClosed( - tile.getBlockPos().offset(-1, -3, -1), - tile.getBlockPos().offset(1, -1, 1))) { + tile.getBlockPos().offset(0, -3, 0), + tile.getBlockPos().offset(0, -1, 0))) { final BlockState blockState = tile.getLevel().getBlockState(blockPos); diff --git a/src/main/resources/data/voluminousenergy/recipes/crushing/organics/grass.json b/src/main/resources/data/voluminousenergy/recipes/crushing/organics/short_grass.json similarity index 87% rename from src/main/resources/data/voluminousenergy/recipes/crushing/organics/grass.json rename to src/main/resources/data/voluminousenergy/recipes/crushing/organics/short_grass.json index c891ef229..e37103a34 100644 --- a/src/main/resources/data/voluminousenergy/recipes/crushing/organics/grass.json +++ b/src/main/resources/data/voluminousenergy/recipes/crushing/organics/short_grass.json @@ -2,7 +2,7 @@ "type": "voluminousenergy:crushing", "ingredients": [ { - "item": "minecraft:grass", + "item": "minecraft:short_grass", "count": 1 } ], diff --git a/src/main/resources/data/voluminousenergy/recipes/crushing/organics/tall_grass.json b/src/main/resources/data/voluminousenergy/recipes/crushing/organics/tall_grass.json index c4c11810b..1291ed69a 100644 --- a/src/main/resources/data/voluminousenergy/recipes/crushing/organics/tall_grass.json +++ b/src/main/resources/data/voluminousenergy/recipes/crushing/organics/tall_grass.json @@ -13,7 +13,7 @@ "count": 2 }, { - "item": "minecraft:grass", + "item": "minecraft:short_grass", "count": 1, "chance": 0.75 } diff --git a/src/main/resources/data/voluminousenergy/recipes/hydroponic_incubating/shrubbery/grass.json b/src/main/resources/data/voluminousenergy/recipes/hydroponic_incubating/shrubbery/grass.json index 1259afbf9..aaed1b67a 100644 --- a/src/main/resources/data/voluminousenergy/recipes/hydroponic_incubating/shrubbery/grass.json +++ b/src/main/resources/data/voluminousenergy/recipes/hydroponic_incubating/shrubbery/grass.json @@ -3,7 +3,7 @@ "process_time": 200, "ingredients": [ { - "item": "minecraft:grass", + "item": "minecraft:short_grass", "count": 1 } ], @@ -15,7 +15,7 @@ ], "item_results": [ { - "item": "minecraft:grass", + "item": "minecraft:short_grass", "count": 9 }, {