@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))));
    }
  }
Beispiel #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))));
    }
  }
Beispiel #5
0
 @Override
 public boolean isMuted() {
   return MConf.get().herochatFactionMuted;
 }
Beispiel #6
0
 @Override
 public boolean isCrossWorld() {
   return MConf.get().herochatFactionCrossWorld;
 }
Beispiel #7
0
 @Override
 public void setCrossWorld(boolean crossWorld) {
   MConf.get().herochatFactionCrossWorld = crossWorld;
 }
Beispiel #8
0
 @Override
 public boolean isShortcutAllowed() {
   return MConf.get().herochatFactionIsShortcutAllowed;
 }
Beispiel #9
0
 @Override
 public void setShortcutAllowed(boolean shortcutAllowed) {
   MConf.get().herochatFactionIsShortcutAllowed = shortcutAllowed;
 }
Beispiel #10
0
 @Override
 public void setNick(String nick) {
   MConf.get().herochatFactionNick = nick;
 }
Beispiel #11
0
 @Override
 public void setWorlds(Set<String> worlds) {
   MConf.get().herochatFactionWorlds = worlds;
 }
Beispiel #12
0
 @Override
 public String getName() {
   return MConf.get().herochatFactionName;
 }
Beispiel #13
0
 @Override
 public void addWorld(String world) {
   MConf.get().herochatFactionWorlds.add(world);
 }
Beispiel #14
0
 @Override
 public void setColor(ChatColor color) {
   MConf.get().herochatFactionColor = color;
 }
Beispiel #15
0
 @Override
 public int getDistance() {
   return MConf.get().herochatFactionDistance;
 }
Beispiel #16
0
 @Override
 public ChatColor getColor() {
   return MConf.get().herochatFactionColor;
 }
Beispiel #17
0
 @Override
 public void setFormat(String format) {
   MConf.get().herochatFactionFormat = format;
 }
Beispiel #18
0
 @Override
 public String getFormat() {
   return MConf.get().herochatFactionFormat;
 }
Beispiel #19
0
 @Override
 public void setMuted(boolean value) {
   MConf.get().herochatFactionMuted = value;
 }
Beispiel #20
0
 @Override
 public Set<String> getWorlds() {
   return new HashSet<String>(MConf.get().herochatFactionWorlds);
 }
Beispiel #21
0
 @Override
 public void setDistance(int distance) {
   MConf.get().herochatFactionDistance = distance;
 }
Beispiel #22
0
 @Override
 public String getNick() {
   return MConf.get().herochatFactionNick;
 }