From 12527cd168be9cd3fcdfbfed399a3ba81e80915f Mon Sep 17 00:00:00 2001 From: Caffeine Date: Wed, 6 Nov 2024 12:11:46 +0100 Subject: [PATCH 1/2] Config option: disable energy overlay --- .../de/ellpeck/actuallyadditions/mod/config/CommonConfig.java | 4 ++++ .../de/ellpeck/actuallyadditions/mod/event/ClientEvents.java | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java b/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java index 26c132405..c23149b6f 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/config/CommonConfig.java @@ -89,6 +89,7 @@ public class CommonConfig { } public static class Other { + public static ModConfigSpec.BooleanValue HIDE_ENERGY_OVERLAY; public static ModConfigSpec.BooleanValue SOLID_XP_ALWAYS_ORBS; public static ModConfigSpec.BooleanValue DO_UPDATE_CHECK; public static ModConfigSpec.BooleanValue UPDATE_CHECK_VERSION_SPECIFIC; @@ -116,6 +117,9 @@ public class CommonConfig { BUILDER.comment("Everything else").push("other"); + HIDE_ENERGY_OVERLAY = BUILDER.comment("If true, when looking at blocks the Energy Overlay will be hidden.") + .define("hideEnergyOverlay", false); + SOLID_XP_ALWAYS_ORBS = BUILDER.comment("If true, Solidified Experience will always spawn orbs, even for regular players.") .define("solidXPOrbs", false); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java index 50874e63b..b3b60350d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java @@ -60,6 +60,8 @@ public class ClientEvents { private static EnergyDisplay energyDisplay; + boolean shouldHideEnergyOverlay = CommonConfig.Other.HIDE_ENERGY_OVERLAY.get(); + // TODO: [port] the fuck? @SubscribeEvent public void onClientTick(ClientTickEvent.Post event) { @@ -264,7 +266,7 @@ public class ClientEvents { } } - if (tileHit instanceof IEnergyDisplay display) { + if (tileHit instanceof IEnergyDisplay display && !shouldHideEnergyOverlay) { if (!display.needsHoldShift() || player.isShiftKeyDown()) { if (energyDisplay == null) { energyDisplay = new EnergyDisplay(0, 0, null); From e21713e39ae798fd54b91e5773daee270eb0d5a1 Mon Sep 17 00:00:00 2001 From: Caffeine <61048648+Caffeinew@users.noreply.github.com> Date: Wed, 6 Nov 2024 12:41:38 +0100 Subject: [PATCH 2/2] Update ClientEvents.java --- .../de/ellpeck/actuallyadditions/mod/event/ClientEvents.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java index b3b60350d..5bc45b7bc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/event/ClientEvents.java @@ -60,8 +60,6 @@ public class ClientEvents { private static EnergyDisplay energyDisplay; - boolean shouldHideEnergyOverlay = CommonConfig.Other.HIDE_ENERGY_OVERLAY.get(); - // TODO: [port] the fuck? @SubscribeEvent public void onClientTick(ClientTickEvent.Post event) { @@ -266,7 +264,7 @@ public class ClientEvents { } } - if (tileHit instanceof IEnergyDisplay display && !shouldHideEnergyOverlay) { + if (tileHit instanceof IEnergyDisplay display && !CommonConfig.Other.HIDE_ENERGY_OVERLAY.get()) { if (!display.needsHoldShift() || player.isShiftKeyDown()) { if (energyDisplay == null) { energyDisplay = new EnergyDisplay(0, 0, null);