File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
bukkit/src/main/java/revxrsal/commands/bukkit/util Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,13 @@ public final class PluginCommands {
61
61
Constructor <PluginCommand > ctr ;
62
62
Field knownCommands = null ;
63
63
CommandMap commandMap ;
64
- MethodHandle getPluginMeta ;
64
+ MethodHandle getPluginMeta = null ;
65
+ try {
66
+ getPluginMeta = MethodHandles .lookup ().unreflect (
67
+ JavaPlugin .class .getDeclaredMethod ("getPluginMeta" )
68
+ );
69
+ } catch (Exception ignored ) {
70
+ }
65
71
try {
66
72
ctr = PluginCommand .class .getDeclaredConstructor (String .class , Plugin .class );
67
73
ctr .setAccessible (true );
@@ -72,9 +78,6 @@ public final class PluginCommands {
72
78
knownCommands = SimpleCommandMap .class .getDeclaredField ("knownCommands" );
73
79
knownCommands .setAccessible (true );
74
80
}
75
- getPluginMeta = MethodHandles .lookup ().unreflect (
76
- JavaPlugin .class .getDeclaredMethod ("getPluginMeta" )
77
- );
78
81
} catch (NoSuchMethodException e ) {
79
82
e .printStackTrace ();
80
83
throw new IllegalStateException ("Unable to access PluginCommand(String, Plugin) construtor!" );
You can’t perform that action at this time.
0 commit comments