From 6f940db47052df6182d4f869aaa34f3193e44b6f Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Wed, 10 Apr 2024 20:46:05 +0200 Subject: [PATCH] Add back the RF literal to restore addon compatibility --- src/generated/resources/assets/ae2/lang/en_us.json | 1 + src/main/java/appeng/api/config/PowerUnits.java | 4 +++- src/main/java/appeng/api/config/Settings.java | 4 ++-- src/main/java/appeng/core/AEConfig.java | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/generated/resources/assets/ae2/lang/en_us.json b/src/generated/resources/assets/ae2/lang/en_us.json index 5f88c631296..13ad4c3fce2 100644 --- a/src/generated/resources/assets/ae2/lang/en_us.json +++ b/src/generated/resources/assets/ae2/lang/en_us.json @@ -521,6 +521,7 @@ "gui.ae2.inWorldSingularity": "To create drop 1 Singularity and 1 Ender Dust and cause an explosion within range of the items.", "gui.ae2.units.appliedenergistics": "AE", "gui.ae2.units.fe": "FE", + "gui.ae2.units.rf": "RF", "gui.tooltips.ae2.ActiveOnPulse": "Activate once per pulse", "gui.tooltips.ae2.ActiveWithSignal": "Active with signal", "gui.tooltips.ae2.ActiveWithoutSignal": "Active without signal", diff --git a/src/main/java/appeng/api/config/PowerUnits.java b/src/main/java/appeng/api/config/PowerUnits.java index 77f66bcd126..8514d8dd044 100644 --- a/src/main/java/appeng/api/config/PowerUnits.java +++ b/src/main/java/appeng/api/config/PowerUnits.java @@ -27,7 +27,9 @@ public enum PowerUnits { AE("gui.ae2.units.appliedenergistics", "AE"), // Native Units - AE Energy - FE("gui.ae2.units.fe", "FE"); // Forge Energy + FE("gui.ae2.units.fe", "FE"), // Forge Energy + @Deprecated(forRemoval = true) + RF("gui.ae2.units.rf", "RF"); // Forge Energy /** * unlocalized name for the power unit. diff --git a/src/main/java/appeng/api/config/Settings.java b/src/main/java/appeng/api/config/Settings.java index 57b45a67d47..2e9d6c4fec6 100644 --- a/src/main/java/appeng/api/config/Settings.java +++ b/src/main/java/appeng/api/config/Settings.java @@ -37,7 +37,7 @@ private Settings() { private synchronized static > Setting register(String name, Class enumClass) { Preconditions.checkState(!SETTINGS.containsKey(name)); - var setting = new Setting(name, enumClass); + var setting = new Setting<>(name, enumClass); SETTINGS.put(name, setting); return setting; } @@ -56,7 +56,7 @@ private synchronized static > Setting register(String name, RedstoneMode.LOW_SIGNAL); public static final Setting REDSTONE_CONTROLLED = register("redstone_controlled", RedstoneMode.class); public static final Setting CONDENSER_OUTPUT = register("condenser_output", CondenserOutput.class); - public static final Setting POWER_UNITS = register("power_units", PowerUnits.class); + public static final Setting POWER_UNITS = register("power_units", PowerUnits.AE, PowerUnits.FE); public static final Setting ACCESS = register("access", AccessRestriction.READ_WRITE, AccessRestriction.READ, AccessRestriction.WRITE); public static final Setting SORT_DIRECTION = register("sort_direction", SortDir.class); diff --git a/src/main/java/appeng/core/AEConfig.java b/src/main/java/appeng/core/AEConfig.java index a5f143029ac..27e2a342e4a 100644 --- a/src/main/java/appeng/core/AEConfig.java +++ b/src/main/java/appeng/core/AEConfig.java @@ -171,6 +171,7 @@ private void syncClientConfig() { private void syncCommonConfig() { PowerUnits.FE.conversionRatio = COMMON.powerRatioForgeEnergy.get(); + PowerUnits.RF.conversionRatio = COMMON.powerRatioForgeEnergy.get(); PowerMultiplier.CONFIG.multiplier = COMMON.powerUsageMultiplier.get(); CondenserOutput.MATTER_BALLS.requiredPower = COMMON.condenserMatterBallsPower.get();