org.bukkit.command.Command.toString()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(1.6k)|赞(0)|评价(0)|浏览(140)

本文整理了Java中org.bukkit.command.Command.toString()方法的一些代码示例,展示了Command.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Command.toString()方法的具体详情如下:
包路径:org.bukkit.command.Command
类名称:Command
方法名:toString

Command.toString介绍

暂无

代码示例

代码示例来源:origin: Bukkit/Bukkit

@Override
  public String toString() {
    StringBuilder stringBuilder = new StringBuilder(super.toString());
    stringBuilder.deleteCharAt(stringBuilder.length() - 1);
    stringBuilder.append(", ").append(owningPlugin.getDescription().getFullName()).append(')');
    return stringBuilder.toString();
  }
}

代码示例来源:origin: EngineHub/CommandHelper

@Override
public String toString() {
  return cmd.toString();
}

代码示例来源:origin: SpigotMC/Spigot-API

@Override
  public String toString() {
    StringBuilder stringBuilder = new StringBuilder(super.toString());
    stringBuilder.deleteCharAt(stringBuilder.length() - 1);
    stringBuilder.append(", ").append(owningPlugin.getDescription().getFullName()).append(')');
    return stringBuilder.toString();
  }
}

代码示例来源:origin: artex-development/Lukkit

public void unregister() throws NoSuchFieldException, IllegalAccessException {
  Object result = getPrivateField(Bukkit.getServer().getPluginManager(), "commandMap");
  SimpleCommandMap commandMap = (SimpleCommandMap) result;
  Object map = getPrivateField(commandMap, "knownCommands");
  HashMap<String, Command> knownCommands = (HashMap<String, Command>) map;
  knownCommands.remove(getName());
  for (String alias : getAliases()) {
    if (knownCommands.containsKey(alias) && knownCommands.get(alias).toString().contains(this.getName())) {
      knownCommands.remove(alias);
    }
  }
}

相关文章