Config option: disable energy overlay

This commit is contained in:
Caffeine 2024-11-06 12:11:46 +01:00
parent c1e274db4f
commit 12527cd168
2 changed files with 7 additions and 1 deletions

View file

@ -89,6 +89,7 @@ public class CommonConfig {
} }
public static class Other { public static class Other {
public static ModConfigSpec.BooleanValue HIDE_ENERGY_OVERLAY;
public static ModConfigSpec.BooleanValue SOLID_XP_ALWAYS_ORBS; public static ModConfigSpec.BooleanValue SOLID_XP_ALWAYS_ORBS;
public static ModConfigSpec.BooleanValue DO_UPDATE_CHECK; public static ModConfigSpec.BooleanValue DO_UPDATE_CHECK;
public static ModConfigSpec.BooleanValue UPDATE_CHECK_VERSION_SPECIFIC; public static ModConfigSpec.BooleanValue UPDATE_CHECK_VERSION_SPECIFIC;
@ -116,6 +117,9 @@ public class CommonConfig {
BUILDER.comment("Everything else").push("other"); 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.") SOLID_XP_ALWAYS_ORBS = BUILDER.comment("If true, Solidified Experience will always spawn orbs, even for regular players.")
.define("solidXPOrbs", false); .define("solidXPOrbs", false);

View file

@ -60,6 +60,8 @@ public class ClientEvents {
private static EnergyDisplay energyDisplay; private static EnergyDisplay energyDisplay;
boolean shouldHideEnergyOverlay = CommonConfig.Other.HIDE_ENERGY_OVERLAY.get();
// TODO: [port] the fuck? // TODO: [port] the fuck?
@SubscribeEvent @SubscribeEvent
public void onClientTick(ClientTickEvent.Post event) { 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 (!display.needsHoldShift() || player.isShiftKeyDown()) {
if (energyDisplay == null) { if (energyDisplay == null) {
energyDisplay = new EnergyDisplay(0, 0, null); energyDisplay = new EnergyDisplay(0, 0, null);