This commit is contained in:
loki5512344 2026-03-11 11:05:47 +01:00
parent 49744acc59
commit 0fea0f4537
19 changed files with 192 additions and 377 deletions

View file

@ -71,10 +71,8 @@ public class CustomCommandManager {
private void registerCommand(CustomCommandData data) {
try {
// Получаем CommandMap через рефлексию
Field commandMapField = Bukkit.getServer().getClass().getDeclaredField("commandMap");
commandMapField.setAccessible(true);
CommandMap commandMap = (CommandMap) commandMapField.get(Bukkit.getServer());
// Получаем CommandMap через Paper API (безопаснее чем рефлексия)
CommandMap commandMap = Bukkit.getCommandMap();
// Создаем и регистрируем команду
CustomCommand command = new CustomCommand(data.name, this);