Skip to content

Commit

Permalink
that's a very big woopsie
Browse files Browse the repository at this point in the history
  • Loading branch information
Revxrsal committed Jan 28, 2025
1 parent 158d564 commit 54acb04
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ public final class PluginCommands {
Constructor<PluginCommand> ctr;
Field knownCommands = null;
CommandMap commandMap;
MethodHandle getPluginMeta;
MethodHandle getPluginMeta = null;
try {
getPluginMeta = MethodHandles.lookup().unreflect(
JavaPlugin.class.getDeclaredMethod("getPluginMeta")
);
} catch (Exception ignored) {
}
try {
ctr = PluginCommand.class.getDeclaredConstructor(String.class, Plugin.class);
ctr.setAccessible(true);
Expand All @@ -72,9 +78,6 @@ public final class PluginCommands {
knownCommands = SimpleCommandMap.class.getDeclaredField("knownCommands");
knownCommands.setAccessible(true);
}
getPluginMeta = MethodHandles.lookup().unreflect(
JavaPlugin.class.getDeclaredMethod("getPluginMeta")
);
} catch (NoSuchMethodException e) {
e.printStackTrace();
throw new IllegalStateException("Unable to access PluginCommand(String, Plugin) construtor!");
Expand Down

0 comments on commit 54acb04

Please sign in to comment.