Ejemplo n.º 1
0
  public String getUseageTemplate(boolean withDescription) {
    String ret = "";

    ret += Conf.colorCommand;

    ret +=
        Factions.instance.getBaseCommand() + " " + TextUtil.implode(this.getAliases(), ",") + " ";

    List<String> parts = new ArrayList<String>();

    for (String requiredParameter : this.requiredParameters) {
      parts.add("[" + requiredParameter + "]");
    }

    for (String optionalParameter : this.optionalParameters) {
      parts.add("*[" + optionalParameter + "]");
    }

    ret += Conf.colorParameter;

    ret += TextUtil.implode(parts, " ");

    if (withDescription) {
      ret += "  " + Conf.colorSystem + this.helpDescription;
    }
    return ret;
  }
Ejemplo n.º 2
0
  @Override
  public void perform() {
    // if economy is enabled, they're not on the bypass list, and this
    // command has a cost set, make 'em pay
    if (!payForCommand(
        Conf.econCostDesc, "to change faction description", "for changing faction description"))
      return;

    myFaction.setDescription(TextUtil.implode(args, " ").replaceAll("(&([a-f0-9]))", ""));

    // Broadcast the description to everyone
    for (FPlayer fplayer : FPlayers.i.getOnline()) {
      fplayer.msg(
          "<i>The faction %s<i> changed their description to:", myFaction.describeTo(fplayer));
      fplayer.sendMessage(myFaction.getDescription());
    }
  }