mirror of
https://e.coding.net/circlecloud/YumCore.git
synced 2024-11-24 02:08:48 +00:00
feat: 存在默认命令且子命令未找到时优先调用默认命令
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
5acc85e53a
commit
9d45715190
@ -1,11 +1,5 @@
|
||||
package pw.yumc.YumCore.commands;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.*;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -13,7 +7,6 @@ import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.util.StringUtil;
|
||||
|
||||
import pw.yumc.YumCore.bukkit.Log;
|
||||
import pw.yumc.YumCore.bukkit.P;
|
||||
import pw.yumc.YumCore.bukkit.compatible.C;
|
||||
@ -22,6 +15,12 @@ import pw.yumc.YumCore.commands.info.CommandTabInfo;
|
||||
import pw.yumc.YumCore.commands.interfaces.CommandExecutor;
|
||||
import pw.yumc.YumCore.commands.interfaces.CommandHelpParse;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 命令管理类
|
||||
*
|
||||
@ -151,6 +150,9 @@ public class CommandManager implements TabExecutor {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (defCmd != null) {
|
||||
cmdCache.put(subcmd, defCmd);
|
||||
}
|
||||
if (!cmdCache.containsKey(subcmd)) {
|
||||
cmdCache.put(subcmd, CommandInfo.Unknow);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user