From 63df442eb38592471eac47204f38560721e2f93e Mon Sep 17 00:00:00 2001 From: brandyn Date: Tue, 21 May 2024 19:53:56 +0100 Subject: [PATCH] Add config option for the colored heart renderer (#118) * HeartRenderCFG * Minor nits, bump deps * don't register heart renderer at all if config is off * avoid double negation in the setting name --------- Co-authored-by: ah-OOG-ah <75745146+ah-OOG-ah@users.noreply.github.com> Co-authored-by: Alexdoru <57050655+Alexdoru@users.noreply.github.com> --- dependencies.gradle | 2 +- src/main/java/tconstruct/armor/ArmorProxyClient.java | 9 ++++++--- src/main/java/tconstruct/util/config/PHConstruct.java | 4 ++++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index c6680e572f6..a8fc4be7435 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -7,7 +7,7 @@ dependencies { implementation("com.github.GTNewHorizons:NotEnoughItems:2.6.0-GTNH:dev") compileOnlyApi("curse.maven:cofh-core-69162:2388751") compileOnly("com.github.GTNewHorizons:inventory-tweaks:1.6.2:api") - compileOnly("com.github.GTNewHorizons:waila:1.7.3:api") + compileOnly("com.github.GTNewHorizons:waila:1.8.0:api") compileOnly("com.github.GTNewHorizons:Battlegear2:1.4.0:api") { } compileOnly("curse.maven:minefactory-reloaded-66672:2366150") diff --git a/src/main/java/tconstruct/armor/ArmorProxyClient.java b/src/main/java/tconstruct/armor/ArmorProxyClient.java index e3b68589cf5..15d14395899 100644 --- a/src/main/java/tconstruct/armor/ArmorProxyClient.java +++ b/src/main/java/tconstruct/armor/ArmorProxyClient.java @@ -39,6 +39,7 @@ import tconstruct.library.client.TConstructClientRegistry; import tconstruct.library.crafting.ModifyBuilder; import tconstruct.tools.TinkerTools; +import tconstruct.util.config.PHConstruct; import tconstruct.world.TinkerWorld; public class ArmorProxyClient extends ArmorProxyCommon { @@ -69,9 +70,11 @@ public void initialize() { registerManualIcons(); registerManualRecipes(); MinecraftForge.EVENT_BUS.register(this); - final HealthBarRenderer healthBarRenderer = new HealthBarRenderer(); - MinecraftForge.EVENT_BUS.register(healthBarRenderer); - FMLCommonHandler.instance().bus().register(healthBarRenderer); + if (PHConstruct.coloredHeartRender) { + final HealthBarRenderer healthBarRenderer = new HealthBarRenderer(); + MinecraftForge.EVENT_BUS.register(healthBarRenderer); + FMLCommonHandler.instance().bus().register(healthBarRenderer); + } } private void registerManualIcons() { diff --git a/src/main/java/tconstruct/util/config/PHConstruct.java b/src/main/java/tconstruct/util/config/PHConstruct.java index f7123b50ea2..6e678063e08 100644 --- a/src/main/java/tconstruct/util/config/PHConstruct.java +++ b/src/main/java/tconstruct/util/config/PHConstruct.java @@ -274,6 +274,9 @@ public static void initProps(File location) { .getBoolean(false); // Experimental functionality + coloredHeartRender = config + .get("Experimental", "Renders one row of colored hearts instead of multiple rows of hearts", true) + .getBoolean(true); throwableSmeltery = config.get("Experimental", "Items can be thrown into smelteries", true).getBoolean(true); meltableHorses = config.get("Experimental", "Allow horses to be melted down for glue", true).getBoolean(true); meltableVillagers = config.get("Experimental", "Allow villagers to be melted down for emeralds", true) @@ -481,6 +484,7 @@ public static void initProps(File location) { public static boolean genOresFlat; // Experimental functionality + public static boolean coloredHeartRender; public static boolean throwableSmeltery; public static boolean meltableHorses; public static boolean meltableVillagers;