mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2025-09-02 11:36:59 +00:00
@ -15,6 +15,7 @@ import org.bukkit.plugin.java.JavaPlugin;
|
|||||||
|
|
||||||
import pw.yumc.YumCore.bukkit.Log;
|
import pw.yumc.YumCore.bukkit.Log;
|
||||||
import pw.yumc.YumCore.bukkit.P;
|
import pw.yumc.YumCore.bukkit.P;
|
||||||
|
import pw.yumc.YumCore.reflect.Reflect;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 命令工具类
|
* 命令工具类
|
||||||
@ -38,9 +39,7 @@ public class CommandKit {
|
|||||||
commandMapField.setAccessible(true);
|
commandMapField.setAccessible(true);
|
||||||
SimpleCommandMap commandMap = (SimpleCommandMap) commandMapField.get(pluginManager);
|
SimpleCommandMap commandMap = (SimpleCommandMap) commandMapField.get(pluginManager);
|
||||||
|
|
||||||
Field knownCommandsField = commandMap.getClass().getDeclaredField("knownCommands");
|
knownCommands = Reflect.on(commandMap).field("knownCommands").get();
|
||||||
knownCommandsField.setAccessible(true);
|
|
||||||
knownCommands = (Map<String, Command>) knownCommandsField.get(commandMap);
|
|
||||||
|
|
||||||
PluginCommandConstructor = PluginCommand.class.getDeclaredConstructor(String.class, Plugin.class);
|
PluginCommandConstructor = PluginCommand.class.getDeclaredConstructor(String.class, Plugin.class);
|
||||||
PluginCommandConstructor.setAccessible(true);
|
PluginCommandConstructor.setAccessible(true);
|
||||||
|
Reference in New Issue
Block a user