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/VoluminousEnergy.java b/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java index 023d7bbc5..490705b80 100644 --- a/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java +++ b/src/main/java/com/veteam/voluminousenergy/VoluminousEnergy.java @@ -69,6 +69,7 @@ public class VoluminousEnergy { VoluminousEnergy voluminousEnergy = new VoluminousEnergy(); voluminousEnergy.init(); } + public void init() { ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, Config.COMMON_CONFIG); @@ -124,7 +125,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 @@ -133,10 +134,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); @@ -174,10 +174,10 @@ 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){ + private void setupWhenLoadingComplete(final FMLLoadCompleteEvent event) { } public static MinecraftServer server; @@ -194,9 +194,9 @@ 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.SAWMILL.block().get(), RenderType.cutout())); event.enqueueWork(() -> ItemBlockRenderTypes.setRenderLayer(VEBlocks.PRESSURE_LADDER.get(), RenderType.cutout())); } @@ -206,12 +206,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 9763cce77..226c187ff 100644 --- a/src/main/java/com/veteam/voluminousenergy/achievements/triggers/VECriteriaTriggers.java +++ b/src/main/java/com/veteam/voluminousenergy/achievements/triggers/VECriteriaTriggers.java @@ -2,14 +2,13 @@ import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.advancements.CriterionTrigger; -import net.minecraft.advancements.critereon.ConstructBeaconTrigger; 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 8649afe98..8c22f774e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/DimensionalLaserBlock.java @@ -1,28 +1,27 @@ package com.veteam.voluminousenergy.blocks.blocks; -import com.veteam.voluminousenergy.blocks.tiles.DimensionalLaserTile; +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.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.sounds.SoundSource; 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.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 net.minecraft.world.phys.BlockHitResult; +import org.jetbrains.annotations.NotNull; 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() @@ -36,38 +35,25 @@ 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) { - return createTicker(level, blockEntityType, VEBlocks.DIMENSIONAL_LASER_TILE.get()); + 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; + 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; } - return InteractionResult.SUCCESS; + super.destroy(levelAccessor, blockPos, blockState); } } 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 d42b14757..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,425 +12,393 @@ 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.tank.*; -import com.veteam.voluminousenergy.blocks.tiles.*; -import com.veteam.voluminousenergy.blocks.tiles.tank.*; +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; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntities; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +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; +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; 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 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", () -> - IForgeMenuType.create((id, inv, data)-> { - BlockPos pos = data.readBlockPos(); - return new PrimitiveBlastFurnaceContainer(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(PrimitiveStirlingGeneratorTile::new,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 new PrimitiveStirlingGeneratorContainer(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(CrusherTile::new,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 new CrusherContainer(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(ElectrolyzerTile::new,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 new ElectrolyzerContainer(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(CentrifugalAgitatorTile::new,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 new CentrifugalAgitatorContainer(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(CompressorTile::new,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 new CompressorContainer(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(StirlingGeneratorTile::new,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 new StirlingGeneratorContainer(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(CombustionGeneratorTile::new,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 new CombustionGeneratorContainer(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(AqueoulizerTile::new,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 new AqueoulizerContainer(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(AirCompressorTile::new,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 new AirCompressorContainer(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(DistillationUnitTile::new,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 new DistillationUnitContainer(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(PumpTile::new,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 new PumpContainer(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(GasFiredFurnaceTile::new,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 new GasFiredFurnaceContainer(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(ElectricFurnaceTile::new,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 new ElectricFurnaceContainer(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(BatteryBoxTile::new,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 new BatteryBoxContainer(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(PrimitiveSolarPanelTile::new,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 new PrimitiveSolarPanelContainer(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(SolarPanelTile::new,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 new SolarPanelContainer(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(CentrifugalSeparatorTile::new,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 new CentrifugalSeparatorContainer(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(ImplosionCompressorTile::new,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 new ImplosionCompressorContainer(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(BlastFurnaceTile::new,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 new BlastFurnaceContainer(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(ToolingStationTile::new,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(SawmillTile::new,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 new SawmillContainer(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(DimensionalLaserTile::new,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 new DimensionalLaserContainer(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(FluidElectrolyzerTile::new,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 new FluidElectrolyzerContainer(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(FluidMixerTile::new,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 new FluidMixerContainer(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(HydroponicIncubatorTile::new,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 new HydroponicIncubatorContainer(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); + + // 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 = 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 PRESSURE_LADDER = VE_BLOCKS_REGISTRY.register("pressure_ladder", PressureLadder::new); + public static RegistryObject RAW_BONE_BLOCK = registerWithBlockItemSupport("raw_bone_block", RawBoneBlock::new); // Unused + + public static RegistryObject PRESSURE_LADDER = registerWithBlockItemSupport("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 = 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, () -> + 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; + } + } + + 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/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 7eaf32bad..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 @@ -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,12 +30,12 @@ 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 @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 61388724d..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 @@ -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,11 +31,11 @@ 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 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 baa0162bd..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 @@ -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,12 +31,12 @@ 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 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 10661c8ec..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 @@ -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,11 +31,11 @@ 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 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 5dedc0de4..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 @@ -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,11 +31,11 @@ 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 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 975538e0e..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 @@ -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,11 +31,11 @@ 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 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 2d07382d3..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 @@ -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,12 +30,12 @@ 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 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 ed3e0978b..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 @@ -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,11 +30,11 @@ 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 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 32e48c9a1..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 @@ -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.datagen.VETagDataGenerator; import net.minecraft.core.BlockPos; import net.minecraft.world.level.Level; @@ -31,17 +31,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..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 @@ -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,11 +31,11 @@ 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 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 a5f56885a..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 @@ -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,11 +31,11 @@ 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 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 b26cfbd15..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 @@ -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,12 +31,12 @@ 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 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 f1489beb6..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 @@ -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,11 +31,11 @@ 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 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 1a39ce342..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 @@ -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,11 +30,11 @@ 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 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 7360661c0..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 @@ -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,11 +32,11 @@ 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 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 d0ae7b2af..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 @@ -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,11 +30,11 @@ 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 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 6830466ef..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 @@ -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,11 +30,11 @@ 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 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/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/machines/PrimitiveBlastFurnaceBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/PrimitiveBlastFurnaceBlock.java index a820bcc7a..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 @@ -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,12 +37,12 @@ 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 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 8dec76479..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 @@ -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,11 +30,11 @@ 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 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 d3daf7091..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 @@ -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,11 +32,11 @@ 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 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 a9c281ce4..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 @@ -1,28 +1,21 @@ 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; -public class PumpBlock extends FaceableBlock implements EntityBlock { +public class PumpBlock extends VEFaceableMachineBlock { public PumpBlock() { super(Block.Properties.of() .sound(SoundType.METAL) @@ -36,37 +29,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; + public BlockEntityTicker getTicker(@NotNull Level level, @NotNull BlockState state, @NotNull BlockEntityType blockEntityType) { + return createTicker(level, blockEntityType, VEBlocks.PUMP.tile().get()); } @Nullable - public BlockEntityTicker getTicker(Level level, BlockState state, BlockEntityType blockEntityType) { - return createTicker(level, blockEntityType, VEBlocks.PUMP_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; + 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/SawmillBlock.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/machines/SawmillBlock.java index 19a34adf3..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 @@ -2,7 +2,8 @@ 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; import net.minecraft.core.Direction; @@ -74,22 +75,22 @@ 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); + 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.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 2752e5da5..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 @@ -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.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.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; @@ -38,11 +30,11 @@ 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 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 1f494ff4d..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 @@ -1,27 +1,19 @@ 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.StirlingGeneratorTile; +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.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) @@ -37,36 +29,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; - + 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 693c1beae..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 @@ -2,7 +2,8 @@ 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; import net.minecraft.server.level.ServerPlayer; @@ -38,22 +39,22 @@ 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); + 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.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/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/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/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 ff63cebe5..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 @@ -6,18 +6,16 @@ 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; 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); @@ -29,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/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/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/blocks/util/VEItemStackWithFluidHandler.java index c31dcac98..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 @@ -1,9 +1,9 @@ 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.RelationalTank; 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; @@ -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 VERecipe 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; } @@ -45,11 +45,10 @@ public boolean isItemValid(int slot, @NotNull ItemStack stack) { if (slot == upgradeSlot) return TagUtil.isTaggedMachineUpgradeItem(stack); - return false; } - public RelationalTank[] getRelationalTanks() { + public VERelationalTank[] getRelationalTanks() { return relationalTanks; } 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/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/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/ToolingStationContainer.java b/src/main/java/com/veteam/voluminousenergy/blocks/containers/ToolingStationContainer.java index b39d61bff..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 @@ -66,22 +65,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 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 + 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 +91,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 +109,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 83a82aeec..4897434e8 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainer.java @@ -1,9 +1,10 @@ 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; +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; @@ -46,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); @@ -55,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) { } @@ -85,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++; @@ -102,41 +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){ - 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; + public int powerScreen(int px) { + int stored = tileEntity.getEnergy().getEnergyStored(); + int max = tileEntity.getEnergy().getMaxEnergyStored(); + return (((stored * 100 / max * 100) / 100) * px) / 100; } - public ItemStack handleCoreQuickMoveStackLogicWithUpgradeSlot(final int index, final int containerSlots, final int upgradeSlotId, ItemStack slotStack){ + // 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)) { 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; @@ -147,34 +156,35 @@ 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(){ - if (tileEntity instanceof IVEPoweredTileEntity){ - return ((IVEPoweredTileEntity) tileEntity).getUpgradeSlotId(); + public int 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; @@ -186,16 +196,17 @@ public ItemStack quickMoveStack(final @NotNull Player player, final int index) { ItemStack returnStack = ItemStack.EMPTY; final Slot slot = this.slots.get(index); - 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(); returnStack = slotStack.copy(); - if (handleItemMove(index, numberOfSlots, slotStack,index) != null) + if (handleItemMove(index, numberOfSlots, slotStack, index) != null) return ItemStack.EMPTY; if (slotStack.getCount() == 0) { @@ -213,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; } @@ -232,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 instanceof IVEPoweredTileEntity ivePoweredTileEntity) powerId = ivePoweredTileEntity.getUpgradeSlotId(); + if (tileEntity.getEnergy() != null) powerId = tileEntity.getEnergy().getUpgradeSlotId(); if (stackToMove.isStackable()) { while (!stackToMove.isEmpty()) { if (currentPos >= endPos) { @@ -244,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; @@ -286,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 new file mode 100644 index 000000000..8fabd314f --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainerFactory.java @@ -0,0 +1,127 @@ +package com.veteam.voluminousenergy.blocks.containers; + +import com.veteam.voluminousenergy.VoluminousEnergy; +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; +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; +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<>(); + + 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 + protected void addSlotsToGUI(IItemHandler h) { + List slots = VEContainerFactory.this.slots; + + int energySlotId = -1; + + if (this.tileEntity.getEnergy() != null) { + energySlotId = this.tileEntity.getEnergy().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."); + 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)); + } + } + }; + } + + 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; + + public VEContainerFactoryBuilder create(RegistryObject> menuRegistry, RegistryObject blockRegistry) { + this.factory = new VEContainerFactory(); + this.factory.menuTypeRegistryObject = menuRegistry; + this.factory.block = blockRegistry; + return this; + } + + private int index = 0; + + 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; + } + + public VEContainerFactory build() { + return this.factory; + } + } + + 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 new file mode 100644 index 000000000..67bc0cd1f --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/containers/VEContainers.java @@ -0,0 +1,265 @@ +package com.veteam.voluminousenergy.blocks.containers; + +import com.veteam.voluminousenergy.blocks.containers.VEContainerFactory.VEContainerFactoryBuilder; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.*; + +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(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()) + .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(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 slot + .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from heat tank + .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() + .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(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 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 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 + .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, 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(); + + 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 + .addUpgradeSlot(154, -14) //Upgrade slot + .build(); + + public static final VEContainerFactory CRUSHER_FACTORY = new VEContainerFactoryBuilder() + .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 + .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 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 slot + .addSlot(38, 49, new BucketOutputSlot(DOWN)) // Extract fluid from input + .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 + .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(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(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, 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 + .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 + .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(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, 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, 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()) + .build(); + + public static final VEContainerFactory PRIMITIVE_STIRLING_GENERATOR_FACTORY = new VEContainerFactoryBuilder() + .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()) + .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(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() + .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(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(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(); + + 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 6cb3cc5d6..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 c72b8a2d7..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 20e0b9951..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 14fc5baef..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 b4e4aac22..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 94bd0b57f..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 - protected 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 9da351c69..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/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 7699fbf08..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 @@ -7,16 +7,16 @@ 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){ + 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 b2b7a00a1..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 @@ -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 8cd29766a..97fe3f30b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AirCompressorScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.AirCompressorContainer; -import com.veteam.voluminousenergy.blocks.tiles.AirCompressorTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -12,36 +12,37 @@ 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 { +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(AirCompressorContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (AirCompressorTile) screenContainer.getTileEntity(); + 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); } @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); @@ -50,7 +51,7 @@ protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { } @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); @@ -61,14 +62,12 @@ 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 - String name = tileEntity.getAirTankFluid().getTranslationKey(); - int amount = tileEntity.getAirTankFluid().getAmount(); + 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); } @@ -83,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); @@ -95,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.getAirTankFluid(),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 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/AqueoulizerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java index d3d85bc0a..14f4982ea 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/AqueoulizerScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.AqueoulizerContainer; -import com.veteam.voluminousenergy.blocks.tiles.AqueoulizerTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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,15 +19,15 @@ import java.util.Arrays; import java.util.List; -public class AqueoulizerScreen extends VEContainerScreen { - private final AqueoulizerTile tileEntity; +public class AqueoulizerScreen extends VEContainerScreen { + 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(AqueoulizerContainer screenContainer, Inventory inv, Component titleIn) { + public AqueoulizerScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (AqueoulizerTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -45,18 +45,18 @@ protected void init() { } @Override - protected void renderLabels(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); + 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); 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 5093a2a46..fcb8063cc 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BatteryBoxScreen.java @@ -2,10 +2,9 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.BatteryBoxContainer; -import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -19,123 +18,102 @@ 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 { +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(BatteryBoxContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (BatteryBoxTile) screenContainer.getTileEntity(); + + public BatteryBoxScreen(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 - 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(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 -> { + })); } @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(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); + 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); } @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); // 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); } @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)){ - 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.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); } } - 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: @@ -147,28 +125,15 @@ 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()); - } - 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()); } } - 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 c34a31368..594976884 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/BlastFurnaceScreen.java @@ -2,8 +2,9 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.BlastFurnaceContainer; -import com.veteam.voluminousenergy.blocks.tiles.BlastFurnaceTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -13,46 +14,55 @@ 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; import java.util.List; -public class BlastFurnaceScreen extends VEContainerScreen { - private BlastFurnaceTile tileEntity; +public class BlastFurnaceScreen extends VEContainerScreen { + 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(BlastFurnaceContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (BlastFurnaceTile) screenContainer.getTileEntity(); + 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 - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { - if (tileEntity.getMultiblockValidity()){ - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("blast_furnace"), 8, 6, WHITE_TEXT_STYLE); + 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("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.getTemperatureKelvin() + " K (" + - tileEntity.getTemperatureCelsius() + " \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.getTemperatureFahrenheit() + " \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); @@ -61,11 +71,11 @@ protected void renderLabels(GuiGraphics matrixStack,int mouseX, int 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")), 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); @@ -73,22 +83,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)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, 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() { @@ -102,15 +110,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 && tileEntity.getMultiblockValidity()){ - int progress = tileEntity.progressCounterPX(9); + 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); /*Note for this.blit below: @@ -121,23 +129,35 @@ 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 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); } 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); } } + 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/screens/CentrifugalAgitatorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java index 5d5590423..1e9d476f0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalAgitatorScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.CentrifugalAgitatorContainer; -import com.veteam.voluminousenergy.blocks.tiles.CentrifugalAgitatorTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -13,31 +13,32 @@ 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; -public class CentrifugalAgitatorScreen extends VEContainerScreen { - private final CentrifugalAgitatorTile tileEntity; +public class CentrifugalAgitatorScreen extends VEContainerScreen { + 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(CentrifugalAgitatorContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (CentrifugalAgitatorTile) screenContainer.getTileEntity(); + + public CentrifugalAgitatorScreen(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(tileEntity); @@ -45,9 +46,9 @@ protected void init(){ } @Override - protected void renderLabels(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); + 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); } @@ -63,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() { @@ -104,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: @@ -123,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 a96715850..624d13020 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CentrifugalSeparatorScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.CentrifugalSeparatorContainer; -import com.veteam.voluminousenergy.blocks.tiles.CentrifugalSeparatorTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -12,63 +12,62 @@ 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; -public class CentrifugalSeparatorScreen extends VEContainerScreen { - private CentrifugalSeparatorTile tileEntity; +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(CentrifugalSeparatorContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (CentrifugalSeparatorTile) screenContainer.getTileEntity(); + + 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(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); + 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); } @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)) { - 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); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -82,15 +81,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: p_blit_1_ = starting x for blit on screen @@ -100,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 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); } } \ No newline at end of file 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..ce831e535 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CombustionGeneratorScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.CombustionGeneratorContainer; -import com.veteam.voluminousenergy.blocks.tiles.CombustionGeneratorTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -14,79 +14,78 @@ 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; -public class CombustionGeneratorScreen extends VEContainerScreen { - private CombustionGeneratorTile tileEntity; +public class CombustionGeneratorScreen extends VEContainerScreen { + 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(CombustionGeneratorContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (CombustionGeneratorTile) screenContainer.getTileEntity(); + + public CombustionGeneratorScreen(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 -18); + renderIOMenu(this.tileEntity, 64 + (this.width / 2), this.topPos - 18); } @Override - protected void renderLabels(GuiGraphics matrixStack,int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("combustion_generator"), 8, 6, WHITE_TEXT_STYLE); + 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); + 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); } @@ -101,19 +100,19 @@ 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 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.progressBurnCounterPX(14); int power = menu.powerScreen(49); /*Note for this.blit below: @@ -124,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 85030cb7a..4e55ae4bc 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CompressorScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.CompressorContainer; -import com.veteam.voluminousenergy.blocks.tiles.CompressorTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -12,61 +12,60 @@ 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; -public class CompressorScreen extends VEContainerScreen { +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(CompressorContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (CompressorTile) screenContainer.getTileEntity(); + + 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(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); + 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); } @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)) { - 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); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -80,15 +79,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: @@ -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 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); } } \ 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 eca5b2522..55ec5ef22 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/CrusherScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.CrusherContainer; -import com.veteam.voluminousenergy.blocks.tiles.CrusherTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -12,62 +12,60 @@ 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; -public class CrusherScreen extends VEContainerScreen { - private final CrusherTile tileEntity; +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(CrusherContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (CrusherTile) screenContainer.getTileEntity(); + + public CrusherScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { + super(screenContainer, inv, titleIn); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @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(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); + 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); } @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)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, 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() { @@ -81,15 +79,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, 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: @@ -100,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 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); } 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 a27ddaba1..f4341730c 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DimensionalLaserScreen.java @@ -2,14 +2,16 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.DimensionalLaserContainer; -import com.veteam.voluminousenergy.blocks.tiles.DimensionalLaserTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -19,20 +21,21 @@ 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; -public class DimensionalLaserScreen extends VEContainerScreen { - private final DimensionalLaserTile tileEntity; +public class DimensionalLaserScreen extends VEContainerScreen { + 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"); - public DimensionalLaserScreen(DimensionalLaserContainer screenContainer, Inventory inv, Component titleIn) { + public DimensionalLaserScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (DimensionalLaserTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -51,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 slot - 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 })); @@ -89,31 +94,32 @@ protected void init() { } @Override - protected void renderLabels(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); + protected void renderLabels(@NotNull GuiGraphics matrixStack, int mouseX, int mouseY) { + + 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)) { - 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); } @@ -145,8 +151,9 @@ 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()) { - int progress = tileEntity.progressCounterPX(17); // 17 vertical, 15 horz for Dimensional Laser + 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); /*Note for this.blit below: @@ -168,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 d0b956aa9..fffe49a6e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/DistillationUnitScreen.java @@ -2,8 +2,9 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.DistillationUnitContainer; -import com.veteam.voluminousenergy.blocks.tiles.DistillationUnitTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -13,92 +14,92 @@ 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; -public class DistillationUnitScreen extends VEContainerScreen { - private DistillationUnitTile tileEntity; +public class DistillationUnitScreen extends VEContainerScreen { + 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"); - - public DistillationUnitScreen(DistillationUnitContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (DistillationUnitTile) screenContainer.getTileEntity(); + + 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); } @Override - protected void renderLabels(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); + 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); } - 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)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, 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() { @@ -112,15 +113,16 @@ 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 && tileEntity.getMultiblockValidity()){ - int progress = tileEntity.progressCounterPX(9); + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + MultiBlockRecipeProcessor processor = (MultiBlockRecipeProcessor) tileEntity.getRecipeProcessor(); + if (tileEntity != null && processor.isMultiBlockValid(tileEntity)) { + int progress = tileEntity.progressProcessingCounterPX(9); int power = menu.powerScreen(49); /*Note for this.blit below: @@ -131,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 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); } 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/ElectricFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java index 770ad92a0..1caa07110 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectricFurnaceScreen.java @@ -2,12 +2,13 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.ElectricFurnaceContainer; -import com.veteam.voluminousenergy.blocks.tiles.ElectricFurnaceTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -15,83 +16,84 @@ 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; -public class ElectricFurnaceScreen extends VEContainerScreen { +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(ElectricFurnaceContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (ElectricFurnaceTile) screenContainer.getTileEntity(); + + public ElectricFurnaceScreen(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 - 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.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 })); } @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(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); + 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); } @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() { @@ -101,19 +103,19 @@ 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 - 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: @@ -124,12 +126,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 dded3b35d..b8c99d711 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ElectrolyzerScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.ElectrolyzerContainer; -import com.veteam.voluminousenergy.blocks.tiles.ElectrolyzerTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -12,64 +12,63 @@ 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; -public class ElectrolyzerScreen extends VEContainerScreen { - private ElectrolyzerTile tileEntity; +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(ElectrolyzerContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (ElectrolyzerTile) screenContainer.getTileEntity(); + + 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(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); + 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); } @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)) { - 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); } - super.renderTooltip(matrixStack,mouseX, mouseY); + super.renderTooltip(matrixStack, mouseX, mouseY); } public Rect2i getTooltipArea() { @@ -83,15 +82,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: p_blit_1_ = starting x for blit on screen @@ -101,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 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/FluidElectrolyzerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java index e66de062a..5c610aff1 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidElectrolyzerScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.FluidElectrolyzerContainer; -import com.veteam.voluminousenergy.blocks.tiles.FluidElectrolyzerTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -13,89 +13,88 @@ 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; -public class FluidElectrolyzerScreen extends VEContainerScreen { - private final FluidElectrolyzerTile tileEntity; +public class FluidElectrolyzerScreen extends VEContainerScreen { + 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(FluidElectrolyzerContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (FluidElectrolyzerTile) screenContainer.getTileEntity(); + 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); } @Override - protected void renderLabels(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); + 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); } @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)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, 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() { @@ -109,15 +108,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: @@ -128,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 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/FluidMixerScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java index 4a49f6d49..c3e6ca9c3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/FluidMixerScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.FluidMixerContainer; -import com.veteam.voluminousenergy.blocks.tiles.FluidMixerTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -14,90 +14,89 @@ 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; -public class FluidMixerScreen extends VEContainerScreen { - private final FluidMixerTile tileEntity; +public class FluidMixerScreen extends VEContainerScreen { + 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(FluidMixerContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (FluidMixerTile) screenContainer.getTileEntity(); + 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); } @Override - protected void renderLabels(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); + 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); 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)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, 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() { @@ -111,15 +110,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: @@ -130,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 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/GasFiredFurnaceScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java index b89913152..ba824317d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/GasFiredFurnaceScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.GasFiredFurnaceContainer; -import com.veteam.voluminousenergy.blocks.tiles.GasFiredFurnaceTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -12,66 +12,67 @@ 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; -public class GasFiredFurnaceScreen extends VEContainerScreen { - private GasFiredFurnaceTile tileEntity; - private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID,"textures/gui/gas_fired_furnace_gui.png"); +public class GasFiredFurnaceScreen extends VEContainerScreen { + 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(GasFiredFurnaceContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (GasFiredFurnaceTile) screenContainer.getTileEntity(); + + public GasFiredFurnaceScreen(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(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)){ - int amount = tileEntity.getFluidFromTank().getAmount(); - String name = tileEntity.getFluidFromTank().getTranslationKey(); + protected void renderTooltip(GuiGraphics matrixStack, int mouseX, int mouseY) { + if (isHovering(31, 18, 12, 49, mouseX, mouseY)) { + 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)){ + } 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() { @@ -80,8 +81,9 @@ 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(tileEntity.getData("fuel_counter"),tileEntity.getData("fuel_length")) + "%"), + Component.nullToEmpty(TextUtil.translateString("text.voluminousenergy.ticks_left").getString() + ": " + tileEntity.getData("fuel_counter"))); } public Rect2i getCounterTooltipArea() { @@ -91,21 +93,22 @@ 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 - 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){ - int progress = tileEntity.progressCounterPX(9); - int fuelProgress = tileEntity.progressFuelCounterPX(flameHeight); + if (tileEntity != null) { + int progress = tileEntity.progressProcessingCounterPX(9); + 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 @@ -115,14 +118,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.getFluidStackFromTank(0), 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 8d1482561..17a4f4efb 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/HydroponicIncubatorScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.HydroponicIncubatorContainer; -import com.veteam.voluminousenergy.blocks.tiles.HydroponicIncubatorTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -18,34 +18,34 @@ import java.util.Arrays; import java.util.List; -public class HydroponicIncubatorScreen extends VEContainerScreen { - private final HydroponicIncubatorTile tileEntity; +public class HydroponicIncubatorScreen extends VEContainerScreen { + 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(HydroponicIncubatorContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (HydroponicIncubatorTile) screenContainer.getTileEntity(); + 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 - 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); @@ -68,21 +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)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, 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() { @@ -96,15 +94,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: @@ -115,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 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/ImplosionCompressorScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java index 5a1b5023d..b4dc53dc3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ImplosionCompressorScreen.java @@ -2,12 +2,13 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.ImplosionCompressorContainer; -import com.veteam.voluminousenergy.blocks.tiles.ImplosionCompressorTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -15,91 +16,92 @@ 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; -public class ImplosionCompressorScreen extends VEContainerScreen { +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(ImplosionCompressorContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (ImplosionCompressorTile) screenContainer.getTileEntity(); + + public ImplosionCompressorScreen(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 - 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 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 })); } @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(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); + 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); } @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() { @@ -113,15 +115,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: @@ -132,12 +134,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 7a82577b4..5cdd2164d 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveBlastFurnaceScreen.java @@ -2,11 +2,12 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.PrimitiveBlastFurnaceContainer; -import com.veteam.voluminousenergy.blocks.tiles.PrimitiveBlastFurnaceTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -14,72 +15,75 @@ 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; -public class PrimitiveBlastFurnaceScreen extends VEContainerScreen { - private PrimitiveBlastFurnaceTile tileEntity; - private final ResourceLocation GUI = new ResourceLocation(VoluminousEnergy.MODID,"textures/gui/primitiveblastgui.png"); +public class PrimitiveBlastFurnaceScreen extends VEContainerScreen { + 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(PrimitiveBlastFurnaceContainer screenContainer, Inventory inv, Component titleIn) { + + public PrimitiveBlastFurnaceScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (PrimitiveBlastFurnaceTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @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(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 })); } @Override - protected void renderLabels(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); + 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); } @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); } @@ -88,29 +92,29 @@ 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() { 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 - 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); /*Note for this.blit below: x = starting x for blit on screen y = starting y for blit on screen @@ -119,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 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/PrimitiveSolarPanelScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java index 26ff6555a..9d43dd195 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveSolarPanelScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.PrimitiveSolarPanelContainer; -import com.veteam.voluminousenergy.blocks.tiles.PrimitiveSolarPanelTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.Minecraft; @@ -14,60 +14,59 @@ 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; + private final VETileEntity 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(); + 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)) { - 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); + super.renderTooltip(matrixStack, mouseX, mouseY); } @Override - protected void renderLabels(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.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); } @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 19bafe7f8..7a8f32c1b 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PrimitiveStirlingGeneratorScreen.java @@ -2,9 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.PrimitiveStirlingGeneratorContainer; -import com.veteam.voluminousenergy.blocks.tiles.PrimitiveStirlingGeneratorTile; -import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -16,58 +15,57 @@ 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; -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; - + private VETileEntity 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(); + tileEntity = container.getTileEntity(); container.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 -> { })); // Input slot - 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)) { - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, Config.PRIMITIVE_STIRLING_GENERATOR_MAX_POWER.get()), 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() { @@ -78,18 +76,16 @@ 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(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; - if (tileEntity.ticksLeft() > 0) generationRate = Config.PRIMITIVE_STIRLING_GENERATOR_GENERATE.get(); - else generationRate = 0; - 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); + 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); super.renderLabels(matrixStack, mouseX, mouseY); } @@ -97,22 +93,22 @@ protected void renderLabels(GuiGraphics matrixStack,int mouseX, int 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 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.progressCounterPX(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); + 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); 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 160aefd37..d373b8e3a 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/PumpScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.PumpContainer; -import com.veteam.voluminousenergy.blocks.tiles.PumpTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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,31 +16,33 @@ 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 { +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(PumpContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (PumpTile) screenContainer.getTileEntity(); + + public PumpScreen(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 - 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; @@ -57,46 +59,45 @@ protected void init(){ } @Override - protected void renderLabels(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); + 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); } @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)) { - 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 - String name = tileEntity.getAirTankFluid().getTranslationKey(); - int amount = tileEntity.getAirTankFluid().getAmount(); + if (isHovering(93, 18, 12, 50, mouseX, mouseY)) { // Oxidizer Tank + 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); } - 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); @@ -108,11 +109,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.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/SawmillScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java index a0348423a..7f3cad7b0 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SawmillScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.SawmillContainer; -import com.veteam.voluminousenergy.blocks.tiles.SawmillTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -13,75 +13,74 @@ 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; -public class SawmillScreen extends VEContainerScreen { - private SawmillTile tileEntity; +public class SawmillScreen extends VEContainerScreen { + 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(SawmillContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (SawmillTile) screenContainer.getTileEntity(); + + public SawmillScreen(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(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); + 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); } @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)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, 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() { @@ -95,15 +94,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: @@ -114,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 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/SolarPanelScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java index efaecad25..8929f13b6 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/SolarPanelScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.SolarPanelContainer; -import com.veteam.voluminousenergy.blocks.tiles.SolarPanelTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.TextUtil; import net.minecraft.client.Minecraft; @@ -14,55 +14,56 @@ 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; + private final VETileEntity 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(); + 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)) { - 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); + super.renderTooltip(matrixStack, mouseX, mouseY); } + @Override - protected void renderLabels(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.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); } @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 049237634..96e2d3a24 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/StirlingGeneratorScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.StirlingGeneratorContainer; -import com.veteam.voluminousenergy.blocks.tiles.StirlingGeneratorTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -16,19 +16,20 @@ 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; -public class StirlingGeneratorScreen extends VEContainerScreen { - private final StirlingGeneratorTile tileEntity; +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(StirlingGeneratorContainer screenContainer, Inventory inv, Component titleIn) { + + public StirlingGeneratorScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); - tileEntity = (StirlingGeneratorTile) screenContainer.getTileEntity(); + tileEntity = screenContainer.getTileEntity(); screenContainer.setScreen(this); } @@ -58,25 +59,23 @@ 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); + 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); } @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)) { - 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); } @@ -91,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 @@ -103,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.progressBurnCounterPX(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 b911dff37..1e4b44a3e 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/screens/ToolingStationScreen.java @@ -2,8 +2,8 @@ import com.mojang.blaze3d.systems.RenderSystem; import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.containers.ToolingStationContainer; -import com.veteam.voluminousenergy.blocks.tiles.ToolingStationTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +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; @@ -12,67 +12,66 @@ 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; +public class ToolingStationScreen extends VEContainerScreen { + 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(ToolingStationContainer screenContainer, Inventory inv, Component titleIn){ - super(screenContainer,inv,titleIn); - tileEntity = (ToolingStationTile) screenContainer.getTileEntity(); + + public ToolingStationScreen(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(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); + 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)){ - tileEntity.getEnergy().ifPresent((veEnergyStorage -> { - matrixStack.renderTooltip(this.font, TextUtil.powerBarTooltip(veEnergyStorage, tileEntity.getMaxPower()), 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() { @@ -80,15 +79,15 @@ 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){ - boolean lightArrow = tileEntity.hasValidRecipe(); + matrixStack.blit(GUI, i, j, 0, 0, this.imageWidth, this.imageHeight); + if (tileEntity != null) { + boolean lightArrow = (tileEntity.getSelectedRecipe() == null); int power = menu.powerScreen(49); /*Note for this.blit below: @@ -99,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 f9dbab7e3..fd3483805 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,6 @@ 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.tools.buttons.VEIOButton; import com.veteam.voluminousenergy.tools.buttons.ioMenuButton; @@ -12,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.RelationalTank; 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; @@ -25,6 +24,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 +46,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,14 +54,10 @@ 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 -> { + addRenderableWidget(new ioMenuButton(menuButtonX, menuButtonY, buttons -> { })); @@ -77,7 +73,7 @@ public void renderIOMenu(VEFluidTileEntity tileEntity, int menuButtonX, int menu 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 @@ -90,27 +86,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 -> { @@ -138,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); } }); @@ -159,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); @@ -177,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); @@ -196,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/AluminumTankScreen.java b/src/main/java/com/veteam/voluminousenergy/blocks/screens/tank/AluminumTankScreen.java index e306f872c..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,18 +1,19 @@ 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; 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) { + public AluminumTankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); } @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..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,19 +1,20 @@ 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; 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) { + public EighzoTankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("eighzo_tank"), 8, 6, WHITE_TEXT_STYLE); + 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); } } \ 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 5a376b63c..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,19 +1,20 @@ 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; 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) { + public NetheriteTankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("netherite_tank"), 8, 6, WHITE_TEXT_STYLE); + 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); } } \ 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 af5ba02b6..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,19 +1,20 @@ 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; 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) { + public NighaliteTankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("nighalite_tank"), 8, 6, WHITE_TEXT_STYLE); + 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); } } \ 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 3154a65dd..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,19 +1,20 @@ 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; 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) { + public SolariumTankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("solarium_tank"), 8, 6, WHITE_TEXT_STYLE); + 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); } } \ 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 bfcdef909..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; @@ -21,64 +21,65 @@ 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; -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){ - super(screenContainer,inv,titleIn); - tileEntity = (TankTile) screenContainer.getTileEntity(); + + public TankScreen(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(tileEntity,64 + (this.width/2), this.topPos + 4); + renderIOMenu(tileEntity, 64 + (this.width / 2), this.topPos + 4); } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { - 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.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)){ - 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); + if (isHovering(93, 18, 12, 50, 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); + 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); @@ -88,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.getRelationalTank(0).getTank(), tileEntity.getRelationalTank(0).getTank().getCapacity(), i + 93, j + 18, 0, 12, 50); + } catch (Exception e) { + } // IO Rendering RenderSystem.setShaderTexture(0, GUI_TOOLS); @@ -109,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); @@ -128,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); @@ -147,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 c7e7e78e3..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,19 +1,20 @@ 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; 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) { + public TitaniumTankScreen(VEContainer screenContainer, Inventory inv, Component titleIn) { super(screenContainer, inv, titleIn); } @Override - protected void renderLabels(GuiGraphics matrixStack, int mouseX, int mouseY) { - TextUtil.renderShadowedText(matrixStack, this.font, TextUtil.translateVEBlock("titanium_tank"), 8, 6, WHITE_TEXT_STYLE); + 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); } } \ No newline at end of file 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 84999c4fe..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AirCompressorTile.java +++ /dev/null @@ -1,178 +0,0 @@ -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.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.RelationalTank; -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 VEFluidTileEntity implements IVEPoweredTileEntity, IVECountable { - - 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 RelationalTank airTank = new RelationalTank(new FluidTank(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.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.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 new AirCompressorContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - public FluidStack getAirTankFluid() { - return this.airTank.getTank().getFluid(); - } - - @Override - public @Nonnull List getRelationalTanks() { - return Collections.singletonList(airTank); - } - - public RelationalTank getAirTank() { - return this.airTank; - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return this.inventory; - } - - @Override - 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 deleted file mode 100644 index 41295938c..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/AqueoulizerTile.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.AqueoulizerContainer; -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.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 VEFluidTileEntity implements IVEPoweredTileEntity, IVECountable { - private final ItemStackHandler inventory = createHandler(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 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); - fluidManagers.get(0).setValidator(this, true); - fluidManagers.get(1).setValidator(this, false); - } - - @Override - public void tick() { - updateClients(); - super.tick(); - } - - @Nonnull - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new AqueoulizerContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull List getRelationalTanks() { - return fluidManagers; - } - - @Override - 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 deleted file mode 100644 index e442c3325..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BatteryBoxTile.java +++ /dev/null @@ -1,354 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.BatteryBoxContainer; -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; -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.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; - -import javax.annotation.Nonnull; -import java.util.ArrayList; -import java.util.List; - -public class BatteryBoxTile extends VETileEntity implements IVEPoweredTileEntity { - - 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; - - private final VEPowerIOManager powerIOManager = new VEPowerIOManager(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); - BatteryBoxTile.this.setChanged(); - } - }; - - @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(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); - } - } - } - }); - } - }); - } - - 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 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 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)){ - //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); - } - - 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; - } - } - } - }); - } - - /* - 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")); - - powerIOManager.setFlipped(tag.getBoolean("send_out_power")); - 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()); - - tag.putBoolean("send_out_power", powerIOManager.isFlipped()); - super.saveAdditional(tag); - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new BatteryBoxContainer(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){ - this.powerIOManager.setFlipped(sendOutPower); - if(sendOutPower) { - this.energy.ifPresent(e -> e.setMaxReceive(0)); - } else { - this.energy.ifPresent(e -> e.setMaxReceive(getTransferRate())); - } - } - - public VEBatterySwitchManager[] getSwitchManagers() { - return switchManagers; - } - - 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 deleted file mode 100644 index 19e70b463..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/BlastFurnaceTile.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.BlastFurnaceContainer; -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.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 implements IVEPoweredTileEntity, IVECountable { - - 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)); - } - }; - - RelationalTank[] fluidManagers = new RelationalTank[]{ - new RelationalTank(new FluidTank(TANK_CAPACITY), 0,0, TankType.INPUT, "heatTank:heat_tank_gui") - }; - - private byte tick = 19; - - public ItemStackHandler inventory = createHandler(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 new BlastFurnaceContainer(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); - } - - @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 deleted file mode 100644 index f05b60c0d..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalAgitatorTile.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.CentrifugalAgitatorContainer; -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.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 VEFluidTileEntity implements IVEPoweredTileEntity, IVECountable { - - 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 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 CentrifugalAgitatorTile(BlockPos pos, BlockState state) { - super(VEBlocks.CENTRIFUGAL_AGITATOR_TILE.get(), pos, state, CentrifugalAgitatorRecipe.RECIPE_TYPE); - } - - public ItemStackHandler inventory = createHandler(7); - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @Override - public void tick() { - super.tick(); - } - - @Override - public int getUpgradeSlotId() { - return 6; - } - - @Nonnull - @Override - public List getSlotManagers() { - return slotManagers; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new CentrifugalAgitatorContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - 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 deleted file mode 100644 index 8e0207678..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CentrifugalSeparatorTile.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.CentrifugalSeparatorContainer; -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 implements IVEPoweredTileEntity,IVECountable { - private final ItemStackHandler handler = createHandler(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 new CentrifugalSeparatorContainer(i,level,worldPosition,playerInventory,playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return handler; - } - - @NotNull - @Override - 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 deleted file mode 100644 index 97b845102..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CombustionGeneratorTile.java +++ /dev/null @@ -1,276 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.CombustionGeneratorContainer; -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.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.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.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; -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; - -public class CombustionGeneratorTile extends VEFluidTileEntity 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)); - 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 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")); - } - }; - 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 = CombustionGeneratorFuelRecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE); - 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)); - }); - } - - private LazyOptional energyCapability = null; - - VEFluidRecipe oxidizerRecipe; - VEFluidRecipe 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.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 (!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 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, - CombustionGeneratorFuelRecipe.RECIPE_TYPE, - Collections.singletonList(fluidManagers.get(0).getTank().getFluid()), - new ArrayList<>()); - } - - @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); - } - - 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; - } - } - } - }); - } - - 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(CombustionGeneratorFuelRecipe.RECIPE_TYPE); - 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 true; - } - return false; - } - }; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new CombustionGeneratorContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } - public int progressCounterPX(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; - } - - @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 deleted file mode 100644 index 8d8020868..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CompressorTile.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.CompressorContainer; -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 implements IVEPoweredTileEntity, IVECountable { - - 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 = createHandler(3); - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new CompressorContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - 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 deleted file mode 100644 index 89eaafeb1..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/CrusherTile.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.CrusherContainer; -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; -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 implements IVEPoweredTileEntity, IVECountable { - - 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); - } - - @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); - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new CrusherContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - 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 deleted file mode 100644 index e53b82daf..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DimensionalLaserTile.java +++ /dev/null @@ -1,298 +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.DimensionalLaserContainer; -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.RelationalTank; -import com.veteam.voluminousenergy.util.SlotType; -import com.veteam.voluminousenergy.util.TankType; -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 implements IVEPoweredTileEntity, IVECountable { - - 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); - }}; - - RelationalTank outputTank = new RelationalTank(new FluidTank(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 = createHandler(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() < TANK_CAPACITY) { - if (counter == 1) { - - if (outputTank.isFluidValid(fluid.getFluid())) { - int fillSize = Math.min(fluid.getAmount(), 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.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 new DimensionalLaserContainer(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 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) { - - // 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/DistillationUnitTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java deleted file mode 100644 index a0fd4770c..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/DistillationUnitTile.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.DistillationUnitContainer; -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; -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.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; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.ArrayList; -import java.util.List; - -public class DistillationUnitTile extends VEMultiBlockTileEntity implements IVEPoweredTileEntity, IVECountable { - 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 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")); - }}; - - 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); - } - - @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 new DistillationUnitContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @Override - 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 deleted file mode 100644 index 610ab0ead..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectricFurnaceTile.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.ElectricFurnaceContainer; -import com.veteam.voluminousenergy.recipe.CombustionGenerator.CombustionGeneratorFuelRecipe; -import com.veteam.voluminousenergy.recipe.RecipeCache; -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.Collections; -import java.util.List; -import java.util.Objects; -import java.util.concurrent.atomic.AtomicReference; - -public class ElectricFurnaceTile extends VETileEntity implements IVEPoweredTileEntity, IVECountable { - - 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 slot - // 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.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 new ElectricFurnaceContainer(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; - } - - @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 deleted file mode 100644 index f7030ad9a..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ElectrolyzerTile.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.ElectrolyzerContainer; -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; -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 implements IVEPoweredTileEntity, IVECountable { - - 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 = createHandler(7); - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new ElectrolyzerContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - 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 deleted file mode 100644 index c77698ca3..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidElectrolyzerTile.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.FluidElectrolyzerContainer; -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.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 VEFluidTileEntity implements IVEPoweredTileEntity, IVECountable { - - - 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 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 FluidElectrolyzerTile(BlockPos pos, BlockState state) { - super(VEBlocks.FLUID_ELECTROLYZER_TILE.get(), pos, state, FluidElectrolyzerRecipe.RECIPE_TYPE); - } - - public ItemStackHandler inventory = createHandler(7); - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @Override - public int getUpgradeSlotId() { - return 6; - } - - @Nonnull - @Override - public List getSlotManagers() { - return slotManagers; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new FluidElectrolyzerContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - 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 deleted file mode 100644 index ddc7d9da9..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/FluidMixerTile.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.FluidMixerContainer; -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.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 VEFluidTileEntity 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)); - 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 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")); - }}; - - public FluidMixerTile(BlockPos pos, BlockState state) { - super(VEBlocks.FLUID_MIXER_TILE.get(), pos, state, FluidMixerRecipe.RECIPE_TYPE); - } - - public ItemStackHandler inventory = createHandler(7); - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @Override - public int getUpgradeSlotId() { - return 6; - } - - @Nonnull - @Override - public List getSlotManagers() { - return slotManagers; - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new FluidMixerContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - @Override - 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 deleted file mode 100644 index f53534140..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/GasFiredFurnaceTile.java +++ /dev/null @@ -1,353 +0,0 @@ -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.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.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.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 VEFluidTileEntity implements 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)); - add(new VESlotManager(2, Direction.EAST, true, SlotType.INPUT)); - 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"); - - 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 CombustionGeneratorFuelRecipe 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 = this.calculateCounter(200, inventory.getStackInSlot(4)); - 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 = (CombustionGeneratorFuelRecipe) - RecipeCache.getFluidRecipeFromCache(level, CombustionGeneratorFuelRecipe.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(CombustionGeneratorFuelRecipe.RECIPE_TYPE) - .stream().anyMatch(r -> ((VEFluidRecipe)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 new GasFiredFurnaceContainer(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 RelationalTank 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 deleted file mode 100644 index e220c3e4e..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/HydroponicIncubatorTile.java +++ /dev/null @@ -1,212 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.HydroponicIncubatorContainer; -import com.veteam.voluminousenergy.recipe.HydroponicIncubatorRecipe; -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.RelationalTank; -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.item.crafting.Ingredient; -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 VEFluidTileEntity implements IVEPoweredTileEntity, IVECountable { - - private final ItemStackHandler inventory = createHandler(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)); - } - }; - - RelationalTank inputTank = new RelationalTank(new FluidTank(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 new HydroponicIncubatorContainer(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; - 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()); - } - } - } - - // 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 @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/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/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 deleted file mode 100644 index dc49d24af..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ImplosionCompressorTile.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.ImplosionCompressorContainer; -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 implements IVEPoweredTileEntity,IVECountable { - - 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 = createHandler(4); - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) - { - return new ImplosionCompressorContainer(i,level,worldPosition,playerInventory,playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - 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() { - 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 ce3cee6a7..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveBlastFurnaceTile.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.PrimitiveBlastFurnaceContainer; -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; -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.common.util.LazyOptional; -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 implements IVECountable,IVEPoweredTileEntity { - - 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 = createHandler(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 new PrimitiveBlastFurnaceContainer(i,level,worldPosition,playerInventory,playerEntity); - } - - @Override - public @Nonnull ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - 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 deleted file mode 100644 index e6d3b508a..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveSolarPanelTile.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.PrimitiveSolarPanelContainer; -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 new PrimitiveSolarPanelContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - 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 deleted file mode 100644 index cfd2f5a40..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PrimitiveStirlingGeneratorTile.java +++ /dev/null @@ -1,184 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.PrimitiveStirlingGeneratorContainer; -import com.veteam.voluminousenergy.recipe.RecipeCache; -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 implements IVEPowerGenerator, IVECountable { - - 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.ifPresent(e -> e.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(); - } - - 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 - 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 new PrimitiveStirlingGeneratorContainer(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 progressCounterPX(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; - } - - @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 deleted file mode 100644 index 206d2368d..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/PumpTile.java +++ /dev/null @@ -1,322 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.PumpContainer; -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.RelationalTank; -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.item.Items; -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.Capability; -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 VEFluidTileEntity implements IVEPoweredTileEntity { - 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 RelationalTank fluidTank = new RelationalTank(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.ifPresent(e -> e.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 (RelationalTank 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); - } - }; - } - - @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) { - return new PumpContainer(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 RelationalTank 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 deleted file mode 100644 index 3d1ce1b9f..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SawmillTile.java +++ /dev/null @@ -1,292 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - -import com.veteam.voluminousenergy.VoluminousEnergy; -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.SawmillContainer; -import com.veteam.voluminousenergy.recipe.VEFluidSawmillRecipe; -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.SlotType; -import com.veteam.voluminousenergy.util.TagUtil; -import com.veteam.voluminousenergy.util.TankType; -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.item.crafting.ShapelessRecipe; -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 VEFluidTileEntity implements IVEPoweredTileEntity,IVECountable { - - 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)); - }}; - RelationalTank outputTank = new RelationalTank(new FluidTank(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, com.veteam.voluminousenergy.recipe.VEFluidSawmillRecipe.RECIPE_TYPE); - outputTank.setAllowAny(true); - } - - VEFluidSawmillRecipe 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()) <= 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()) <= 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 slot - } - 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 VEFluidSawmillRecipe VEFluidSawmillRecipe, - ItemStack logInput, - ItemStack resolvedPlankOutput, - ItemStack secondItemOutput, - 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){ - currentPlankStack.setCount(1); - } - inventory.insertItem(1, resolvedPlankOutput.copy(), false); - } else { // Assuming the recipe output item is already in the output slot - // 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 slot - //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 = 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 - length = counter; - } - } - } - - @Nullable - @Override - public AbstractContainerMenu createMenu(int i, @Nonnull Inventory playerInventory, @Nonnull Player playerEntity) { - return new SawmillContainer(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 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 deleted file mode 100644 index 4e2c53ca1..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/SolarPanelTile.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles; - - -import com.veteam.voluminousenergy.blocks.blocks.VEBlocks; -import com.veteam.voluminousenergy.blocks.containers.SolarPanelContainer; -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 new SolarPanelContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - 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 deleted file mode 100644 index 852beaa58..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/StirlingGeneratorTile.java +++ /dev/null @@ -1,211 +0,0 @@ -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.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; -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.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 StirlingGeneratorTile extends VETileEntity implements IVEPowerGenerator, IVECountable { - 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(); - - 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(); - } - - @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); - } - - 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; - } - } - } - }); - } - - @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 new StirlingGeneratorContainer(i, level, worldPosition, playerInventory, playerEntity); - } - - @Nullable - @Override - public ItemStackHandler getInventoryHandler() { - return inventory; - } - - @NotNull - @Override - public List getSlotManagers() { - return slotManagers; - } - public int progressCounterPX(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 608f8ef2d..d02cd02a3 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/ToolingStationTile.java @@ -1,20 +1,18 @@ 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; 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.VEFluidRecipe; -import com.veteam.voluminousenergy.tools.Config; +import com.veteam.voluminousenergy.recipe.VERecipe; import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.RelationalTank; 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; @@ -24,7 +22,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 +29,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 { // Slot Managers List slotManagers = new ArrayList<>() {{ @@ -54,9 +49,9 @@ public class ToolingStationTile extends VEFluidTileEntity implements IVEPoweredT 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); }}; @@ -74,10 +69,10 @@ 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); } - VEFluidRecipe fuelRecipe; + VERecipe fuelRecipe; @Override public void tick() { @@ -163,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<>()); } @@ -233,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/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/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 deleted file mode 100644 index 7d5ca8730..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VESolarTile.java +++ /dev/null @@ -1,157 +0,0 @@ -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; -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.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 { - 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){ - if (this.getCapability(ForgeCapabilities.ENERGY).map(IEnergyStorage::getEnergyStored).orElse(0) < getMaxPower()){ - energy.ifPresent(e -> e.addEnergy(fe)); //Amount of energy to add per tick - } - } - - public static int receiveEnergy(BlockEntity tileEntity, Direction from, int maxReceive){ - return tileEntity.getCapability(ForgeCapabilities.ENERGY, from).map(handler -> - handler.receiveEnergy(maxReceive, false)).orElse(0); - } - - - @Override - public int getPowerUsage() { - return 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; - } - } - } - }); - } - - /** - * 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.energy.resolve().get().getEnergyStored(); - - } - - @Override - public void saveAdditional(@NotNull CompoundTag tag) { - this.generation = tag.getInt("generation_rate"); - 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() { - return null; - } - - @NotNull - @Override - 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..b700856dd --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntities.java @@ -0,0 +1,366 @@ +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.VETileEntityFactory.FluidInputTank; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntityFactory.FluidOutputTank; +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 static com.veteam.voluminousenergy.recipe.VERecipes.VERecipeTypes.*; + +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) + .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 VETileEntityFactory AQUEOULIZER_TILE_FACTORY = + new VETileEntityFactory(VEBlocks.AQUEOULIZER.tile(), VEContainers.AQUEOULIZER_FACTORY) + .addEnergyStorageWithConsumption( + Config.AQUEOULIZER_MAX_POWER.get(), + Config.AQUEOULIZER_TRANSFER.get(), + Config.AQUEOULIZER_POWER_USAGE.get()) + .addTanks(new FluidInputTank(0, DEFAULT_TANK_CAPACITY), + new FluidOutputTank(0, DEFAULT_TANK_CAPACITY)) + .countable() + .makesSound() + .withRecipe(AQUEOULIZING) + .withCustomRecipeProcessing(new BasicProcessor()); + + 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()) + .withCustomInventoryValidator(new BatteryBoxInventoryValidator()) + .withCustomRecipeProcessing(new BatteryBoxProcessor()); + + 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(), + Config.BLAST_FURNACE_POWER_USAGE.get()) + .addTanks( + new FluidInputTank(0, DEFAULT_TANK_CAPACITY) + ) + .countable() + .addDataFlag("temperature_kelvin") + .addDataFlag("temperature_celsius") + .addDataFlag("temperature_fahrenheit") + .makesSound() + .withRecipe(INDUSTRIAL_BLASTING) + .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) + .addEnergyStorageWithConsumption( + Config.CENTRIFUGAL_AGITATOR_MAX_POWER.get(), + Config.CENTRIFUGAL_AGITATOR_TRANSFER.get(), + Config.CENTRIFUGAL_AGITATOR_POWER_USAGE.get()) + .addTanks( + 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 BasicProcessor()); + + 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(), + Config.CENTRIFUGAL_SEPARATOR_POWER_USAGE.get()) + .countable() + .makesSound() + .withRecipe(CENTRIFUGAL_SEPARATION) + .withCustomRecipeProcessing(new BasicProcessor()); + + 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()) + .addTanks( + new FluidInputTank(0, DEFAULT_TANK_CAPACITY), + new FluidInputTank(1, DEFAULT_TANK_CAPACITY)) + .countable() + .makesSound() + .sendsOutPower() + .withRecipe(FUEL_COMBUSTION) + .withCustomRecipeProcessing(new CombustionGeneratorProcessor()); + + public static final VETileEntityFactory COMPRESSOR_FACTORY = + new VETileEntityFactory(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 BasicProcessor()); + + public static final VETileEntityFactory CRUSHER_FACTORY = + new VETileEntityFactory(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 BasicProcessor()); + + 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()) + .addTanks( + new FluidOutputTank(0, DEFAULT_TANK_CAPACITY) + ) + .countable() + .makesSound() + .addDataFlag("build_tick") + .withRecipe(DIMENSIONAL_LASING) + .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) + .addEnergyStorageWithConsumption( + Config.DISTILLATION_UNIT_MAX_POWER.get(), + Config.DISTILLATION_UNIT_TRANSFER.get(), + Config.DIMENSIONAL_LASER_POWER_USAGE.get()) + .addTanks( + new FluidInputTank(0, DEFAULT_TANK_CAPACITY), + new FluidOutputTank(0, DEFAULT_TANK_CAPACITY), + new FluidOutputTank(1, DEFAULT_TANK_CAPACITY) + ) + .countable() + .makesSound() + .withRecipe(DISTILLING) + .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) + .addEnergyStorageWithConsumption(Config.ELECTROLYZER_MAX_POWER.get(), + Config.ELECTRIC_FURNACE_TRANSFER.get(), + Config.ELECTRIC_FURNACE_POWER_USAGE.get()) + .countable() + .makesSound() + .withCustomInventoryValidator(new FurnaceInventoryValidator()) + .withCustomRecipeProcessing(new ElectricFurnaceProcessor()); + + 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()) + .countable() + .makesSound() + .withRecipe(ELECTROLYZING) + .withCustomRecipeProcessing(new BasicProcessor()); + + 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(), + Config.FLUID_ELECTROLYZER_POWER_USAGE.get() + ) + .countable() + .makesSound() + .withRecipe(ELECTROLYZING) + .withCustomRecipeProcessing(new BasicProcessor()); + + 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(), + Config.FLUID_MIXER_POWER_USAGE.get() + ) + .addTanks( + 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 BasicProcessor()); + + 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, + (fluid, tile) -> CombustibleFluidsData.isCombustible(fluid)) + ) + .countable() + .makesSound() + .addDataFlag("fuel_length") + .addDataFlag("fuel_counter") + .withCustomInventoryValidator(new GasFiredFurnaceInventoryValidator()) + .withCustomRecipeProcessing(new GasFiredFurnaceProcessor()); + + 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(), + Config.HYDROPONIC_INCUBATOR_POWER_USAGE.get() + ) + .addTanks( + new FluidInputTank(0, DEFAULT_TANK_CAPACITY) + ) + .countable() + .makesSound() + .withRecipe(HYDROPONIC_INCUBATING) + .withCustomRecipeProcessing(new BasicProcessor()); + + 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(), + Config.IMPLOSION_COMPRESSOR_POWER_USAGE.get() + ) + .countable() + .makesSound() + .withRecipe(IMPLOSION_COMPRESSING) + .withCustomRecipeProcessing(new BasicProcessor()); + + 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) + .withCustomRecipeProcessing(new BasicProcessor()); + + 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() + ) + .sendsOutPower() + .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) + .addEnergyStorage( + Config.SOLAR_PANEL_MAX_POWER.get(), + Config.SOLAR_PANEL_SEND.get() + ) + .sendsOutPower() + .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) + .addEnergyStorage( + Config.PRIMITIVE_STIRLING_GENERATOR_MAX_POWER.get(), + Config.PRIMITIVE_STIRLING_GENERATOR_SEND.get()) + .countable() + .makesSound() + .sendsOutPower() + .withRecipe(STIRLING) + .withCustomRecipeProcessing(new GeneratorProcessor(true, 4)); + + public static final VETileEntityFactory PUMP_FACTORY = + new VETileEntityFactory(VEBlocks.PUMP.tile(), VEContainers.PUMP_FACTORY) + .addEnergyStorage( + Config.PUMP_MAX_POWER.get(), + Config.PUMP_TRANSFER.get() + ) + .addTanks(new FluidOutputTank(0, DEFAULT_TANK_CAPACITY)) + .countable() + .addDataFlag("lx") + .addDataFlag("ly") + .addDataFlag("lz") + .addSavableTag("selected_fluid") + .withCustomRecipeProcessing(new PumpTileProcessor()) + .makesSound(); + + public static final VETileEntityFactory SAWMILL_FACTORY = + new VETileEntityFactory(VEBlocks.SAWMILL.tile(), VEContainers.SAWMILL_FACTORY) + .addEnergyStorage( + Config.SAWMILL_MAX_POWER.get(), + Config.SAWMILL_TRANSFER.get() + ).addTanks( + new FluidOutputTank(0, DEFAULT_TANK_CAPACITY) + ) + .countable() + .makesSound() + .withRecipe(SAWMILLING) + .withCustomRecipeProcessing(new BasicProcessor()); + + 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() + ) + .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) + .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/VETileEntity.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java index 2792da0b7..13b1b0e36 100644 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntity.java @@ -1,12 +1,12 @@ package com.veteam.voluminousenergy.blocks.tiles; -import com.veteam.voluminousenergy.VoluminousEnergy; +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.RecipeCache; -import com.veteam.voluminousenergy.recipe.VERNGRecipe; import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.sounds.VESounds; +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; @@ -19,25 +19,28 @@ 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; import net.minecraft.world.inventory.AbstractContainerMenu; +import net.minecraft.world.item.BucketItem; import net.minecraft.world.item.ItemStack; -import net.minecraft.world.item.crafting.Ingredient; +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.Level; 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; @@ -45,117 +48,156 @@ 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 java.util.concurrent.atomic.AtomicReference; - -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<>(); + VERecipe selectedRecipe = null; + List potentialRecipes = new ArrayList<>(); + + final List tanks = new ArrayList<>(); + final List managers = new ArrayList<>(); + final HashMap dataMap = new HashMap<>(); + final HashMap tagMap = new HashMap<>(); + final HashMap stateManager = new HashMap<>(); + AbstractRecipeProcessor recipeProcessor; + 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? + + 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(); + 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(VERelationalTank 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 DEFAULT_TANK_CAPACITY; + } + + public void updateTankPacketFromGui(boolean status, int id) { + for (VERelationalTank tank : getRelationalTanks()) { + if (id == tank.getSlotNum()) tank.setSideStatus(status); + } + } + + public void updateTankPacketFromGui(int direction, int id) { + for (VERelationalTank tank : getRelationalTanks()) { + if (id == tank.getSlotNum()) { + this.capabilityMap.moveFluidSlotManagerPos(tank, IntToDirection.IntegerToDirection(direction)); + } + } + } + + public @Nonnull List getRelationalTanks() { + return tanks; + } + + 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) { + + 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) + 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; + boolean isRecipeDirty = true; + /** * 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; - - if (canConsumeEnergy()) { - - if (counter == 1) { - // Validate output - 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 rngRecipe = null; - if(recipe instanceof VERNGRecipe rec) { - rngRecipe = 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(rngRecipe != null) { - float randomness = rngRecipe.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); - // This is to support recipes with empty slots - if(ingredient.isEmpty()) continue; - currentStack.setCount(currentStack.getCount() - ingredient.getItems()[0].getCount()); - } - } - this.doExtraRecipeProcessing(); - } - - this.markRecipeDirty(); - 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; + if (this.recipeProcessor != null) { + if (this.isRecipeDirty) { + recipeProcessor.validateRecipe(this); + this.isRecipeDirty = false; } - counter--; - consumeEnergy(); + recipeProcessor.processRecipe(this); } + if (this.sendsOutPower) sendOutPower(); } /** @@ -169,7 +211,17 @@ public void updateClients() { level.sendBlockUpdated(this.worldPosition, this.getBlockState(), this.getBlockState(), 1); } - protected int calculateCounter(int processTime, ItemStack upgradeStack) { + 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 + * @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) { @@ -179,12 +231,13 @@ protected 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; } - 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) { @@ -220,16 +273,6 @@ protected int consumptionMultiplier(int consumption, ItemStack upgradeStack) { 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() { @@ -252,18 +295,30 @@ public void load(CompoundTag tag) { if (handler != null) { handler.deserializeNBT(inv); } + if (energy != null) energy.deserializeNBT(tag); - if (energy != null) energy.ifPresent(h -> h.deserializeNBT(tag)); + for (var entry : dataMap.entrySet()) { + dataMap.put(entry.getKey(), tag.getInt(entry.getKey())); + } - if (this instanceof IVECountable) { - counter = tag.getInt("counter"); - length = tag.getInt("length"); + for(var entry : tagMap.entrySet()) { + tagMap.put(entry.getKey(), tag.getCompound(entry.getKey())); } for (VESlotManager manager : getSlotManagers()) { manager.read(tag); } + for (VERelationalTank relationalTank : getRelationalTanks()) { + CompoundTag compoundTag = tag.getCompound(relationalTank.getTankName()); + relationalTank.getTank().readFromNBT(compoundTag); + relationalTank.readGuiProperties(tag); + } + + if(tag.contains("sends_out_power")) { + this.sendsOutPower = tag.getBoolean("sends_out_power"); + } + super.load(tag); } @@ -281,74 +336,40 @@ 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()); } - 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(); + for(var entry: tagMap.entrySet()) { + tag.put(entry.getKey(), entry.getValue()); } - int finalUpgradeSlotLocation = upgradeSlotLocation; - return new ItemStackHandler(slots) { + for (VERelationalTank relationalTank : getRelationalTanks()) { + CompoundTag compoundTag = new CompoundTag(); + relationalTank.getTank().writeToNBT(compoundTag); + tag.put(relationalTank.getTankName(), compoundTag); + relationalTank.writeGuiProperties(tag); + } - @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(); - } - } - } + tag.putBoolean("sends_out_power", sendsOutPower); - @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; - } + super.saveAdditional(tag); + } - @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) { + @Deprecated + public ItemStackHandler createHandler(int size, VETileEntity tileEntity) { return new ItemStackHandler(size) { @Override protected void onContentsChanged(int slot) { @@ -357,7 +378,7 @@ protected void onContentsChanged(int slot) { @Override public boolean isItemValid(int slot, @Nonnull ItemStack stack) { - if (tileEntity.getUpgradeSlotId() == slot) { + if (tileEntity.energy != null && tileEntity.energy.getUpgradeSlotId() == slot) { return TagUtil.isTaggedMachineUpgradeItem(stack); } return true; @@ -366,7 +387,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 (tileEntity.energy != null && slot == tileEntity.energy.getUpgradeSlotId()) { return TagUtil.isTaggedMachineUpgradeItem(stack) ? super.insertItem(slot, stack, simulate) : stack; } return super.insertItem(slot, stack, simulate); @@ -374,8 +395,30 @@ 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); + } + return 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 */ @@ -391,7 +434,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 +443,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 @@ -409,30 +453,14 @@ 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) { - 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 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(); + return this.capabilityMap.getCapability(cap, side, this); } /** @@ -442,35 +470,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; } /** @@ -504,18 +517,23 @@ 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; + } + + public @Nonnull ItemStack getStackInSlot(int slot) { + return this.inventory.getStackInSlot(slot); + } /** * When a data packet is received load it. @@ -525,17 +543,42 @@ public boolean canConsumeEnergy() { */ @Override public void onDataPacket(Connection net, ClientboundBlockEntityDataPacket pkt) { - if (energy != null) energy.ifPresent(e -> 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 progressBurnCounterPX(int px,int counter, int 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 { + return 0; + } + } + + public int progressCounterPercent(int counter, int length) { if (length != 0) { return (int) (100 - (((float) counter / (float) length) * 100)); } else { @@ -544,7 +587,7 @@ public int progressCounterPercent() { } public int ticksLeft() { - return counter; + return dataMap.get("counter"); } @Nullable @@ -553,83 +596,159 @@ public ClientboundBlockEntityDataPacket getUpdatePacket() { return ClientboundBlockEntityDataPacket.create(this); } - public LazyOptional getEnergy() { + @Nullable + public VEEnergyStorage getEnergy() { return energy; } - public int decrementCounterOnNoPower(int localCounter) { - return localCounter < this.length ? localCounter + Config.DECREMENT_SPEED_ON_NO_POWER.get() : this.length; + public void markRecipeDirty() { + this.isRecipeDirty = true; } - 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 RecipeType> getRecipeType() { + return this.recipeType; } - public void markRecipeDirty() { - this.isRecipeDirty = true; + public List getPotentialRecipes() { + return potentialRecipes; } - public void validateRecipe() { - if (!this.isRecipeDirty) { - return; - } - this.isRecipeDirty = false; + void addTanks(List tanks) { + this.tanks.addAll(tanks); + } - this.potentialRecipes = RecipeCache.getRecipesFromCache(level, this.getRecipeType(), getSlotManagers(),this,true); - if (this.potentialRecipes.size() == 1) { + void addSlots(List managers) { + this.managers.addAll(managers); + } - 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(); - } - VERecipe newRecipe = RecipeCache.getRecipeFromCache(level, getRecipeType(), inputItems); + public VEItemStackHandler getInventory() { + return inventory; + } - if (newRecipe == null) { - counter = 0; - length = 0; - this.selectedRecipe = null; - return; - } + @Nullable + public VERecipe getSelectedRecipe() { + return selectedRecipe; + } - int newLength; + public List getTanks() { + return 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); - } + public VERelationalTank getRelationalTank(int id) { + return tanks.get(id); + } + public int getTankCapacity(int id) { + return this.tanks.get(id).getTank().getCapacity(); + } - double ratio = (double) length / (double) newLength; - length = newLength; - counter = (int) (counter / ratio); + public List getManagers() { + return managers; + } - if (this.selectedRecipe != newRecipe) { - this.selectedRecipe = newRecipe; - counter = newLength; - } + public boolean isRecipeDirty() { + return isRecipeDirty; + } + + public int getData(String key) { + return this.dataMap.getOrDefault(key, -1); + } + + 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; + } + + 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; + this.setChanged(); + } + + public void setSelectedRecipe(VERecipe recipe) { + this.selectedRecipe = recipe; + } + + public AbstractRecipeProcessor getRecipeProcessor() { + return recipeProcessor; + } + + public int updateCounter(VERecipe recipe) { + int newLength; + ItemStackHandler handler = this.getInventoryHandler(); + if (energy != null && handler != null && energy.getUpgradeSlotId() != -1) { + newLength = this.calculateCounter(recipe.getProcessTime(), + handler.getStackInSlot(energy.getUpgradeSlotId()).copy()); } else { - counter = 0; - length = 0; - this.selectedRecipe = null; + 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; } - public void doExtraRecipeProcessing() { + /** + * 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 overwrite the changes here (this.setData("length") for example) + */ + 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); - public RecipeType> getRecipeType() { - return this.recipeType; + this.setData("counter", ratioedCounter == 0 ? newLength : ratioedCounter); + this.setChanged(); + return newLength; } - public List> getPotentialRecipes() { - return potentialRecipes; + @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 new file mode 100644 index 000000000..742866a1e --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/VETileEntityFactory.java @@ -0,0 +1,261 @@ +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; +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; +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.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.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; +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 VETileEntityFactory { + private List tanks = new ArrayList<>(); + private RegistryObject> recipeType; + 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 tagMap = new HashMap<>(); + private AbstractRecipeProcessor processor; + private boolean sendsOutPower = false; + + public VETileEntityFactory(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 == null ? null : recipeType.get()) { + + @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); + } + + @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()); + index.set(0); + 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 slot count otherwise we'll run into issues with the data slot + if (storage != null) + newTile.energy = storage.copy(); + + //set processor + newTile.recipeProcessor = processor; + + // send out power + newTile.sendsOutPower = sendsOutPower; + + // build out the inventory + int inventorySize = containerFactory.getNumberOfSlots(); + 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; + } + + public VETileEntityFactory withRecipe(RegistryObject> recipe) { + this.recipeType = recipe; + return this; + } + + public VETileEntityFactory addEnergyStorageWithConsumption(int maxPower, int transferRate, int consumption) { + VEEnergyStorage storage = new VEEnergyStorage(maxPower, transferRate); + storage.setConsumption(consumption); + this.storage = storage; + return this; + } + + public VETileEntityFactory addEnergyStorage(int maxPower, int transferRate) { + this.storage = new VEEnergyStorage(maxPower, transferRate); + return this; + } + + public VETileEntityFactory countable() { + this.dataMap.put("counter", 0); + this.dataMap.put("length", 0); + return this; + } + + public VETileEntityFactory isMultiBlock() { + this.dataMap.put("multiblock_complete", 0); + return this; + } + + public VETileEntityFactory addDataFlag(String flag) { + this.dataMap.put(flag, 0); + return this; + } + + public VETileEntityFactory includeSoundTick() { + this.dataMap.put("sound_tick", 0); + return this; + } + + public VETileEntityFactory addTanks(TileTank... tanks) { + this.tanks = List.of(tanks); + return this; + } + + public VETileEntityFactory makesSound() { + this.dataMap.put("sound_tick", 0); + return this; + } + + public VETileEntityFactory withCustomRecipeProcessing(AbstractRecipeProcessor processor) { + this.processor = processor; + return this; + } + + public VETileEntityFactory sendsOutPower() { + this.sendsOutPower = true; + return this; + } + + public VETileEntityFactory withInfiniteRender() { + infiniteRender = true; + return this; + } + + public VETileEntityFactory withCustomInventoryValidator(AbstractItemStackValidator validator) { + this.validator = validator; + 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) { + return new VESlotManager(id, direction, true, SlotType.INPUT); + } + } + + 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) implements TileSlot { + @Override + public VESlotManager asManager(int id) { + return new VESlotManager(id, 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, @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",fluidValidator); + } + } + + 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 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/AbstractItemStackValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/AbstractItemStackValidator.java new file mode 100644 index 000000000..b0543e042 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/AbstractItemStackValidator.java @@ -0,0 +1,10 @@ +package com.veteam.voluminousenergy.blocks.tiles.inventory; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +import net.minecraft.world.item.ItemStack; + +public interface AbstractItemStackValidator { + + boolean isItemValid(int slot, ItemStack itemStack, VETileEntity tile); + +} 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/DimensionalLaserInventoryValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/DimensionalLaserInventoryValidator.java new file mode 100644 index 000000000..34edd9d3b --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/DimensionalLaserInventoryValidator.java @@ -0,0 +1,29 @@ +package com.veteam.voluminousenergy.blocks.tiles.inventory; + +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, VETileEntity tile) { + if (slot == 2) { + if (!(stack.getItem() instanceof RFIDChip)) { + return false; + } + CompoundTag tag = stack.getOrCreateTag(); + if (!tag.contains("ve_x")) 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/inventory/FurnaceInventoryValidator.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/FurnaceInventoryValidator.java new file mode 100644 index 000000000..7c1a0c141 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/FurnaceInventoryValidator.java @@ -0,0 +1,24 @@ +package com.veteam.voluminousenergy.blocks.tiles.inventory; + +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/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/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/inventory/VEItemStackHandler.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/VEItemStackHandler.java new file mode 100644 index 000000000..824c3ec46 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/inventory/VEItemStackHandler.java @@ -0,0 +1,92 @@ +package com.veteam.voluminousenergy.blocks.tiles.inventory; + +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; +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.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 upgradeSlotLocation; + private AbstractItemStackValidator validator; + + public VEItemStackHandler(VETileEntity tileEntity, int slots) { + super(slots); + this.tileEntity = tileEntity; + upgradeSlotLocation = -1; + } + + 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(); + 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) { + // For simple custom validation. + if (validator != null) { + return validator.isItemValid(slot, stack,tileEntity); + } + 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) { + return bucketItem.getFluid().isSame(Fluids.EMPTY); + } + for (VERecipe recipe : tileEntity.getPotentialRecipes()) { + if (recipe.getFluidIngredient(tank.getRecipePos()).test(new FluidStack(bucketItem.getFluid(), 1))) { + return true; + } + } + } else if (manager.getSlotType() == SlotType.INPUT || manager.getSlotType() == SlotType.OUTPUT) { + for (VERecipe recipe : tileEntity.getPotentialRecipes()) { + if (recipe.getParser().canInsertItem(slot, 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/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/blocks/tiles/tank/AluminumTankTile.java b/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/AluminumTankTile.java deleted file mode 100644 index 34a011466..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 d6b00bd0e..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 41a8503c6..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 2bbfdb628..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 b07754ff3..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 58e48bdce..000000000 --- a/src/main/java/com/veteam/voluminousenergy/blocks/tiles/tank/TankTile.java +++ /dev/null @@ -1,180 +0,0 @@ -package com.veteam.voluminousenergy.blocks.tiles.tank; - -import com.veteam.voluminousenergy.blocks.tiles.VEFluidTileEntity; -import com.veteam.voluminousenergy.tools.sidemanager.VESlotManager; -import com.veteam.voluminousenergy.util.MultiFluidSlotWrapper; -import com.veteam.voluminousenergy.util.RelationalTank; -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.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 VEFluidTileEntity { - private final RelationalTank tank = new RelationalTank(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 RelationalTank 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 104692bf6..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/client/renderers/entity/LaserBlockEntityRenderer.java b/src/main/java/com/veteam/voluminousenergy/client/renderers/entity/LaserBlockEntityRenderer.java index dbcab3717..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 @@ -4,7 +4,7 @@ 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; import net.minecraft.client.renderer.MultiBufferSource; @@ -21,16 +21,12 @@ 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; -import java.util.Random; - @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"); @@ -39,7 +35,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 @@ -49,14 +45,22 @@ 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 staticBuildTick = tile.getData("build_tick"); + int buildTick = staticBuildTick; + boolean fullyBuilt = buildTick == 1000; + boolean firstStageBuilt = buildTick >= 400; + + if (firstStageBuilt) buildTick -= 400; height += 2; - if (!tile.isFirstStageComplete()) { + if (!firstStageBuilt) { height = 1; - } else if (tile.getTickTimer() < 5) { - SoundManager manager = Minecraft.getInstance().getSoundManager(); + } + SoundManager manager = Minecraft.getInstance().getSoundManager(); + if (buildTick == 0) { manager.stop(VESounds.ENERGY_BEAM_ACTIVATE.getLocation(), SoundSource.BLOCKS); } @@ -87,7 +91,45 @@ public void renderBeaconBeam(DimensionalLaserTile tile, PoseStack poseStack, Mul PoseStack.Pose pose = poseStack.last(); Matrix4f matrix4f = pose.pose(); - if (!tile.isFirstStageComplete()) { + 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; } @@ -97,7 +139,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; @@ -126,6 +168,16 @@ public void renderBeaconBeam(DimensionalLaserTile tile, PoseStack poseStack, Mul 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}, @@ -236,7 +288,7 @@ public void renderBeaconBeam(DimensionalLaserTile tile, PoseStack poseStack, Mul {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(); @@ -246,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; @@ -266,16 +318,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 077ecae2b..b3ac0bb90 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.*; @@ -10,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.CombustionGenerator.CombustionGeneratorFuelRecipe; import com.veteam.voluminousenergy.util.TextUtil; import mezz.jei.api.IModPlugin; import mezz.jei.api.JeiPlugin; @@ -90,7 +91,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)); @@ -99,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)); @@ -115,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")); @@ -140,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")); } @@ -182,18 +183,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(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.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 @@ -202,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 1c0a91bb9..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 @@ -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())); + 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..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 @@ -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())); + 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..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 @@ -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())); + 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 03238c66c..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 @@ -4,10 +4,11 @@ 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.CombustionGenerator.CombustionGeneratorOxidizerRecipe; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +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; @@ -35,23 +36,23 @@ 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){ + 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(); } @Override - public @NotNull RecipeType getRecipeType(){ + public @NotNull RecipeType getRecipeType() { return RECIPE_TYPE; } @@ -71,7 +72,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( @@ -83,11 +84,14 @@ public void draw(CombustionGeneratorFuelRecipe recipe, IRecipeSlotsView slotsVie 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(recipe.getVolumetricEnergy() + " FE/B"), + Component.nullToEmpty(energy + " FE/B"), 35, 16, VEContainerScreen.GREY_TEXT_STYLE @@ -98,22 +102,9 @@ public void draw(CombustionGeneratorFuelRecipe recipe, IRecipeSlotsView slotsVie 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 veFluidRecipe : recipes) { - if(veFluidRecipe 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()); + if (oxiStack.isPresent()) { - int fePerTick = recipe.getVolumetricEnergy()/oxidizerRecipe.getProcessTime(); + int fePerTick = energy / Config.COMBUSTION_GENERATOR_FIXED_TICK_TIME.get(); Component fePerTickComponent = Component.nullToEmpty(fePerTick+""); int x = 50; if (fePerTick < 100){ @@ -151,25 +142,18 @@ public void draw(CombustionGeneratorFuelRecipe recipe, IRecipeSlotsView slotsVie } - public void ingredientHandler(CombustionGeneratorFuelRecipe recipe, + public void ingredientHandler(CombustionGeneratorRecipe recipe, IIngredientAcceptor fuelAcceptor, IIngredientAcceptor oxidizerAcceptor) { 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(((VEFluidRecipe)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 - 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/compat/jei/category/CompressingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/CompressingCategory.java index 8f516661a..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 @@ -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())); + 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..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 @@ -36,16 +36,16 @@ 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())); + 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); } @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..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,14 +40,14 @@ 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); + 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..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 @@ -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())); + 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/ElectrolyzingCategory.java b/src/main/java/com/veteam/voluminousenergy/compat/jei/category/ElectrolyzingCategory.java index 3bc6aa1ee..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 @@ -28,7 +28,6 @@ import java.util.ArrayList; import java.util.Arrays; -import java.util.List; public class ElectrolyzingCategory implements IRecipeCategory { @@ -43,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 cc9f02080..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); @@ -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..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); @@ -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..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 @@ -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())); + 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..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 @@ -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())); + 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..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 @@ -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())); + 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..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 @@ -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())); + 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..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 @@ -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,29 +34,29 @@ 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<>(); - 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())); + 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; } @@ -76,28 +76,28 @@ 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); + 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); + slotDrawable.draw(matrixStack, 66, 9); + arrow.draw(matrixStack, 24, 11); + emptyArrow.draw(matrixStack, 24, 11); } - public void ingredientHandler(VEFluidSawmillRecipe recipe, + public void ingredientHandler(SawmillRecipe recipe, IIngredientAcceptor inputItemAcceptor, 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()) { @@ -140,10 +140,10 @@ 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); + 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..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 @@ -33,16 +33,16 @@ 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(); - 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(); } @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/VEClientSideListener.java b/src/main/java/com/veteam/voluminousenergy/events/VEClientSideListener.java index 5fae7baf9..960b2a5eb 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,26 @@ 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); } } diff --git a/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java b/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java index 622b15625..74c3deb55 100644 --- a/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java +++ b/src/main/java/com/veteam/voluminousenergy/events/VEServerSideListener.java @@ -1,9 +1,16 @@ 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 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; import net.minecraftforge.event.OnDatapackSyncEvent; @@ -11,25 +18,56 @@ 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 { @SubscribeEvent(priority = EventPriority.HIGHEST) 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) { - VoluminousEnergy.LOGGER.info("Finalizing recipe cache on server reload!"); - VERecipe.updateCache(); + if (event.getPlayer() != null) { + updateOnePlayer(event.getPlayer()); + return; } + server = event.getPlayerList().getServer(); + VERecipe.updateCache(); + doDataProcess(server); + updateAllPlayers(); } @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. + * 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); + } + + 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/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..0537b3427 100644 --- a/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java +++ b/src/main/java/com/veteam/voluminousenergy/items/VEBlockItems.java @@ -9,87 +9,93 @@ 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)); + static { + for(VEBlocks.RegistryWithName registryWithName : VEBlocks.REGISTERED_BLOCKS) { + VE_BLOCK_ITEM_REGISTRY.register(registryWithName.name(),() -> new BlockItem(registryWithName.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)); + //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 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/data/CombustibleFluidsData.java b/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java new file mode 100644 index 000000000..a580c4175 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/items/data/CombustibleFluidsData.java @@ -0,0 +1,92 @@ +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 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 boolean isCombustible(Fluid fluid) { + buildCache(); + return combustibleFluidData.containsKey(fluid); + } + + 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()); + } + } + } + + 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/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..8fdabf279 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/items/data/OxidizerFluidsData.java @@ -0,0 +1,91 @@ +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 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()); + } + } + } + + public static HashMap getDataForNetworkTransfer() { + buildCache(); + return oxidizerFluidData; + } + + public static void updateFromPacket(HashMap data) { + oxidizerFluidData = data; + } + + private static void resetCache() { + oxidizerFluidData.clear(); + } +} \ No newline at end of file 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 90fe75e44..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 @@ -1,13 +1,11 @@ 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.CombustionGeneratorRecipe; 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,15 +31,15 @@ public class CombustionMultitool extends Multitool { - public final int TANK_CAPACITY = VEFluidTileEntity.TANK_CAPACITY; + public final int TANK_CAPACITY = VETileEntity.DEFAULT_TANK_CAPACITY; public CombustionMultitool(MultitoolBit bit, String registryName, Properties itemProperties) { super(bit, registryName, itemProperties); } @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( @@ -53,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); } @@ -89,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); } @@ -99,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 } @@ -167,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); @@ -198,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); } } @@ -214,17 +212,15 @@ 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; - 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 r : VERecipe.getCachedRecipes(CombustionGeneratorFuelRecipe.RECIPE_TYPE)) { - VEFluidRecipe recipe = (VEFluidRecipe) r; - 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/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/AqueoulizerRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/AqueoulizerRecipe.java index c3d530809..a17cfa840 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.BasicParser; +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,9 +16,14 @@ 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 BasicParser parser = new BasicParser(this) + .addIngredient(4, 0) + .addFluidIngredient(0, 0) + .addFluidResult(1, 0); public AqueoulizerRecipe() { } @@ -35,12 +41,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,16 +62,23 @@ 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; } @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.AQUEOULIZER_BLOCK.get()); + return new ItemStack(VEBlocks.AQUEOULIZER.block().get()); + } + + @Override + 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 1400cff0a..586f132a3 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalAgitatorRecipe.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.BasicParser; +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,51 +16,66 @@ 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(); + + private final BasicParser parser = new BasicParser(this) + .addFluidIngredient(0, 0) + .addFluidResult(1, 0) + .addFluidResult(2, 1); public CentrifugalAgitatorRecipe() { + } public CentrifugalAgitatorRecipe(List fi, List of, int processTime) { 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;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } + @Override - public @NotNull RecipeType getType() { + public @NotNull RecipeType getType() { return RECIPE_TYPE; } @Override public @NotNull ItemStack getToastSymbol() { - return new ItemStack(VEBlocks.CENTRIFUGAL_AGITATOR_BLOCK.get()); + return new ItemStack(VEBlocks.CENTRIFUGAL_AGITATOR.block().get()); + } + + @Override + 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 efb572f79..043fafff1 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CentrifugalSeparatorRecipe.java @@ -3,7 +3,9 @@ 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.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; import net.minecraft.world.item.ItemStack; @@ -12,24 +14,34 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; public class CentrifugalSeparatorRecipe extends VERNGRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_SEPARATION.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.CENTRIFUGAL_SEPARATION.get(); + + private final BasicParser parser = new RNGBasicParser(this) + .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, 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)); @@ -54,7 +66,15 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CentrifugalSepar @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } + + @Override + public BasicParser getParser() { + return parser; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; @@ -62,6 +82,6 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CentrifugalSepar @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/CombustionGenerator/CombustionGeneratorFuelRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorFuelRecipe.java deleted file mode 100644 index 85b9b9cb1..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.VEFluidRecipe; -import com.veteam.voluminousenergy.recipe.VERecipe; -import com.veteam.voluminousenergy.recipe.VERecipes; -import com.veteam.voluminousenergy.util.recipe.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 VEFluidRecipe { - 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 111deba38..000000000 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGenerator/CombustionGeneratorOxidizerRecipe.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.veteam.voluminousenergy.recipe.CombustionGenerator; - -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.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; -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 VEFluidRecipe { - 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..6577fd7c6 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CombustionGeneratorRecipe.java @@ -0,0 +1,72 @@ +package com.veteam.voluminousenergy.recipe; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +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; +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 BasicParser parser = new BasicParser(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 BasicParser 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 3427ee8a8..70bd9c02a 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CompressorRecipe.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.IngredientSerializerHelper; +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; import net.minecraft.world.item.ItemStack; @@ -12,16 +13,21 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.ArrayList; 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 BasicParser parser = new BasicParser(this) + .addIngredient(0, 0) + .addItemResult(1, 0); 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<>() { @@ -56,6 +62,11 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CompressorRecipe return SERIALIZER; } + @Override + public BasicParser getParser() { + return parser; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; @@ -63,6 +74,6 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CompressorRecipe @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 85c43c58a..d29d9cb1f 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/CrusherRecipe.java @@ -3,7 +3,9 @@ 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.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; import net.minecraft.world.item.ItemStack; @@ -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 BasicParser parser = new RNGBasicParser(this) + .addChancedItemResult(1, 0) + .addChancedItemResult(2, 1) + .addIngredient(0, 0); public CrusherRecipe() { } @@ -29,7 +36,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)); @@ -55,7 +62,15 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CrusherRecipe re @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } + + @Override + public BasicParser getParser() { + return parser; + } + @Override public @NotNull RecipeType getType() { return RECIPE_TYPE; @@ -63,7 +78,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull CrusherRecipe re @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 148c6ab12..8f7b821e5 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DimensionalLaserRecipe.java @@ -3,9 +3,10 @@ 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.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.util.ServerSideOnly; import com.veteam.voluminousenergy.util.climate.FluidClimateSpawn; -import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.RecipeSerializer; @@ -21,9 +22,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; @@ -74,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 @@ -99,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); } }; @@ -145,7 +146,7 @@ public FluidClimateSpawn getFluidClimateSpawn() { } @Override - public @NotNull RecipeType getType() { + public @NotNull RecipeType getType() { return RECIPE_TYPE; } @@ -244,8 +245,16 @@ 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 BasicParser getParser() { + return null; + } + @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 353c34fc8..222a9aed0 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/DistillationRecipe.java @@ -3,7 +3,9 @@ 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.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; import net.minecraft.world.item.ItemStack; @@ -15,8 +17,14 @@ import javax.annotation.Nullable; import java.util.List; -public class DistillationRecipe extends VEFluidRNGRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.DISTILLING.get(); +public class DistillationRecipe extends VERNGRecipe { + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.DISTILLING.get(); + + private final BasicParser parser = new RNGBasicParser(this) + .addChancedItemResult(6, 0) + .addFluidIngredient(0, 0) + .addFluidResult(1, 0) + .addFluidResult(2, 1); public DistillationRecipe() { } @@ -54,13 +62,22 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull DistillationReci }; @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} - + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } + @Override - public @NotNull ItemStack getToastSymbol(){ - return new ItemStack(VEBlocks.DISTILLATION_UNIT_BLOCK.get()); + public BasicParser getParser() { + return parser; } @Override - public @NotNull RecipeType getType(){return RECIPE_TYPE;} + public @NotNull ItemStack getToastSymbol() { + return new ItemStack(VEBlocks.DISTILLATION_UNIT.block().get()); + } + + @Override + 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..8c5ae1282 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ElectrolyzerRecipe.java @@ -3,7 +3,9 @@ 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.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; import net.minecraft.world.item.ItemStack; @@ -12,24 +14,33 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.ArrayList; import java.util.List; 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 BasicParser parser = new RNGBasicParser(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, 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)); @@ -51,8 +62,16 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ElectrolyzerReci helper.toNetwork(buffer, recipe); } }; + + @Override + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } + @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public BasicParser getParser() { + return parser; + } @Override public @NotNull RecipeType getType() { @@ -61,7 +80,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ElectrolyzerReci @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 90bf08bde..e69a81903 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidElectrolyzerRecipe.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.BasicParser; +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 +16,13 @@ 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(); + + private final BasicParser parser = new BasicParser(this) + .addFluidIngredient(0, 0) + .addFluidResult(1, 0) + .addFluidResult(2, 1); public FluidElectrolyzerRecipe() { } @@ -58,12 +64,17 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull FluidElectrolyze } @Override - public @NotNull RecipeType getType() { + public BasicParser getParser() { + return parser; + } + + @Override + public @NotNull RecipeType getType() { return RECIPE_TYPE; } @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 5dc9b6a37..53dd9e40e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/FluidMixerRecipe.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.BasicParser; +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 +16,13 @@ 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(); + + private final BasicParser parser = new BasicParser(this) + .addFluidIngredient(0, 0) + .addFluidResult(1, 0) + .addFluidResult(2, 1); public FluidMixerRecipe() { } @@ -53,15 +59,22 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull FluidMixerRecipe }; @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } + + @Override + public BasicParser getParser() { + return parser; + } @Override - public @NotNull RecipeType getType() { + public @NotNull RecipeType getType() { return RECIPE_TYPE; } @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 4d0dd53a6..fae09df86 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/HydroponicIncubatorRecipe.java @@ -3,7 +3,9 @@ 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.BasicParser; +import com.veteam.voluminousenergy.recipe.parser.HydroponicParser; +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; @@ -14,8 +16,16 @@ import javax.annotation.Nullable; import java.util.List; -public class HydroponicIncubatorRecipe extends VEFluidRNGRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.HYDROPONIC_INCUBATING.get(); +public class HydroponicIncubatorRecipe extends VERNGRecipe { + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.HYDROPONIC_INCUBATING.get(); + + private final BasicParser parser = new HydroponicParser(this) + .addChancedItemResult(2, 0) + .addChancedItemResult(3, 1) + .addChancedItemResult(4, 2) + .addChancedItemResult(5, 3) + .addChancedItemResult(6, 4) + .addFluidIngredient(0, 0); public HydroponicIncubatorRecipe() { } @@ -53,15 +63,23 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull HydroponicIncuba }; @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } + + @Override + public BasicParser getParser() { + return parser; + } + @Override - public @NotNull RecipeType getType() { + public @NotNull RecipeType getType() { return RECIPE_TYPE; } @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 0b6cea231..a25a22fb1 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ImplosionCompressorRecipe.java @@ -3,7 +3,9 @@ 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.parser.BasicParser; +import com.veteam.voluminousenergy.recipe.parser.ImplosionCompressorParser; +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,16 +14,21 @@ import org.jetbrains.annotations.NotNull; import javax.annotation.Nullable; +import java.util.ArrayList; 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 BasicParser parser = new ImplosionCompressorParser(this) + .addIngredient(0, 0) + .addItemResult(2, 0); 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<>() { @@ -52,7 +59,14 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ImplosionCompres }; @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } + + @Override + public BasicParser getParser() { + return parser; + } @Override public @NotNull RecipeType getType() { @@ -61,6 +75,6 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ImplosionCompres @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 641dd226a..4bca7c47e 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/IndustrialBlastingRecipe.java @@ -3,9 +3,11 @@ 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.IndustrialBlastFurnaceParser; +import com.veteam.voluminousenergy.recipe.serializer.IngredientSerializerHelper; import com.veteam.voluminousenergy.tools.Config; import com.veteam.voluminousenergy.util.recipe.FluidIngredient; -import com.veteam.voluminousenergy.util.recipe.IngredientSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.item.ItemStack; @@ -22,9 +24,15 @@ 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 final BasicParser parser = new IndustrialBlastFurnaceParser(this) + .addIngredient(2, 0) + .addIngredient(3,1) + .addItemResult(4, 0); - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.INDUSTRIAL_BLASTING.get(); private static final RecipeSerializer SERIALIZER = new RecipeSerializer<>() { public static final Codec VE_RECIPE_CODEC = RecordCodecBuilder.create((instance) -> instance.group( @@ -64,7 +72,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; } @@ -72,6 +80,7 @@ public IndustrialBlastingRecipe(List i, List< public @NotNull RecipeType getType() { return RECIPE_TYPE; } + @Override public @NotNull RecipeSerializer getSerializer() { return SERIALIZER; @@ -79,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) { @@ -93,9 +102,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(); @@ -106,15 +115,20 @@ 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()); return List.of(fluidIngredient); } + @Override + public BasicParser 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 eda07a3a9..52dec7acd 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/PrimitiveBlastFurnaceRecipe.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.IngredientSerializerHelper; +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; import net.minecraft.world.item.ItemStack; @@ -13,17 +14,22 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; import java.util.List; 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 BasicParser parser = new BasicParser(this) + .addIngredient(0, 0) + .addItemResult(1, 0); 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<>() { @@ -52,8 +58,16 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull PrimitiveBlastFu helper.toNetwork(buffer, recipe); } }; + + @Override + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } + @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public BasicParser getParser() { + return parser; + } @Override public @NotNull RecipeType getType() { @@ -62,7 +76,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull PrimitiveBlastFu @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/RecipeCache.java b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java index 4e36d1b7b..3b503cd82 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/RecipeCache.java @@ -1,54 +1,26 @@ package com.veteam.voluminousenergy.recipe; -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.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; +@Deprecated public class RecipeCache { @Nullable - public static VERecipe getRecipeFromCache(Level level, RecipeType> type, List items) { + public static VERecipe getFluidRecipeFromCache(Level level, RecipeType> type, List fluids, 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 VEFluidRecipe getFluidRecipeFromCache(Level level, RecipeType> type, List fluids, List items) { - - var recipes = VERecipe.getCachedRecipes(type); - for (VERecipe r : recipes) { - VEFluidRecipe recipe = (VEFluidRecipe) r; - boolean isValid = true; for (int i = 0; i < fluids.size(); i++) { - if(recipe.getFluidIngredient(i).isEmpty()) continue; + if (recipe.getFluidIngredient(i).isEmpty()) continue; if (!recipe.getFluidIngredient(i).test(fluids.get(i)) || fluids.get(i).getAmount() < recipe.getFluidIngredientAmount(i)) { isValid = false; @@ -68,68 +40,4 @@ public static VEFluidRecipe 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(Level level, RecipeType> type, List slots, List tanks, VETileEntity entity, boolean ignoreEmpty) { - - var recipes = VERecipe.getCachedRecipes(type); - - List recipeList = new ArrayList<>(); - - for (VERecipe recipe : recipes) { - boolean isValid = true; - - for (RelationalTank tank : tanks) { - if (ignoreEmpty && tank.getTank().isEmpty()) continue; - if (tank.getTankType() != TankType.INPUT) continue; - FluidStack currentFluid = tank.getTank().getFluid(); - if (!((VEFluidRecipe) recipe).getFluidIngredient(tank.getRecipePos()).test(currentFluid)) { - isValid = false; - break; - } - } - - 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((VEFluidRecipe) recipe); - } - return recipeList; - } } diff --git a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java similarity index 60% rename from src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java rename to src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java index e283f0222..09538afad 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidSawmillRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/SawmillRecipe.java @@ -3,8 +3,10 @@ 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.SawmillParser; +import com.veteam.voluminousenergy.recipe.serializer.FluidSerializerHelper; import com.veteam.voluminousenergy.tools.Config; -import com.veteam.voluminousenergy.util.recipe.FluidSerializerHelper; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.resources.ResourceLocation; @@ -20,47 +22,54 @@ import javax.annotation.Nullable; import java.util.List; -public class VEFluidSawmillRecipe extends VEFluidRecipe { +public class SawmillRecipe 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() { + private final BasicParser 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) { - super(i,List.of(),of,oi,processTime); + 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); } @@ -77,8 +86,8 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull VEFluidSawmillRe } @Override - public @NotNull ItemStack getToastSymbol(){ - return new ItemStack(VEBlocks.SAWMILL_BLOCK.get()); + public @NotNull ItemStack getToastSymbol() { + return new ItemStack(VEBlocks.SAWMILL.block().get()); } public boolean isLogRecipe() { @@ -96,11 +105,8 @@ public List 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); + 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 3bb261198..a3197c3cb 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/StirlingGeneratorRecipe.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.IngredientSerializerHelper; +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; import net.minecraft.world.item.ItemStack; @@ -16,7 +17,10 @@ public class StirlingGeneratorRecipe extends VEEnergyRecipe { - public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.STIRLING.get(); + public static final RecipeType RECIPE_TYPE = VERecipes.VERecipeTypes.STIRLING.get(); + + private final BasicParser parser = new BasicParser(this) + .addIngredient(0, 0); public StirlingGeneratorRecipe() { } @@ -56,16 +60,22 @@ 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(){ - return new ItemStack(VEBlocks.STIRLING_GENERATOR_BLOCK.get()); + public @NotNull ItemStack getToastSymbol() { + return new ItemStack(VEBlocks.STIRLING_GENERATOR.block().get()); } + @Override + 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 1cdd0ef5e..b65a6e2e4 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/ToolingRecipe.java @@ -5,7 +5,8 @@ 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.parser.BasicParser; +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; @@ -22,14 +23,16 @@ 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(); + + private final BasicParser parser = new BasicParser(this); 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<>(); @@ -130,7 +133,14 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ToolingRecipe re }; @Override - public @NotNull RecipeSerializer getSerializer(){ return SERIALIZER;} + public @NotNull RecipeSerializer getSerializer() { + return SERIALIZER; + } + + @Override + public BasicParser getParser() { + return parser; + } protected Lazy> bits; protected ArrayList basesAndBits; @@ -140,20 +150,20 @@ public void toNetwork(@NotNull FriendlyByteBuf buffer, @NotNull ToolingRecipe re protected String tagKeyString; @Override - public @NotNull RecipeType getType(){ + public @NotNull RecipeType getType() { return RECIPE_TYPE; } @Override - public @NotNull ItemStack getToastSymbol(){ - return new ItemStack(VEBlocks.TOOLING_STATION_BLOCK.get()); + 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()); @@ -162,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 a068b6c69..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<>(),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/VEFluidRNGRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRNGRecipe.java deleted file mode 100644 index bb1d8aad6..000000000 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VEFluidRNGRecipe.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.veteam.voluminousenergy.recipe; - -import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; -import net.minecraftforge.fluids.FluidStack; - -import java.util.List; - -public abstract class VEFluidRNGRecipe extends VEFluidRecipe { - - public List rngValues; - public List itemResultsWithChance; - - public VEFluidRNGRecipe() { - - } - - public VEFluidRNGRecipe(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; - this.rngValues = oi.stream().map(VERecipeCodecs.VEChancedItemWithCount::chance).toList(); - } - - public List getRNGOutputs() { - return rngValues; - } - - public void setRNGOutputs(List rngOutputs) { - this.rngValues = rngOutputs; - } - - public float getOutputChance(int i) { - if (i >= rngValues.size()) { - return 1; - } - return rngValues.get(i); - } -} 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/VERNGExperienceRecipe.java b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java index c7a13834a..347b66fa8 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGExperienceRecipe.java @@ -2,6 +2,7 @@ import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; +import java.util.ArrayList; import java.util.List; public abstract class VERNGExperienceRecipe extends VERNGRecipe { @@ -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 index 0219c8f81..79782e1ec 100644 --- a/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/VERNGRecipe.java @@ -1,47 +1,38 @@ package com.veteam.voluminousenergy.recipe; import com.veteam.voluminousenergy.util.recipe.VERecipeCodecs; -import net.minecraft.world.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; import java.util.List; public abstract class VERNGRecipe extends VERecipe { public List rngValues; - public List resultsWithChance; + public List itemResultsWithChance; 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(); + 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; + this.rngValues = oi.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 void setRNGOutputs(List rngOutputs) { + this.rngValues = rngOutputs; + } + 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 d9350baf2..1acd855fe 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.BasicParser; +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,18 +12,26 @@ 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.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; public abstract class VERecipe implements Recipe { - public List registryIngredients; - private static final HashMap,List> recipeCache = new HashMap<>(); - private static final HashMap,List> newCache = new HashMap<>(); + 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<>(); private NonNullList ingredients = null; @@ -29,17 +39,19 @@ 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); VERecipe recipe = this; - if(newCache.isEmpty()) VoluminousEnergy.LOGGER.info("Building Recipe cache!"); - if(newCache.containsKey(this.getType())) { + if (newCache.containsKey(this.getType())) { newCache.get(this.getType()).add(this); } else { newCache.put(this.getType(), new ArrayList<>() {{ @@ -74,7 +86,6 @@ public boolean canCraftInDimensions(int width, int height) { @Override public @NotNull ItemStack getResultItem(@NotNull RegistryAccess registryAccess) { - VoluminousEnergy.LOGGER.warn("Suspicious call to getResultItem in " + this.getClass().getName() + "."); return new ItemStack(Items.BUCKET, 1); } @@ -89,6 +100,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() { @@ -105,6 +117,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()); } @@ -118,7 +135,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; @@ -136,12 +153,47 @@ 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() { - if(ingredients == null) { + if (ingredients == null) { ingredients = NonNullList.create(); - for(VERecipeCodecs.RegistryIngredient ingredient : registryIngredients) { + for (VERecipeCodecs.RegistryIngredient ingredient : registryIngredients) { ingredients.add(ingredient.getIngredient()); } } @@ -154,7 +206,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); } @@ -166,8 +218,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<>() {{ @@ -175,4 +227,22 @@ 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 abstract BasicParser getParser(); } 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 ec4b3674a..05346cb15 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; @@ -14,64 +12,61 @@ 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 = + 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 = + 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 = + 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 = + 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 = + 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 = + 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)); } @@ -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 = @@ -104,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..67d8a6cc8 --- /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.inventory.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 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/parser/BasicParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/BasicParser.java new file mode 100644 index 000000000..7c657eeae --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/BasicParser.java @@ -0,0 +1,154 @@ +package com.veteam.voluminousenergy.recipe.parser; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +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; +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; + +public class BasicParser { + + List ingredientPositions = new ArrayList<>(); + List itemResultPositions = new ArrayList<>(); + List fluidIngredientPositions = new ArrayList<>(); + List fluidResultPositions = new ArrayList<>(); + + final VERecipe recipe; + + public BasicParser(VERecipe recipe) { + this.recipe = recipe; + } + + public BasicParser addIngredient(int tilePos, int recipePos) { + this.ingredientPositions.add(new SlotAndRecipePos(tilePos, recipePos)); + return this; + } + + public BasicParser addFluidIngredient(int tilePos, int recipePos) { + this.fluidIngredientPositions.add(new SlotAndRecipePos(tilePos, recipePos)); + return this; + } + + public BasicParser addItemResult(int tilePos, int recipePos) { + this.itemResultPositions.add(new SlotAndRecipePos(tilePos, recipePos)); + return this; + } + + public BasicParser addFluidResult(int tilePos, int recipePos) { + this.fluidResultPositions.add(new SlotAndRecipePos(tilePos, recipePos)); + 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.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()); + if (fluidIngredient.isEmpty()) continue; + 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.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; + } + 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) { + tile.getRelationalTank(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); + } + + for (SlotAndRecipePos pos : fluidResultPositions) { + FluidStack result = recipe.getOutputFluid(pos.recipePos()); + tile.getRelationalTank(pos.tilePos()).fillTank(result.copy()); + } + + // 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); + } + } + 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/parser/HydroponicParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java new file mode 100644 index 000000000..2331f2781 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/HydroponicParser.java @@ -0,0 +1,61 @@ +package com.veteam.voluminousenergy.recipe.parser; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +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; +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 RNGBasicParser { + 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/ImplosionCompressorParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/ImplosionCompressorParser.java new file mode 100644 index 000000000..281f86c04 --- /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 BasicParser { + + 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/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/RNGBasicParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGBasicParser.java new file mode 100644 index 000000000..763073654 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/RNGBasicParser.java @@ -0,0 +1,76 @@ +package com.veteam.voluminousenergy.recipe.parser; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; +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; +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 RNGBasicParser extends BasicParser { + public RNGBasicParser(VERecipe recipe) { + super(recipe); + } + + List randomItemResultPositions = new ArrayList<>(); + + public RNGBasicParser 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()); + 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; + 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/SawmillParser.java b/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java new file mode 100644 index 000000000..d796975e8 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/parser/SawmillParser.java @@ -0,0 +1,153 @@ +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 BasicParser { + + 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()) && 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.getRelationalTank(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.getRelationalTank(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/recipe/processor/AbstractRecipeProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java new file mode 100644 index 000000000..f07f12451 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AbstractRecipeProcessor.java @@ -0,0 +1,31 @@ +package com.veteam.voluminousenergy.recipe.processor; + +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; + +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 + * 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); + + + +} 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..5730efff6 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/AirCompressorProcessor.java @@ -0,0 +1,80 @@ +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.getRelationalTank(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 = tile.updateCounter(20); + 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/BasicProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/BasicProcessor.java new file mode 100644 index 000000000..7e35c95f2 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/BasicProcessor.java @@ -0,0 +1,68 @@ +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.BasicParser; +import com.veteam.voluminousenergy.sounds.VESounds; +import com.veteam.voluminousenergy.tools.Config; +import net.minecraft.sounds.SoundSource; + +public class BasicProcessor implements AbstractRecipeProcessor { + + @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 = tile.updateCounter(newRecipe); + + 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) { + + BasicParser 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/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/CombustionGeneratorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java new file mode 100644 index 000000000..21ce365b6 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/CombustionGeneratorProcessor.java @@ -0,0 +1,94 @@ +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; +import com.veteam.voluminousenergy.recipe.VERecipe; +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; + + +public class CombustionGeneratorProcessor extends BasicProcessor { + public static final int COMBUSTION_GENERATOR_CONSUMPTION_AMOUNT = 250; + public static final int COMBUSTION_GENERATOR_PROCESS_TIME = 1600; + + @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.setSelectedRecipe(null); + return; + } + if (tile.getSelectedRecipe() != newRecipe) { + tile.setSelectedRecipe(newRecipe); + } + } else { + tile.setSelectedRecipe(null); + } + } + + @Override + public void processRecipe(VETileEntity tile) { + VERecipe recipe = tile.getSelectedRecipe(); + int counter = tile.getData("counter"); + VEEnergyStorage storage = tile.getEnergy(); + if (storage.getEnergyStored() + storage.getProduction() > 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); + + 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; + } + + int production = (int) (powerGeneration * multiplier); + + VoluminousEnergy.LOGGER.info("Setting production to: " + production); + + storage.setProduction(production); + tile.setData("length",counter); + tile.setChanged(); + } else { + storage.setProduction(0); + } + tile.setData("counter", counter); + } + +} 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..ddc8fc0a3 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/DimensionalLaserRecipeProcessor.java @@ -0,0 +1,167 @@ +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; +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.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; +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.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) { + tile.setChanged(); + 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); + } + } + + // 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); + } + + 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.setChanged(); + tile.setData("build_tick", buildTick + 1); + return; + } + + if (!tile.canConsumeEnergy()) return; + ItemStack stack = tile.getStackInSlot(2); + if (stack.isEmpty()) { + tile.updateCounter(Config.DIMENSIONAL_LASER_PROCESS_TIME.get()); + 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.getRelationalTank(0).testFillTank(new FluidStack(singleChunkFluid.getFluid(), amount)) > 0; + if (!canFill) return; + + int counter = tile.getData("counter"); + + if (counter == 1) { + counter--; + FluidStack fluidStack = new FluidStack(singleChunkFluid.getFluid(), amount); + tile.getRelationalTank(0).fillTank(fluidStack); + tile.consumeEnergy(); + tile.setChanged(); + } else if (counter > 0) { + counter--; + tile.consumeEnergy(); + } else { + counter = tile.updateCounter(Config.DIMENSIONAL_LASER_PROCESS_TIME.get()); + } + 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(0, -3, 0), + tile.getBlockPos().offset(0, -1, 0))) { + + 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/ElectricFurnaceProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/ElectricFurnaceProcessor.java new file mode 100644 index 000000000..f50cca732 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/ElectricFurnaceProcessor.java @@ -0,0 +1,86 @@ +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"); + 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..b35e681b0 --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GasFiredFurnaceProcessor.java @@ -0,0 +1,118 @@ +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) { + 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) && !stack.isEmpty()) { + // Drain Input + tile.getRelationalTank(0).getTank().drain(250, IFluidHandler.FluidAction.EXECUTE); + 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); + } 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 { + 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; + } + 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(3, 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/GeneratorProcessor.java b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java new file mode 100644 index 000000000..36e0af22f --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/GeneratorProcessor.java @@ -0,0 +1,87 @@ +package com.veteam.voluminousenergy.recipe.processor; + +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.BasicParser; +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; + +import java.util.List; + +public class GeneratorProcessor implements AbstractRecipeProcessor { + + private int divisor = 1; + private boolean allowOverflow = false; + + public GeneratorProcessor(boolean allowOverflow, int divisor) { + this.allowOverflow = allowOverflow; + this.divisor = divisor; + } + + + public GeneratorProcessor() { + } + + @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 + 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 veEnergyRecipe) { + 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; + // 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 { + tile.getEnergy().setProduction(0); + } + } + } + +} 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..ae947c1dd --- /dev/null +++ b/src/main/java/com/veteam/voluminousenergy/recipe/processor/MultiBlockRecipeProcessor.java @@ -0,0 +1,72 @@ +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 BasicProcessor { + + private RegistryObject blockRegistry; + private Block block; + + public MultiBlockRecipeProcessor(RegistryObject 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; + 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); + + 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() != getBlock()) { // Fails MultiBlock condition + lastReading = false; + } + } + return lastReading; + } + + Block getBlock() { + if (block == null) { + block = blockRegistry.get(); + } + return block; + } + +} 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..cc88dc051 --- /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.getRelationalTank(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.getRelationalTank(0).getTank() + .fill(new FluidStack(fluid, 1000), IFluidHandler.FluidAction.EXECUTE); + } +} 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; + } +} 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 88% 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 20f3b06c8..21432386c 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,8 @@ -package com.veteam.voluminousenergy.util.recipe; +package com.veteam.voluminousenergy.recipe.serializer; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; -import com.veteam.voluminousenergy.recipe.VEFluidRNGRecipe; +import com.veteam.voluminousenergy.recipe.VERNGRecipe; 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 +13,7 @@ import java.util.ArrayList; import java.util.List; -public class FluidSerializerHelper { +public class FluidSerializerHelper { @Nullable public T fromNetwork(T recipe, FriendlyByteBuf buffer) { @@ -49,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++) { @@ -86,9 +86,9 @@ 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()) { + for (float f : irngRecipe.getRNGOutputs()) { buffer.writeFloat(f); } } 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 88% 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..dc602b20e 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/recipe/IngredientSerializerHelper.java +++ b/src/main/java/com/veteam/voluminousenergy/recipe/serializer/IngredientSerializerHelper.java @@ -1,4 +1,4 @@ -package com.veteam.voluminousenergy.util.recipe; +package com.veteam.voluminousenergy.recipe.serializer; import com.veteam.voluminousenergy.recipe.VERNGExperienceRecipe; import com.veteam.voluminousenergy.recipe.VERNGRecipe; @@ -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..7b19cc42e 100644 --- a/src/main/java/com/veteam/voluminousenergy/setup/ClientProxy.java +++ b/src/main/java/com/veteam/voluminousenergy/setup/ClientProxy.java @@ -12,46 +12,47 @@ 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 - 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/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; 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 deleted file mode 100644 index 086f199d1..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 cb84630fb..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; + private int u = 0; + private int v = 166; - 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; @@ -36,32 +33,30 @@ 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); + tile.setSendsOutPower(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 eeea945ad..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 @@ -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); @@ -30,29 +30,33 @@ public TankBoolButton(RelationalTank tank, int x, int y, Button.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 = 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 17af2d0d2..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 @@ -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.RelationalTank; 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; @@ -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); @@ -33,8 +33,8 @@ public TankDirectionButton(RelationalTank 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 9c8e43fd6..5d88e2a79 100644 --- a/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java +++ b/src/main/java/com/veteam/voluminousenergy/tools/energy/VEEnergyStorage.java @@ -9,24 +9,35 @@ 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 void setEnergy(int energy){ + 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; } } - public void consumeEnergy(int energy){ + public void consumeEnergy(int energy) { this.energy -= energy; - if (this.energy < 0){ + if (this.energy < 0) { this.energy = 0; } } @@ -40,20 +51,72 @@ 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; + } + + public boolean isFullyCharged() { + return this.capacity == this.energy; + } + } 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..ddaf10933 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) @@ -60,13 +61,19 @@ 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(){ + 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 8741cf29d..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.BatteryBoxContainer; -import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; +import com.veteam.voluminousenergy.blocks.tiles.VETileEntity; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.inventory.AbstractContainerMenu; @@ -12,50 +12,49 @@ 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 BatteryBoxContainer batteryBoxContainer){ - if(onServer){ - BlockEntity tileEntity = batteryBoxContainer.getTileEntity(); - if(tileEntity instanceof BatteryBoxTile batteryBoxTile){ - batteryBoxTile.updateSendOutPower(packet.status); - batteryBoxTile.setChanged(); + public static void handlePacket(BatteryBoxSendOutPowerPacket packet, AbstractContainerMenu openContainer, boolean onServer) { + if (openContainer != null) { + if (openContainer instanceof VEContainer container) { + if (onServer) { + 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 e0d3b0136..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.BatteryBoxContainer; -import com.veteam.voluminousenergy.blocks.tiles.BatteryBoxTile; +import com.veteam.voluminousenergy.blocks.containers.VEContainer; import net.minecraft.client.Minecraft; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.world.inventory.AbstractContainerMenu; @@ -13,51 +12,51 @@ 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); } } 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) { - 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/networking/packets/BoolButtonPacket.java b/src/main/java/com/veteam/voluminousenergy/tools/networking/packets/BoolButtonPacket.java index 75c333c60..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 @@ -14,59 +14,57 @@ 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){ - //VoluminousEnergy.LOGGER.debug(contextSupplier.get().getDirection()); + public static void handle(BoolButtonPacket 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(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/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!"); + } + } + +} 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 99eb32a42..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 @@ -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; @@ -14,52 +14,52 @@ 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 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..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 @@ -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; @@ -14,52 +14,52 @@ 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) { 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/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 d4aa0b5fa..54569c763 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) { @@ -35,12 +33,13 @@ 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 - * @param direction The direction it will be facing by default - * @param status The status of the IO - * @param slotType The type of slot + * + * @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 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 + * @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); @@ -52,22 +51,6 @@ public VESlotManager(int slotNum, Direction direction, boolean status, SlotType this.tankId = tankId; } - /** - * Use this for an input slot or others - * @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 slot - */ - 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 +79,6 @@ public String getTranslationKey() { return slotType.getTranslationKey(); } - public int getRecipePos() { - return recipePos; - } - public String getNbtName() { return nbtName; } @@ -137,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/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/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 ce378d1fc..f657c6bf7 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java +++ b/src/main/java/com/veteam/voluminousenergy/util/MultiFluidSlotWrapper.java @@ -1,29 +1,21 @@ 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; +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; import javax.annotation.Nonnull; -import java.util.HashMap; import java.util.List; public class MultiFluidSlotWrapper implements IFluidHandler { + List tanks; + VETileEntity tileEntity; - HashMap tankHashMap = new HashMap<>(); - List tanks; - VEFluidTileEntity 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)); } @Override @@ -34,29 +26,24 @@ public int getTanks() { @Nonnull @Override public FluidStack getFluidInTank(int tank) { - if (tankHashMap.containsKey(tank)) { - RelationalTank 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)) { - RelationalTank 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) { - RelationalTank 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)) { + 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; } } @@ -66,11 +53,10 @@ public boolean isFluidValid(int tank, @Nonnull FluidStack stack) { @Override public int fill(FluidStack resource, FluidAction action) { - for(RelationalTank 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.getTank().getFluid().getAmount() != tank.getTank().getCapacity()) tileEntity.markRecipeDirty(); return tank.getTank().fill(resource.copy(), action); } } @@ -83,13 +69,13 @@ public FluidStack drain(FluidStack resource, FluidAction action) { if (resource.isEmpty()) { return FluidStack.EMPTY; } - for(RelationalTank 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); } } @@ -99,25 +85,23 @@ public FluidStack drain(FluidStack resource, FluidAction action) { @Nonnull @Override public FluidStack drain(int maxDrain, FluidAction action) { - for(RelationalTank 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 (!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); } } return FluidStack.EMPTY; } - public void addRelationalTank(RelationalTank tank) { - tankHashMap.put(tank.getSlotNum(),tank); + public void addRelationalTank(VERelationalTank tank) { tanks.add(tank); } - public void removeRelationalTank(RelationalTank tank) { - tankHashMap.remove(tank.getSlotNum()); + + public void removeRelationalTank(VERelationalTank tank) { tanks.remove(tank); } } \ No newline at end of file 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 2d732d799..2ea734b97 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/SlotType.java +++ b/src/main/java/com/veteam/voluminousenergy/util/SlotType.java @@ -3,12 +3,13 @@ public enum SlotType { INPUT("slot.voluminousenergy.input_slot"), OUTPUT("slot.voluminousenergy.output_slot"), - FLUID_INPUT("slot.voluminousenergy.input_slot",true), - FLUID_OUTPUT("slot.voluminousenergy.output_slot",true); + 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; - 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 de2f195e4..4e612cf4b 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/RelationalTank.java b/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java similarity index 55% rename from src/main/java/com/veteam/voluminousenergy/util/RelationalTank.java rename to src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java index 785280e4f..ee4093cda 100644 --- a/src/main/java/com/veteam/voluminousenergy/util/RelationalTank.java +++ b/src/main/java/com/veteam/voluminousenergy/util/VERelationalTank.java @@ -1,21 +1,15 @@ package com.veteam.voluminousenergy.util; -import com.veteam.voluminousenergy.blocks.tiles.VEFluidTileEntity; -import com.veteam.voluminousenergy.recipe.VEFluidRecipe; +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.item.crafting.Recipe; -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 RelationalTank { +public class VERelationalTank { FluidTank tank; int slotNum; @@ -23,23 +17,24 @@ public class RelationalTank { 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 */ 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 +44,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 +54,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,16 +62,20 @@ 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, 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; } /** @@ -84,53 +83,19 @@ 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(); } - /** - * @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(VEFluidRecipe 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); } - public void setValidator(VEFluidTileEntity 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; - }); + 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(VEFluidRecipe recipe, int id) { - this.tank.drain(recipe.getFluidIngredients().get(id).getFluids()[0].getAmount(), IFluidHandler.FluidAction.EXECUTE); - } public boolean isIgnoreDirection() { return ignoreDirection; @@ -148,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; } @@ -182,10 +129,6 @@ public int getSlotNum() { return slotNum; } - public void setSlotNum(int slotNum) { - this.slotNum = slotNum; - } - public ItemStack getInput() { return input; } @@ -230,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"; @@ -253,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(); - } } diff --git a/src/main/java/com/veteam/voluminousenergy/util/WorldUtil.java b/src/main/java/com/veteam/voluminousenergy/util/WorldUtil.java index 510787434..393fc259d 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; @@ -47,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()); @@ -63,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); @@ -82,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))); } } @@ -108,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) @@ -138,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 b45ed2f83..5ee95170a 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; @@ -79,7 +78,7 @@ public FluidStack[] getFluids() { return this.fluidStacks; } - public int getCount() { + public int getAmountNeeded() { return getFluids()[0].getAmount(); } @@ -187,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) { @@ -199,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) { @@ -278,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_) -> { @@ -309,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); }); @@ -329,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 23f0dbf8d..f71877f97 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.SawmillRecipe; import com.veteam.voluminousenergy.util.RegistryLookups; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.TagKey; @@ -15,22 +17,24 @@ 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 { - 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; @@ -40,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; } } @@ -52,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]); }); } } @@ -95,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 (ingredientStack.getItem().equals(logStack.getItem())){ - atomicRecipe.set(VEFluidSawmillRecipe); + if (recipe.value() instanceof SawmillRecipe SawmillRecipe) { + if (!SawmillRecipe.isLogRecipe()) { + for (ItemStack ingredientStack : SawmillRecipe.getIngredient(0).getItems()) { + if (ingredientStack.getItem().equals(logStack.getItem())) { + atomicRecipe.set(SawmillRecipe); break; } } @@ -114,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); } } } @@ -131,42 +137,44 @@ 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 (itemStack.getItem().equals(item)){ - atomicRecipe.set(VEFluidSawmillRecipe); + if (recipe.value() instanceof SawmillRecipe SawmillRecipe) { + if (!SawmillRecipe.isLogRecipe()) { + Item item = SawmillRecipe.getResult(0).getItem(); + if (itemStack.getItem().equals(item)) { + atomicRecipe.set(SawmillRecipe); } } } }); 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; @@ -174,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); } } @@ -186,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); } } @@ -224,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..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 { @@ -68,7 +71,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 +129,45 @@ 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 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 record IntPair(int min, int max) {} + 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 ClimateData(FloatPair continentalness,FloatPair erosion, FloatPair humidity, FloatPair temperature ) {} + public record FloatPair(float min, float max) { + } - public record FluidMinMax(Fluid fluid,int min,int max) { + public record IntPair(int min, int max) { + } + + public record ClimateData(FloatPair continentalness, FloatPair erosion, FloatPair humidity, FloatPair temperature) { + } + + public record FluidMinMax(Fluid fluid, int min, int max) { } @@ -171,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/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java b/src/main/java/com/veteam/voluminousenergy/util/tiles/CapabilityMap.java index db493c701..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,14 +1,12 @@ 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; 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; @@ -24,42 +22,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 VEFluidTileEntity 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); @@ -67,26 +64,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/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/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/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 4f50e31ad..88e325729 100644 --- a/src/main/resources/assets/voluminousenergy/lang/en_us.json +++ b/src/main/resources/assets/voluminousenergy/lang/en_us.json @@ -1,483 +1,468 @@ { - "_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.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", + "block.voluminousenergy.laser_pylon": "Laser Pylon", + "_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": "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!", + "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/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/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/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/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/assets/voluminousenergy/textures/block/laser_pylon.png b/src/main/resources/assets/voluminousenergy/textures/block/laser_pylon.png new file mode 100644 index 000000000..f7d5bbbcd Binary files /dev/null and b/src/main/resources/assets/voluminousenergy/textures/block/laser_pylon.png differ 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/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/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/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/fuel_combustion/biofuel.json b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/biofuel.json index 96d9b92b3..9edd3fe4a 100644 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/biofuel.json +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/biofuel.json @@ -3,8 +3,11 @@ "fluid_ingredients": [ { "tag": "forge:biofuel", - "amount" : 250 + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "amount": 250 } - ], - "volumetric_energy": 115200 + ] } \ 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 index d7950d083..1b8146705 100644 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/crude_oil.json +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/crude_oil.json @@ -3,8 +3,11 @@ "fluid_ingredients": [ { "tag": "forge:crude_oil", - "amount" : 250 + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "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 index e0c56cdd5..bd99425d3 100644 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/diesel.json +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/diesel.json @@ -3,8 +3,11 @@ "fluid_ingredients": [ { "tag": "forge:diesel", - "amount" : 250 + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "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 index 2eeaff7a2..7c71faf5e 100644 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/gasoline.json +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/gasoline.json @@ -3,8 +3,11 @@ "fluid_ingredients": [ { "tag": "forge:gasoline", - "amount" : 250 + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "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 index 145521151..0a0fe6843 100644 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/light_fuel.json +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/light_fuel.json @@ -3,8 +3,11 @@ "fluid_ingredients": [ { "tag": "forge:light_fuel", - "amount" : 250 + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "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 index 17ceabf78..366212215 100644 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coal.json +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coal.json @@ -3,8 +3,11 @@ "fluid_ingredients": [ { "tag": "forge:liquefied_coal", - "amount" : 250 + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "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 index ee2293976..13f4df476 100644 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coke.json +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/liquefied_coke.json @@ -3,8 +3,11 @@ "fluid_ingredients": [ { "tag": "forge:liquefied_coke", - "amount" : 250 + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "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 index 35c7ec53d..ecd564c70 100644 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/naphtha.json +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/naphtha.json @@ -3,8 +3,11 @@ "fluid_ingredients": [ { "tag": "forge:naphtha", - "amount" : 250 + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "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 index b25b3d3c6..60c2f0bf1 100644 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/nitroglycerin.json +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/nitroglycerin.json @@ -3,8 +3,11 @@ "fluid_ingredients": [ { "tag": "forge:nitroglycerin", - "amount" : 250 + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "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 index 02ad7816a..d2a19e593 100644 --- a/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/treethanol.json +++ b/src/main/resources/data/voluminousenergy/recipes/fuel_combustion/treethanol.json @@ -3,8 +3,11 @@ "fluid_ingredients": [ { "tag": "forge:treethanol", - "amount" : 250 + "amount": 250 + }, + { + "tag": "voluminousenergy:oxidizer", + "amount": 250 } - ], - "volumetric_energy": 102400 + ] } \ No newline at end of file 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 }, { 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 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 diff --git a/src/main/resources/data/voluminousenergy/tags/fluids/combustible.json b/src/main/resources/data/voluminousenergy/tags/fluids/combustible.json new file mode 100644 index 000000000..edd3ac5b6 --- /dev/null +++ b/src/main/resources/data/voluminousenergy/tags/fluids/combustible.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 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." + } }