From 0099a7df8f9738ad2fd487f5fee9aafa23f90363 Mon Sep 17 00:00:00 2001 From: Pilad Date: Fri, 10 May 2024 14:53:11 +0500 Subject: [PATCH 1/2] Fixed the controller texture for the turbines.PlayerCache is not called anywhere? (#878) * Fixed the controller texture for the turbines. * The file is not called anywhere? This file doesn't seem to be used anywhere. Maybe it's worth removing? --- .../gtPlusPlus/core/common/CommonProxy.java | 3 - .../core/util/player/PlayerCache.java | 66 ------------------- .../turbines/GT_MTE_LargeTurbine_Gas.java | 5 +- .../turbines/GT_MTE_LargeTurbine_Plasma.java | 5 +- .../turbines/GT_MTE_LargeTurbine_SCSteam.java | 5 +- .../turbines/GT_MTE_LargeTurbine_SHSteam.java | 5 +- .../turbines/GT_MTE_LargeTurbine_Steam.java | 5 +- 7 files changed, 15 insertions(+), 79 deletions(-) delete mode 100644 src/main/java/gtPlusPlus/core/util/player/PlayerCache.java diff --git a/src/main/java/gtPlusPlus/core/common/CommonProxy.java b/src/main/java/gtPlusPlus/core/common/CommonProxy.java index ab7090351b..70062a5f00 100644 --- a/src/main/java/gtPlusPlus/core/common/CommonProxy.java +++ b/src/main/java/gtPlusPlus/core/common/CommonProxy.java @@ -36,7 +36,6 @@ import gtPlusPlus.core.util.Utils; import gtPlusPlus.core.util.minecraft.EntityUtils; import gtPlusPlus.core.util.minecraft.ItemUtils; -import gtPlusPlus.core.util.player.PlayerCache; import gtPlusPlus.core.util.reflect.ReflectionUtils; import gtPlusPlus.preloader.CORE_Preloader; import gtPlusPlus.xmod.gregtech.api.util.SpecialBehaviourTooltipHandler; @@ -101,8 +100,6 @@ public void init(final FMLInitializationEvent e) { } public void postInit(final FMLPostInitializationEvent e) { - Logger.INFO("Cleaning up, doing postInit."); - PlayerCache.initCache(); // Make Burnables burnable if (!CORE.burnables.isEmpty()) { diff --git a/src/main/java/gtPlusPlus/core/util/player/PlayerCache.java b/src/main/java/gtPlusPlus/core/util/player/PlayerCache.java deleted file mode 100644 index a403756c77..0000000000 --- a/src/main/java/gtPlusPlus/core/util/player/PlayerCache.java +++ /dev/null @@ -1,66 +0,0 @@ -package gtPlusPlus.core.util.player; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.OutputStream; -import java.util.HashMap; -import java.util.Properties; -import java.util.UUID; - -import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.core.lib.CORE; - -public class PlayerCache { - - private static final File cache = new File("PlayerCache.dat"); - - public static void initCache() { - if (CORE.PlayerCache == null) { - if (cache.exists()) { - CORE.PlayerCache = PlayerCache.readPropertiesFileAsMap(); - Logger.INFO("Loaded PlayerCache.dat"); - } - if (CORE.PlayerCache == null) { - Logger.INFO("Failed to load PlayerCache.dat"); - PlayerCache.createPropertiesFile("PLAYER_", "DATA"); - } - } - } - - public static void createPropertiesFile(final String playerName, final String playerUUIDasString) { - try { - final Properties props = new Properties(); - props.setProperty(playerName + " ", playerUUIDasString); - final OutputStream out = new FileOutputStream(cache); - props.store(out, "Player Cache."); - Logger.INFO("PlayerCache.dat created for future use."); - out.close(); - } catch (final Exception e) { - e.printStackTrace(); - } - } - - public static HashMap readPropertiesFileAsMap() { - HashMap map = null; - try { - final FileInputStream fis = new FileInputStream(cache); - final ObjectInputStream ois = new ObjectInputStream(fis); - map = (HashMap) ois.readObject(); - ois.close(); - fis.close(); - } catch (final IOException ioe) { - ioe.printStackTrace(); - return null; - } catch (final ClassNotFoundException c) { - Logger.INFO("Class not found"); - c.printStackTrace(); - return null; - } - Logger.WARNING("Deserialized PlayerCache.."); - return map; - } - -} diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java index f2fd9a9a0a..c1491c7bf6 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Gas.java @@ -25,6 +25,7 @@ import gregtech.api.recipe.maps.FuelBackend; import gregtech.api.util.GT_Recipe; import gregtech.api.util.GT_Utility; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @SuppressWarnings("deprecation") public class GT_MTE_LargeTurbine_Gas extends GregtechMetaTileEntity_LargerTurbineBase { @@ -194,11 +195,11 @@ protected String getCasingName() { @Override protected ITexture getTextureFrontFace() { - return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS5); + return new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Controller_Advanced); } @Override protected ITexture getTextureFrontFaceActive() { - return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_SS_ACTIVE5); + return new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java index fb875dba3a..f6293920b5 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Plasma.java @@ -26,6 +26,7 @@ import gregtech.api.util.shutdown.ShutDownReasonRegistry; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.xmod.gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Turbine; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @SuppressWarnings("deprecation") public class GT_MTE_LargeTurbine_Plasma extends GregtechMetaTileEntity_LargerTurbineBase { @@ -301,11 +302,11 @@ protected String getCasingName() { @Override protected ITexture getTextureFrontFace() { - return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU5); + return new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Controller_Advanced); } @Override protected ITexture getTextureFrontFaceActive() { - return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TU_ACTIVE5); + return new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SCSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SCSteam.java index 627717695b..7ee40757fd 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SCSteam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SCSteam.java @@ -13,6 +13,7 @@ import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gtPlusPlus.core.util.math.MathUtils; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; public class GT_MTE_LargeTurbine_SCSteam extends GregtechMetaTileEntity_LargerTurbineBase { @@ -115,11 +116,11 @@ protected String getCasingName() { @Override protected ITexture getTextureFrontFace() { - return TextureFactory.of(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI5); + return TextureFactory.of(TexturesGtBlock.Overlay_Machine_Controller_Advanced); } @Override protected ITexture getTextureFrontFaceActive() { - return TextureFactory.of(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5); + return TextureFactory.of(TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java index 7d36d35c77..dded1d04d9 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_SHSteam.java @@ -18,6 +18,7 @@ import gtPlusPlus.core.lib.CORE; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @SuppressWarnings("deprecation") public class GT_MTE_LargeTurbine_SHSteam extends GregtechMetaTileEntity_LargerTurbineBase { @@ -188,11 +189,11 @@ protected String getCasingName() { @Override protected ITexture getTextureFrontFace() { - return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI5); + return new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Controller_Advanced); } @Override protected ITexture getTextureFrontFaceActive() { - return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_TI_ACTIVE5); + return new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active); } } diff --git a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java index 3173ef8f37..cb8bc06124 100644 --- a/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java +++ b/src/main/java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/production/turbines/GT_MTE_LargeTurbine_Steam.java @@ -19,6 +19,7 @@ import gregtech.api.util.GT_Utility; import gtPlusPlus.core.util.math.MathUtils; import gtPlusPlus.core.util.minecraft.PlayerUtils; +import gtPlusPlus.xmod.gregtech.common.blocks.textures.TexturesGtBlock; @SuppressWarnings("deprecation") public class GT_MTE_LargeTurbine_Steam extends GregtechMetaTileEntity_LargerTurbineBase { @@ -199,11 +200,11 @@ protected String getCasingName() { @Override protected ITexture getTextureFrontFace() { - return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST5); + return new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Controller_Advanced); } @Override protected ITexture getTextureFrontFaceActive() { - return new GT_RenderedTexture(gregtech.api.enums.Textures.BlockIcons.LARGETURBINE_ST_ACTIVE5); + return new GT_RenderedTexture(TexturesGtBlock.Overlay_Machine_Controller_Advanced_Active); } } From 3d3dc4928236f8c5ba137d34e22aca255216d4c8 Mon Sep 17 00:00:00 2001 From: Martin Robertz Date: Fri, 10 May 2024 11:54:15 +0200 Subject: [PATCH 2/2] update --- addon.gradle | 2 +- dependencies.gradle | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addon.gradle b/addon.gradle index cc0f5d57e5..e6ce5c7157 100644 --- a/addon.gradle +++ b/addon.gradle @@ -1,3 +1,3 @@ -compileJava { + compileJava { options.encoding = "UTF-8" } diff --git a/dependencies.gradle b/dependencies.gradle index 394e54303b..5ecbb5050f 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -1,5 +1,5 @@ dependencies { - api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.02:dev') + api('com.github.GTNewHorizons:GT5-Unofficial:5.09.46.05:dev') api("com.github.GTNewHorizons:bartworks:0.10.0:dev") implementation('curse.maven:cofh-core-69162:2388751') @@ -14,5 +14,5 @@ dependencies { compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive=false} compileOnly('com.github.GTNewHorizons:Chisel:2.14.1-GTNH:dev') {transitive=false} - runtimeOnly('com.github.GTNewHorizons:ForestryMC:4.8.9:dev') {transitive=false} + runtimeOnly('com.github.GTNewHorizons:ForestryMC:4.9.0:dev') {transitive=false} }