@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)))); } }
@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)))); } }
@Override public boolean isMuted() { return MConf.get().herochatFactionMuted; }
@Override public boolean isCrossWorld() { return MConf.get().herochatFactionCrossWorld; }
@Override public void setCrossWorld(boolean crossWorld) { MConf.get().herochatFactionCrossWorld = crossWorld; }
@Override public boolean isShortcutAllowed() { return MConf.get().herochatFactionIsShortcutAllowed; }
@Override public void setShortcutAllowed(boolean shortcutAllowed) { MConf.get().herochatFactionIsShortcutAllowed = shortcutAllowed; }
@Override public void setNick(String nick) { MConf.get().herochatFactionNick = nick; }
@Override public void setWorlds(Set<String> worlds) { MConf.get().herochatFactionWorlds = worlds; }
@Override public String getName() { return MConf.get().herochatFactionName; }
@Override public void addWorld(String world) { MConf.get().herochatFactionWorlds.add(world); }
@Override public void setColor(ChatColor color) { MConf.get().herochatFactionColor = color; }
@Override public int getDistance() { return MConf.get().herochatFactionDistance; }
@Override public ChatColor getColor() { return MConf.get().herochatFactionColor; }
@Override public void setFormat(String format) { MConf.get().herochatFactionFormat = format; }
@Override public String getFormat() { return MConf.get().herochatFactionFormat; }
@Override public void setMuted(boolean value) { MConf.get().herochatFactionMuted = value; }
@Override public Set<String> getWorlds() { return new HashSet<String>(MConf.get().herochatFactionWorlds); }
@Override public void setDistance(int distance) { MConf.get().herochatFactionDistance = distance; }
@Override public String getNick() { return MConf.get().herochatFactionNick; }