diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-09-12 23:05:35 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-09-12 23:05:35 +0800 |
| commit | d938b32705594c995ad9f82b0f0b64897b6c423f (patch) | |
| tree | e2cd09be1630093d69d6ce7d1942d861efa848f9 /default-plugin/src | |
| parent | 47896cdd0e1d440ca85aef3cc8f24b229a18c949 (diff) | |
| download | RoughlyEnoughItems-feature/obfuscate.tar.gz RoughlyEnoughItems-feature/obfuscate.tar.bz2 RoughlyEnoughItems-feature/obfuscate.zip | |
Obfuscate REI Internalsfeature/obfuscate
Diffstat (limited to 'default-plugin/src')
2 files changed, 4 insertions, 2 deletions
diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/CommandSender.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/CommandSender.java index e0ae0ba1e..5d33a4ec3 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/CommandSender.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/CommandSender.java @@ -30,7 +30,8 @@ import java.lang.reflect.InvocationTargetException; class CommandSender { static void sendCommand(String command) { try { - Class.forName("me.shedaniel.rei.impl.client.%s.CommandSenderImpl".formatted(Platform.isForge() ? "forge" : "fabric")) + String s = "me.shedaniel.rei.impl.client.%s.CommandSenderImpl"; + Class.forName(s.contains("%s") ? s.formatted(Platform.isForge() ? "forge" : "fabric") : s) .getDeclaredMethod("sendCommand", String.class).invoke(null, command); } catch (IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) { throw new RuntimeException(e); diff --git a/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/DefaultCraftingDisplay.java b/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/DefaultCraftingDisplay.java index 84f4b50e1..8e897ef48 100644 --- a/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/DefaultCraftingDisplay.java +++ b/default-plugin/src/main/java/me/shedaniel/rei/plugin/common/displays/crafting/DefaultCraftingDisplay.java @@ -68,7 +68,8 @@ public abstract class DefaultCraftingDisplay<C extends Recipe<?>> extends BasicD static { try { - Class.forName("me.shedaniel.rei.plugin.common.displays.crafting.%s.DefaultCraftingDisplayImpl".formatted(Platform.isForge() ? "forge" : "fabric")) + String s = "me.shedaniel.rei.plugin.common.displays.crafting.%s.DefaultCraftingDisplayImpl"; + Class.forName(s.contains("%s") ? s.formatted(Platform.isForge() ? "forge" : "fabric") : s) .getDeclaredMethod("registerPlatformSizeProvider") .invoke(null); } catch (IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) { |
