mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-12-26 07:18:52 +00:00
fix: 修复新版本命令注册失败的问题
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
be1ad18954
commit
f7b67e724d
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user