diff options
Diffstat (limited to 'default-plugin/src/main/java/me/shedaniel/rei/plugin/client')
| -rw-r--r-- | default-plugin/src/main/java/me/shedaniel/rei/plugin/client/favorites/CommandSender.java | 3 |
1 files changed, 2 insertions, 1 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); |
