@Override
  public void perform() {
    Double amount = this.arg(0, ARDouble.get());
    if (amount == null) return;

    UPlayer from = this.arg(1, ARUPlayer.getStartAny(sender));
    if (from == null) return;

    Faction to = this.arg(2, ARFaction.get(sender));
    if (to == null) return;

    boolean success = Econ.transferMoney(usender, from, to, amount);

    if (success && MConf.get().logMoneyTransactions) {
      Factions.get()
          .log(
              ChatColor.stripColor(
                  Txt.parse(
                      "%s transferred %s from the player \"%s\" to the faction \"%s\"",
                      usender.getName(),
                      Money.format(amount),
                      from.describeTo(null),
                      to.describeTo(null))));
    }
  }
Esempio n. 2
0
  @Override
  public Set<PS> getChunks() {
    // Common Startup
    final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
    final Set<PS> chunks = new LinkedHashSet<PS>();

    // What faction (aka color) resides there?
    // NOTE: Wilderness/None is valid.
    final Faction color = BoardColl.get().getFactionAt(chunk);

    // We start where we are!
    chunks.add(chunk);

    // Flood!
    int max = MConf.get().setFillMax;
    floodSearch(chunks, color, max);

    // Limit Reached?
    if (chunks.size() >= max) {
      msg("<b>Fill limit of <h>%d <b>reached.", max);
      return null;
    }

    // OK!
    return chunks;
  }
  @Override
  public void perform() {
    // Args
    Faction faction = this.arg(0, ARFaction.get(usender), usenderFaction);
    if (faction == null) return;

    // FPerm
    if (!FPerm.DISBAND.has(usender, faction, true)) return;

    // Verify
    if (faction.getFlag(FFlag.PERMANENT)) {
      msg("<i>This faction is designated as permanent, so you cannot disband it.");
      return;
    }

    // Event
    EventFactionsDisband event = new EventFactionsDisband(me, faction);
    event.run();
    if (event.isCancelled()) return;

    // Merged Apply and Inform

    // Run event for each player in the faction
    for (UPlayer uplayer : faction.getUPlayers()) {
      EventFactionsMembershipChange membershipChangeEvent =
          new EventFactionsMembershipChange(
              sender,
              uplayer,
              FactionColls.get().get(faction).getNone(),
              MembershipChangeReason.DISBAND);
      membershipChangeEvent.run();
    }

    // Inform all players
    for (UPlayer uplayer : UPlayerColls.get().get(usender).getAllOnline()) {
      String who = usender.describeTo(uplayer);
      if (uplayer.getFaction() == faction) {
        uplayer.msg("<h>%s<i> disbanded your faction.", who);
      } else {
        uplayer.msg("<h>%s<i> disbanded the faction %s.", who, faction.getName(uplayer));
      }
    }

    if (MConf.get().logFactionDisband) {
      Factions.get()
          .log(
              Txt.parse(
                  "<i>The faction <h>%s <i>(<h>%s<i>) was disbanded by <h>%s<i>.",
                  faction.getName(), faction.getId(), usender.getDisplayName()));
    }

    faction.detach();
  }
  @Override
  public void perform() {
    Double amount = this.arg(0, ARDouble.get());
    if (amount == null) return;

    Faction from = this.arg(1, ARFaction.get(sender), myFaction);
    if (from == null) return;

    FPlayer to = fme;

    boolean success = Econ.transferMoney(fme, from, to, amount);

    if (success && MConf.get().logMoneyTransactions) {
      Factions.get()
          .log(
              ChatColor.stripColor(
                  Txt.parse(
                      "%s withdrew %s from the faction bank: %s",
                      fme.getName(), Money.format(from, amount), from.describeTo(null))));
    }
  }
Esempio n. 5
0
 @Override
 public boolean isMuted() {
   return MConf.get().herochatFactionMuted;
 }
Esempio n. 6
0
 @Override
 public boolean isCrossWorld() {
   return MConf.get().herochatFactionCrossWorld;
 }
Esempio n. 7
0
 @Override
 public void setCrossWorld(boolean crossWorld) {
   MConf.get().herochatFactionCrossWorld = crossWorld;
 }
Esempio n. 8
0
 @Override
 public boolean isShortcutAllowed() {
   return MConf.get().herochatFactionIsShortcutAllowed;
 }
Esempio n. 9
0
 @Override
 public void setShortcutAllowed(boolean shortcutAllowed) {
   MConf.get().herochatFactionIsShortcutAllowed = shortcutAllowed;
 }
Esempio n. 10
0
 @Override
 public void setNick(String nick) {
   MConf.get().herochatFactionNick = nick;
 }
Esempio n. 11
0
 @Override
 public void setWorlds(Set<String> worlds) {
   MConf.get().herochatFactionWorlds = worlds;
 }
Esempio n. 12
0
 @Override
 public String getName() {
   return MConf.get().herochatFactionName;
 }
Esempio n. 13
0
 @Override
 public void addWorld(String world) {
   MConf.get().herochatFactionWorlds.add(world);
 }
Esempio n. 14
0
 @Override
 public void setColor(ChatColor color) {
   MConf.get().herochatFactionColor = color;
 }
Esempio n. 15
0
 @Override
 public int getDistance() {
   return MConf.get().herochatFactionDistance;
 }
Esempio n. 16
0
 @Override
 public ChatColor getColor() {
   return MConf.get().herochatFactionColor;
 }
Esempio n. 17
0
 @Override
 public void setFormat(String format) {
   MConf.get().herochatFactionFormat = format;
 }
Esempio n. 18
0
 @Override
 public String getFormat() {
   return MConf.get().herochatFactionFormat;
 }
Esempio n. 19
0
 @Override
 public void setMuted(boolean value) {
   MConf.get().herochatFactionMuted = value;
 }
Esempio n. 20
0
 @Override
 public Set<String> getWorlds() {
   return new HashSet<String>(MConf.get().herochatFactionWorlds);
 }
Esempio n. 21
0
 @Override
 public void setDistance(int distance) {
   MConf.get().herochatFactionDistance = distance;
 }
Esempio n. 22
0
 @Override
 public String getNick() {
   return MConf.get().herochatFactionNick;
 }