docs(bukkit): 添加部分文档

This commit is contained in:
2023-01-18 22:44:11 +08:00
parent 770689f004
commit 340e53d208

View File

@@ -23,6 +23,9 @@ public abstract class ParentCommand extends ChildCommand {
childCommands = new ArrayList<>();
}
@NotNull
public abstract JavaPlugin getPlugin();
@Override
public @NotNull String getName() {
return name;
@@ -33,15 +36,13 @@ public abstract class ParentCommand extends ChildCommand {
return null;
}
@NotNull
public abstract JavaPlugin getPlugin();
@NotNull
public List<ChildCommand> getChildCommands() {
return childCommands;
}
@NotNull
@Override
public String getUsage() {
if (getParent() == null) {
return "/" + name;
@@ -59,6 +60,13 @@ public abstract class ParentCommand extends ChildCommand {
return "";
}
/**
* 获取所有子命令
* <p>
* 如果子命令也是 ParentCommand 类型,则继续递归获取该 ParentCommand 的子命令
*
* @return 所有子命令
*/
@NotNull
public List<ChildCommand> getEndChildCommands() {
ArrayList<ChildCommand> list = new ArrayList<>();