From cf49faeab34c2559fc7d430f55c99ed8e80d734f Mon Sep 17 00:00:00 2001 From: UselessBullets <80850784+UselessBullets@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:42:41 -0500 Subject: [PATCH 1/5] server boots and can connect --- .../signalindustries/SignalIndustries.java | 76 +++++++++++++------ .../pages/MultiblockMaterialsPage.java | 13 ++-- .../items/attachments/ItemNVGAttachment.java | 4 + .../mixin/DimensionMixin.java | 17 +++++ .../signalindustries/mixin/WorldMixin.java | 10 ++- src/main/resources/fabric.mod.json | 3 + .../resources/signalindustries.mixins.json | 23 +++--- 7 files changed, 101 insertions(+), 45 deletions(-) create mode 100644 src/main/java/sunsetsatellite/signalindustries/mixin/DimensionMixin.java diff --git a/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java b/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java index 2e00a7c4..811cb0d6 100644 --- a/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java +++ b/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java @@ -1,7 +1,9 @@ package sunsetsatellite.signalindustries; +import net.fabricmc.api.EnvType; import net.fabricmc.api.ModInitializer; +import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.fx.EntityFX; import net.minecraft.client.gui.Gui; @@ -15,6 +17,7 @@ import net.minecraft.client.render.entity.MobRenderer; import net.minecraft.client.render.entity.SnowballRenderer; import net.minecraft.client.render.model.ModelZombie; +import net.minecraft.core.Global; import net.minecraft.core.block.*; import net.minecraft.core.block.material.Material; import net.minecraft.core.block.tag.BlockTags; @@ -39,6 +42,7 @@ import net.minecraft.core.world.type.WorldTypes; import net.minecraft.core.world.weather.Weather; import net.minecraft.server.entity.player.EntityPlayerMP; +import org.lwjgl.opengl.GL11; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import sunsetsatellite.catalyst.core.util.BlockInstance; @@ -86,6 +90,7 @@ import sunsetsatellite.signalindustries.weather.WeatherSolarApocalypse; import turniplabs.halplibe.HalpLibe; import turniplabs.halplibe.helper.*; +import turniplabs.halplibe.util.ClientStartEntrypoint; import turniplabs.halplibe.util.GameStartEntrypoint; import turniplabs.halplibe.util.achievements.AchievementPage; import turniplabs.halplibe.util.toml.Toml; @@ -99,7 +104,7 @@ import java.util.function.BiFunction; import java.util.stream.Collectors; -public class SignalIndustries implements ModInitializer, GameStartEntrypoint { +public class SignalIndustries implements ModInitializer, GameStartEntrypoint, ClientStartEntrypoint { private static final int blockIdStart = 1200; private static final int itemIdStart = 17100; @@ -1214,7 +1219,7 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint { public static final Biome biomeEternity = Biomes.register("signalindustries:eternity",new Biome("signalindustries:eternity").setFillerBlock(realityFabric.id).setTopBlock(realityFabric.id).setColor(0x808080)); public static final WorldType eternityWorld = WorldTypes.register("signalindustries:eternity",new WorldTypeEternity(key("eternity"))); - public static final Dimension dimEternity = new Dimension(key("eternity"),Dimension.overworld,1,portalEternity.id).setDefaultWorldType(eternityWorld); + public static Dimension dimEternity; public static final Multiblock dimAnchorMultiblock = new Multiblock(MOD_ID,new Class[]{SignalIndustries.class},"dimensionalAnchor","dimensionalAnchor",false); public static final Multiblock wrathTree = new Multiblock(MOD_ID,new Class[]{SignalIndustries.class},"wrathTree","reinforcedWrathBeacon",false); @@ -1318,8 +1323,6 @@ public void onInitialize() { textures.put(Tier.REINFORCED.name()+".ignitor.ready.overlay",new BlockTexture(MOD_ID).setSides("ignitor_5_overlay.png").setTopTexture("ignitor_8_overlay.png").setBottomTexture("ignitor_4_overlay.png")); textures.put(Tier.REINFORCED.name()+".ignitor.inverted.ready",new BlockTexture(MOD_ID).setSides("reinforced_ignitor_ready_inverted.png").setTopTexture("reinforced_ignitor_bottom_ready.png").setBottomTexture("reinforced_ignitor_top_ready.png")); textures.put(Tier.REINFORCED.name()+".ignitor.inverted.ready.overlay",new BlockTexture(MOD_ID).setSides("ignitor_6_overlay.png").setTopTexture("ignitor_4_overlay.png").setBottomTexture("ignitor_8_overlay.png")); - - Dimension.registerDimension(config.getInt("Other.eternityDimId"),dimEternity); } public SignalIndustries(){ @@ -1368,13 +1371,17 @@ public SignalIndustries(){ CommandHelper.Core.createCommand(new StructureCommand("structure","struct")); EntityHelper.Core.createEntity(EntityCrystal.class,47,"signalumCrystal"); - EntityHelper.Client.assignEntityRenderer(EntityCrystal.class,new SnowballRenderer(volatileSignalumCrystal.getIconFromDamage(0))); EntityHelper.Core.createEntity(EntityEnergyOrb.class,49,"energyOrb"); - EntityHelper.Client.assignEntityRenderer(EntityEnergyOrb.class,new SnowballRenderer(Block.texCoordToIndex(energyOrbTex[0],energyOrbTex[1]))); EntityHelper.Core.createEntity(EntitySunbeam.class,49,"sunBeam"); - EntityHelper.Client.assignEntityRenderer(EntitySunbeam.class,new SunbeamRenderer()); EntityHelper.Core.createEntity(EntityFallingMeteor.class,50,"fallingMeteor"); - EntityHelper.Client.assignEntityRenderer(EntityFallingMeteor.class,new FallingMeteorRenderer()); + + + if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT){ + EntityHelper.Client.assignEntityRenderer(EntityCrystal.class,new SnowballRenderer(volatileSignalumCrystal.getIconFromDamage(0))); + EntityHelper.Client.assignEntityRenderer(EntityEnergyOrb.class,new SnowballRenderer(Block.texCoordToIndex(energyOrbTex[0],energyOrbTex[1]))); + EntityHelper.Client.assignEntityRenderer(EntitySunbeam.class,new SunbeamRenderer()); + EntityHelper.Client.assignEntityRenderer(EntityFallingMeteor.class,new FallingMeteorRenderer()); + } addEntities(); //crafting recipes in RecipeHandlerCraftingSI @@ -1384,23 +1391,31 @@ public SignalIndustries(){ //idea got *too smart* recently and now considers anything after accessor stubs "unreachable" due to the throw statement in them that will never be triggered @SuppressWarnings("UnreachableCode") private void addEntities(){ - EntityHelper.Core.createSpecialTileEntity(TileEntityConduit.class, new RenderFluidInConduit(),"Conduit"); + boolean isClientSide = FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT; + EntityHelper.Core.createTileEntity(TileEntityConduit.class,"Conduit"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntityConduit.class, new RenderFluidInConduit()); - EntityHelper.Core.createSpecialTileEntity(TileEntityFluidConduit.class, new RenderFluidInConduit(),"Fluid Conduit"); - EntityHelper.Core.createSpecialTileEntity(TileEntityItemConduit.class, new RenderItemsInConduit(),"Item Conduit"); + EntityHelper.Core.createTileEntity(TileEntityFluidConduit.class,"Fluid Conduit"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntityFluidConduit.class, new RenderFluidInConduit()); + + EntityHelper.Core.createTileEntity(TileEntityItemConduit.class,"Item Conduit"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntityItemConduit.class, new RenderItemsInConduit()); EntityHelper.Core.createTileEntity(TileEntityInserter.class, "Inserter"); - EntityHelper.Core.createSpecialTileEntity(TileEntityEnergyCell.class,new RenderFluidInBlock(),"Energy Cell"); + EntityHelper.Core.createTileEntity(TileEntityEnergyCell.class,"Energy Cell"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntityEnergyCell.class,new RenderFluidInBlock()); addToNameGuiMap("Energy Cell", GuiEnergyCell.class, TileEntityEnergyCell.class); - EntityHelper.Core.createSpecialTileEntity(TileEntitySIFluidTank.class,new RenderFluidInBlock(),"SI Fluid Tank"); + EntityHelper.Core.createTileEntity(TileEntitySIFluidTank.class,"SI Fluid Tank"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntitySIFluidTank.class,new RenderFluidInBlock()); addToNameGuiMap("SI Fluid Tank", GuiSIFluidTank.class, TileEntitySIFluidTank.class); EntityHelper.Core.createTileEntity(TileEntityExtractor.class,"Extractor"); addToNameGuiMap("Extractor", GuiExtractor.class, TileEntityExtractor.class); - EntityHelper.Core.createSpecialTileEntity(TileEntityReinforcedExtractor.class, new RenderMultiblock(), "Extraction Manifold"); + EntityHelper.Core.createTileEntity(TileEntityReinforcedExtractor.class, "Extraction Manifold"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntityReinforcedExtractor.class, new RenderMultiblock()); addToNameGuiMap("Extraction Manifold", GuiReinforcedExtractor.class, TileEntityReinforcedExtractor.class); EntityHelper.Core.createTileEntity(TileEntityCrusher.class,"Crusher"); @@ -1430,15 +1445,19 @@ private void addEntities(){ EntityHelper.Core.createTileEntity(TileEntityPump.class,"Pump"); addToNameGuiMap("Pump", GuiPump.class, TileEntityCrystalChamber.class); - EntityHelper.Core.createSpecialTileEntity(TileEntityAssembler.class, new RenderAssemblerItemSprite3D(),"SI Assembler"); + EntityHelper.Core.createTileEntity(TileEntityAssembler.class,"SI Assembler"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntityAssembler.class, new RenderAssemblerItemSprite3D()); addToNameGuiMap("SI Assembler", GuiAssembler.class, TileEntityAssembler.class); - EntityHelper.Core.createSpecialTileEntity(TileEntityStorageContainer.class, new RenderStorageContainer(),"Storage Container"); + EntityHelper.Core.createTileEntity(TileEntityStorageContainer.class,"Storage Container"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntityStorageContainer.class, new RenderStorageContainer()); - EntityHelper.Core.createSpecialTileEntity(TileEntityDimensionalAnchor.class,new RenderMultiblock(),"Dimensional Anchor"); + EntityHelper.Core.createTileEntity(TileEntityDimensionalAnchor.class,"Dimensional Anchor"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntityDimensionalAnchor.class,new RenderMultiblock()); addToNameGuiMap("Dimensional Anchor", GuiDimAnchor.class, TileEntityDimensionalAnchor.class); - EntityHelper.Core.createSpecialTileEntity(TileEntityAutoMiner.class, new RenderAutoMiner(),"Automatic Miner"); + EntityHelper.Core.createTileEntity(TileEntityAutoMiner.class,"Automatic Miner"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntityAutoMiner.class, new RenderAutoMiner()); addToNameGuiMap("Automatic Miner", GuiAutoMiner.class, TileEntityAutoMiner.class); EntityHelper.Core.createTileEntity(TileEntityExternalIO.class,"External I/O"); @@ -1447,7 +1466,8 @@ private void addEntities(){ EntityHelper.Core.createTileEntity(TileEntityCentrifuge.class,"Separation Centrifuge"); addToNameGuiMap("Separation Centrifuge", GuiCentrifuge.class, TileEntityCentrifuge.class); - EntityHelper.Core.createSpecialTileEntity(TileEntitySignalumReactor.class,new RenderSignalumReactor(),"Signalum Reactor"); + EntityHelper.Core.createTileEntity(TileEntitySignalumReactor.class,"Signalum Reactor"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntitySignalumReactor.class,new RenderSignalumReactor()); addToNameGuiMap("Signalum Reactor", GuiSignalumReactor.class, TileEntitySignalumReactor.class); EntityHelper.Core.createTileEntity(TileEntityEnergyConnector.class,"Energy Connector"); @@ -1461,7 +1481,8 @@ private void addEntities(){ EntityHelper.Core.createTileEntity(TileEntityIgnitor.class,"Signalum Ignitor"); - EntityHelper.Core.createSpecialTileEntity(TileEntityEnergyInjector.class,new RenderEnergyInjector(),"Energy Injector"); + EntityHelper.Core.createTileEntity(TileEntityEnergyInjector.class,"Energy Injector"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntityEnergyInjector.class,new RenderEnergyInjector()); addToNameGuiMap("Energy Injector",GuiEnergyInjector.class,TileEntityEnergyInjector.class); EntityHelper.Core.createTileEntity(TileEntitySignalumDynamo.class,"Signalum Dynamo"); @@ -1481,7 +1502,8 @@ private void addEntities(){ EntityHelper.Core.createTileEntity(TileEntityRecipeMaker.class,"Recipe Maker"); EntityHelper.Core.createTileEntity(TileEntityWrathBeacon.class,"Wrath Beacon"); - EntityHelper.Core.createSpecialTileEntity(TileEntityReinforcedWrathBeacon.class,new RenderReinforcedWrathBeacon(),"Reinforced Wrath Beacon"); + EntityHelper.Core.createTileEntity(TileEntityReinforcedWrathBeacon.class,"Reinforced Wrath Beacon"); + if (isClientSide) EntityHelper.Client.assignTileEntityRenderer(TileEntityReinforcedWrathBeacon.class,new RenderReinforcedWrathBeacon()); EntityHelper.Core.createTileEntity(TileEntityBlockBreaker.class,"Block Breaker"); Multiblock.multiblocks.put("dimensionalAnchor",dimAnchorMultiblock); @@ -1492,7 +1514,7 @@ private void addEntities(){ SignalIndustries.LOGGER.info(String.format("Loaded %d internal structures.", Structure.internalStructures.size())); EntityHelper.Core.createEntity(EntityInfernal.class,config.getInt("EntityIDs.infernalId"),"Infernal"); - EntityHelper.Client.assignEntityRenderer(EntityInfernal.class,new MobRenderer(new ModelZombie(),0.5F)); + if (isClientSide) EntityHelper.Client.assignEntityRenderer(EntityInfernal.class,new MobRenderer(new ModelZombie(),0.5F)); } public static Map mapOf(K[] keys, V[] values){ @@ -1722,6 +1744,16 @@ public void beforeGameStart() { @Override public void afterGameStart() { + + } + + @Override + public void beforeClientStart() { + + } + + @Override + public void afterClientStart() { BlockDataExporter.export(this.getClass()); AchievementHelper.addPage(ACHIEVEMENTS); OptionsCategory category = new OptionsCategory("gui.options.page.controls.category.signalindustries"); diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/guidebook/pages/MultiblockMaterialsPage.java b/src/main/java/sunsetsatellite/signalindustries/gui/guidebook/pages/MultiblockMaterialsPage.java index 048d259b..18b0bd22 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/guidebook/pages/MultiblockMaterialsPage.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/guidebook/pages/MultiblockMaterialsPage.java @@ -3,33 +3,30 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiRenderItem; import net.minecraft.client.gui.GuiTooltip; -import net.minecraft.client.gui.guidebook.*; +import net.minecraft.client.gui.guidebook.GuiGuidebook; +import net.minecraft.client.gui.guidebook.GuidebookPage; +import net.minecraft.client.gui.guidebook.GuidebookSection; +import net.minecraft.client.gui.guidebook.GuidebookSections; +import net.minecraft.client.gui.guidebook.PageManager; import net.minecraft.client.gui.guidebook.search.SearchPage; import net.minecraft.client.render.FontRenderer; import net.minecraft.client.render.RenderEngine; import net.minecraft.core.achievement.stat.StatList; import net.minecraft.core.data.registry.recipe.RecipeSymbol; import net.minecraft.core.data.registry.recipe.SearchQuery; -import net.minecraft.core.item.Item; import net.minecraft.core.item.ItemStack; import net.minecraft.core.lang.I18n; import net.minecraft.core.player.gamemode.Gamemode; import net.minecraft.core.player.inventory.slot.Slot; import net.minecraft.core.player.inventory.slot.SlotGuidebook; -import org.apache.logging.log4j.core.util.Integers; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; -import sunsetsatellite.catalyst.core.util.BlockInstance; import sunsetsatellite.catalyst.multiblocks.Multiblock; import sunsetsatellite.signalindustries.SignalIndustries; -import sunsetsatellite.signalindustries.recipes.entry.RecipeEntryMachine; -import turniplabs.halplibe.HalpLibe; import java.util.ArrayList; import java.util.List; -import java.util.Optional; import java.util.stream.Collectors; -import java.util.stream.Stream; public class MultiblockMaterialsPage extends GuidebookPage { public final Multiblock multiblock; diff --git a/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemNVGAttachment.java b/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemNVGAttachment.java index 08fe2dc0..99cbea43 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemNVGAttachment.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemNVGAttachment.java @@ -3,6 +3,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.render.shader.Shaders; import net.minecraft.client.render.shader.ShadersRenderer; +import net.minecraft.core.Global; import net.minecraft.core.entity.player.EntityPlayer; import net.minecraft.core.item.ItemStack; import net.minecraft.core.world.World; @@ -22,6 +23,7 @@ public ItemNVGAttachment(String name, int id, List attachmentPo @Override public void activate(ItemStack stack, SignalumPowerSuit signalumPowerSuit, EntityPlayer player, World world) { super.activate(stack, signalumPowerSuit, player, world); + if (Global.isServer) return; Minecraft mc = Minecraft.getMinecraft(this); if(signalumPowerSuit.getEnergy() >= 1 ) { if (Shaders.enableShaders) { @@ -45,6 +47,7 @@ public void activate(ItemStack stack, SignalumPowerSuit signalumPowerSuit, Entit @Override public void tick(ItemStack stack, SignalumPowerSuit signalumPowerSuit, EntityPlayer player, World world, int slot) { super.tick(stack, signalumPowerSuit, player, world, slot); + if (Global.isServer) return; Minecraft mc = Minecraft.getMinecraft(this); if(mc.render instanceof ShadersRendererSI){ if(signalumPowerSuit.getEnergy() < 1 ){ @@ -59,6 +62,7 @@ public void tick(ItemStack stack, SignalumPowerSuit signalumPowerSuit, EntityPla } public static void disable(){ + if (Global.isServer) return; Minecraft mc = Minecraft.getMinecraft(SignalIndustries.class); if (mc.render instanceof ShadersRendererSI) { mc.setRenderer(new ShadersRenderer(mc)); diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/DimensionMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/DimensionMixin.java new file mode 100644 index 00000000..d2d495fe --- /dev/null +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/DimensionMixin.java @@ -0,0 +1,17 @@ +package sunsetsatellite.signalindustries.mixin; + +import net.minecraft.core.world.Dimension; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import sunsetsatellite.signalindustries.SignalIndustries; + +@Mixin(value = Dimension.class, remap = false) +public class DimensionMixin { + @Inject(method = "", at = @At("TAIL")) + private static void addDimension(CallbackInfo ci){ + SignalIndustries.dimEternity = new Dimension(SignalIndustries.key("eternity"),Dimension.overworld,1,SignalIndustries.portalEternity.id).setDefaultWorldType(SignalIndustries.eternityWorld); + Dimension.registerDimension(SignalIndustries.config.getInt("Other.eternityDimId"),SignalIndustries.dimEternity); + } +} diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java index 79442f07..7ca1c694 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java @@ -101,10 +101,12 @@ public void doBloodMoon(CallbackInfo ci){ if(dayTime == 0 && getCurrentWeather() == SignalIndustries.weatherBloodMoon){ weatherManager.overrideWeather(Weather.overworldClear); } - if(getCurrentWeather() == SignalIndustries.weatherBloodMoon){ - ColorizerWater.updateColorData(Minecraft.getMinecraft(Minecraft.class).renderEngine.getTextureImageData("/assets/signalindustries/misc/blood_moon_colorizer.png")); - } else { - ColorizerWater.updateColorData(Minecraft.getMinecraft(Minecraft.class).renderEngine.getTextureImageData("/misc/watercolor.png")); + if (!Global.isServer){ + if(getCurrentWeather() == SignalIndustries.weatherBloodMoon){ + ColorizerWater.updateColorData(Minecraft.getMinecraft(Minecraft.class).renderEngine.getTextureImageData("/assets/signalindustries/misc/blood_moon_colorizer.png")); + } else { + ColorizerWater.updateColorData(Minecraft.getMinecraft(Minecraft.class).renderEngine.getTextureImageData("/misc/watercolor.png")); + } } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 5b913ee6..684c97cc 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -34,6 +34,9 @@ "afterGameStart": [ "sunsetsatellite.signalindustries.SignalIndustries" ], + "afterClientStart": [ + "sunsetsatellite.signalindustries.SignalIndustries" + ], "recipesReady": [ "sunsetsatellite.signalindustries.recipes.container.SIRecipes" ], diff --git a/src/main/resources/signalindustries.mixins.json b/src/main/resources/signalindustries.mixins.json index 040d068b..beb07c9d 100644 --- a/src/main/resources/signalindustries.mixins.json +++ b/src/main/resources/signalindustries.mixins.json @@ -7,6 +7,7 @@ "AchievementMixin", "BlockFluidMixin", "BlockRailMixin", + "DimensionMixin", "EntityArrowMixin", "EntityLivingMixin", "EntityMinecartMixin", @@ -15,28 +16,28 @@ "EntityPlayerMPMixin", "EntityTrackerEntryMixin", "EntityTrackerMixin", - "GameSettingsMixin", - "GuidebookSectionsMixin", - "GuiIngameMixin", "InventoryPlayerMixin", "ItemStackMixin", - "MinecraftMixin", "NBTTagCompoundMixin", - "NetClientHandlerMixin", - "RenderEngineMixin", - "RenderGlobalMixin", - "RenderPlayerMixin", - "RichPresenceHandlerThreadMixin", "SaveHandlerBaseMixin", "SlotCraftingMixin", "SlotMixin", "SpawnerMobsMixin", "WorldGenLabyrinthMixin", "WorldMixin", - "WorldTypeOverworldMixin", - "invokers.GuiInvoker" + "WorldTypeOverworldMixin" ], "client": [ + "GameSettingsMixin", + "GuidebookSectionsMixin", + "GuiIngameMixin", + "MinecraftMixin", + "NetClientHandlerMixin", + "RenderEngineMixin", + "RenderGlobalMixin", + "RenderPlayerMixin", + "RichPresenceHandlerThreadMixin", + "invokers.GuiInvoker" ], "injectors": { "defaultRequire": 1 From c2744abd383f0304d0c38dbe085e99ef0bd37777 Mon Sep 17 00:00:00 2001 From: UselessBullets <80850784+UselessBullets@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:04:19 -0500 Subject: [PATCH 2/5] Fixed crystal crash in mp --- .../signalindustries/mixin/EntityTrackerEntryMixin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/EntityTrackerEntryMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/EntityTrackerEntryMixin.java index c0e2a39b..943ef75f 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/EntityTrackerEntryMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/EntityTrackerEntryMixin.java @@ -28,8 +28,8 @@ public class EntityTrackerEntryMixin { ) private void getSpawnPacket(CallbackInfoReturnable cir){ if(this.trackedEntity instanceof EntityCrystal){ - EntityLiving entityliving = ((EntityCrystal)this.trackedEntity).thrower; - cir.setReturnValue(new Packet23VehicleSpawn(this.trackedEntity, 47, entityliving == null ? this.trackedEntity.id : entityliving.id)); + Entity entity = ((EntityCrystal)this.trackedEntity).thrower; + cir.setReturnValue(new Packet23VehicleSpawn(this.trackedEntity, 47, entity == null ? this.trackedEntity.id : entity.id)); } /*if(this.trackedEntity instanceof EntityPipeItem){ cir.setReturnValue(new PacketPipeItemSpawn((EntityPipeItem) this.trackedEntity)); From 0ae2dd6b8a36bf2520d1c6c6a471f64b7ea28a49 Mon Sep 17 00:00:00 2001 From: UselessBullets <80850784+UselessBullets@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:08:49 -0500 Subject: [PATCH 3/5] fixed entity id overlap --- .../signalindustries/SignalIndustries.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java b/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java index 811cb0d6..41061e43 100644 --- a/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java +++ b/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java @@ -1370,10 +1370,10 @@ public SignalIndustries(){ CommandHelper.Core.createCommand(new RecipeReloadCommand("recipes")); CommandHelper.Core.createCommand(new StructureCommand("structure","struct")); - EntityHelper.Core.createEntity(EntityCrystal.class,47,"signalumCrystal"); - EntityHelper.Core.createEntity(EntityEnergyOrb.class,49,"energyOrb"); - EntityHelper.Core.createEntity(EntitySunbeam.class,49,"sunBeam"); - EntityHelper.Core.createEntity(EntityFallingMeteor.class,50,"fallingMeteor"); + EntityHelper.Core.createEntity(EntityCrystal.class,347,"signalumCrystal"); + EntityHelper.Core.createEntity(EntityEnergyOrb.class,349,"energyOrb"); + EntityHelper.Core.createEntity(EntitySunbeam.class,349,"sunBeam"); + EntityHelper.Core.createEntity(EntityFallingMeteor.class,350,"fallingMeteor"); if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT){ From efa138de7d7152d124474ed9e5b5e91adee73747 Mon Sep 17 00:00:00 2001 From: UselessBullets <80850784+UselessBullets@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:38:11 -0500 Subject: [PATCH 4/5] GuiSupplier to not explode the server + more mp fixes --- .../signalindustries/SignalIndustries.java | 21 +++++++++++-------- .../blocks/BlockEnergyCell.java | 2 +- .../blocks/BlockEnergyConnector.java | 2 +- .../blocks/BlockExternalIO.java | 2 +- .../signalindustries/blocks/BlockFilter.java | 2 +- .../blocks/BlockFluidInputHatch.java | 2 +- .../blocks/BlockFluidOutputHatch.java | 2 +- .../blocks/BlockInputBus.java | 2 +- .../blocks/BlockItemConduit.java | 4 ++-- .../blocks/BlockOutputBus.java | 2 +- .../blocks/BlockSIFluidTank.java | 2 +- .../blocks/machines/BlockAlloySmelter.java | 2 +- .../blocks/machines/BlockAssembler.java | 2 +- .../blocks/machines/BlockAutoMiner.java | 2 +- .../blocks/machines/BlockCentrifuge.java | 2 +- .../blocks/machines/BlockCrusher.java | 2 +- .../blocks/machines/BlockCrystalChamber.java | 2 +- .../blocks/machines/BlockCrystalCutter.java | 2 +- .../machines/BlockDilithiumBooster.java | 2 +- .../machines/BlockDilithiumStabilizer.java | 2 +- .../machines/BlockDimensionalAnchor.java | 2 +- .../blocks/machines/BlockEnergyInjector.java | 2 +- .../blocks/machines/BlockExtractor.java | 4 ++-- .../blocks/machines/BlockInfuser.java | 2 +- .../blocks/machines/BlockPlateFormer.java | 2 +- .../blocks/machines/BlockProgrammer.java | 2 +- .../blocks/machines/BlockPump.java | 2 +- .../blocks/machines/BlockSignalumDynamo.java | 2 +- .../machines/BlockSignalumReactorCore.java | 2 +- .../signalindustries/gui/GuiAlloySmelter.java | 4 ++-- .../signalindustries/gui/GuiAssembler.java | 4 ++-- .../signalindustries/gui/GuiAutoMiner.java | 4 ++-- .../signalindustries/gui/GuiBooster.java | 4 ++-- .../signalindustries/gui/GuiCentrifuge.java | 4 ++-- .../signalindustries/gui/GuiCrusher.java | 4 ++-- .../gui/GuiCrystalChamber.java | 4 ++-- .../gui/GuiCrystalCutter.java | 4 ++-- .../signalindustries/gui/GuiDimAnchor.java | 4 ++-- .../signalindustries/gui/GuiEnergyCell.java | 2 +- .../gui/GuiEnergyConnector.java | 4 ++-- .../gui/GuiEnergyInjector.java | 4 ++-- .../signalindustries/gui/GuiExternalIO.java | 4 ++-- .../signalindustries/gui/GuiExtractor.java | 4 ++-- .../signalindustries/gui/GuiFluidHatch.java | 4 ++-- .../gui/GuiFluidIOConfig.java | 2 +- .../signalindustries/gui/GuiInfuser.java | 4 ++-- .../signalindustries/gui/GuiItemBus.java | 4 ++-- .../signalindustries/gui/GuiItemIOConfig.java | 2 +- .../signalindustries/gui/GuiPlateFormer.java | 4 ++-- .../signalindustries/gui/GuiProgrammer.java | 4 ++-- .../signalindustries/gui/GuiPump.java | 2 +- .../gui/GuiReinforcedExtractor.java | 4 ++-- .../signalindustries/gui/GuiSIFluidTank.java | 2 +- .../gui/GuiSignalumDynamo.java | 4 ++-- .../signalindustries/gui/GuiStabilizer.java | 4 ++-- .../interfaces/mixins/IEntityPlayerMP.java | 9 +++++--- .../items/ItemAbilityModule.java | 2 +- .../signalindustries/items/ItemPulsar.java | 2 +- .../items/ItemSignalumPrototypeHarness.java | 2 +- .../attachments/ItemBackpackAttachment.java | 6 +++--- .../attachments/ItemPulsarAttachment.java | 2 +- .../mixin/EntityPlayerMPMixin.java | 13 +++++++----- .../signalindustries/mixin/WorldMixin.java | 3 ++- .../powersuit/GuiPowerSuit.java | 8 +++---- .../powersuit/SignalumPowerSuit.java | 2 +- 65 files changed, 117 insertions(+), 107 deletions(-) diff --git a/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java b/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java index 41061e43..148449c4 100644 --- a/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java +++ b/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java @@ -82,6 +82,7 @@ import sunsetsatellite.signalindustries.items.attachments.*; import sunsetsatellite.signalindustries.items.containers.*; import sunsetsatellite.signalindustries.misc.SignalIndustriesAchievementPage; +import sunsetsatellite.signalindustries.mp.packets.PacketOpenMachineGUI; import sunsetsatellite.signalindustries.render.*; import sunsetsatellite.signalindustries.util.*; import sunsetsatellite.signalindustries.weather.WeatherBloodMoon; @@ -102,6 +103,7 @@ import java.lang.reflect.Field; import java.util.*; import java.util.function.BiFunction; +import java.util.function.Supplier; import java.util.stream.Collectors; public class SignalIndustries implements ModInitializer, GameStartEntrypoint, ClientStartEntrypoint { @@ -1230,6 +1232,7 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint, Cl @Override public void onInitialize() { + NetworkHelper.register(PacketOpenMachineGUI.class, true, true); LOGGER.info("Signal Industries initialized."); } @@ -1541,27 +1544,27 @@ public static Item simpleItem(String name, String lang, String texture){ return ItemHelper.createItem(MOD_ID,new Item(lang,config.getInt("ItemIDs."+name)),texture); } - public static void displayGui(EntityPlayer entityplayer, GuiScreen guiScreen, Container container, IInventory tile, int x, int y, int z) { + public static void displayGui(EntityPlayer entityplayer, Supplier screenSupplier, Container container, IInventory tile, int x, int y, int z) { if(entityplayer instanceof EntityPlayerMP) { - ((IEntityPlayerMP)entityplayer).displayGuiScreen_si(guiScreen,container,tile,x,y,z); + ((IEntityPlayerMP)entityplayer).displayGuiScreen_si(screenSupplier,container,tile,x,y,z); } else { - Minecraft.getMinecraft(Minecraft.class).displayGuiScreen(guiScreen); + Minecraft.getMinecraft(Minecraft.class).displayGuiScreen(screenSupplier.get()); } } - public static void displayGui(EntityPlayer entityplayer, GuiScreen guiScreen, TileEntityWithName tile, int x, int y, int z) { + public static void displayGui(EntityPlayer entityplayer, Supplier screenSupplier, TileEntityWithName tile, int x, int y, int z) { if(entityplayer instanceof EntityPlayerMP) { - ((IEntityPlayerMP)entityplayer).displayGuiScreen_si(guiScreen,tile,x,y,z); + ((IEntityPlayerMP)entityplayer).displayGuiScreen_si(screenSupplier,tile,x,y,z); } else { - Minecraft.getMinecraft(Minecraft.class).displayGuiScreen(guiScreen); + Minecraft.getMinecraft(Minecraft.class).displayGuiScreen(screenSupplier.get()); } } - public static void displayGui(EntityPlayer entityplayer, GuiScreen guiScreen, Container container, IInventory tile, ItemStack stack) { + public static void displayGui(EntityPlayer entityplayer, Supplier screenSupplier, Container container, IInventory tile, ItemStack stack) { if(entityplayer instanceof EntityPlayerMP) { - ((IEntityPlayerMP)entityplayer).displayItemGuiScreen_si(guiScreen,container,tile,stack); + ((IEntityPlayerMP)entityplayer).displayItemGuiScreen_si(screenSupplier,container,tile,stack); } else { - Minecraft.getMinecraft(Minecraft.class).displayGuiScreen(guiScreen); + Minecraft.getMinecraft(Minecraft.class).displayGuiScreen(screenSupplier.get()); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockEnergyCell.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockEnergyCell.java index e0bc39ed..50124b45 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockEnergyCell.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockEnergyCell.java @@ -88,7 +88,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityEnergyCell tile = (TileEntityEnergyCell) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiEnergyCell(entityplayer.inventory, tile),new ContainerFluidTank(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiEnergyCell(entityplayer.inventory, tile),new ContainerFluidTank(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockEnergyConnector.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockEnergyConnector.java index e67640c5..16c0a597 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockEnergyConnector.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockEnergyConnector.java @@ -77,7 +77,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityEnergyConnector tile = (TileEntityEnergyConnector) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiEnergyConnector(entityplayer.inventory, tile),new ContainerEnergyConnector(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiEnergyConnector(entityplayer.inventory, tile),new ContainerEnergyConnector(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExternalIO.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExternalIO.java index 23d7bc88..e9ba0b7f 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExternalIO.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockExternalIO.java @@ -39,7 +39,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityExternalIO tile = (TileEntityExternalIO) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiExternalIO(entityplayer.inventory, tile),new ContainerExternalIO(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiExternalIO(entityplayer.inventory, tile),new ContainerExternalIO(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFilter.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFilter.java index 77c0b813..1fd46e6c 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFilter.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFilter.java @@ -72,7 +72,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityFilter tile = (TileEntityFilter) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiFilter(entityplayer.inventory, tile),new ContainerFilter(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiFilter(entityplayer.inventory, tile),new ContainerFilter(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFluidInputHatch.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFluidInputHatch.java index 66563ee5..0bad08ab 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFluidInputHatch.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFluidInputHatch.java @@ -85,7 +85,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityFluidHatch tile = (TileEntityFluidHatch) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiFluidHatch(entityplayer.inventory, tile),new ContainerFluidHatch(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiFluidHatch(entityplayer.inventory, tile),new ContainerFluidHatch(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFluidOutputHatch.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFluidOutputHatch.java index 2a4ca312..16c13343 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFluidOutputHatch.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockFluidOutputHatch.java @@ -85,7 +85,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityFluidHatch tile = (TileEntityFluidHatch) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiFluidHatch(entityplayer.inventory, tile),new ContainerFluidHatch(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiFluidHatch(entityplayer.inventory, tile),new ContainerFluidHatch(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockInputBus.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockInputBus.java index 4d472742..4dfdb46f 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockInputBus.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockInputBus.java @@ -85,7 +85,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityItemBus tile = (TileEntityItemBus) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiItemBus(entityplayer.inventory, tile),new ContainerItemBus(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiItemBus(entityplayer.inventory, tile),new ContainerItemBus(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockItemConduit.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockItemConduit.java index eb6c868b..3145fd20 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockItemConduit.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockItemConduit.java @@ -53,12 +53,12 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent } if (!world.isClientSide && type == PipeType.RESTRICT) { TileEntityItemConduit tile = (TileEntityItemConduit) world.getBlockTileEntity(i,j,k); - SignalIndustries.displayGui(entityplayer, new GuiRestrictPipeConfig(entityplayer, tile, null), tile, tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiRestrictPipeConfig(entityplayer, tile, null), tile, tile.x,tile.y,tile.z); return true; } if(!world.isClientSide && type == PipeType.SENSOR) { TileEntityItemConduit tile = (TileEntityItemConduit) world.getBlockTileEntity(i,j,k); - SignalIndustries.displayGui(entityplayer, new GuiSensorPipeConfig(entityplayer.inventory, tile), tile, tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiSensorPipeConfig(entityplayer.inventory, tile), tile, tile.x,tile.y,tile.z); return true; } return false; diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockOutputBus.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockOutputBus.java index 88b24318..99c0bf93 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockOutputBus.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockOutputBus.java @@ -85,7 +85,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityItemBus tile = (TileEntityItemBus) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiItemBus(entityplayer.inventory, tile),new ContainerItemBus(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiItemBus(entityplayer.inventory, tile),new ContainerItemBus(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockSIFluidTank.java b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockSIFluidTank.java index e9607715..ee53f9db 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/BlockSIFluidTank.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/BlockSIFluidTank.java @@ -88,7 +88,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntitySIFluidTank tile = (TileEntitySIFluidTank) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiSIFluidTank(entityplayer.inventory, tile),new ContainerFluidTank(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiSIFluidTank(entityplayer.inventory, tile),new ContainerFluidTank(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockAlloySmelter.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockAlloySmelter.java index fcdbb4dc..0eab70a6 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockAlloySmelter.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockAlloySmelter.java @@ -86,7 +86,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityAlloySmelter tile = (TileEntityAlloySmelter) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiAlloySmelter(entityplayer.inventory, tile),new ContainerAlloySmelter(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiAlloySmelter(entityplayer.inventory, tile),new ContainerAlloySmelter(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockAssembler.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockAssembler.java index 21a15844..a61ba2f1 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockAssembler.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockAssembler.java @@ -114,7 +114,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityAssembler tile = (TileEntityAssembler) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiAssembler(entityplayer.inventory, tile),new ContainerAssembler(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiAssembler(entityplayer.inventory, tile),new ContainerAssembler(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockAutoMiner.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockAutoMiner.java index 3e52abc5..0b94cdfa 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockAutoMiner.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockAutoMiner.java @@ -123,7 +123,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent TileEntityAutoMiner tile = (TileEntityAutoMiner) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiAutoMiner(entityplayer.inventory, tile),new ContainerAutoMiner(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiAutoMiner(entityplayer.inventory, tile),new ContainerAutoMiner(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCentrifuge.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCentrifuge.java index bb94a07c..4c8b1a63 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCentrifuge.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCentrifuge.java @@ -86,7 +86,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityCentrifuge tile = (TileEntityCentrifuge) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiCentrifuge(entityplayer.inventory, tile),new ContainerCentrifuge(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiCentrifuge(entityplayer.inventory, tile),new ContainerCentrifuge(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCrusher.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCrusher.java index 98d62587..3e8b2f4b 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCrusher.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCrusher.java @@ -88,7 +88,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityCrusher tile = (TileEntityCrusher) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiCrusher(entityplayer.inventory, tile),new ContainerCrusher(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiCrusher(entityplayer.inventory, tile),new ContainerCrusher(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCrystalChamber.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCrystalChamber.java index dff3e888..a4253f9e 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCrystalChamber.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCrystalChamber.java @@ -87,7 +87,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityCrystalChamber tile = (TileEntityCrystalChamber) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiCrystalChamber(entityplayer.inventory, tile),new ContainerCrystalChamber(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiCrystalChamber(entityplayer.inventory, tile),new ContainerCrystalChamber(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCrystalCutter.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCrystalCutter.java index 5d0e895a..53859665 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCrystalCutter.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockCrystalCutter.java @@ -124,7 +124,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityCrystalCutter tile = (TileEntityCrystalCutter) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiCrystalCutter(entityplayer.inventory, tile),new ContainerCrystalCutter(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiCrystalCutter(entityplayer.inventory, tile),new ContainerCrystalCutter(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockDilithiumBooster.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockDilithiumBooster.java index 1420fccc..31f3363f 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockDilithiumBooster.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockDilithiumBooster.java @@ -86,7 +86,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityBooster tile = (TileEntityBooster) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiBooster(entityplayer.inventory, tile),new ContainerBooster(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiBooster(entityplayer.inventory, tile),new ContainerBooster(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockDilithiumStabilizer.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockDilithiumStabilizer.java index 33c089bb..a6aaf122 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockDilithiumStabilizer.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockDilithiumStabilizer.java @@ -87,7 +87,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityStabilizer tile = (TileEntityStabilizer) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiStabilizer(entityplayer.inventory, tile),new ContainerStabilizer(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiStabilizer(entityplayer.inventory, tile),new ContainerStabilizer(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockDimensionalAnchor.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockDimensionalAnchor.java index 735b5b42..47db1484 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockDimensionalAnchor.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockDimensionalAnchor.java @@ -111,7 +111,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityDimensionalAnchor tile = (TileEntityDimensionalAnchor) world.getBlockTileEntity(i, j, k); if(tile.multiblock != null && tile.multiblock.isValidAt(world,new BlockInstance(this,new Vec3i(i,j,k),tile),Direction.getDirectionFromSide(world.getBlockMetadata(i,j,k)))){ - SignalIndustries.displayGui(entityplayer,new GuiDimAnchor(entityplayer.inventory, tile),new ContainerDimAnchor(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiDimAnchor(entityplayer.inventory, tile),new ContainerDimAnchor(entityplayer.inventory,tile),tile,i,j,k); entityplayer.triggerAchievement(SignalIndustriesAchievementPage.HORIZONS); } else { entityplayer.addChatMessage("event.signalindustries.invalidMultiblock"); diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockEnergyInjector.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockEnergyInjector.java index a49319ed..366318c4 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockEnergyInjector.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockEnergyInjector.java @@ -43,7 +43,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityEnergyInjector tile = (TileEntityEnergyInjector) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiEnergyInjector(entityplayer.inventory, tile),new ContainerEnergyInjector(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiEnergyInjector(entityplayer.inventory, tile),new ContainerEnergyInjector(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockExtractor.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockExtractor.java index 5117cc78..54061dc1 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockExtractor.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockExtractor.java @@ -108,7 +108,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent TileEntityReinforcedExtractor tile = (TileEntityReinforcedExtractor) world.getBlockTileEntity(i, j, k); if (tile != null) { if(tile.multiblock != null && tile.multiblock.isValidAt(world,new BlockInstance(this,new Vec3i(i,j,k),tile),Direction.getDirectionFromSide(world.getBlockMetadata(i,j,k)))){ - SignalIndustries.displayGui(entityplayer,new GuiReinforcedExtractor(entityplayer.inventory, tile),new ContainerReinforcedExtractor(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiReinforcedExtractor(entityplayer.inventory, tile),new ContainerReinforcedExtractor(entityplayer.inventory,tile),tile,i,j,k); entityplayer.triggerAchievement(SignalIndustriesAchievementPage.HORIZONS); } else { entityplayer.addChatMessage("event.signalindustries.invalidMultiblock"); @@ -118,7 +118,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent } else { TileEntityExtractor tile = (TileEntityExtractor) world.getBlockTileEntity(i, j, k); if (tile != null) { - SignalIndustries.displayGui(entityplayer, new GuiExtractor(entityplayer.inventory, tile), new ContainerExtractor(entityplayer.inventory, tile), tile, i, j, k); + SignalIndustries.displayGui(entityplayer, () -> new GuiExtractor(entityplayer.inventory, tile), new ContainerExtractor(entityplayer.inventory, tile), tile, i, j, k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockInfuser.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockInfuser.java index 069b807e..014cf021 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockInfuser.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockInfuser.java @@ -87,7 +87,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityInfuser tile = (TileEntityInfuser) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiInfuser(entityplayer.inventory, tile),new ContainerInfuser(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiInfuser(entityplayer.inventory, tile),new ContainerInfuser(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockPlateFormer.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockPlateFormer.java index 6ed5735c..b189185e 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockPlateFormer.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockPlateFormer.java @@ -87,7 +87,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityPlateFormer tile = (TileEntityPlateFormer) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiPlateFormer(entityplayer.inventory, tile),new ContainerPlateFormer(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiPlateFormer(entityplayer.inventory, tile),new ContainerPlateFormer(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockProgrammer.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockProgrammer.java index abfd0e38..bb3aa99a 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockProgrammer.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockProgrammer.java @@ -84,7 +84,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityProgrammer tile = (TileEntityProgrammer) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiProgrammer(entityplayer.inventory, tile),new ContainerProgrammer(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiProgrammer(entityplayer.inventory, tile),new ContainerProgrammer(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockPump.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockPump.java index c58b7533..bc897671 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockPump.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockPump.java @@ -119,7 +119,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntityPump tile = (TileEntityPump) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiPump(entityplayer.inventory, tile),new ContainerPump(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiPump(entityplayer.inventory, tile),new ContainerPump(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockSignalumDynamo.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockSignalumDynamo.java index f7c2fb19..620bec16 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockSignalumDynamo.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockSignalumDynamo.java @@ -43,7 +43,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntitySignalumDynamo tile = (TileEntitySignalumDynamo) world.getBlockTileEntity(i, j, k); if(tile != null) { - SignalIndustries.displayGui(entityplayer,new GuiSignalumDynamo(entityplayer.inventory, tile),new ContainerSignalumDynamo(entityplayer.inventory,tile),tile,i,j,k); + SignalIndustries.displayGui(entityplayer,() -> new GuiSignalumDynamo(entityplayer.inventory, tile),new ContainerSignalumDynamo(entityplayer.inventory,tile),tile,i,j,k); } return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockSignalumReactorCore.java b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockSignalumReactorCore.java index 7d3b928b..9b1ce060 100644 --- a/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockSignalumReactorCore.java +++ b/src/main/java/sunsetsatellite/signalindustries/blocks/machines/BlockSignalumReactorCore.java @@ -44,7 +44,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent { TileEntitySignalumReactor tile = (TileEntitySignalumReactor) world.getBlockTileEntity(i, j, k); if(tile.multiblock != null && tile.multiblock.isValidAt(world,new BlockInstance(this,new Vec3i(i,j,k),tile), Direction.Z_POS/*Direction.getDirectionFromSide(world.getBlockMetadata(i,j,k)))*/)){ - SignalIndustries.displayGui(entityplayer, new GuiSignalumReactor(entityplayer.inventory, tile), tile, i, j, k); + SignalIndustries.displayGui(entityplayer, () -> new GuiSignalumReactor(entityplayer.inventory, tile), tile, i, j, k); entityplayer.triggerAchievement(SignalIndustriesAchievementPage.HORIZONS); } else { entityplayer.addChatMessage("event.signalindustries.invalidMultiblock"); diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiAlloySmelter.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiAlloySmelter.java index 7a554224..8cf5f187 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiAlloySmelter.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiAlloySmelter.java @@ -126,10 +126,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiAssembler.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiAssembler.java index 77b257da..9ed39c55 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiAssembler.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiAssembler.java @@ -120,10 +120,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiAutoMiner.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiAutoMiner.java index c4b1ad50..dd971a6a 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiAutoMiner.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiAutoMiner.java @@ -116,10 +116,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 2: if(tile.workTimer.isPaused()){ diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiBooster.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiBooster.java index bf512867..983ee543 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiBooster.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiBooster.java @@ -129,10 +129,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiCentrifuge.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiCentrifuge.java index 3bbba9f1..85d63eec 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiCentrifuge.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiCentrifuge.java @@ -124,10 +124,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiCrusher.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiCrusher.java index 695bc2d6..902d275e 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiCrusher.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiCrusher.java @@ -126,10 +126,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiCrystalChamber.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiCrystalChamber.java index 3cf09bce..85194f88 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiCrystalChamber.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiCrystalChamber.java @@ -126,10 +126,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiCrystalCutter.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiCrystalCutter.java index 92901ad8..c0eeaaa4 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiCrystalCutter.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiCrystalCutter.java @@ -139,10 +139,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 2: if(tile.recipeSelector > 0 && (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54))){ diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiDimAnchor.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiDimAnchor.java index d90d4405..0a0a5fc8 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiDimAnchor.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiDimAnchor.java @@ -114,10 +114,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiEnergyCell.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiEnergyCell.java index c8c947bf..f5bed5c2 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiEnergyCell.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiEnergyCell.java @@ -49,7 +49,7 @@ protected void buttonPressed(GuiButton guibutton) { return; } if (guibutton.id == 0) { - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer, inventorySlots, tile, this), inventorySlots, (IInventory) tile, tile.x, tile.y, tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer, inventorySlots, tile, this), inventorySlots, (IInventory) tile, tile.x, tile.y, tile.z); } if(tile.getTier() == Tier.INFINITE && guibutton.id == 1){ tile.isInfiniteSource = !tile.isInfiniteSource; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiEnergyConnector.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiEnergyConnector.java index 8b9268cb..6330dc21 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiEnergyConnector.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiEnergyConnector.java @@ -76,10 +76,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiEnergyInjector.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiEnergyInjector.java index cca1cae0..675990d1 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiEnergyInjector.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiEnergyInjector.java @@ -119,10 +119,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiExternalIO.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiExternalIO.java index 37381e40..ff3accda 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiExternalIO.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiExternalIO.java @@ -110,10 +110,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 2: Minecraft.getMinecraft(this).ingameGUI.addChatMessage("Link removed!"); diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiExtractor.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiExtractor.java index 20cae9cd..68538d57 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiExtractor.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiExtractor.java @@ -126,10 +126,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidHatch.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidHatch.java index 16447145..5cb3bbbc 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidHatch.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidHatch.java @@ -72,10 +72,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidIOConfig.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidIOConfig.java index 3368be69..2e1c4155 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidIOConfig.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiFluidIOConfig.java @@ -64,7 +64,7 @@ public void action2Performed(GuiButton guibutton) { public void keyTyped(char c, int i) { if (i == 1) { - SignalIndustries.displayGui(entityplayer, parentScreen, inventorySlots, (IInventory) tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> parentScreen, inventorySlots, (IInventory) tile,tile.x,tile.y,tile.z); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiInfuser.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiInfuser.java index 3c3b8be3..65a45f7d 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiInfuser.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiInfuser.java @@ -116,10 +116,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemBus.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemBus.java index f0612853..a94db532 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemBus.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemBus.java @@ -72,10 +72,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemIOConfig.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemIOConfig.java index 7d47e41a..2317fcbf 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemIOConfig.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiItemIOConfig.java @@ -64,7 +64,7 @@ public void action2Performed(GuiButton guibutton) { public void keyTyped(char c, int i) { if (i == 1) { - SignalIndustries.displayGui(entityplayer, parentScreen, inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> parentScreen, inventorySlots, tile,tile.x,tile.y,tile.z); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiPlateFormer.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiPlateFormer.java index 385b92fb..72d37193 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiPlateFormer.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiPlateFormer.java @@ -128,10 +128,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiProgrammer.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiProgrammer.java index 7742da09..5292f51d 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiProgrammer.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiProgrammer.java @@ -116,10 +116,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiPump.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiPump.java index a09a6265..6f9669c5 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiPump.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiPump.java @@ -125,7 +125,7 @@ protected void buttonPressed(GuiButton guibutton) { return; } if (guibutton.id == 0) { - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer, inventorySlots, tile, this), inventorySlots, tile, tile.x, tile.y, tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer, inventorySlots, tile, this), inventorySlots, tile, tile.x, tile.y, tile.z); /*case 1: SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break;*/ diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiReinforcedExtractor.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiReinforcedExtractor.java index 2b41a022..cafdba42 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiReinforcedExtractor.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiReinforcedExtractor.java @@ -80,10 +80,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiSIFluidTank.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiSIFluidTank.java index abbffedc..51815bac 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiSIFluidTank.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiSIFluidTank.java @@ -47,7 +47,7 @@ protected void buttonPressed(GuiButton guibutton) { return; } if (guibutton.id == 0) { - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer, inventorySlots, tile, this), inventorySlots, (IInventory) tile, tile.x, tile.y, tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer, inventorySlots, tile, this), inventorySlots, (IInventory) tile, tile.x, tile.y, tile.z); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiSignalumDynamo.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiSignalumDynamo.java index 5984a531..10c17aba 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiSignalumDynamo.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiSignalumDynamo.java @@ -110,10 +110,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/gui/GuiStabilizer.java b/src/main/java/sunsetsatellite/signalindustries/gui/GuiStabilizer.java index acbf8889..89b2ed2a 100644 --- a/src/main/java/sunsetsatellite/signalindustries/gui/GuiStabilizer.java +++ b/src/main/java/sunsetsatellite/signalindustries/gui/GuiStabilizer.java @@ -117,10 +117,10 @@ protected void buttonPressed(GuiButton guibutton) { } switch (guibutton.id){ case 0: - SignalIndustries.displayGui(entityplayer, new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiFluidIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; case 1: - SignalIndustries.displayGui(entityplayer, new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); + SignalIndustries.displayGui(entityplayer, () -> new GuiItemIOConfig(entityplayer,inventorySlots, tile, this), inventorySlots, tile,tile.x,tile.y,tile.z); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/interfaces/mixins/IEntityPlayerMP.java b/src/main/java/sunsetsatellite/signalindustries/interfaces/mixins/IEntityPlayerMP.java index 5f1c8828..07e5ae8a 100644 --- a/src/main/java/sunsetsatellite/signalindustries/interfaces/mixins/IEntityPlayerMP.java +++ b/src/main/java/sunsetsatellite/signalindustries/interfaces/mixins/IEntityPlayerMP.java @@ -7,10 +7,13 @@ import net.minecraft.core.player.inventory.IInventory; import sunsetsatellite.signalindustries.inventories.base.TileEntityWithName; +import java.util.function.Function; +import java.util.function.Supplier; + public interface IEntityPlayerMP { - void displayGuiScreen_si(GuiScreen guiScreen, Container container, IInventory inventory, int x, int y, int z); + void displayGuiScreen_si(Supplier screenSupplier, Container container, IInventory inventory, int x, int y, int z); - void displayGuiScreen_si(GuiScreen guiScreen, TileEntityWithName inventory, int x, int y, int z); + void displayGuiScreen_si(Supplier screenSupplier, TileEntityWithName inventory, int x, int y, int z); - void displayItemGuiScreen_si(GuiScreen guiScreen, Container container, IInventory inventory, ItemStack stack); + void displayItemGuiScreen_si(Supplier screenSupplier, Container container, IInventory inventory, ItemStack stack); } diff --git a/src/main/java/sunsetsatellite/signalindustries/items/ItemAbilityModule.java b/src/main/java/sunsetsatellite/signalindustries/items/ItemAbilityModule.java index 1781279e..a4d888e4 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/ItemAbilityModule.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/ItemAbilityModule.java @@ -31,7 +31,7 @@ public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World w InventoryAbilityModule inv = new InventoryAbilityModule(entityplayer.inventory.getCurrentItem()); ContainerItemFluid container = new ContainerAbilityModule(entityplayer.inventory,inv); GuiAbilityModule gui = new GuiAbilityModule(container,entityplayer.inventory); - SignalIndustries.displayGui(entityplayer,gui,container,inv,entityplayer.inventory.getCurrentItem()); + SignalIndustries.displayGui(entityplayer,() -> gui,container,inv,entityplayer.inventory.getCurrentItem()); return true; } diff --git a/src/main/java/sunsetsatellite/signalindustries/items/ItemPulsar.java b/src/main/java/sunsetsatellite/signalindustries/items/ItemPulsar.java index 0b2e93fb..d9824bd9 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/ItemPulsar.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/ItemPulsar.java @@ -45,7 +45,7 @@ public String getDescription(ItemStack stack) { @Override public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) { if(entityplayer.isSneaking() && !itemstack.getData().getBoolean("charging")){ - SignalIndustries.displayGui(entityplayer,new GuiPulsar(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new ContainerPulsar(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new InventoryPulsar(entityplayer.inventory.getCurrentItem()),itemstack); + SignalIndustries.displayGui(entityplayer,() -> new GuiPulsar(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new ContainerPulsar(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new InventoryPulsar(entityplayer.inventory.getCurrentItem()),itemstack); return true; } return false; diff --git a/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumPrototypeHarness.java b/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumPrototypeHarness.java index f51253b9..4a861c26 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumPrototypeHarness.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/ItemSignalumPrototypeHarness.java @@ -41,7 +41,7 @@ public ItemSignalumPrototypeHarness(String key, int id, ArmorMaterial material, @Override public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) { if(entityplayer.isSneaking()){ - SignalIndustries.displayGui(entityplayer,new GuiHarness(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new ContainerHarness(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new InventoryHarness(entityplayer.inventory.getCurrentItem()),itemstack); + SignalIndustries.displayGui(entityplayer,() -> new GuiHarness(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new ContainerHarness(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new InventoryHarness(entityplayer.inventory.getCurrentItem()),itemstack); return true; } return false; diff --git a/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemBackpackAttachment.java b/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemBackpackAttachment.java index d6a0117f..93e9ba8a 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemBackpackAttachment.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemBackpackAttachment.java @@ -25,18 +25,18 @@ public ItemBackpackAttachment(String name, int id, List attachm @Override public void activate(ItemStack stack, SignalumPowerSuit signalumPowerSuit, EntityPlayer entityplayer, World world) { - SignalIndustries.displayGui(entityplayer,new GuiBackpack(entityplayer.inventory,stack),new ContainerBackpack(entityplayer.inventory,stack),new InventoryBackpack(stack),stack); + SignalIndustries.displayGui(entityplayer,() -> new GuiBackpack(entityplayer.inventory,stack),new ContainerBackpack(entityplayer.inventory,stack),new InventoryBackpack(stack),stack); } @Override public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world, int blockX, int blockY, int blockZ, Side side, double xPlaced, double yPlaced) { - SignalIndustries.displayGui(entityplayer,new GuiBackpack(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new ContainerBackpack(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new InventoryBackpack(entityplayer.inventory.getCurrentItem()),itemstack); + SignalIndustries.displayGui(entityplayer,() -> new GuiBackpack(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new ContainerBackpack(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new InventoryBackpack(entityplayer.inventory.getCurrentItem()),itemstack); return true; } @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { - SignalIndustries.displayGui(entityplayer,new GuiBackpack(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new ContainerBackpack(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new InventoryBackpack(entityplayer.inventory.getCurrentItem()),itemstack); + SignalIndustries.displayGui(entityplayer,() -> new GuiBackpack(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new ContainerBackpack(entityplayer.inventory,entityplayer.inventory.getCurrentItem()),new InventoryBackpack(entityplayer.inventory.getCurrentItem()),itemstack); return super.onItemRightClick(itemstack, world, entityplayer); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemPulsarAttachment.java b/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemPulsarAttachment.java index cd30d8d4..12369984 100644 --- a/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemPulsarAttachment.java +++ b/src/main/java/sunsetsatellite/signalindustries/items/attachments/ItemPulsarAttachment.java @@ -72,7 +72,7 @@ public void activate(ItemStack stack, SignalumPowerSuit signalumPowerSuit, Entit @Override public void openSettings(ItemStack stack, SignalumPowerSuit signalumPowerSuit, EntityPlayer player, World world) { if(!stack.getData().getBoolean("charging")){ - SignalIndustries.displayGui(player,new GuiPulsarAttachment(player.inventory,stack),new ContainerPulsarAttachment(player.inventory,stack),new InventoryPulsar(stack),stack); + SignalIndustries.displayGui(player,() -> new GuiPulsarAttachment(player.inventory,stack),new ContainerPulsarAttachment(player.inventory,stack),new InventoryPulsar(stack),stack); } } diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/EntityPlayerMPMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/EntityPlayerMPMixin.java index 412a5068..bba8b1dd 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/EntityPlayerMPMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/EntityPlayerMPMixin.java @@ -17,6 +17,8 @@ import sunsetsatellite.signalindustries.inventories.base.TileEntityWithName; import sunsetsatellite.signalindustries.mp.packets.PacketOpenMachineGUI; +import java.util.function.Supplier; + @Debug( export = true ) @@ -37,7 +39,8 @@ public EntityPlayerMPMixin(World world) { @Shadow private int currentWindowId; - public void displayGuiScreen_si(GuiScreen guiScreen, Container container, IInventory inventory, int x, int y, int z) { + @Override + public void displayGuiScreen_si(Supplier screenSupplier, Container container, IInventory inventory, int x, int y, int z) { this.getNextWindowId(); //this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, Config.getFromConfig("GuiID",8), inventory.getInvName(), inventory.getSizeInventory())); this.playerNetServerHandler.sendPacket(new PacketOpenMachineGUI(this.currentWindowId,inventory.getInvName(),inventory.getSizeInventory(),x,y,z)); @@ -45,13 +48,13 @@ public void displayGuiScreen_si(GuiScreen guiScreen, Container container, IInven this.craftingInventory.windowId = this.currentWindowId; this.craftingInventory.onContainerInit(((EntityPlayerMP)((Object)this))); } - - public void displayGuiScreen_si(GuiScreen guiScreen, TileEntityWithName inventory, int x, int y, int z){ + @Override + public void displayGuiScreen_si(Supplier screenSupplier, TileEntityWithName inventory, int x, int y, int z){ this.getNextWindowId(); this.playerNetServerHandler.sendPacket(new PacketOpenMachineGUI(this.currentWindowId,inventory.getName(),0,x,y,z)); } - - public void displayItemGuiScreen_si(GuiScreen guiScreen, Container container, IInventory inventory, ItemStack stack){ + @Override + public void displayItemGuiScreen_si(Supplier screenSupplier, Container container, IInventory inventory, ItemStack stack){ this.getNextWindowId(); //this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, Config.getFromConfig("GuiID",8), inventory.getInvName(), inventory.getSizeInventory())); this.playerNetServerHandler.sendPacket(new PacketOpenMachineGUI(this.currentWindowId,inventory.getInvName(),inventory.getSizeInventory(),stack)); diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java index 7ca1c694..436d49eb 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/WorldMixin.java @@ -58,6 +58,7 @@ public abstract class WorldMixin implements IWorldDataAccessor { @Shadow @Final public WorldType worldType; + @Shadow public int difficultySetting; @Unique private final World thisAs = (World)((Object)this); @@ -90,7 +91,7 @@ public void doBloodMoon(CallbackInfo ci){ int dayTime = (int)(worldTime % (long)dayLength); int triggerTime = worldType.getSunriseTick(thisAs)+dayTicks; if((dayTime == triggerTime && (getCurrentWeather() != SignalIndustries.weatherBloodMoon || getCurrentWeather() != SignalIndustries.weatherEclipse))){ - if(rand.nextInt(16) == 15 && !(Minecraft.getMinecraft(Minecraft.class).gameSettings.difficulty.value == Difficulty.PEACEFUL) && getCurrentWeather() != SignalIndustries.weatherBloodMoon){ + if(rand.nextInt(16) == 15 && !(difficultySetting == 0) && getCurrentWeather() != SignalIndustries.weatherBloodMoon){ for (EntityPlayer player : players) { player.addChatMessage(TextFormatting.RED+"A Blood Moon is rising!"); player.triggerAchievement(SignalIndustriesAchievementPage.BLOOD_MOON); diff --git a/src/main/java/sunsetsatellite/signalindustries/powersuit/GuiPowerSuit.java b/src/main/java/sunsetsatellite/signalindustries/powersuit/GuiPowerSuit.java index 56a8fa51..1fe1daf0 100644 --- a/src/main/java/sunsetsatellite/signalindustries/powersuit/GuiPowerSuit.java +++ b/src/main/java/sunsetsatellite/signalindustries/powersuit/GuiPowerSuit.java @@ -115,28 +115,28 @@ protected void buttonPressed(GuiButton guibutton) { gui = new GuiPowerSuit(container,mc.thePlayer.inventory); gui.powerSuit = powerSuit; gui.name = "Signalum Power Suit | Helmet"; - SignalIndustries.displayGui(mc.thePlayer,gui,container,powerSuit.helmet,powerSuit.armor[3]); + SignalIndustries.displayGui(mc.thePlayer,() -> gui,container,powerSuit.helmet,powerSuit.armor[3]); break; case 1: container = new ContainerPowerSuit(mc.thePlayer.inventory,powerSuit.chestplate); gui = new GuiPowerSuit(container,mc.thePlayer.inventory); gui.powerSuit = powerSuit; gui.name = "Signalum Power Suit | Core"; - SignalIndustries.displayGui(mc.thePlayer,gui,container,powerSuit.chestplate,powerSuit.armor[2]); + SignalIndustries.displayGui(mc.thePlayer,() -> gui,container,powerSuit.chestplate,powerSuit.armor[2]); break; case 2: container = new ContainerPowerSuit(mc.thePlayer.inventory,powerSuit.leggings); gui = new GuiPowerSuit(container,mc.thePlayer.inventory); gui.powerSuit = powerSuit; gui.name = "Signalum Power Suit | Leggings"; - SignalIndustries.displayGui(mc.thePlayer,gui,container,powerSuit.leggings,powerSuit.armor[1]); + SignalIndustries.displayGui(mc.thePlayer,() -> gui,container,powerSuit.leggings,powerSuit.armor[1]); break; case 3: container = new ContainerPowerSuit(mc.thePlayer.inventory,powerSuit.boots); gui = new GuiPowerSuit(container,mc.thePlayer.inventory); gui.powerSuit = powerSuit; gui.name = "Signalum Power Suit | Boots"; - SignalIndustries.displayGui(mc.thePlayer,gui,container,powerSuit.boots,powerSuit.armor[0]); + SignalIndustries.displayGui(mc.thePlayer,() -> gui,container,powerSuit.boots,powerSuit.armor[0]); break; default: break; diff --git a/src/main/java/sunsetsatellite/signalindustries/powersuit/SignalumPowerSuit.java b/src/main/java/sunsetsatellite/signalindustries/powersuit/SignalumPowerSuit.java index fabcb77f..dd74a67f 100644 --- a/src/main/java/sunsetsatellite/signalindustries/powersuit/SignalumPowerSuit.java +++ b/src/main/java/sunsetsatellite/signalindustries/powersuit/SignalumPowerSuit.java @@ -99,7 +99,7 @@ public void openCoreUi() { GuiPowerSuit guiCore = new GuiPowerSuit(container,player.inventory); guiCore.powerSuit = this; guiCore.name = "Signalum Power Suit | Core"; - SignalIndustries.displayGui(player,guiCore,container,chestplate,armor[2]); + SignalIndustries.displayGui(player,() -> guiCore,container,chestplate,armor[2]); } public void activateAttachment(KeyBinding attachmentKeybind) { From dbea8de3f00c90cfa167b4294e22809ef8c40794 Mon Sep 17 00:00:00 2001 From: UselessBullets <80850784+UselessBullets@users.noreply.github.com> Date: Mon, 22 Apr 2024 12:42:55 -0500 Subject: [PATCH 5/5] Backpacks no longer crash but additionally also seem not to work --- .../signalindustries/SignalIndustries.java | 8 +++++++- .../signalindustries/mixin/EntityPlayerMPMixin.java | 2 -- .../mixin/NetClientHandlerMixin.java | 13 +++++++++---- .../mp/packets/PacketOpenMachineGUI.java | 1 + 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java b/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java index 148449c4..69bb471b 100644 --- a/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java +++ b/src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java @@ -30,6 +30,7 @@ import net.minecraft.core.item.material.ToolMaterial; import net.minecraft.core.item.tool.ItemToolPickaxe; import net.minecraft.core.lang.I18n; +import net.minecraft.core.net.packet.Packet; import net.minecraft.core.player.inventory.Container; import net.minecraft.core.player.inventory.IInventory; import net.minecraft.core.sound.BlockSounds; @@ -47,6 +48,7 @@ import org.slf4j.LoggerFactory; import sunsetsatellite.catalyst.core.util.BlockInstance; import sunsetsatellite.catalyst.core.util.NBTEditCommand; +import sunsetsatellite.catalyst.fluids.mp.packets.PacketSetFluidSlot; import sunsetsatellite.catalyst.fluids.util.FluidStack; import sunsetsatellite.catalyst.multiblocks.Multiblock; import sunsetsatellite.catalyst.multiblocks.RenderMultiblock; @@ -101,6 +103,7 @@ import java.io.File; import java.io.IOException; import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; import java.util.*; import java.util.function.BiFunction; import java.util.function.Supplier; @@ -1232,7 +1235,6 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint, Cl @Override public void onInitialize() { - NetworkHelper.register(PacketOpenMachineGUI.class, true, true); LOGGER.info("Signal Industries initialized."); } @@ -1326,6 +1328,10 @@ public void onInitialize() { textures.put(Tier.REINFORCED.name()+".ignitor.ready.overlay",new BlockTexture(MOD_ID).setSides("ignitor_5_overlay.png").setTopTexture("ignitor_8_overlay.png").setBottomTexture("ignitor_4_overlay.png")); textures.put(Tier.REINFORCED.name()+".ignitor.inverted.ready",new BlockTexture(MOD_ID).setSides("reinforced_ignitor_ready_inverted.png").setTopTexture("reinforced_ignitor_bottom_ready.png").setBottomTexture("reinforced_ignitor_top_ready.png")); textures.put(Tier.REINFORCED.name()+".ignitor.inverted.ready.overlay",new BlockTexture(MOD_ID).setSides("ignitor_6_overlay.png").setTopTexture("ignitor_4_overlay.png").setBottomTexture("ignitor_8_overlay.png")); + + NetworkHelper.register(PacketOpenMachineGUI.class, true, true); + // TODO For the love of god martin you need to register your packets 💀 + NetworkHelper.register(PacketSetFluidSlot.class, true, true); } public SignalIndustries(){ diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/EntityPlayerMPMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/EntityPlayerMPMixin.java index bba8b1dd..df97e3d6 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/EntityPlayerMPMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/EntityPlayerMPMixin.java @@ -42,7 +42,6 @@ public EntityPlayerMPMixin(World world) { @Override public void displayGuiScreen_si(Supplier screenSupplier, Container container, IInventory inventory, int x, int y, int z) { this.getNextWindowId(); - //this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, Config.getFromConfig("GuiID",8), inventory.getInvName(), inventory.getSizeInventory())); this.playerNetServerHandler.sendPacket(new PacketOpenMachineGUI(this.currentWindowId,inventory.getInvName(),inventory.getSizeInventory(),x,y,z)); this.craftingInventory = container; this.craftingInventory.windowId = this.currentWindowId; @@ -56,7 +55,6 @@ public void displayGuiScreen_si(Supplier screenSupplier, TileEntityWi @Override public void displayItemGuiScreen_si(Supplier screenSupplier, Container container, IInventory inventory, ItemStack stack){ this.getNextWindowId(); - //this.playerNetServerHandler.sendPacket(new Packet100OpenWindow(this.currentWindowId, Config.getFromConfig("GuiID",8), inventory.getInvName(), inventory.getSizeInventory())); this.playerNetServerHandler.sendPacket(new PacketOpenMachineGUI(this.currentWindowId,inventory.getInvName(),inventory.getSizeInventory(),stack)); this.craftingInventory = container; this.craftingInventory.windowId = this.currentWindowId; diff --git a/src/main/java/sunsetsatellite/signalindustries/mixin/NetClientHandlerMixin.java b/src/main/java/sunsetsatellite/signalindustries/mixin/NetClientHandlerMixin.java index db143673..2a283277 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mixin/NetClientHandlerMixin.java +++ b/src/main/java/sunsetsatellite/signalindustries/mixin/NetClientHandlerMixin.java @@ -19,8 +19,10 @@ import org.spongepowered.asm.mixin.injection.callback.LocalCapture; import sunsetsatellite.signalindustries.SignalIndustries; import sunsetsatellite.signalindustries.entities.EntityCrystal; +import sunsetsatellite.signalindustries.gui.GuiBackpack; import sunsetsatellite.signalindustries.gui.GuiPulsar; import sunsetsatellite.signalindustries.interfaces.mixins.INetClientHandler; +import sunsetsatellite.signalindustries.inventories.item.InventoryBackpack; import sunsetsatellite.signalindustries.inventories.item.InventoryPulsar; import sunsetsatellite.signalindustries.mp.packets.PacketOpenMachineGUI; @@ -150,14 +152,18 @@ public void handleOpenMachineGUI(PacketOpenMachineGUI p) { throw new RuntimeException(e); } } else { - if(p.stack != null && Objects.equals(p.windowTitle, "The Pulsar")){ - InventoryPulsar inv = new InventoryPulsar(p.stack); - this.mc.displayGuiScreen(new GuiPulsar(this.mc.thePlayer.inventory,p.stack)); + if(p.stack != null){ + if (p.windowTitle.equals("The Pulsar")){ + InventoryPulsar inv = new InventoryPulsar(p.stack); + this.mc.displayGuiScreen(new GuiPulsar(this.mc.thePlayer.inventory,p.stack)); /*try { this.mc.displayGuiScreen((GuiScreen) SignalIndustries.nameToGuiMap.get(p.windowTitle).get(0).getDeclaredConstructors()[0].newInstance(this.mc.thePlayer.inventory,inv)); } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { throw new RuntimeException(e); }*/ + } else if (p.windowTitle.equals("Backpack")) { + this.mc.displayGuiScreen(new GuiBackpack(mc.thePlayer.inventory, p.stack)); + } } else { try { tile = (TileEntity) SignalIndustries.nameToGuiMap.get(p.windowTitle).get(1).getDeclaredConstructor().newInstance(); @@ -171,7 +177,6 @@ public void handleOpenMachineGUI(PacketOpenMachineGUI p) { throw new RuntimeException(e); } } - } this.mc.thePlayer.craftingInventory.windowId = p.windowId; } diff --git a/src/main/java/sunsetsatellite/signalindustries/mp/packets/PacketOpenMachineGUI.java b/src/main/java/sunsetsatellite/signalindustries/mp/packets/PacketOpenMachineGUI.java index 3a8d49e0..1dc9e075 100644 --- a/src/main/java/sunsetsatellite/signalindustries/mp/packets/PacketOpenMachineGUI.java +++ b/src/main/java/sunsetsatellite/signalindustries/mp/packets/PacketOpenMachineGUI.java @@ -20,6 +20,7 @@ public class PacketOpenMachineGUI extends Packet { public int blockY; public int blockZ; public ItemStack stack; + public PacketOpenMachineGUI(){} public PacketOpenMachineGUI(int windowId, String windowTitle, int slotsCount, int x, int y, int z) { this.windowId = windowId;