示例#1
0
  @Override
  // TODO: optimize
  public boolean canUseCommand(String command) {
    if (dataholder.canUseCommand(command, getWorld().getName())) return true;

    if (dataholder.canUseCommand(Config.FULL_ACCESS_STRING, getWorld().getName())) return true;

    String[] split = command.split(".");
    if (split.length > 1) {
      for (int i = 0; i < split.length; i++) {
        String t = split[0];
        for (int x = 1; x <= i; x++) t += "." + split[x];
        t += "." + Config.FULL_ACCESS_STRING;
        if (dataholder.canUseCommand(t, getWorld().getName())) return true;
      }
    }

    return false;
  }