Skip to content

Commit

Permalink
Add config option for the colored heart renderer (#118)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Alexdoru <[email protected]>
  • Loading branch information
3 people authored May 21, 2024
1 parent c5d7770 commit 63df442
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/tconstruct/armor/ArmorProxyClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/tconstruct/util/config/PHConstruct.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 63df442

Please sign in to comment.