From 7065f5efaea2ac76c5986d37054664e9281cc9ba Mon Sep 17 00:00:00 2001 From: modmuss50 Date: Wed, 2 Mar 2022 01:06:05 +0000 Subject: [PATCH] Split GuiType into ClientGuiType to remove some horrid code. --- .../src/main/java/reborncore/RebornCore.java | 6 - .../client/gui/builder/GuiBase.java | 2 +- .../gui/builder/slot/SlotConfigGui.java | 2 +- .../screen/builder/ScreenHandlerBuilder.java | 1 + .../network/ClientBoundPacketHandlers.java | 2 +- .../screen}/BuiltScreenHandler.java | 2 +- .../screen/BuiltScreenHandlerProvider.java | 4 +- src/main/java/techreborn/TechReborn.java | 2 +- .../java/techreborn/TechRebornClient.java | 2 + .../{client => blockentity}/GuiType.java | 145 +++++++----------- .../data/DataDrivenBEProvider.java | 4 +- .../blockentity/data/DataDrivenGui.java | 2 +- .../generator/PlasmaGeneratorBlockEntity.java | 4 +- .../generator/SolarPanelBlockEntity.java | 4 +- .../advanced/DieselGeneratorBlockEntity.java | 4 +- .../advanced/GasTurbineBlockEntity.java | 4 +- .../SemiFluidGeneratorBlockEntity.java | 4 +- .../advanced/ThermalGeneratorBlockEntity.java | 4 +- .../basic/SolidFuelGeneratorBlockEntity.java | 4 +- .../iron/IronAlloyFurnaceBlockEntity.java | 4 +- .../machine/iron/IronFurnaceBlockEntity.java | 4 +- .../machine/misc/ChargeOMatBlockEntity.java | 4 +- .../DistillationTowerBlockEntity.java | 4 +- .../FluidReplicatorBlockEntity.java | 4 +- .../FusionControlComputerBlockEntity.java | 4 +- .../ImplosionCompressorBlockEntity.java | 4 +- .../IndustrialBlastFurnaceBlockEntity.java | 4 +- .../IndustrialGrinderBlockEntity.java | 4 +- .../IndustrialSawmillBlockEntity.java | 4 +- .../multiblock/VacuumFreezerBlockEntity.java | 4 +- .../tier1/AlloySmelterBlockEntity.java | 4 +- .../tier1/AssemblingMachineBlockEntity.java | 4 +- .../tier1/AutoCraftingTableBlockEntity.java | 4 +- .../tier1/ChemicalReactorBlockEntity.java | 4 +- .../machine/tier1/CompressorBlockEntity.java | 4 +- .../tier1/ElectricFurnaceBlockEntity.java | 4 +- .../machine/tier1/ExtractorBlockEntity.java | 4 +- .../GreenhouseControllerBlockEntity.java | 4 +- .../IndustrialElectrolyzerBlockEntity.java | 4 +- .../tier1/PlayerDetectorBlockEntity.java | 4 +- .../machine/tier1/RecyclerBlockEntity.java | 4 +- .../tier1/RollingMachineBlockEntity.java | 4 +- .../tier1/ScrapboxinatorBlockEntity.java | 4 +- .../tier1/SolidCanningMachineBlockEntity.java | 4 +- .../machine/tier1/WireMillBlockEntity.java | 4 +- .../machine/tier3/ChunkLoaderBlockEntity.java | 4 +- .../IndustrialCentrifugeBlockEntity.java | 4 +- .../tier3/MatterFabricatorBlockEntity.java | 4 +- .../energy/AdjustableSUBlockEntity.java | 4 +- .../energy/HighVoltageSUBlockEntity.java | 5 +- .../energy/LowVoltageSUBlockEntity.java | 4 +- .../energy/MediumVoltageSUBlockEntity.java | 4 +- .../idsu/InterdimensionalSUBlockEntity.java | 4 +- .../energy/lesu/LapotronicSUBlockEntity.java | 6 +- .../fluid/TankUnitBaseBlockEntity.java | 4 +- .../item/StorageUnitBaseBlockEntity.java | 4 +- .../blocks/DataDrivenMachineBlock.java | 2 +- .../generator/BlockFusionControlComputer.java | 2 +- .../blocks/generator/BlockSolarPanel.java | 2 +- .../machine/tier0/IronAlloyFurnaceBlock.java | 2 +- .../machine/tier0/IronFurnaceBlock.java | 2 +- .../machine/tier1/PlayerDetectorBlock.java | 2 +- .../storage/energy/AdjustableSUBlock.java | 2 +- .../storage/energy/HighVoltageSUBlock.java | 2 +- .../energy/InterdimensionalSUBlock.java | 2 +- .../storage/energy/LapotronicSUBlock.java | 2 +- .../storage/energy/LowVoltageSUBlock.java | 2 +- .../storage/energy/MediumVoltageSUBlock.java | 2 +- .../blocks/storage/fluid/TankUnitBlock.java | 2 +- .../blocks/storage/item/StorageUnitBlock.java | 2 +- .../java/techreborn/client/ClientGuiType.java | 144 +++++++++++++++++ .../java/techreborn/client/GuiFactory.java | 48 ++++++ .../java/techreborn/client/gui/GuiAESU.java | 2 +- .../client/gui/GuiAlloyFurnace.java | 2 +- .../client/gui/GuiAlloySmelter.java | 2 +- .../client/gui/GuiAssemblingMachine.java | 2 +- .../client/gui/GuiAutoCrafting.java | 2 +- .../java/techreborn/client/gui/GuiBatbox.java | 2 +- .../client/gui/GuiBlastFurnace.java | 2 +- .../techreborn/client/gui/GuiCentrifuge.java | 2 +- .../techreborn/client/gui/GuiChargeBench.java | 2 +- .../client/gui/GuiChemicalReactor.java | 2 +- .../techreborn/client/gui/GuiChunkLoader.java | 2 +- .../techreborn/client/gui/GuiCompressor.java | 2 +- .../client/gui/GuiDieselGenerator.java | 2 +- .../client/gui/GuiDistillationTower.java | 2 +- .../client/gui/GuiElectricFurnace.java | 2 +- .../techreborn/client/gui/GuiExtractor.java | 2 +- .../client/gui/GuiFluidReplicator.java | 2 +- .../client/gui/GuiFusionReactor.java | 2 +- .../techreborn/client/gui/GuiGasTurbine.java | 2 +- .../techreborn/client/gui/GuiGenerator.java | 2 +- .../client/gui/GuiGreenhouseController.java | 2 +- .../java/techreborn/client/gui/GuiIDSU.java | 2 +- .../client/gui/GuiImplosionCompressor.java | 2 +- .../client/gui/GuiIndustrialElectrolyzer.java | 2 +- .../client/gui/GuiIndustrialGrinder.java | 2 +- .../client/gui/GuiIndustrialSawmill.java | 2 +- .../techreborn/client/gui/GuiIronFurnace.java | 2 +- .../java/techreborn/client/gui/GuiLESU.java | 2 +- .../java/techreborn/client/gui/GuiMFE.java | 2 +- .../java/techreborn/client/gui/GuiMFSU.java | 2 +- .../client/gui/GuiMatterFabricator.java | 2 +- .../client/gui/GuiPlasmaGenerator.java | 2 +- .../client/gui/GuiPlayerDetector.java | 2 +- .../techreborn/client/gui/GuiRecycler.java | 2 +- .../client/gui/GuiRollingMachine.java | 2 +- .../client/gui/GuiScrapboxinator.java | 2 +- .../client/gui/GuiSemifluidGenerator.java | 2 +- .../java/techreborn/client/gui/GuiSolar.java | 2 +- .../client/gui/GuiSolidCanningMachine.java | 2 +- .../techreborn/client/gui/GuiStorageUnit.java | 2 +- .../techreborn/client/gui/GuiTankUnit.java | 2 +- .../client/gui/GuiThermalGenerator.java | 2 +- .../client/gui/GuiVacuumFreezer.java | 2 +- .../techreborn/client/gui/GuiWireMill.java | 2 +- src/main/java/techreborn/init/TRContent.java | 3 +- 117 files changed, 411 insertions(+), 253 deletions(-) rename RebornCore/src/main/java/reborncore/{client/screen/builder => common/screen}/BuiltScreenHandler.java (99%) rename RebornCore/src/main/java/reborncore/{client => common}/screen/BuiltScreenHandlerProvider.java (93%) rename src/main/java/techreborn/{client => blockentity}/GuiType.java (62%) create mode 100644 src/main/java/techreborn/client/ClientGuiType.java create mode 100644 src/main/java/techreborn/client/GuiFactory.java diff --git a/RebornCore/src/main/java/reborncore/RebornCore.java b/RebornCore/src/main/java/reborncore/RebornCore.java index 66c1b69a6..83c8689b6 100644 --- a/RebornCore/src/main/java/reborncore/RebornCore.java +++ b/RebornCore/src/main/java/reborncore/RebornCore.java @@ -140,10 +140,4 @@ public class RebornCore implements ModInitializer { public static EnvType getSide() { return FabricLoader.getInstance().getEnvironmentType(); } - - public static void clientOnly(Supplier runnable){ - if(FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT){ - runnable.get().run(); - } - } } diff --git a/RebornCore/src/main/java/reborncore/client/gui/builder/GuiBase.java b/RebornCore/src/main/java/reborncore/client/gui/builder/GuiBase.java index 0e8a94327..c5bd6fd65 100644 --- a/RebornCore/src/main/java/reborncore/client/gui/builder/GuiBase.java +++ b/RebornCore/src/main/java/reborncore/client/gui/builder/GuiBase.java @@ -54,7 +54,7 @@ import reborncore.client.gui.builder.slot.GuiTab; import reborncore.client.gui.builder.slot.SlotConfigGui; import reborncore.client.gui.builder.widget.GuiButtonHologram; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.slot.PlayerInventorySlot; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.mixin.client.AccessorScreen; diff --git a/RebornCore/src/main/java/reborncore/client/gui/builder/slot/SlotConfigGui.java b/RebornCore/src/main/java/reborncore/client/gui/builder/slot/SlotConfigGui.java index 18667c951..f1cc1e485 100644 --- a/RebornCore/src/main/java/reborncore/client/gui/builder/slot/SlotConfigGui.java +++ b/RebornCore/src/main/java/reborncore/client/gui/builder/slot/SlotConfigGui.java @@ -37,7 +37,7 @@ import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.slot.elements.ConfigSlotElement; import reborncore.client.gui.builder.slot.elements.ElementBase; import reborncore.client.gui.builder.slot.elements.SlotType; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.network.NetworkManager; import reborncore.common.network.ServerBoundPackets; diff --git a/RebornCore/src/main/java/reborncore/client/screen/builder/ScreenHandlerBuilder.java b/RebornCore/src/main/java/reborncore/client/screen/builder/ScreenHandlerBuilder.java index 5c2171dc4..efff246ea 100644 --- a/RebornCore/src/main/java/reborncore/client/screen/builder/ScreenHandlerBuilder.java +++ b/RebornCore/src/main/java/reborncore/client/screen/builder/ScreenHandlerBuilder.java @@ -33,6 +33,7 @@ import net.minecraft.util.math.Vec3d; import org.apache.commons.lang3.Range; import org.apache.commons.lang3.tuple.Pair; import reborncore.common.blockentity.MachineBaseBlockEntity; +import reborncore.common.screen.BuiltScreenHandler; import java.util.ArrayList; import java.util.List; diff --git a/RebornCore/src/main/java/reborncore/common/network/ClientBoundPacketHandlers.java b/RebornCore/src/main/java/reborncore/common/network/ClientBoundPacketHandlers.java index f6a7508e3..9cf3d7ba3 100644 --- a/RebornCore/src/main/java/reborncore/common/network/ClientBoundPacketHandlers.java +++ b/RebornCore/src/main/java/reborncore/common/network/ClientBoundPacketHandlers.java @@ -41,7 +41,7 @@ import org.slf4j.LoggerFactory; import org.slf4j.Logger; import reborncore.RebornCore; import reborncore.client.ClientChunkManager; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.blockentity.FluidConfiguration; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blockentity.SlotConfiguration; diff --git a/RebornCore/src/main/java/reborncore/client/screen/builder/BuiltScreenHandler.java b/RebornCore/src/main/java/reborncore/common/screen/BuiltScreenHandler.java similarity index 99% rename from RebornCore/src/main/java/reborncore/client/screen/builder/BuiltScreenHandler.java rename to RebornCore/src/main/java/reborncore/common/screen/BuiltScreenHandler.java index 83206005d..b8c396761 100644 --- a/RebornCore/src/main/java/reborncore/client/screen/builder/BuiltScreenHandler.java +++ b/RebornCore/src/main/java/reborncore/common/screen/BuiltScreenHandler.java @@ -22,7 +22,7 @@ * SOFTWARE. */ -package reborncore.client.screen.builder; +package reborncore.common.screen; import it.unimi.dsi.fastutil.ints.Int2ObjectMap; import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; diff --git a/RebornCore/src/main/java/reborncore/client/screen/BuiltScreenHandlerProvider.java b/RebornCore/src/main/java/reborncore/common/screen/BuiltScreenHandlerProvider.java similarity index 93% rename from RebornCore/src/main/java/reborncore/client/screen/BuiltScreenHandlerProvider.java rename to RebornCore/src/main/java/reborncore/common/screen/BuiltScreenHandlerProvider.java index bf9aa98aa..d4a23c618 100644 --- a/RebornCore/src/main/java/reborncore/client/screen/BuiltScreenHandlerProvider.java +++ b/RebornCore/src/main/java/reborncore/common/screen/BuiltScreenHandlerProvider.java @@ -22,10 +22,10 @@ * SOFTWARE. */ -package reborncore.client.screen; +package reborncore.common.screen; import net.minecraft.entity.player.PlayerEntity; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; public interface BuiltScreenHandlerProvider { BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player); diff --git a/src/main/java/techreborn/TechReborn.java b/src/main/java/techreborn/TechReborn.java index 1bb0b595a..bb16be8c1 100644 --- a/src/main/java/techreborn/TechReborn.java +++ b/src/main/java/techreborn/TechReborn.java @@ -39,7 +39,7 @@ import reborncore.common.blockentity.RedstoneConfiguration; import reborncore.common.config.Configuration; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.util.Torus; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; import techreborn.compat.trinkets.Trinkets; import techreborn.config.TechRebornConfig; import techreborn.events.ApplyArmorToDamageHandler; diff --git a/src/main/java/techreborn/TechRebornClient.java b/src/main/java/techreborn/TechRebornClient.java index 79580c511..77f7f9552 100644 --- a/src/main/java/techreborn/TechRebornClient.java +++ b/src/main/java/techreborn/TechRebornClient.java @@ -55,6 +55,7 @@ import reborncore.common.powerSystem.RcEnergyItem; import reborncore.common.util.ItemUtils; import reborncore.mixin.client.AccessorModelPredicateProviderRegistry; import team.reborn.energy.api.base.SimpleBatteryItem; +import techreborn.client.ClientGuiType; import techreborn.client.render.DynamicBucketBakedModel; import techreborn.client.render.DynamicCellBakedModel; import techreborn.client.render.entitys.CableCoverRenderer; @@ -243,6 +244,7 @@ public class TechRebornClient implements ClientModInitializer { } ); + ClientGuiType.validate(); } private static void registerPredicateProvider(Class itemClass, Identifier identifier, ItemModelPredicateProvider modelPredicateProvider) { diff --git a/src/main/java/techreborn/client/GuiType.java b/src/main/java/techreborn/blockentity/GuiType.java similarity index 62% rename from src/main/java/techreborn/client/GuiType.java rename to src/main/java/techreborn/blockentity/GuiType.java index 4a9cbfef0..3f0b818fa 100644 --- a/src/main/java/techreborn/client/GuiType.java +++ b/src/main/java/techreborn/blockentity/GuiType.java @@ -22,15 +22,11 @@ * SOFTWARE. */ -package techreborn.client; +package techreborn.blockentity; -import net.fabricmc.api.EnvType; -import net.fabricmc.api.Environment; -import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry; import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory; import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry; import net.minecraft.block.entity.BlockEntity; -import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.network.PacketByteBuf; @@ -43,12 +39,10 @@ import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -import reborncore.RebornCore; import reborncore.api.blockentity.IMachineGuiHandler; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.data.DataDrivenBEProvider; -import techreborn.blockentity.data.DataDrivenGui; import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity; import techreborn.blockentity.generator.SolarPanelBlockEntity; import techreborn.blockentity.generator.advanced.DieselGeneratorBlockEntity; @@ -72,85 +66,79 @@ import techreborn.blockentity.storage.energy.idsu.InterdimensionalSUBlockEntity; import techreborn.blockentity.storage.energy.lesu.LapotronicSUBlockEntity; import techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity; import techreborn.blockentity.storage.item.StorageUnitBaseBlockEntity; -import techreborn.client.gui.*; import java.util.HashMap; import java.util.Map; -import java.util.function.Supplier; -// The meme is here the double suppliers don't cause the client side gui classes to load on the server public final class GuiType implements IMachineGuiHandler { - private static final Map> TYPES = new HashMap<>(); + public static final Map> TYPES = new HashMap<>(); - public static final GuiType AESU = register("aesu", () -> () -> GuiAESU::new); - public static final GuiType ALLOY_FURNACE = register("alloy_furnace", () -> () -> GuiAlloyFurnace::new); - public static final GuiType ALLOY_SMELTER = register("alloy_smelter", () -> () -> GuiAlloySmelter::new); - public static final GuiType ASSEMBLING_MACHINE = register("assembling_machine", () -> () -> GuiAssemblingMachine::new); - public static final GuiType LOW_VOLTAGE_SU = register("low_voltage_su", () -> () -> GuiBatbox::new); - public static final GuiType AUTO_CRAFTING_TABLE = register("auto_crafting_table", () -> () -> GuiAutoCrafting::new); - public static final GuiType BLAST_FURNACE = register("blast_furnace", () -> () -> GuiBlastFurnace::new); - public static final GuiType CENTRIFUGE = register("centrifuge", () -> () -> GuiCentrifuge::new); - public static final GuiType CHARGEBENCH = register("chargebench", () -> () -> GuiChargeBench::new); - public static final GuiType CHEMICAL_REACTOR = register("chemical_reactor", () -> () -> GuiChemicalReactor::new); - public static final GuiType CHUNK_LOADER = register("chunk_loader", () -> () -> GuiChunkLoader::new); - public static final GuiType COMPRESSOR = register("compressor", () -> () -> GuiCompressor::new); - public static final GuiType DIESEL_GENERATOR = register("diesel_generator", () -> () -> GuiDieselGenerator::new); - public static final GuiType DISTILLATION_TOWER = register("distillation_tower", () -> () -> GuiDistillationTower::new); - public static final GuiType ELECTRIC_FURNACE = register("electric_furnace", () -> () -> GuiElectricFurnace::new); - public static final GuiType EXTRACTOR = register("extractor", () -> () -> GuiExtractor::new); - public static final GuiType FUSION_CONTROLLER = register("fusion_controller", () -> () -> GuiFusionReactor::new); - public static final GuiType GAS_TURBINE = register("gas_turbine", () -> () -> GuiGasTurbine::new); - public static final GuiType GENERATOR = register("generator", () -> () -> GuiGenerator::new); - public static final GuiType HIGH_VOLTAGE_SU = register("high_voltage_su", () -> () -> GuiMFSU::new); - public static final GuiType IDSU = register("idsu", () -> () -> GuiIDSU::new); - public static final GuiType IMPLOSION_COMPRESSOR = register("implosion_compressor", () -> () -> GuiImplosionCompressor::new); - public static final GuiType INDUSTRIAL_ELECTROLYZER = register("industrial_electrolyzer", () -> () -> GuiIndustrialElectrolyzer::new); - public static final GuiType INDUSTRIAL_GRINDER = register("industrial_grinder", () -> () -> GuiIndustrialGrinder::new); - public static final GuiType LESU = register("lesu", () -> () -> GuiLESU::new); - public static final GuiType MATTER_FABRICATOR = register("matter_fabricator", () -> () -> GuiMatterFabricator::new); - public static final GuiType MEDIUM_VOLTAGE_SU = register("medium_voltage_su", () -> () -> GuiMFE::new); - public static final GuiType PLASMA_GENERATOR = register("plasma_generator", () -> () -> GuiPlasmaGenerator::new); - public static final GuiType IRON_FURNACE = register("iron_furnace", () -> () -> GuiIronFurnace::new); - public static final GuiType STORAGE_UNIT = register("storage_unit", () -> () -> GuiStorageUnit::new); - public static final GuiType TANK_UNIT = register("tank_unit", () -> () -> GuiTankUnit::new); - public static final GuiType RECYCLER = register("recycler", () -> () -> GuiRecycler::new); - public static final GuiType ROLLING_MACHINE = register("rolling_machine", () -> () -> GuiRollingMachine::new); - public static final GuiType SAWMILL = register("sawmill", () -> () -> GuiIndustrialSawmill::new); - public static final GuiType SCRAPBOXINATOR = register("scrapboxinator", () -> () -> GuiScrapboxinator::new); - public static final GuiType SOLAR_PANEL = register("solar_panel", () -> () -> GuiSolar::new); - public static final GuiType SEMIFLUID_GENERATOR = register("semifluid_generator", () -> () -> GuiSemifluidGenerator::new); - public static final GuiType THERMAL_GENERATOR = register("thermal_generator", () -> () -> GuiThermalGenerator::new); - public static final GuiType VACUUM_FREEZER = register("vacuum_freezer", () -> () -> GuiVacuumFreezer::new); - public static final GuiType SOLID_CANNING_MACHINE = register("solid_canning_machine", () -> () -> GuiSolidCanningMachine::new); - public static final GuiType WIRE_MILL = register("wire_mill", () -> () -> GuiWireMill::new); - public static final GuiType GREENHOUSE_CONTROLLER = register("greenhouse_controller", () -> () -> GuiGreenhouseController::new); - public static final GuiType FLUID_REPLICATOR = register("fluid_replicator", () -> () -> GuiFluidReplicator::new); - public static final GuiType PLAYER_DETECTOR = register("player_detector", () -> () -> GuiPlayerDetector::new); + public static final GuiType AESU = register("aesu"); + public static final GuiType ALLOY_FURNACE = register("alloy_furnace"); + public static final GuiType ALLOY_SMELTER = register("alloy_smelter"); + public static final GuiType ASSEMBLING_MACHINE = register("assembling_machine"); + public static final GuiType LOW_VOLTAGE_SU = register("low_voltage_su"); + public static final GuiType AUTO_CRAFTING_TABLE = register("auto_crafting_table"); + public static final GuiType BLAST_FURNACE = register("blast_furnace"); + public static final GuiType CENTRIFUGE = register("centrifuge"); + public static final GuiType CHARGEBENCH = register("chargebench"); + public static final GuiType CHEMICAL_REACTOR = register("chemical_reactor"); + public static final GuiType CHUNK_LOADER = register("chunk_loader"); + public static final GuiType COMPRESSOR = register("compressor"); + public static final GuiType DIESEL_GENERATOR = register("diesel_generator"); + public static final GuiType DISTILLATION_TOWER = register("distillation_tower"); + public static final GuiType ELECTRIC_FURNACE = register("electric_furnace"); + public static final GuiType EXTRACTOR = register("extractor"); + public static final GuiType FUSION_CONTROLLER = register("fusion_controller"); + public static final GuiType GAS_TURBINE = register("gas_turbine"); + public static final GuiType GENERATOR = register("generator"); + public static final GuiType HIGH_VOLTAGE_SU = register("high_voltage_su"); + public static final GuiType IDSU = register("idsu"); + public static final GuiType IMPLOSION_COMPRESSOR = register("implosion_compressor"); + public static final GuiType INDUSTRIAL_ELECTROLYZER = register("industrial_electrolyzer"); + public static final GuiType INDUSTRIAL_GRINDER = register("industrial_grinder"); + public static final GuiType LESU = register("lesu"); + public static final GuiType MATTER_FABRICATOR = register("matter_fabricator"); + public static final GuiType MEDIUM_VOLTAGE_SU = register("medium_voltage_su"); + public static final GuiType PLASMA_GENERATOR = register("plasma_generator"); + public static final GuiType IRON_FURNACE = register("iron_furnace"); + public static final GuiType STORAGE_UNIT = register("storage_unit"); + public static final GuiType TANK_UNIT = register("tank_unit"); + public static final GuiType RECYCLER = register("recycler"); + public static final GuiType ROLLING_MACHINE = register("rolling_machine"); + public static final GuiType SAWMILL = register("sawmill"); + public static final GuiType SCRAPBOXINATOR = register("scrapboxinator"); + public static final GuiType SOLAR_PANEL = register("solar_panel"); + public static final GuiType SEMIFLUID_GENERATOR = register("semifluid_generator"); + public static final GuiType THERMAL_GENERATOR = register("thermal_generator"); + public static final GuiType VACUUM_FREEZER = register("vacuum_freezer"); + public static final GuiType SOLID_CANNING_MACHINE = register("solid_canning_machine"); + public static final GuiType WIRE_MILL = register("wire_mill"); + public static final GuiType GREENHOUSE_CONTROLLER = register("greenhouse_controller"); + public static final GuiType FLUID_REPLICATOR = register("fluid_replicator"); + public static final GuiType PLAYER_DETECTOR = register("player_detector"); + public static final GuiType DATA_DRIVEN = register("data_driven"); - public static final GuiType DATA_DRIVEN = register("data_driven", () -> () -> DataDrivenGui::new); - - private static GuiType register(String id, Supplier>> factorySupplierMeme) { - return register(new Identifier("techreborn", id), factorySupplierMeme); + private static GuiType register(String id) { + return register(new Identifier("techreborn", id)); } - public static GuiType register(Identifier identifier, Supplier>> factorySupplierMeme) { + public static GuiType register(Identifier identifier) { if (TYPES.containsKey(identifier)) { throw new RuntimeException("Duplicate gui type found"); } - GuiType type = new GuiType<>(identifier, factorySupplierMeme); - TYPES.put(identifier, type); - return type; + + return new GuiType<>(identifier); } private final Identifier identifier; - private final Supplier>> guiFactory; private final ScreenHandlerType screenHandlerType; - private GuiType(Identifier identifier, Supplier>> factorySupplierMeme) { + private GuiType(Identifier identifier) { this.identifier = identifier; - this.guiFactory = factorySupplierMeme; this.screenHandlerType = ScreenHandlerRegistry.registerExtended(identifier, getScreenHandlerFactory()); - RebornCore.clientOnly(() -> () -> ScreenRegistry.register(screenHandlerType, getGuiFactory())); + + TYPES.put(identifier, this); } private ScreenHandlerRegistry.ExtendedClientHandlerFactory getScreenHandlerFactory() { @@ -165,11 +153,6 @@ public final class GuiType implements IMachineGuiHandler }; } - @Environment(EnvType.CLIENT) - private GuiFactory getGuiFactory() { - return guiFactory.get().get(); - } - @Override public void open(PlayerEntity player, BlockPos pos, World world) { if (!world.isClient) { @@ -201,17 +184,7 @@ public final class GuiType implements IMachineGuiHandler return identifier; } - @Environment(EnvType.CLIENT) - public interface GuiFactory extends ScreenRegistry.Factory> { - HandledScreen create(int syncId, PlayerEntity playerEntity, T blockEntity); - - @Override - default HandledScreen create(BuiltScreenHandler builtScreenHandler, PlayerInventory playerInventory, Text text) { - PlayerEntity playerEntity = playerInventory.player; - //noinspection unchecked - T blockEntity = (T) builtScreenHandler.getBlockEntity(); - return create(builtScreenHandler.syncId, playerEntity, blockEntity); - } + public ScreenHandlerType getScreenHandlerType() { + return screenHandlerType; } - } diff --git a/src/main/java/techreborn/blockentity/data/DataDrivenBEProvider.java b/src/main/java/techreborn/blockentity/data/DataDrivenBEProvider.java index e8bd356fe..014a264f1 100644 --- a/src/main/java/techreborn/blockentity/data/DataDrivenBEProvider.java +++ b/src/main/java/techreborn/blockentity/data/DataDrivenBEProvider.java @@ -40,9 +40,9 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.Validate; import org.apache.commons.lang3.text.WordUtils; import org.jetbrains.annotations.Nullable; -import reborncore.client.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandlerProvider; import reborncore.client.screen.builder.BlockEntityScreenHandlerBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.crafting.RebornRecipeType; import reborncore.common.recipes.RecipeCrafter; diff --git a/src/main/java/techreborn/blockentity/data/DataDrivenGui.java b/src/main/java/techreborn/blockentity/data/DataDrivenGui.java index 8f452943e..0909116b3 100644 --- a/src/main/java/techreborn/blockentity/data/DataDrivenGui.java +++ b/src/main/java/techreborn/blockentity/data/DataDrivenGui.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; public class DataDrivenGui extends GuiBase { diff --git a/src/main/java/techreborn/blockentity/generator/PlasmaGeneratorBlockEntity.java b/src/main/java/techreborn/blockentity/generator/PlasmaGeneratorBlockEntity.java index 66c243d5a..bb9b905e3 100644 --- a/src/main/java/techreborn/blockentity/generator/PlasmaGeneratorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/PlasmaGeneratorBlockEntity.java @@ -28,8 +28,8 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.fluid.FluidValue; import techreborn.api.generator.EFluidGenerator; diff --git a/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java b/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java index 1a6cc985f..e4094554b 100644 --- a/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/SolarPanelBlockEntity.java @@ -39,8 +39,8 @@ import net.minecraft.util.math.Direction; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; import reborncore.api.IToolDrop; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blocks.BlockMachineBase; diff --git a/src/main/java/techreborn/blockentity/generator/advanced/DieselGeneratorBlockEntity.java b/src/main/java/techreborn/blockentity/generator/advanced/DieselGeneratorBlockEntity.java index 82d29b1ec..6e021a0de 100644 --- a/src/main/java/techreborn/blockentity/generator/advanced/DieselGeneratorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/advanced/DieselGeneratorBlockEntity.java @@ -28,8 +28,8 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.fluid.FluidValue; import techreborn.api.generator.EFluidGenerator; diff --git a/src/main/java/techreborn/blockentity/generator/advanced/GasTurbineBlockEntity.java b/src/main/java/techreborn/blockentity/generator/advanced/GasTurbineBlockEntity.java index e088b6e03..2778163fc 100644 --- a/src/main/java/techreborn/blockentity/generator/advanced/GasTurbineBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/advanced/GasTurbineBlockEntity.java @@ -28,8 +28,8 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.fluid.FluidValue; import techreborn.api.generator.EFluidGenerator; diff --git a/src/main/java/techreborn/blockentity/generator/advanced/SemiFluidGeneratorBlockEntity.java b/src/main/java/techreborn/blockentity/generator/advanced/SemiFluidGeneratorBlockEntity.java index 91b75b25c..e85045742 100644 --- a/src/main/java/techreborn/blockentity/generator/advanced/SemiFluidGeneratorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/advanced/SemiFluidGeneratorBlockEntity.java @@ -28,8 +28,8 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.fluid.FluidValue; import techreborn.api.generator.EFluidGenerator; diff --git a/src/main/java/techreborn/blockentity/generator/advanced/ThermalGeneratorBlockEntity.java b/src/main/java/techreborn/blockentity/generator/advanced/ThermalGeneratorBlockEntity.java index 2c7abdd1c..2d8572863 100644 --- a/src/main/java/techreborn/blockentity/generator/advanced/ThermalGeneratorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/advanced/ThermalGeneratorBlockEntity.java @@ -28,8 +28,8 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.fluid.FluidValue; import techreborn.api.generator.EFluidGenerator; diff --git a/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java b/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java index 142144d97..4fbbcdea8 100644 --- a/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/generator/basic/SolidFuelGeneratorBlockEntity.java @@ -39,8 +39,8 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import reborncore.api.IToolDrop; import reborncore.api.blockentity.InventoryProvider; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blocks.BlockMachineBase; diff --git a/src/main/java/techreborn/blockentity/machine/iron/IronAlloyFurnaceBlockEntity.java b/src/main/java/techreborn/blockentity/machine/iron/IronAlloyFurnaceBlockEntity.java index 4a2f7e67b..53ae99931 100644 --- a/src/main/java/techreborn/blockentity/machine/iron/IronAlloyFurnaceBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/iron/IronAlloyFurnaceBlockEntity.java @@ -28,8 +28,8 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.crafting.RebornRecipe; import reborncore.common.crafting.ingredient.RebornIngredient; diff --git a/src/main/java/techreborn/blockentity/machine/iron/IronFurnaceBlockEntity.java b/src/main/java/techreborn/blockentity/machine/iron/IronFurnaceBlockEntity.java index 0f174f69a..e08f8123c 100644 --- a/src/main/java/techreborn/blockentity/machine/iron/IronFurnaceBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/iron/IronFurnaceBlockEntity.java @@ -35,8 +35,8 @@ import net.minecraft.recipe.RecipeType; import net.minecraft.recipe.SmeltingRecipe; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.util.RebornInventory; import techreborn.init.TRBlockEntities; diff --git a/src/main/java/techreborn/blockentity/machine/misc/ChargeOMatBlockEntity.java b/src/main/java/techreborn/blockentity/machine/misc/ChargeOMatBlockEntity.java index 5c07aefb4..c574b4cf8 100644 --- a/src/main/java/techreborn/blockentity/machine/misc/ChargeOMatBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/misc/ChargeOMatBlockEntity.java @@ -33,8 +33,8 @@ import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; import reborncore.api.IToolDrop; import reborncore.api.blockentity.InventoryProvider; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.powerSystem.PowerAcceptorBlockEntity; diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/DistillationTowerBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/DistillationTowerBlockEntity.java index 4317c1fb8..f25b55f2b 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/DistillationTowerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/DistillationTowerBlockEntity.java @@ -28,8 +28,8 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MultiblockWriter; import reborncore.common.crafting.RebornRecipe; diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/FluidReplicatorBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/FluidReplicatorBlockEntity.java index f54e7d632..05d0b2b55 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/FluidReplicatorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/FluidReplicatorBlockEntity.java @@ -32,8 +32,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blockentity.MultiblockWriter; diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java index 5c88d64c1..71537d25b 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/FusionControlComputerBlockEntity.java @@ -36,8 +36,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blockentity.MultiblockWriter; diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/ImplosionCompressorBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/ImplosionCompressorBlockEntity.java index f1826133d..e87977eef 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/ImplosionCompressorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/ImplosionCompressorBlockEntity.java @@ -28,8 +28,8 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MultiblockWriter; import reborncore.common.crafting.RebornRecipe; diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialBlastFurnaceBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialBlastFurnaceBlockEntity.java index 5c2aecefc..2091d2b91 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialBlastFurnaceBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialBlastFurnaceBlockEntity.java @@ -32,8 +32,8 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.BlockView; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MultiblockWriter; import reborncore.common.multiblock.IMultiblockPart; diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialGrinderBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialGrinderBlockEntity.java index 75ce935c8..d7ef2f53e 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialGrinderBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialGrinderBlockEntity.java @@ -33,8 +33,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blockentity.MultiblockWriter; diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialSawmillBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialSawmillBlockEntity.java index 2e2bc191e..0619664c4 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialSawmillBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/IndustrialSawmillBlockEntity.java @@ -33,8 +33,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blockentity.MultiblockWriter; diff --git a/src/main/java/techreborn/blockentity/machine/multiblock/VacuumFreezerBlockEntity.java b/src/main/java/techreborn/blockentity/machine/multiblock/VacuumFreezerBlockEntity.java index 079093246..4aa87aa48 100644 --- a/src/main/java/techreborn/blockentity/machine/multiblock/VacuumFreezerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/multiblock/VacuumFreezerBlockEntity.java @@ -28,8 +28,8 @@ import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MultiblockWriter; import reborncore.common.crafting.RebornRecipe; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/AlloySmelterBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/AlloySmelterBlockEntity.java index 5fc9758b8..4f5b40aff 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/AlloySmelterBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/AlloySmelterBlockEntity.java @@ -27,8 +27,8 @@ package techreborn.blockentity.machine.tier1; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.util.RebornInventory; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/AssemblingMachineBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/AssemblingMachineBlockEntity.java index aefe688bd..a36981431 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/AssemblingMachineBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/AssemblingMachineBlockEntity.java @@ -27,8 +27,8 @@ package techreborn.blockentity.machine.tier1; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.util.RebornInventory; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/AutoCraftingTableBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/AutoCraftingTableBlockEntity.java index 21302c028..ef00c10d6 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/AutoCraftingTableBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/AutoCraftingTableBlockEntity.java @@ -43,8 +43,8 @@ import org.apache.commons.lang3.tuple.Pair; import org.jetbrains.annotations.Nullable; import reborncore.api.IToolDrop; import reborncore.api.blockentity.InventoryProvider; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.powerSystem.PowerAcceptorBlockEntity; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/ChemicalReactorBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/ChemicalReactorBlockEntity.java index 42bd70d11..93496deb4 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/ChemicalReactorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/ChemicalReactorBlockEntity.java @@ -27,8 +27,8 @@ package techreborn.blockentity.machine.tier1; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.util.RebornInventory; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/CompressorBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/CompressorBlockEntity.java index df1e403ee..8f51b4b41 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/CompressorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/CompressorBlockEntity.java @@ -27,8 +27,8 @@ package techreborn.blockentity.machine.tier1; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.util.RebornInventory; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/ElectricFurnaceBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/ElectricFurnaceBlockEntity.java index da2905087..f62252edc 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/ElectricFurnaceBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/ElectricFurnaceBlockEntity.java @@ -36,8 +36,8 @@ import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; import reborncore.api.IToolDrop; import reborncore.api.blockentity.InventoryProvider; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blocks.BlockMachineBase; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/ExtractorBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/ExtractorBlockEntity.java index 831b4e548..997737077 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/ExtractorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/ExtractorBlockEntity.java @@ -27,8 +27,8 @@ package techreborn.blockentity.machine.tier1; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.util.RebornInventory; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/GreenhouseControllerBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/GreenhouseControllerBlockEntity.java index ee762c0de..4e66cd07d 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/GreenhouseControllerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/GreenhouseControllerBlockEntity.java @@ -36,8 +36,8 @@ import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; import reborncore.api.IToolDrop; import reborncore.api.blockentity.InventoryProvider; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blockentity.MultiblockWriter; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/IndustrialElectrolyzerBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/IndustrialElectrolyzerBlockEntity.java index 36eaf0a3d..d8cb9c9b3 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/IndustrialElectrolyzerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/IndustrialElectrolyzerBlockEntity.java @@ -27,8 +27,8 @@ package techreborn.blockentity.machine.tier1; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.util.ItemUtils; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/PlayerDetectorBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/PlayerDetectorBlockEntity.java index 59e1088e7..678dff5ce 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/PlayerDetectorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/PlayerDetectorBlockEntity.java @@ -34,8 +34,8 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; import reborncore.api.IToolDrop; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.powerSystem.PowerAcceptorBlockEntity; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/RecyclerBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/RecyclerBlockEntity.java index 8093761c7..75ac6a852 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/RecyclerBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/RecyclerBlockEntity.java @@ -31,8 +31,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.util.registry.Registry; import reborncore.api.blockentity.IUpgrade; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.util.RebornInventory; import techreborn.api.recipe.RecyclerRecipeCrafter; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java index b3643229d..19aa07fa0 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/RollingMachineBlockEntity.java @@ -39,8 +39,8 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import reborncore.api.IToolDrop; import reborncore.api.blockentity.InventoryProvider; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.blocks.BlockMachineBase; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/ScrapboxinatorBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/ScrapboxinatorBlockEntity.java index 9a8ba207d..78ee82e7b 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/ScrapboxinatorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/ScrapboxinatorBlockEntity.java @@ -27,8 +27,8 @@ package techreborn.blockentity.machine.tier1; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.util.RebornInventory; import techreborn.api.recipe.ScrapboxRecipeCrafter; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/SolidCanningMachineBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/SolidCanningMachineBlockEntity.java index 802786a60..c6979d112 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/SolidCanningMachineBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/SolidCanningMachineBlockEntity.java @@ -27,8 +27,8 @@ package techreborn.blockentity.machine.tier1; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.util.RebornInventory; diff --git a/src/main/java/techreborn/blockentity/machine/tier1/WireMillBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier1/WireMillBlockEntity.java index 4cbe61c04..c416e8373 100644 --- a/src/main/java/techreborn/blockentity/machine/tier1/WireMillBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier1/WireMillBlockEntity.java @@ -27,8 +27,8 @@ package techreborn.blockentity.machine.tier1; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.util.RebornInventory; diff --git a/src/main/java/techreborn/blockentity/machine/tier3/ChunkLoaderBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier3/ChunkLoaderBlockEntity.java index 2368e8bfd..354df0bb7 100644 --- a/src/main/java/techreborn/blockentity/machine/tier3/ChunkLoaderBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier3/ChunkLoaderBlockEntity.java @@ -37,8 +37,8 @@ import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.Nullable; import reborncore.api.IToolDrop; import reborncore.api.blockentity.InventoryProvider; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.chunkloading.ChunkLoaderManager; diff --git a/src/main/java/techreborn/blockentity/machine/tier3/IndustrialCentrifugeBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier3/IndustrialCentrifugeBlockEntity.java index aa8fa42e0..6ef363965 100644 --- a/src/main/java/techreborn/blockentity/machine/tier3/IndustrialCentrifugeBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier3/IndustrialCentrifugeBlockEntity.java @@ -31,8 +31,8 @@ import net.minecraft.text.LiteralText; import net.minecraft.text.Text; import net.minecraft.util.math.BlockPos; import reborncore.api.IListInfoProvider; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.recipes.RecipeCrafter; import reborncore.common.util.ItemUtils; diff --git a/src/main/java/techreborn/blockentity/machine/tier3/MatterFabricatorBlockEntity.java b/src/main/java/techreborn/blockentity/machine/tier3/MatterFabricatorBlockEntity.java index da7fe6218..4fed6c5d3 100644 --- a/src/main/java/techreborn/blockentity/machine/tier3/MatterFabricatorBlockEntity.java +++ b/src/main/java/techreborn/blockentity/machine/tier3/MatterFabricatorBlockEntity.java @@ -33,8 +33,8 @@ import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; import reborncore.api.IToolDrop; import reborncore.api.blockentity.InventoryProvider; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.powerSystem.PowerAcceptorBlockEntity; diff --git a/src/main/java/techreborn/blockentity/storage/energy/AdjustableSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/energy/AdjustableSUBlockEntity.java index 7a36018db..af7a9f1c5 100644 --- a/src/main/java/techreborn/blockentity/storage/energy/AdjustableSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/energy/AdjustableSUBlockEntity.java @@ -33,8 +33,8 @@ import net.minecraft.util.math.Direction; import net.minecraft.world.World; import org.jetbrains.annotations.Nullable; import reborncore.api.blockentity.IUpgrade; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.powerSystem.RcEnergyTier; diff --git a/src/main/java/techreborn/blockentity/storage/energy/HighVoltageSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/energy/HighVoltageSUBlockEntity.java index 501f6da63..49e7a1013 100644 --- a/src/main/java/techreborn/blockentity/storage/energy/HighVoltageSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/energy/HighVoltageSUBlockEntity.java @@ -27,11 +27,10 @@ package techreborn.blockentity.storage.energy; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.powerSystem.RcEnergyTier; -import reborncore.common.powerSystem.RcEnergyTier; import techreborn.init.TRBlockEntities; import techreborn.init.TRContent; diff --git a/src/main/java/techreborn/blockentity/storage/energy/LowVoltageSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/energy/LowVoltageSUBlockEntity.java index 0151f7085..7b9458f50 100644 --- a/src/main/java/techreborn/blockentity/storage/energy/LowVoltageSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/energy/LowVoltageSUBlockEntity.java @@ -27,8 +27,8 @@ package techreborn.blockentity.storage.energy; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.powerSystem.RcEnergyTier; import techreborn.init.TRBlockEntities; diff --git a/src/main/java/techreborn/blockentity/storage/energy/MediumVoltageSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/energy/MediumVoltageSUBlockEntity.java index 3fe58cf05..24ac7805e 100644 --- a/src/main/java/techreborn/blockentity/storage/energy/MediumVoltageSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/energy/MediumVoltageSUBlockEntity.java @@ -27,8 +27,8 @@ package techreborn.blockentity.storage.energy; import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.powerSystem.RcEnergyTier; import techreborn.init.TRBlockEntities; diff --git a/src/main/java/techreborn/blockentity/storage/energy/idsu/InterdimensionalSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/energy/idsu/InterdimensionalSUBlockEntity.java index 04176eb88..dde070525 100644 --- a/src/main/java/techreborn/blockentity/storage/energy/idsu/InterdimensionalSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/energy/idsu/InterdimensionalSUBlockEntity.java @@ -32,8 +32,8 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.Nullable; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.powerSystem.RcEnergyTier; import team.reborn.energy.api.EnergyStorage; diff --git a/src/main/java/techreborn/blockentity/storage/energy/lesu/LapotronicSUBlockEntity.java b/src/main/java/techreborn/blockentity/storage/energy/lesu/LapotronicSUBlockEntity.java index a8e75a87f..7abd64c14 100644 --- a/src/main/java/techreborn/blockentity/storage/energy/lesu/LapotronicSUBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/energy/lesu/LapotronicSUBlockEntity.java @@ -24,20 +24,18 @@ package techreborn.blockentity.storage.energy.lesu; -import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.World; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.powerSystem.RcEnergyTier; import techreborn.blockentity.storage.energy.EnergyStorageBlockEntity; -import techreborn.blocks.storage.energy.LapotronicSUBlock; import techreborn.config.TechRebornConfig; import techreborn.init.TRBlockEntities; import techreborn.init.TRContent; diff --git a/src/main/java/techreborn/blockentity/storage/fluid/TankUnitBaseBlockEntity.java b/src/main/java/techreborn/blockentity/storage/fluid/TankUnitBaseBlockEntity.java index 587f946be..af99dd52b 100644 --- a/src/main/java/techreborn/blockentity/storage/fluid/TankUnitBaseBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/fluid/TankUnitBaseBlockEntity.java @@ -39,8 +39,8 @@ import org.jetbrains.annotations.Nullable; import reborncore.api.IListInfoProvider; import reborncore.api.IToolDrop; import reborncore.api.blockentity.InventoryProvider; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.fluid.FluidValue; diff --git a/src/main/java/techreborn/blockentity/storage/item/StorageUnitBaseBlockEntity.java b/src/main/java/techreborn/blockentity/storage/item/StorageUnitBaseBlockEntity.java index 633802efe..d2ada2117 100644 --- a/src/main/java/techreborn/blockentity/storage/item/StorageUnitBaseBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/item/StorageUnitBaseBlockEntity.java @@ -45,8 +45,8 @@ import org.jetbrains.annotations.Nullable; import reborncore.api.IListInfoProvider; import reborncore.api.IToolDrop; import reborncore.api.blockentity.InventoryProvider; -import reborncore.client.screen.BuiltScreenHandlerProvider; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandlerProvider; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.client.screen.builder.ScreenHandlerBuilder; import reborncore.common.blockentity.MachineBaseBlockEntity; import reborncore.common.util.ItemUtils; diff --git a/src/main/java/techreborn/blocks/DataDrivenMachineBlock.java b/src/main/java/techreborn/blocks/DataDrivenMachineBlock.java index 2b3ac7f12..389d5b94a 100644 --- a/src/main/java/techreborn/blocks/DataDrivenMachineBlock.java +++ b/src/main/java/techreborn/blocks/DataDrivenMachineBlock.java @@ -26,7 +26,7 @@ package techreborn.blocks; import net.minecraft.util.Identifier; import techreborn.blockentity.data.DataDrivenBEProvider; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; /** * @author modmuss50 diff --git a/src/main/java/techreborn/blocks/generator/BlockFusionControlComputer.java b/src/main/java/techreborn/blocks/generator/BlockFusionControlComputer.java index ee9a8309c..3426721b9 100644 --- a/src/main/java/techreborn/blocks/generator/BlockFusionControlComputer.java +++ b/src/main/java/techreborn/blocks/generator/BlockFusionControlComputer.java @@ -39,7 +39,7 @@ import reborncore.api.blockentity.IMachineGuiHandler; import reborncore.common.blocks.BlockMachineBase; import reborncore.common.util.Torus; import techreborn.blockentity.machine.multiblock.FusionControlComputerBlockEntity; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; import techreborn.init.TRContent; import techreborn.utils.damageSources.FusionDamageSource; diff --git a/src/main/java/techreborn/blocks/generator/BlockSolarPanel.java b/src/main/java/techreborn/blocks/generator/BlockSolarPanel.java index 8c4d37f06..9a86154c8 100644 --- a/src/main/java/techreborn/blocks/generator/BlockSolarPanel.java +++ b/src/main/java/techreborn/blocks/generator/BlockSolarPanel.java @@ -32,7 +32,7 @@ import reborncore.api.blockentity.IMachineGuiHandler; import reborncore.common.blocks.BlockMachineBase; import reborncore.common.powerSystem.PowerAcceptorBlockEntity; import techreborn.blockentity.generator.SolarPanelBlockEntity; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; import techreborn.init.TRContent.SolarPanels; /** diff --git a/src/main/java/techreborn/blocks/machine/tier0/IronAlloyFurnaceBlock.java b/src/main/java/techreborn/blocks/machine/tier0/IronAlloyFurnaceBlock.java index 52bd4d6fc..96b5adfae 100644 --- a/src/main/java/techreborn/blocks/machine/tier0/IronAlloyFurnaceBlock.java +++ b/src/main/java/techreborn/blocks/machine/tier0/IronAlloyFurnaceBlock.java @@ -35,7 +35,7 @@ import net.minecraft.util.math.Direction; import net.minecraft.world.World; import techreborn.blockentity.machine.iron.IronAlloyFurnaceBlockEntity; import techreborn.blocks.GenericMachineBlock; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; import java.util.Random; diff --git a/src/main/java/techreborn/blocks/machine/tier0/IronFurnaceBlock.java b/src/main/java/techreborn/blocks/machine/tier0/IronFurnaceBlock.java index 2e8b37c5b..a325e5ddf 100644 --- a/src/main/java/techreborn/blocks/machine/tier0/IronFurnaceBlock.java +++ b/src/main/java/techreborn/blocks/machine/tier0/IronFurnaceBlock.java @@ -35,7 +35,7 @@ import net.minecraft.util.math.Direction; import net.minecraft.world.World; import techreborn.blockentity.machine.iron.IronFurnaceBlockEntity; import techreborn.blocks.GenericMachineBlock; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; import java.util.Random; diff --git a/src/main/java/techreborn/blocks/machine/tier1/PlayerDetectorBlock.java b/src/main/java/techreborn/blocks/machine/tier1/PlayerDetectorBlock.java index af1d757fc..2cefd1814 100644 --- a/src/main/java/techreborn/blocks/machine/tier1/PlayerDetectorBlock.java +++ b/src/main/java/techreborn/blocks/machine/tier1/PlayerDetectorBlock.java @@ -52,7 +52,7 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.util.ChatUtils; import reborncore.common.util.StringUtils; import techreborn.blockentity.machine.tier1.PlayerDetectorBlockEntity; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; import techreborn.utils.MessageIDs; public class PlayerDetectorBlock extends BlockMachineBase { diff --git a/src/main/java/techreborn/blocks/storage/energy/AdjustableSUBlock.java b/src/main/java/techreborn/blocks/storage/energy/AdjustableSUBlock.java index 18f2773da..68f6bc8a2 100644 --- a/src/main/java/techreborn/blocks/storage/energy/AdjustableSUBlock.java +++ b/src/main/java/techreborn/blocks/storage/energy/AdjustableSUBlock.java @@ -28,7 +28,7 @@ import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.util.math.BlockPos; import techreborn.blockentity.storage.energy.AdjustableSUBlockEntity; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; public class AdjustableSUBlock extends EnergyStorageBlock { diff --git a/src/main/java/techreborn/blocks/storage/energy/HighVoltageSUBlock.java b/src/main/java/techreborn/blocks/storage/energy/HighVoltageSUBlock.java index d35a622f5..a8b051f31 100644 --- a/src/main/java/techreborn/blocks/storage/energy/HighVoltageSUBlock.java +++ b/src/main/java/techreborn/blocks/storage/energy/HighVoltageSUBlock.java @@ -28,7 +28,7 @@ import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.util.math.BlockPos; import techreborn.blockentity.storage.energy.HighVoltageSUBlockEntity; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; /** * Created by modmuss50 on 14/03/2016. diff --git a/src/main/java/techreborn/blocks/storage/energy/InterdimensionalSUBlock.java b/src/main/java/techreborn/blocks/storage/energy/InterdimensionalSUBlock.java index d8b842195..815283eab 100644 --- a/src/main/java/techreborn/blocks/storage/energy/InterdimensionalSUBlock.java +++ b/src/main/java/techreborn/blocks/storage/energy/InterdimensionalSUBlock.java @@ -32,7 +32,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import techreborn.blockentity.storage.energy.idsu.InterdimensionalSUBlockEntity; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; public class InterdimensionalSUBlock extends EnergyStorageBlock { diff --git a/src/main/java/techreborn/blocks/storage/energy/LapotronicSUBlock.java b/src/main/java/techreborn/blocks/storage/energy/LapotronicSUBlock.java index 6581da8de..94f7f921a 100644 --- a/src/main/java/techreborn/blocks/storage/energy/LapotronicSUBlock.java +++ b/src/main/java/techreborn/blocks/storage/energy/LapotronicSUBlock.java @@ -28,7 +28,7 @@ import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.util.math.BlockPos; import techreborn.blockentity.storage.energy.lesu.LapotronicSUBlockEntity; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; public class LapotronicSUBlock extends EnergyStorageBlock { diff --git a/src/main/java/techreborn/blocks/storage/energy/LowVoltageSUBlock.java b/src/main/java/techreborn/blocks/storage/energy/LowVoltageSUBlock.java index 65b4a7cf7..4461de0c2 100644 --- a/src/main/java/techreborn/blocks/storage/energy/LowVoltageSUBlock.java +++ b/src/main/java/techreborn/blocks/storage/energy/LowVoltageSUBlock.java @@ -28,7 +28,7 @@ import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.util.math.BlockPos; import techreborn.blockentity.storage.energy.LowVoltageSUBlockEntity; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; /** * Created by modmuss50 on 14/03/2016. diff --git a/src/main/java/techreborn/blocks/storage/energy/MediumVoltageSUBlock.java b/src/main/java/techreborn/blocks/storage/energy/MediumVoltageSUBlock.java index 36751eefc..5e4515938 100644 --- a/src/main/java/techreborn/blocks/storage/energy/MediumVoltageSUBlock.java +++ b/src/main/java/techreborn/blocks/storage/energy/MediumVoltageSUBlock.java @@ -28,7 +28,7 @@ import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.util.math.BlockPos; import techreborn.blockentity.storage.energy.MediumVoltageSUBlockEntity; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; /** * Created by modmuss50 on 14/03/2016. diff --git a/src/main/java/techreborn/blocks/storage/fluid/TankUnitBlock.java b/src/main/java/techreborn/blocks/storage/fluid/TankUnitBlock.java index bf09a69ad..845a50e20 100644 --- a/src/main/java/techreborn/blocks/storage/fluid/TankUnitBlock.java +++ b/src/main/java/techreborn/blocks/storage/fluid/TankUnitBlock.java @@ -44,7 +44,7 @@ import reborncore.common.fluid.container.ItemFluidInfo; import reborncore.common.util.Tank; import reborncore.common.util.WorldUtils; import techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; import techreborn.init.TRContent; import techreborn.items.DynamicCellItem; diff --git a/src/main/java/techreborn/blocks/storage/item/StorageUnitBlock.java b/src/main/java/techreborn/blocks/storage/item/StorageUnitBlock.java index 3a2d5027a..1d2e6ce59 100644 --- a/src/main/java/techreborn/blocks/storage/item/StorageUnitBlock.java +++ b/src/main/java/techreborn/blocks/storage/item/StorageUnitBlock.java @@ -42,7 +42,7 @@ import reborncore.common.blocks.BlockMachineBase; import reborncore.common.util.RebornInventory; import reborncore.common.util.WorldUtils; import techreborn.blockentity.storage.item.StorageUnitBaseBlockEntity; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; import techreborn.init.TRContent; public class StorageUnitBlock extends BlockMachineBase { diff --git a/src/main/java/techreborn/client/ClientGuiType.java b/src/main/java/techreborn/client/ClientGuiType.java new file mode 100644 index 000000000..da7b5e855 --- /dev/null +++ b/src/main/java/techreborn/client/ClientGuiType.java @@ -0,0 +1,144 @@ +/* + * This file is part of TechReborn, licensed under the MIT License (MIT). + * + * Copyright (c) 2020 TechReborn + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package techreborn.client; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.util.Identifier; +import techreborn.blockentity.GuiType; +import techreborn.blockentity.data.DataDrivenBEProvider; +import techreborn.blockentity.data.DataDrivenGui; +import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity; +import techreborn.blockentity.generator.SolarPanelBlockEntity; +import techreborn.blockentity.generator.advanced.DieselGeneratorBlockEntity; +import techreborn.blockentity.generator.advanced.GasTurbineBlockEntity; +import techreborn.blockentity.generator.advanced.SemiFluidGeneratorBlockEntity; +import techreborn.blockentity.generator.advanced.ThermalGeneratorBlockEntity; +import techreborn.blockentity.generator.basic.SolidFuelGeneratorBlockEntity; +import techreborn.blockentity.machine.iron.IronAlloyFurnaceBlockEntity; +import techreborn.blockentity.machine.iron.IronFurnaceBlockEntity; +import techreborn.blockentity.machine.misc.ChargeOMatBlockEntity; +import techreborn.blockentity.machine.multiblock.*; +import techreborn.blockentity.machine.tier1.*; +import techreborn.blockentity.machine.tier3.ChunkLoaderBlockEntity; +import techreborn.blockentity.machine.tier3.IndustrialCentrifugeBlockEntity; +import techreborn.blockentity.machine.tier3.MatterFabricatorBlockEntity; +import techreborn.blockentity.storage.energy.AdjustableSUBlockEntity; +import techreborn.blockentity.storage.energy.HighVoltageSUBlockEntity; +import techreborn.blockentity.storage.energy.LowVoltageSUBlockEntity; +import techreborn.blockentity.storage.energy.MediumVoltageSUBlockEntity; +import techreborn.blockentity.storage.energy.idsu.InterdimensionalSUBlockEntity; +import techreborn.blockentity.storage.energy.lesu.LapotronicSUBlockEntity; +import techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity; +import techreborn.blockentity.storage.item.StorageUnitBaseBlockEntity; +import techreborn.client.gui.*; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@Environment(EnvType.CLIENT) +public class ClientGuiType { + public static final Map> TYPES = new HashMap<>(); + + public static final ClientGuiType AESU = register(GuiType.AESU, GuiAESU::new); + public static final ClientGuiType ALLOY_FURNACE = register(GuiType.ALLOY_FURNACE, GuiAlloyFurnace::new); + public static final ClientGuiType ALLOY_SMELTER = register(GuiType.ALLOY_SMELTER, GuiAlloySmelter::new); + public static final ClientGuiType ASSEMBLING_MACHINE = register(GuiType.ASSEMBLING_MACHINE, GuiAssemblingMachine::new); + public static final ClientGuiType LOW_VOLTAGE_SU = register(GuiType.LOW_VOLTAGE_SU, GuiBatbox::new); + public static final ClientGuiType AUTO_CRAFTING_TABLE = register(GuiType.AUTO_CRAFTING_TABLE, GuiAutoCrafting::new); + public static final ClientGuiType BLAST_FURNACE = register(GuiType.BLAST_FURNACE, GuiBlastFurnace::new); + public static final ClientGuiType CENTRIFUGE = register(GuiType.CENTRIFUGE, GuiCentrifuge::new); + public static final ClientGuiType CHARGEBENCH = register(GuiType.CHARGEBENCH, GuiChargeBench::new); + public static final ClientGuiType CHEMICAL_REACTOR = register(GuiType.CHEMICAL_REACTOR, GuiChemicalReactor::new); + public static final ClientGuiType CHUNK_LOADER = register(GuiType.CHUNK_LOADER, GuiChunkLoader::new); + public static final ClientGuiType COMPRESSOR = register(GuiType.COMPRESSOR, GuiCompressor::new); + public static final ClientGuiType DIESEL_GENERATOR = register(GuiType.DIESEL_GENERATOR, GuiDieselGenerator::new); + public static final ClientGuiType DISTILLATION_TOWER = register(GuiType.DISTILLATION_TOWER, GuiDistillationTower::new); + public static final ClientGuiType ELECTRIC_FURNACE = register(GuiType.ELECTRIC_FURNACE, GuiElectricFurnace::new); + public static final ClientGuiType EXTRACTOR = register(GuiType.EXTRACTOR, GuiExtractor::new); + public static final ClientGuiType FUSION_CONTROLLER = register(GuiType.FUSION_CONTROLLER, GuiFusionReactor::new); + public static final ClientGuiType GAS_TURBINE = register(GuiType.GAS_TURBINE, GuiGasTurbine::new); + public static final ClientGuiType GENERATOR = register(GuiType.GENERATOR, GuiGenerator::new); + public static final ClientGuiType HIGH_VOLTAGE_SU = register(GuiType.HIGH_VOLTAGE_SU, GuiMFSU::new); + public static final ClientGuiType IDSU = register(GuiType.IDSU, GuiIDSU::new); + public static final ClientGuiType IMPLOSION_COMPRESSOR = register(GuiType.IMPLOSION_COMPRESSOR, GuiImplosionCompressor::new); + public static final ClientGuiType INDUSTRIAL_ELECTROLYZER = register(GuiType.INDUSTRIAL_ELECTROLYZER, GuiIndustrialElectrolyzer::new); + public static final ClientGuiType INDUSTRIAL_GRINDER = register(GuiType.INDUSTRIAL_GRINDER, GuiIndustrialGrinder::new); + public static final ClientGuiType LESU = register(GuiType.LESU, GuiLESU::new); + public static final ClientGuiType MATTER_FABRICATOR = register(GuiType.MATTER_FABRICATOR, GuiMatterFabricator::new); + public static final ClientGuiType MEDIUM_VOLTAGE_SU = register(GuiType.MEDIUM_VOLTAGE_SU, GuiMFE::new); + public static final ClientGuiType PLASMA_GENERATOR = register(GuiType.PLASMA_GENERATOR, GuiPlasmaGenerator::new); + public static final ClientGuiType IRON_FURNACE = register(GuiType.IRON_FURNACE, GuiIronFurnace::new); + public static final ClientGuiType STORAGE_UNIT = register(GuiType.STORAGE_UNIT, GuiStorageUnit::new); + public static final ClientGuiType TANK_UNIT = register(GuiType.TANK_UNIT, GuiTankUnit::new); + public static final ClientGuiType RECYCLER = register(GuiType.RECYCLER, GuiRecycler::new); + public static final ClientGuiType ROLLING_MACHINE = register(GuiType.ROLLING_MACHINE, GuiRollingMachine::new); + public static final ClientGuiType SAWMILL = register(GuiType.SAWMILL, GuiIndustrialSawmill::new); + public static final ClientGuiType SCRAPBOXINATOR = register(GuiType.SCRAPBOXINATOR, GuiScrapboxinator::new); + public static final ClientGuiType SOLAR_PANEL = register(GuiType.SOLAR_PANEL, GuiSolar::new); + public static final ClientGuiType SEMIFLUID_GENERATOR = register(GuiType.SEMIFLUID_GENERATOR, GuiSemifluidGenerator::new); + public static final ClientGuiType THERMAL_GENERATOR = register(GuiType.THERMAL_GENERATOR, GuiThermalGenerator::new); + public static final ClientGuiType VACUUM_FREEZER = register(GuiType.VACUUM_FREEZER, GuiVacuumFreezer::new); + public static final ClientGuiType SOLID_CANNING_MACHINE = register(GuiType.SOLID_CANNING_MACHINE, GuiSolidCanningMachine::new); + public static final ClientGuiType WIRE_MILL = register(GuiType.WIRE_MILL, GuiWireMill::new); + public static final ClientGuiType GREENHOUSE_CONTROLLER = register(GuiType.GREENHOUSE_CONTROLLER, GuiGreenhouseController::new); + public static final ClientGuiType FLUID_REPLICATOR = register(GuiType.FLUID_REPLICATOR, GuiFluidReplicator::new); + public static final ClientGuiType PLAYER_DETECTOR = register(GuiType.PLAYER_DETECTOR, GuiPlayerDetector::new); + public static final ClientGuiType DATA_DRIVEN = register(GuiType.DATA_DRIVEN, DataDrivenGui::new); + + private static ClientGuiType register(GuiType type, GuiFactory factory) { + return new ClientGuiType<>(type, factory); + } + + public static void validate() { + // Ensure all gui types also have a client version. + for (Identifier identifier : GuiType.TYPES.keySet()) { + Objects.requireNonNull(TYPES.get(identifier), "No ClientGuiType for " + identifier); + } + } + + private final GuiType guiType; + private final GuiFactory guiFactory; + + public ClientGuiType(GuiType guiType, GuiFactory guiFactory) { + this.guiType = Objects.requireNonNull(guiType); + this.guiFactory = Objects.requireNonNull(guiFactory); + + ScreenRegistry.register(guiType.getScreenHandlerType(), getGuiFactory()); + + TYPES.put(guiType.getIdentifier(), this); + } + + public GuiType getGuiType() { + return guiType; + } + + public GuiFactory getGuiFactory() { + return guiFactory; + } +} diff --git a/src/main/java/techreborn/client/GuiFactory.java b/src/main/java/techreborn/client/GuiFactory.java new file mode 100644 index 000000000..da45134dd --- /dev/null +++ b/src/main/java/techreborn/client/GuiFactory.java @@ -0,0 +1,48 @@ +/* + * This file is part of TechReborn, licensed under the MIT License (MIT). + * + * Copyright (c) 2020 TechReborn + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +package techreborn.client; + +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; +import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.client.gui.screen.ingame.HandledScreen; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.entity.player.PlayerInventory; +import net.minecraft.text.Text; +import reborncore.common.screen.BuiltScreenHandler; + +@Environment(EnvType.CLIENT) +public interface GuiFactory extends ScreenRegistry.Factory> { + HandledScreen create(int syncId, PlayerEntity playerEntity, T blockEntity); + + @Override + default HandledScreen create(BuiltScreenHandler builtScreenHandler, PlayerInventory playerInventory, Text text) { + PlayerEntity playerEntity = playerInventory.player; + //noinspection unchecked + T blockEntity = (T) builtScreenHandler.getBlockEntity(); + return create(builtScreenHandler.syncId, playerEntity, blockEntity); + } +} diff --git a/src/main/java/techreborn/client/gui/GuiAESU.java b/src/main/java/techreborn/client/gui/GuiAESU.java index 8381811b5..0261c871e 100644 --- a/src/main/java/techreborn/client/gui/GuiAESU.java +++ b/src/main/java/techreborn/client/gui/GuiAESU.java @@ -32,7 +32,7 @@ import net.minecraft.text.Text; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.widget.GuiButtonUpDown; import reborncore.client.gui.builder.widget.GuiButtonUpDown.UpDownButtonType; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.network.NetworkManager; import reborncore.common.powerSystem.PowerSystem; import techreborn.blockentity.storage.energy.AdjustableSUBlockEntity; diff --git a/src/main/java/techreborn/client/gui/GuiAlloyFurnace.java b/src/main/java/techreborn/client/gui/GuiAlloyFurnace.java index 52f10a41b..fda0cd1d9 100644 --- a/src/main/java/techreborn/client/gui/GuiAlloyFurnace.java +++ b/src/main/java/techreborn/client/gui/GuiAlloyFurnace.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.iron.IronAlloyFurnaceBlockEntity; public class GuiAlloyFurnace extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiAlloySmelter.java b/src/main/java/techreborn/client/gui/GuiAlloySmelter.java index 3458480aa..00eb696c8 100644 --- a/src/main/java/techreborn/client/gui/GuiAlloySmelter.java +++ b/src/main/java/techreborn/client/gui/GuiAlloySmelter.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier1.AlloySmelterBlockEntity; public class GuiAlloySmelter extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiAssemblingMachine.java b/src/main/java/techreborn/client/gui/GuiAssemblingMachine.java index ada25034e..8756d1868 100644 --- a/src/main/java/techreborn/client/gui/GuiAssemblingMachine.java +++ b/src/main/java/techreborn/client/gui/GuiAssemblingMachine.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier1.AssemblingMachineBlockEntity; public class GuiAssemblingMachine extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiAutoCrafting.java b/src/main/java/techreborn/client/gui/GuiAutoCrafting.java index c428c18f1..a1c1d67af 100644 --- a/src/main/java/techreborn/client/gui/GuiAutoCrafting.java +++ b/src/main/java/techreborn/client/gui/GuiAutoCrafting.java @@ -32,7 +32,7 @@ import net.minecraft.recipe.CraftingRecipe; import net.minecraft.util.Identifier; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.network.NetworkManager; import techreborn.blockentity.machine.tier1.AutoCraftingTableBlockEntity; import techreborn.packets.ServerboundPackets; diff --git a/src/main/java/techreborn/client/gui/GuiBatbox.java b/src/main/java/techreborn/client/gui/GuiBatbox.java index c71f44b3f..87d13892c 100644 --- a/src/main/java/techreborn/client/gui/GuiBatbox.java +++ b/src/main/java/techreborn/client/gui/GuiBatbox.java @@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.LiteralText; import net.minecraft.text.Text; import reborncore.client.gui.builder.GuiBase; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.powerSystem.PowerSystem; import techreborn.blockentity.storage.energy.LowVoltageSUBlockEntity; diff --git a/src/main/java/techreborn/client/gui/GuiBlastFurnace.java b/src/main/java/techreborn/client/gui/GuiBlastFurnace.java index 710f2fdc3..21430732c 100644 --- a/src/main/java/techreborn/client/gui/GuiBlastFurnace.java +++ b/src/main/java/techreborn/client/gui/GuiBlastFurnace.java @@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.widget.GuiButtonExtended; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.multiblock.IndustrialBlastFurnaceBlockEntity; public class GuiBlastFurnace extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiCentrifuge.java b/src/main/java/techreborn/client/gui/GuiCentrifuge.java index 29041d40c..7401393ff 100644 --- a/src/main/java/techreborn/client/gui/GuiCentrifuge.java +++ b/src/main/java/techreborn/client/gui/GuiCentrifuge.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier3.IndustrialCentrifugeBlockEntity; public class GuiCentrifuge extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiChargeBench.java b/src/main/java/techreborn/client/gui/GuiChargeBench.java index bd51e7454..5a34af95b 100644 --- a/src/main/java/techreborn/client/gui/GuiChargeBench.java +++ b/src/main/java/techreborn/client/gui/GuiChargeBench.java @@ -27,7 +27,7 @@ package techreborn.client.gui; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.misc.ChargeOMatBlockEntity; public class GuiChargeBench extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiChemicalReactor.java b/src/main/java/techreborn/client/gui/GuiChemicalReactor.java index 8b734a4c7..bff71a4b4 100644 --- a/src/main/java/techreborn/client/gui/GuiChemicalReactor.java +++ b/src/main/java/techreborn/client/gui/GuiChemicalReactor.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier1.ChemicalReactorBlockEntity; public class GuiChemicalReactor extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiChunkLoader.java b/src/main/java/techreborn/client/gui/GuiChunkLoader.java index 669bac048..90c5a833a 100644 --- a/src/main/java/techreborn/client/gui/GuiChunkLoader.java +++ b/src/main/java/techreborn/client/gui/GuiChunkLoader.java @@ -33,7 +33,7 @@ import reborncore.client.ClientChunkManager; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.widget.GuiButtonUpDown; import reborncore.client.gui.builder.widget.GuiButtonUpDown.UpDownButtonType; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.network.NetworkManager; import techreborn.blockentity.machine.tier3.ChunkLoaderBlockEntity; import techreborn.packets.ServerboundPackets; diff --git a/src/main/java/techreborn/client/gui/GuiCompressor.java b/src/main/java/techreborn/client/gui/GuiCompressor.java index 63f971173..bd63c6bfd 100644 --- a/src/main/java/techreborn/client/gui/GuiCompressor.java +++ b/src/main/java/techreborn/client/gui/GuiCompressor.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier1.CompressorBlockEntity; public class GuiCompressor extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiDieselGenerator.java b/src/main/java/techreborn/client/gui/GuiDieselGenerator.java index 54bd6cb3a..a030e8a87 100644 --- a/src/main/java/techreborn/client/gui/GuiDieselGenerator.java +++ b/src/main/java/techreborn/client/gui/GuiDieselGenerator.java @@ -30,7 +30,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.generator.advanced.DieselGeneratorBlockEntity; @Environment(EnvType.CLIENT) diff --git a/src/main/java/techreborn/client/gui/GuiDistillationTower.java b/src/main/java/techreborn/client/gui/GuiDistillationTower.java index d200d717b..81670cc8e 100644 --- a/src/main/java/techreborn/client/gui/GuiDistillationTower.java +++ b/src/main/java/techreborn/client/gui/GuiDistillationTower.java @@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.widget.GuiButtonExtended; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.multiblock.DistillationTowerBlockEntity; public class GuiDistillationTower extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiElectricFurnace.java b/src/main/java/techreborn/client/gui/GuiElectricFurnace.java index c6654d4c5..4b77bc47e 100644 --- a/src/main/java/techreborn/client/gui/GuiElectricFurnace.java +++ b/src/main/java/techreborn/client/gui/GuiElectricFurnace.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier1.ElectricFurnaceBlockEntity; public class GuiElectricFurnace extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiExtractor.java b/src/main/java/techreborn/client/gui/GuiExtractor.java index 17175cd5e..7e3a6188a 100644 --- a/src/main/java/techreborn/client/gui/GuiExtractor.java +++ b/src/main/java/techreborn/client/gui/GuiExtractor.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier1.ExtractorBlockEntity; public class GuiExtractor extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiFluidReplicator.java b/src/main/java/techreborn/client/gui/GuiFluidReplicator.java index c00b6e4db..8ce5a6e62 100644 --- a/src/main/java/techreborn/client/gui/GuiFluidReplicator.java +++ b/src/main/java/techreborn/client/gui/GuiFluidReplicator.java @@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.widget.GuiButtonExtended; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.multiblock.FluidReplicatorBlockEntity; /** diff --git a/src/main/java/techreborn/client/gui/GuiFusionReactor.java b/src/main/java/techreborn/client/gui/GuiFusionReactor.java index e14ac3504..ca90b8f6e 100644 --- a/src/main/java/techreborn/client/gui/GuiFusionReactor.java +++ b/src/main/java/techreborn/client/gui/GuiFusionReactor.java @@ -34,7 +34,7 @@ import reborncore.client.gui.builder.widget.GuiButtonExtended; import reborncore.client.gui.builder.widget.GuiButtonUpDown; import reborncore.client.gui.builder.widget.GuiButtonUpDown.UpDownButtonType; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.network.NetworkManager; import reborncore.common.powerSystem.PowerSystem; import reborncore.common.util.Color; diff --git a/src/main/java/techreborn/client/gui/GuiGasTurbine.java b/src/main/java/techreborn/client/gui/GuiGasTurbine.java index b8655b6f8..3e856c237 100644 --- a/src/main/java/techreborn/client/gui/GuiGasTurbine.java +++ b/src/main/java/techreborn/client/gui/GuiGasTurbine.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.generator.advanced.GasTurbineBlockEntity; public class GuiGasTurbine extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiGenerator.java b/src/main/java/techreborn/client/gui/GuiGenerator.java index 62c408368..42508b316 100644 --- a/src/main/java/techreborn/client/gui/GuiGenerator.java +++ b/src/main/java/techreborn/client/gui/GuiGenerator.java @@ -27,7 +27,7 @@ package techreborn.client.gui; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.generator.basic.SolidFuelGeneratorBlockEntity; public class GuiGenerator extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiGreenhouseController.java b/src/main/java/techreborn/client/gui/GuiGreenhouseController.java index 1e92b98c5..e05cee6de 100644 --- a/src/main/java/techreborn/client/gui/GuiGreenhouseController.java +++ b/src/main/java/techreborn/client/gui/GuiGreenhouseController.java @@ -33,7 +33,7 @@ import net.minecraft.text.Text; import net.minecraft.util.Identifier; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.widget.GuiButtonExtended; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier1.GreenhouseControllerBlockEntity; import java.util.Arrays; diff --git a/src/main/java/techreborn/client/gui/GuiIDSU.java b/src/main/java/techreborn/client/gui/GuiIDSU.java index 10ac6e742..bed007f12 100644 --- a/src/main/java/techreborn/client/gui/GuiIDSU.java +++ b/src/main/java/techreborn/client/gui/GuiIDSU.java @@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.LiteralText; import net.minecraft.text.Text; import reborncore.client.gui.builder.GuiBase; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.powerSystem.PowerSystem; import techreborn.blockentity.storage.energy.idsu.InterdimensionalSUBlockEntity; diff --git a/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java b/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java index 8109467a6..d0e85d51b 100644 --- a/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java +++ b/src/main/java/techreborn/client/gui/GuiImplosionCompressor.java @@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.widget.GuiButtonExtended; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.multiblock.ImplosionCompressorBlockEntity; public class GuiImplosionCompressor extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiIndustrialElectrolyzer.java b/src/main/java/techreborn/client/gui/GuiIndustrialElectrolyzer.java index 66154a2b1..2949f9ba9 100644 --- a/src/main/java/techreborn/client/gui/GuiIndustrialElectrolyzer.java +++ b/src/main/java/techreborn/client/gui/GuiIndustrialElectrolyzer.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier1.IndustrialElectrolyzerBlockEntity; public class GuiIndustrialElectrolyzer extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java b/src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java index cb8897a86..20f0f9d19 100644 --- a/src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java +++ b/src/main/java/techreborn/client/gui/GuiIndustrialGrinder.java @@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.widget.GuiButtonExtended; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.multiblock.IndustrialGrinderBlockEntity; public class GuiIndustrialGrinder extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java b/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java index 986708b57..6cc0ddf11 100644 --- a/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java +++ b/src/main/java/techreborn/client/gui/GuiIndustrialSawmill.java @@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.widget.GuiButtonExtended; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.multiblock.IndustrialSawmillBlockEntity; public class GuiIndustrialSawmill extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiIronFurnace.java b/src/main/java/techreborn/client/gui/GuiIronFurnace.java index ba931b32a..fcbead3bd 100644 --- a/src/main/java/techreborn/client/gui/GuiIronFurnace.java +++ b/src/main/java/techreborn/client/gui/GuiIronFurnace.java @@ -33,7 +33,7 @@ import net.minecraft.text.LiteralText; import net.minecraft.util.Identifier; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.network.NetworkManager; import techreborn.blockentity.machine.iron.IronFurnaceBlockEntity; import techreborn.packets.ServerboundPackets; diff --git a/src/main/java/techreborn/client/gui/GuiLESU.java b/src/main/java/techreborn/client/gui/GuiLESU.java index b6a9a017b..ee4c9f594 100644 --- a/src/main/java/techreborn/client/gui/GuiLESU.java +++ b/src/main/java/techreborn/client/gui/GuiLESU.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.LiteralText; import reborncore.client.gui.builder.GuiBase; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.powerSystem.PowerSystem; import techreborn.blockentity.storage.energy.lesu.LapotronicSUBlockEntity; diff --git a/src/main/java/techreborn/client/gui/GuiMFE.java b/src/main/java/techreborn/client/gui/GuiMFE.java index 44c5759b6..163f42169 100644 --- a/src/main/java/techreborn/client/gui/GuiMFE.java +++ b/src/main/java/techreborn/client/gui/GuiMFE.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.LiteralText; import reborncore.client.gui.builder.GuiBase; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.powerSystem.PowerSystem; import techreborn.blockentity.storage.energy.MediumVoltageSUBlockEntity; diff --git a/src/main/java/techreborn/client/gui/GuiMFSU.java b/src/main/java/techreborn/client/gui/GuiMFSU.java index cc129ae74..b3506272d 100644 --- a/src/main/java/techreborn/client/gui/GuiMFSU.java +++ b/src/main/java/techreborn/client/gui/GuiMFSU.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.LiteralText; import reborncore.client.gui.builder.GuiBase; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.powerSystem.PowerSystem; import techreborn.blockentity.storage.energy.HighVoltageSUBlockEntity; diff --git a/src/main/java/techreborn/client/gui/GuiMatterFabricator.java b/src/main/java/techreborn/client/gui/GuiMatterFabricator.java index e4110b93b..25d725512 100644 --- a/src/main/java/techreborn/client/gui/GuiMatterFabricator.java +++ b/src/main/java/techreborn/client/gui/GuiMatterFabricator.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier3.MatterFabricatorBlockEntity; public class GuiMatterFabricator extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiPlasmaGenerator.java b/src/main/java/techreborn/client/gui/GuiPlasmaGenerator.java index 62f265f87..a5d109c63 100644 --- a/src/main/java/techreborn/client/gui/GuiPlasmaGenerator.java +++ b/src/main/java/techreborn/client/gui/GuiPlasmaGenerator.java @@ -30,7 +30,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.generator.PlasmaGeneratorBlockEntity; /** diff --git a/src/main/java/techreborn/client/gui/GuiPlayerDetector.java b/src/main/java/techreborn/client/gui/GuiPlayerDetector.java index 95e6c3a2f..8568ce4cd 100644 --- a/src/main/java/techreborn/client/gui/GuiPlayerDetector.java +++ b/src/main/java/techreborn/client/gui/GuiPlayerDetector.java @@ -30,7 +30,7 @@ import net.minecraft.text.LiteralText; import net.minecraft.text.Text; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.widget.GuiButtonUpDown; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.network.NetworkManager; import techreborn.blockentity.machine.tier1.PlayerDetectorBlockEntity; import techreborn.packets.ServerboundPackets; diff --git a/src/main/java/techreborn/client/gui/GuiRecycler.java b/src/main/java/techreborn/client/gui/GuiRecycler.java index 1dc191c0d..6e85aaa35 100644 --- a/src/main/java/techreborn/client/gui/GuiRecycler.java +++ b/src/main/java/techreborn/client/gui/GuiRecycler.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier1.RecyclerBlockEntity; public class GuiRecycler extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiRollingMachine.java b/src/main/java/techreborn/client/gui/GuiRollingMachine.java index 44c9c4f1d..2b60de4d6 100644 --- a/src/main/java/techreborn/client/gui/GuiRollingMachine.java +++ b/src/main/java/techreborn/client/gui/GuiRollingMachine.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.network.NetworkManager; import techreborn.blockentity.machine.tier1.RollingMachineBlockEntity; import techreborn.packets.ServerboundPackets; diff --git a/src/main/java/techreborn/client/gui/GuiScrapboxinator.java b/src/main/java/techreborn/client/gui/GuiScrapboxinator.java index 3d6a40927..b7f5bb168 100644 --- a/src/main/java/techreborn/client/gui/GuiScrapboxinator.java +++ b/src/main/java/techreborn/client/gui/GuiScrapboxinator.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier1.ScrapboxinatorBlockEntity; public class GuiScrapboxinator extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiSemifluidGenerator.java b/src/main/java/techreborn/client/gui/GuiSemifluidGenerator.java index ecaf87b14..34a5e740a 100644 --- a/src/main/java/techreborn/client/gui/GuiSemifluidGenerator.java +++ b/src/main/java/techreborn/client/gui/GuiSemifluidGenerator.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.generator.advanced.SemiFluidGeneratorBlockEntity; public class GuiSemifluidGenerator extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiSolar.java b/src/main/java/techreborn/client/gui/GuiSolar.java index 825e740f9..fdbdfaeb4 100644 --- a/src/main/java/techreborn/client/gui/GuiSolar.java +++ b/src/main/java/techreborn/client/gui/GuiSolar.java @@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.LiteralText; import net.minecraft.text.TranslatableText; import reborncore.client.gui.builder.GuiBase; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.generator.SolarPanelBlockEntity; public class GuiSolar extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiSolidCanningMachine.java b/src/main/java/techreborn/client/gui/GuiSolidCanningMachine.java index e0d06ff7b..4c751f853 100644 --- a/src/main/java/techreborn/client/gui/GuiSolidCanningMachine.java +++ b/src/main/java/techreborn/client/gui/GuiSolidCanningMachine.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier1.SolidCanningMachineBlockEntity; public class GuiSolidCanningMachine extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiStorageUnit.java b/src/main/java/techreborn/client/gui/GuiStorageUnit.java index b54ac1689..73713ebe2 100644 --- a/src/main/java/techreborn/client/gui/GuiStorageUnit.java +++ b/src/main/java/techreborn/client/gui/GuiStorageUnit.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.TranslatableText; import reborncore.client.gui.builder.GuiBase; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.network.NetworkManager; import techreborn.blockentity.storage.item.StorageUnitBaseBlockEntity; import techreborn.packets.ServerboundPackets; diff --git a/src/main/java/techreborn/client/gui/GuiTankUnit.java b/src/main/java/techreborn/client/gui/GuiTankUnit.java index 681f083b7..bc4b98238 100644 --- a/src/main/java/techreborn/client/gui/GuiTankUnit.java +++ b/src/main/java/techreborn/client/gui/GuiTankUnit.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.text.TranslatableText; import reborncore.client.gui.builder.GuiBase; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import reborncore.common.fluid.FluidUtils; import reborncore.common.fluid.container.FluidInstance; import techreborn.blockentity.storage.fluid.TankUnitBaseBlockEntity; diff --git a/src/main/java/techreborn/client/gui/GuiThermalGenerator.java b/src/main/java/techreborn/client/gui/GuiThermalGenerator.java index feb6ba43c..2b7e3ee21 100644 --- a/src/main/java/techreborn/client/gui/GuiThermalGenerator.java +++ b/src/main/java/techreborn/client/gui/GuiThermalGenerator.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.generator.advanced.ThermalGeneratorBlockEntity; public class GuiThermalGenerator extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java b/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java index c237170b7..9df9de166 100644 --- a/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java +++ b/src/main/java/techreborn/client/gui/GuiVacuumFreezer.java @@ -29,7 +29,7 @@ import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.builder.widget.GuiButtonExtended; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.multiblock.VacuumFreezerBlockEntity; public class GuiVacuumFreezer extends GuiBase { diff --git a/src/main/java/techreborn/client/gui/GuiWireMill.java b/src/main/java/techreborn/client/gui/GuiWireMill.java index 09edbe322..711621bfb 100644 --- a/src/main/java/techreborn/client/gui/GuiWireMill.java +++ b/src/main/java/techreborn/client/gui/GuiWireMill.java @@ -28,7 +28,7 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.player.PlayerEntity; import reborncore.client.gui.builder.GuiBase; import reborncore.client.gui.guibuilder.GuiBuilder; -import reborncore.client.screen.builder.BuiltScreenHandler; +import reborncore.common.screen.BuiltScreenHandler; import techreborn.blockentity.machine.tier1.WireMillBlockEntity; public class GuiWireMill extends GuiBase { diff --git a/src/main/java/techreborn/init/TRContent.java b/src/main/java/techreborn/init/TRContent.java index 926de150e..c56b2cf5e 100644 --- a/src/main/java/techreborn/init/TRContent.java +++ b/src/main/java/techreborn/init/TRContent.java @@ -33,7 +33,6 @@ import net.minecraft.item.ItemConvertible; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.sound.BlockSoundGroup; -import net.minecraft.tag.Tag; import net.minecraft.tag.TagKey; import net.minecraft.util.Identifier; import net.minecraft.util.Pair; @@ -82,7 +81,7 @@ import techreborn.blocks.transformers.BlockEVTransformer; import techreborn.blocks.transformers.BlockHVTransformer; import techreborn.blocks.transformers.BlockLVTransformer; import techreborn.blocks.transformers.BlockMVTransformer; -import techreborn.client.GuiType; +import techreborn.blockentity.GuiType; import techreborn.config.TechRebornConfig; import techreborn.entities.EntityNukePrimed; import techreborn.events.ModRegistry;