From e32a741b3b3190c8903f903e26ec510b7b7346ca Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Thu, 25 Apr 2013 07:29:19 +0200 Subject: [PATCH] Renaming sender vars in the command system to more proper names. --- .../factions/cmd/CmdFactionsAccess.java | 8 +++--- .../factions/cmd/CmdFactionsAdmin.java | 14 +++++----- .../factions/cmd/CmdFactionsAutoClaim.java | 14 +++++----- .../factions/cmd/CmdFactionsClaim.java | 8 +++--- .../factions/cmd/CmdFactionsCreate.java | 16 +++++------ .../factions/cmd/CmdFactionsDemote.java | 16 +++++------ .../factions/cmd/CmdFactionsDescription.java | 6 ++-- .../factions/cmd/CmdFactionsDisband.java | 8 +++--- .../factions/cmd/CmdFactionsFlag.java | 8 +++--- .../factions/cmd/CmdFactionsHome.java | 28 +++++++++---------- .../factions/cmd/CmdFactionsInvite.java | 20 ++++++------- .../factions/cmd/CmdFactionsJoin.java | 22 +++++++-------- .../factions/cmd/CmdFactionsKick.java | 14 +++++----- .../factions/cmd/CmdFactionsLeader.java | 20 ++++++------- .../factions/cmd/CmdFactionsLeave.java | 2 +- .../factions/cmd/CmdFactionsList.java | 2 +- .../factions/cmd/CmdFactionsMap.java | 8 +++--- .../factions/cmd/CmdFactionsMoneyBalance.java | 6 ++-- .../factions/cmd/CmdFactionsMoneyDeposit.java | 6 ++-- .../cmd/CmdFactionsMoneyTransferFf.java | 4 +-- .../cmd/CmdFactionsMoneyTransferFp.java | 4 +-- .../cmd/CmdFactionsMoneyTransferPf.java | 4 +-- .../cmd/CmdFactionsMoneyWithdraw.java | 8 +++--- .../factions/cmd/CmdFactionsName.java | 18 ++++++------ .../factions/cmd/CmdFactionsOfficer.java | 12 ++++---- .../factions/cmd/CmdFactionsOpen.java | 10 +++---- .../factions/cmd/CmdFactionsPerm.java | 8 +++--- .../factions/cmd/CmdFactionsPowerBoost.java | 4 +-- .../factions/cmd/CmdFactionsPromote.java | 14 +++++----- .../cmd/CmdFactionsRelationAbstract.java | 26 ++++++++--------- .../factions/cmd/CmdFactionsSethome.java | 14 +++++----- .../factions/cmd/CmdFactionsShow.java | 22 +++++++-------- .../factions/cmd/CmdFactionsTitle.java | 4 +-- .../factions/cmd/CmdFactionsUnclaim.java | 4 +-- .../factions/cmd/CmdFactionsUnclaimall.java | 6 ++-- .../massivecraft/factions/cmd/FCommand.java | 12 ++++---- 36 files changed, 200 insertions(+), 200 deletions(-) diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java b/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java index 07744026..0c864bf6 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAccess.java @@ -42,7 +42,7 @@ public class CmdFactionsAccess extends FCommand if (type.isEmpty() || type.equals("view")) { if ( ! accessAny && ! Perm.ACCESS_VIEW.has(sender, true)) return; - if ( ! accessAny && ! territory.doesHostFactionMatch(fme)) + if ( ! accessAny && ! territory.doesHostFactionMatch(usender)) { msg("This territory isn't controlled by your faction, so you can't view the access list."); return; @@ -52,7 +52,7 @@ public class CmdFactionsAccess extends FCommand } if ( ! accessAny && ! Perm.ACCESS.has(sender, true)) return; - if ( ! accessAny && ! FPerm.ACCESS.has(fme, locFaction, true)) return; + if ( ! accessAny && ! FPerm.ACCESS.has(usender, locFaction, true)) return; boolean doPlayer = true; if (type.equals("f") || type.equals("faction")) @@ -72,14 +72,14 @@ public class CmdFactionsAccess extends FCommand if (doPlayer) { - UPlayer targetPlayer = this.arg(1, ARUPlayer.getStartAny(fme), fme); + UPlayer targetPlayer = this.arg(1, ARUPlayer.getStartAny(usender), usender); if (targetPlayer == null) return; added = territory.toggleFPlayer(targetPlayer); target = "Player \""+targetPlayer.getName()+"\""; } else { - Faction targetFaction = this.arg(1, ARFaction.get(myFaction), myFaction); + Faction targetFaction = this.arg(1, ARFaction.get(usenderFaction), usenderFaction); if (targetFaction == null) return; added = territory.toggleFaction(targetFaction); target = "Faction \""+targetFaction.getName()+"\""; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java b/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java index 501ca785..ccb5925f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAdmin.java @@ -19,20 +19,20 @@ public class CmdFactionsAdmin extends FCommand @Override public void perform() { - Boolean target = this.arg(0, ARBoolean.get(), !fme.isUsingAdminMode()); + Boolean target = this.arg(0, ARBoolean.get(), !usender.isUsingAdminMode()); if (target == null) return; - fme.setUsingAdminMode(target); + usender.setUsingAdminMode(target); - if ( fme.isUsingAdminMode()) + if ( usender.isUsingAdminMode()) { - fme.msg("You have enabled admin bypass mode."); - Factions.get().log(fme.getName() + " has ENABLED admin bypass mode."); + usender.msg("You have enabled admin bypass mode."); + Factions.get().log(usender.getName() + " has ENABLED admin bypass mode."); } else { - fme.msg("You have disabled admin bypass mode."); - Factions.get().log(fme.getName() + " DISABLED admin bypass mode."); + usender.msg("You have disabled admin bypass mode."); + Factions.get().log(usender.getName() + " DISABLED admin bypass mode."); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsAutoClaim.java b/src/com/massivecraft/factions/cmd/CmdFactionsAutoClaim.java index 441bdc92..966fcdf2 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsAutoClaim.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsAutoClaim.java @@ -23,20 +23,20 @@ public class CmdFactionsAutoClaim extends FCommand @Override public void perform() { - Faction forFaction = this.arg(0, ARFaction.get(myFaction), myFaction); - if (forFaction == null || forFaction == fme.getAutoClaimFaction()) + Faction forFaction = this.arg(0, ARFaction.get(usenderFaction), usenderFaction); + if (forFaction == null || forFaction == usender.getAutoClaimFaction()) { - fme.setAutoClaimFaction(null); + usender.setAutoClaimFaction(null); msg("Auto-claiming of land disabled."); return; } - if (forFaction.isNormal() && !FPerm.TERRITORY.has(fme, forFaction, true)) return; + if (forFaction.isNormal() && !FPerm.TERRITORY.has(usender, forFaction, true)) return; - fme.setAutoClaimFaction(forFaction); + usender.setAutoClaimFaction(forFaction); - msg("Now auto-claiming land for %s.", forFaction.describeTo(fme)); - fme.tryClaim(forFaction, PS.valueOf(me), true, true); + msg("Now auto-claiming land for %s.", forFaction.describeTo(usender)); + usender.tryClaim(forFaction, PS.valueOf(me), true, true); } } \ No newline at end of file diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java b/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java index 16b83dac..4a8ff5d0 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsClaim.java @@ -33,7 +33,7 @@ public class CmdFactionsClaim extends FCommand Integer radius = this.arg(0, ARInteger.get(), 1); if (radius == null) return; - final Faction forFaction = this.arg(1, ARFaction.get(me), myFaction); + final Faction forFaction = this.arg(1, ARFaction.get(me), usenderFaction); if (forFaction == null) return; // FPerm @@ -46,7 +46,7 @@ public class CmdFactionsClaim extends FCommand return; } - if (radius > MConf.get().radiusClaimRadiusLimit && !fme.isUsingAdminMode()) + if (radius > MConf.get().radiusClaimRadiusLimit && !usender.isUsingAdminMode()) { msg("The maximum radius allowed is %s.", MConf.get().radiusClaimRadiusLimit); return; @@ -57,7 +57,7 @@ public class CmdFactionsClaim extends FCommand // single chunk if (radius < 2) { - fme.tryClaim(forFaction, PS.valueOf(me), true, true); + usender.tryClaim(forFaction, PS.valueOf(me), true, true); return; } @@ -81,7 +81,7 @@ public class CmdFactionsClaim extends FCommand @Override public boolean work() { - boolean success = fme.tryClaim(forFaction, PS.valueOf(this.currentLocation()), true, true); + boolean success = usender.tryClaim(forFaction, PS.valueOf(this.currentLocation()), true, true); if (success) { this.failCount = 0; diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java index 3d50064c..68365288 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsCreate.java @@ -34,13 +34,13 @@ public class CmdFactionsCreate extends FCommand String newName = this.arg(0); // Verify - if (fme.getFaction().isNormal()) + if (usender.getFaction().isNormal()) { msg("You must leave your current faction first."); return; } - FactionColl coll = FactionColls.get().get(fme); + FactionColl coll = FactionColls.get().get(usender); if (coll.isNameTaken(newName)) { @@ -67,24 +67,24 @@ public class CmdFactionsCreate extends FCommand Faction faction = coll.create(factionId); faction.setName(newName); - fme.setRole(Rel.LEADER); - fme.setFaction(faction); + usender.setRole(Rel.LEADER); + usender.setFaction(faction); - FactionsEventMembershipChange joinEvent = new FactionsEventMembershipChange(sender, fme, faction, MembershipChangeReason.CREATE); + FactionsEventMembershipChange joinEvent = new FactionsEventMembershipChange(sender, usender, faction, MembershipChangeReason.CREATE); joinEvent.run(); // NOTE: join event cannot be cancelled or you'll have an empty faction // Inform - for (UPlayer follower : UPlayerColls.get().get(fme).getAllOnline()) + for (UPlayer follower : UPlayerColls.get().get(usender).getAllOnline()) { - follower.msg("%s created a new faction %s", fme.describeTo(follower, true), faction.getName(follower)); + follower.msg("%s created a new faction %s", usender.describeTo(follower, true), faction.getName(follower)); } msg("You should now: %s", Factions.get().getOuterCmdFactions().cmdFactionsDescription.getUseageTemplate()); if (MConf.get().logFactionCreate) { - Factions.get().log(fme.getName()+" created a new faction: "+newName); + Factions.get().log(usender.getName()+" created a new faction: "+newName); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDemote.java b/src/com/massivecraft/factions/cmd/CmdFactionsDemote.java index 18877d03..2a31b9d2 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDemote.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDemote.java @@ -25,16 +25,16 @@ public class CmdFactionsDemote extends FCommand @Override public void perform() { - UPlayer you = this.arg(0, ARUPlayer.getStartAny(fme)); + UPlayer you = this.arg(0, ARUPlayer.getStartAny(usender)); if (you == null) return; - if (you.getFaction() != myFaction) + if (you.getFaction() != usenderFaction) { - msg("%s is not a member in your faction.", you.describeTo(fme, true)); + msg("%s is not a member in your faction.", you.describeTo(usender, true)); return; } - if (you == fme) + if (you == usender) { msg("The target player mustn't be yourself."); return; @@ -42,23 +42,23 @@ public class CmdFactionsDemote extends FCommand if (you.getRole() == Rel.MEMBER) { - if (!fme.getRole().isAtLeast(Rel.OFFICER)) + if (!usender.getRole().isAtLeast(Rel.OFFICER)) { msg("You must be an officer to demote a member to recruit."); return; } you.setRole(Rel.RECRUIT); - myFaction.msg("%s was demoted to being a recruit in your faction.", you.describeTo(myFaction, true)); + usenderFaction.msg("%s was demoted to being a recruit in your faction.", you.describeTo(usenderFaction, true)); } else if (you.getRole() == Rel.OFFICER) { - if (!fme.getRole().isAtLeast(Rel.LEADER)) + if (!usender.getRole().isAtLeast(Rel.LEADER)) { msg("You must be the leader to demote an officer to member."); return; } you.setRole(Rel.MEMBER); - myFaction.msg("%s was demoted to being a member in your faction.", you.describeTo(myFaction, true)); + usenderFaction.msg("%s was demoted to being a member in your faction.", you.describeTo(usenderFaction, true)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java b/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java index 6a6abdee..77a3dd49 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDescription.java @@ -27,16 +27,16 @@ public class CmdFactionsDescription extends FCommand String newDescription = this.argConcatFrom(1); // Event - FactionsEventDescriptionChange event = new FactionsEventDescriptionChange(sender, myFaction, newDescription); + FactionsEventDescriptionChange event = new FactionsEventDescriptionChange(sender, usenderFaction, newDescription); event.run(); if (event.isCancelled()) return; newDescription = event.getNewDescription(); // Apply - myFaction.setDescription(this.argConcatFrom(1)); + usenderFaction.setDescription(this.argConcatFrom(1)); // Inform - myFaction.msg("%s set your faction description to:\n%s", Mixin.getDisplayName(sender), myFaction.getDescription()); + usenderFaction.msg("%s set your faction description to:\n%s", Mixin.getDisplayName(sender), usenderFaction.getDescription()); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java index 672dfb4e..4fa2dced 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsDisband.java @@ -30,7 +30,7 @@ public class CmdFactionsDisband extends FCommand public void perform() { // Args - Faction faction = this.arg(0, ARFaction.get(fme), myFaction); + Faction faction = this.arg(0, ARFaction.get(usender), usenderFaction); if (faction == null) return; // FPerm @@ -58,9 +58,9 @@ public class CmdFactionsDisband extends FCommand } // Inform all players - for (UPlayer uplayer : UPlayerColls.get().get(fme).getAllOnline()) + for (UPlayer uplayer : UPlayerColls.get().get(usender).getAllOnline()) { - String who = fme.describeTo(uplayer); + String who = usender.describeTo(uplayer); if (uplayer.getFaction() == faction) { uplayer.msg("%s disbanded your faction.", who); @@ -73,7 +73,7 @@ public class CmdFactionsDisband extends FCommand if (MConf.get().logFactionDisband) { - Factions.get().log("The faction "+faction.getName()+" ("+faction.getId()+") was disbanded by "+(senderIsConsole ? "console command" : fme.getName())+"."); + Factions.get().log("The faction "+faction.getName()+" ("+faction.getId()+") was disbanded by "+(senderIsConsole ? "console command" : usender.getName())+"."); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsFlag.java b/src/com/massivecraft/factions/cmd/CmdFactionsFlag.java index c53dc41a..adacb7fc 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsFlag.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsFlag.java @@ -26,12 +26,12 @@ public class CmdFactionsFlag extends FCommand @Override public void perform() { - Faction faction = this.arg(0, ARFaction.get(sender), myFaction); + Faction faction = this.arg(0, ARFaction.get(sender), usenderFaction); if (faction == null) return; if ( ! this.argIsSet(1)) { - msg(Txt.titleize("Flags for " + faction.describeTo(fme, true))); + msg(Txt.titleize("Flags for " + faction.describeTo(usender, true))); for (FFlag flag : FFlag.values()) { msg(flag.getStateInfo(faction.getFlag(flag), true)); @@ -44,7 +44,7 @@ public class CmdFactionsFlag extends FCommand if ( ! this.argIsSet(2)) { - msg(Txt.titleize("Flag for " + faction.describeTo(fme, true))); + msg(Txt.titleize("Flag for " + faction.describeTo(usender, true))); msg(flag.getStateInfo(faction.getFlag(flag), true)); return; } @@ -56,7 +56,7 @@ public class CmdFactionsFlag extends FCommand if ( ! Perm.FLAG_SET.has(sender, true)) return; // Do the change - msg(Txt.titleize("Flag for " + faction.describeTo(fme, true))); + msg(Txt.titleize("Flag for " + faction.describeTo(usender, true))); faction.setFlag(flag, targetValue); msg(flag.getStateInfo(faction.getFlag(flag), true)); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsHome.java b/src/com/massivecraft/factions/cmd/CmdFactionsHome.java index b1b032f7..4243918e 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsHome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsHome.java @@ -40,32 +40,32 @@ public class CmdFactionsHome extends FCommand // TODO: Hide this command on help also. if ( ! uconf.homesEnabled) { - fme.msg("Sorry, Faction homes are disabled on this server."); + usender.msg("Sorry, Faction homes are disabled on this server."); return; } if ( ! uconf.homesTeleportCommandEnabled) { - fme.msg("Sorry, the ability to teleport to Faction homes is disabled on this server."); + usender.msg("Sorry, the ability to teleport to Faction homes is disabled on this server."); return; } - if ( ! myFaction.hasHome()) + if ( ! usenderFaction.hasHome()) { - fme.msg("Your faction does not have a home. " + (fme.getRole().isLessThan(Rel.OFFICER) ? " Ask your leader to:" : "You should:")); - fme.sendMessage(Factions.get().getOuterCmdFactions().cmdFactionsSethome.getUseageTemplate()); + usender.msg("Your faction does not have a home. " + (usender.getRole().isLessThan(Rel.OFFICER) ? " Ask your leader to:" : "You should:")); + usender.sendMessage(Factions.get().getOuterCmdFactions().cmdFactionsSethome.getUseageTemplate()); return; } - if ( ! uconf.homesTeleportAllowedFromEnemyTerritory && fme.isInEnemyTerritory()) + if ( ! uconf.homesTeleportAllowedFromEnemyTerritory && usender.isInEnemyTerritory()) { - fme.msg("You cannot teleport to your faction home while in the territory of an enemy faction."); + usender.msg("You cannot teleport to your faction home while in the territory of an enemy faction."); return; } - if (!uconf.homesTeleportAllowedFromDifferentWorld && !me.getWorld().getName().equalsIgnoreCase(myFaction.getHome().getWorld())) + if (!uconf.homesTeleportAllowedFromDifferentWorld && !me.getWorld().getName().equalsIgnoreCase(usenderFaction.getHome().getWorld())) { - fme.msg("You cannot teleport to your faction home while in a different world."); + usender.msg("You cannot teleport to your faction home while in a different world."); return; } @@ -81,10 +81,10 @@ public class CmdFactionsHome extends FCommand faction.getFlag(FFlag.PVP) && ( - ! fme.isInOwnTerritory() + ! usender.isInOwnTerritory() || ( - fme.isInOwnTerritory() + usender.isInOwnTerritory() && ! uconf.homesTeleportIgnoreEnemiesIfInOwnTerritory ) @@ -102,7 +102,7 @@ public class CmdFactionsHome extends FCommand continue; UPlayer fp = UPlayer.get(p); - if (fme.getRelationTo(fp) != Rel.ENEMY) + if (usender.getRelationTo(fp) != Rel.ENEMY) continue; Location l = p.getLocation(); @@ -115,7 +115,7 @@ public class CmdFactionsHome extends FCommand if (dx > max || dy > max || dz > max) continue; - fme.msg("You cannot teleport to your faction home while an enemy is within " + uconf.homesTeleportAllowedEnemyDistance + " blocks of you."); + usender.msg("You cannot teleport to your faction home while an enemy is within " + uconf.homesTeleportAllowedEnemyDistance + " blocks of you."); return; } } @@ -128,7 +128,7 @@ public class CmdFactionsHome extends FCommand // Apply try { - Mixin.teleport(me, myFaction.getHome(), "your faction home", sender); + Mixin.teleport(me, usenderFaction.getHome(), "your faction home", sender); } catch (TeleporterException e) { diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java b/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java index a3cef0d5..3955516a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsInvite.java @@ -30,39 +30,39 @@ public class CmdFactionsInvite extends FCommand UPlayer uplayer = this.arg(0, ARUPlayer.getStartAny(sender)); if (uplayer == null) return; - Boolean newInvited = this.arg(1, ARBoolean.get(), !myFaction.isInvited(uplayer)); + Boolean newInvited = this.arg(1, ARBoolean.get(), !usenderFaction.isInvited(uplayer)); if (newInvited == null) return; // Allready member? - if (uplayer.getFaction() == myFaction) + if (uplayer.getFaction() == usenderFaction) { - msg("%s is already a member of %s", uplayer.getName(), myFaction.getName()); + msg("%s is already a member of %s", uplayer.getName(), usenderFaction.getName()); msg("You might want to: " + Factions.get().getOuterCmdFactions().cmdFactionsKick.getUseageTemplate(false)); return; } // FPerm - if ( ! FPerm.INVITE.has(sender, myFaction, true)) return; + if ( ! FPerm.INVITE.has(sender, usenderFaction, true)) return; // Event - FactionsEventInvitedChange event = new FactionsEventInvitedChange(sender, uplayer, myFaction, newInvited); + FactionsEventInvitedChange event = new FactionsEventInvitedChange(sender, uplayer, usenderFaction, newInvited); event.run(); if (event.isCancelled()) return; newInvited = event.isNewInvited(); // Apply - myFaction.setInvited(uplayer, newInvited); + usenderFaction.setInvited(uplayer, newInvited); // Inform if (newInvited) { - uplayer.msg("%s invited you to %s", fme.describeTo(uplayer, true), myFaction.describeTo(uplayer)); - myFaction.msg("%s invited %s to your faction.", fme.describeTo(myFaction, true), uplayer.describeTo(myFaction)); + uplayer.msg("%s invited you to %s", usender.describeTo(uplayer, true), usenderFaction.describeTo(uplayer)); + usenderFaction.msg("%s invited %s to your faction.", usender.describeTo(usenderFaction, true), uplayer.describeTo(usenderFaction)); } else { - uplayer.msg("%s revoked your invitation to %s.", fme.describeTo(uplayer), myFaction.describeTo(uplayer)); - myFaction.msg("%s revoked %s's invitation.", fme.describeTo(myFaction), uplayer.describeTo(myFaction)); + uplayer.msg("%s revoked your invitation to %s.", usender.describeTo(uplayer), usenderFaction.describeTo(uplayer)); + usenderFaction.msg("%s revoked %s's invitation.", usender.describeTo(usenderFaction), uplayer.describeTo(usenderFaction)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java b/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java index 198d56ea..794647eb 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsJoin.java @@ -31,11 +31,11 @@ public class CmdFactionsJoin extends FCommand Faction faction = this.arg(0, ARFaction.get(sender)); if (faction == null) return; - UPlayer uplayer = this.arg(1, ARUPlayer.getStartAny(sender), fme); + UPlayer uplayer = this.arg(1, ARUPlayer.getStartAny(sender), usender); if (uplayer == null) return; Faction uplayerFaction = uplayer.getFaction(); - boolean samePlayer = uplayer == fme; + boolean samePlayer = uplayer == usender; // Validate if (!samePlayer && ! Perm.JOIN_OTHERS.has(sender, false)) @@ -46,29 +46,29 @@ public class CmdFactionsJoin extends FCommand if (faction == uplayerFaction) { - msg("%s %s already a member of %s", uplayer.describeTo(fme, true), (samePlayer ? "are" : "is"), faction.getName(fme)); + msg("%s %s already a member of %s", uplayer.describeTo(usender, true), (samePlayer ? "are" : "is"), faction.getName(usender)); return; } if (UConf.get(faction).factionMemberLimit > 0 && faction.getUPlayers().size() >= UConf.get(faction).factionMemberLimit) { - msg(" ! The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getName(fme), UConf.get(faction).factionMemberLimit, uplayer.describeTo(fme, false)); + msg(" ! The faction %s is at the limit of %d members, so %s cannot currently join.", faction.getName(usender), UConf.get(faction).factionMemberLimit, uplayer.describeTo(usender, false)); return; } if (uplayerFaction.isNormal()) { - msg("%s must leave %s current faction first.", uplayer.describeTo(fme, true), (samePlayer ? "your" : "their")); + msg("%s must leave %s current faction first.", uplayer.describeTo(usender, true), (samePlayer ? "your" : "their")); return; } if (!UConf.get(faction).canLeaveWithNegativePower && uplayer.getPower() < 0) { - msg("%s cannot join a faction with a negative power level.", uplayer.describeTo(fme, true)); + msg("%s cannot join a faction with a negative power level.", uplayer.describeTo(usender, true)); return; } - if( ! (faction.isOpen() || faction.isInvited(uplayer) || fme.isUsingAdminMode() || Perm.JOIN_ANY.has(sender, false))) + if( ! (faction.isOpen() || faction.isInvited(uplayer) || usender.isUsingAdminMode() || Perm.JOIN_ANY.has(sender, false))) { msg("This faction requires invitation."); if (samePlayer) @@ -79,17 +79,17 @@ public class CmdFactionsJoin extends FCommand } // Event - FactionsEventMembershipChange membershipChangeEvent = new FactionsEventMembershipChange(sender, fme, faction, MembershipChangeReason.JOIN); + FactionsEventMembershipChange membershipChangeEvent = new FactionsEventMembershipChange(sender, usender, faction, MembershipChangeReason.JOIN); membershipChangeEvent.run(); if (membershipChangeEvent.isCancelled()) return; // Inform if (!samePlayer) { - uplayer.msg("%s moved you into the faction %s.", fme.describeTo(uplayer, true), faction.getName(uplayer)); + uplayer.msg("%s moved you into the faction %s.", usender.describeTo(uplayer, true), faction.getName(uplayer)); } faction.msg("%s joined your faction.", uplayer.describeTo(faction, true)); - fme.msg("%s successfully joined %s.", uplayer.describeTo(fme, true), faction.getName(fme)); + usender.msg("%s successfully joined %s.", uplayer.describeTo(usender, true), faction.getName(usender)); // Apply uplayer.resetFactionData(); @@ -103,7 +103,7 @@ public class CmdFactionsJoin extends FCommand if (samePlayer) Factions.get().log("%s joined the faction %s.", uplayer.getName(), faction.getName()); else - Factions.get().log("%s moved the player %s into the faction %s.", fme.getName(), uplayer.getName(), faction.getName()); + Factions.get().log("%s moved the player %s into the faction %s.", usender.getName(), uplayer.getName(), faction.getName()); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java index a6cdfda6..57a73980 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsKick.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsKick.java @@ -34,14 +34,14 @@ public class CmdFactionsKick extends FCommand if (uplayer == null) return; // Validate - if (fme == uplayer) + if (usender == uplayer) { msg("You cannot kick yourself."); msg("You might want to: %s", Factions.get().getOuterCmdFactions().cmdFactionsLeave.getUseageTemplate(false)); return; } - if (uplayer.getRole() == Rel.LEADER && !(this.senderIsConsole || fme.isUsingAdminMode())) + if (uplayer.getRole() == Rel.LEADER && !(this.senderIsConsole || usender.isUsingAdminMode())) { msg("The leader can not be kicked."); return; @@ -63,16 +63,16 @@ public class CmdFactionsKick extends FCommand if (event.isCancelled()) return; // Inform - uplayerFaction.msg("%s kicked %s from the faction! :O", fme.describeTo(uplayerFaction, true), uplayer.describeTo(uplayerFaction, true)); - uplayer.msg("%s kicked you from %s! :O", fme.describeTo(uplayer, true), uplayerFaction.describeTo(uplayer)); - if (uplayerFaction != myFaction) + uplayerFaction.msg("%s kicked %s from the faction! :O", usender.describeTo(uplayerFaction, true), uplayer.describeTo(uplayerFaction, true)); + uplayer.msg("%s kicked you from %s! :O", usender.describeTo(uplayer, true), uplayerFaction.describeTo(uplayer)); + if (uplayerFaction != usenderFaction) { - fme.msg("You kicked %s from the faction %s!", uplayer.describeTo(fme), uplayerFaction.describeTo(fme)); + usender.msg("You kicked %s from the faction %s!", uplayer.describeTo(usender), uplayerFaction.describeTo(usender)); } if (MConf.get().logFactionKick) { - Factions.get().log(fme.getDisplayName() + " kicked " + uplayer.getName() + " from the faction " + uplayerFaction.getName()); + Factions.get().log(usender.getDisplayName() + " kicked " + uplayer.getName() + " from the faction " + uplayerFaction.getName()); } // Apply diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsLeader.java b/src/com/massivecraft/factions/cmd/CmdFactionsLeader.java index 1de0f0fb..5b9a84e9 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsLeader.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsLeader.java @@ -31,32 +31,32 @@ public class CmdFactionsLeader extends FCommand UPlayer newLeader = this.arg(0, ARUPlayer.getStartAny(sender)); if (newLeader == null) return; - Faction targetFaction = this.arg(1, ARFaction.get(sender), myFaction); + Faction targetFaction = this.arg(1, ARFaction.get(sender), usenderFaction); if (targetFaction == null) return; UPlayer targetFactionCurrentLeader = targetFaction.getLeader(); // We now have uplayer and the target faction - if (this.senderIsConsole || fme.isUsingAdminMode() || Perm.LEADER_ANY.has(sender, false)) + if (this.senderIsConsole || usender.isUsingAdminMode() || Perm.LEADER_ANY.has(sender, false)) { // Do whatever you wish } else { // Follow the standard rules - if (fme.getRole() != Rel.LEADER || targetFaction != myFaction) + if (usender.getRole() != Rel.LEADER || targetFaction != usenderFaction) { sender.sendMessage(Txt.parse("You must be leader of the faction to %s.", this.getDesc())); return; } - if (newLeader.getFaction() != myFaction) + if (newLeader.getFaction() != usenderFaction) { - msg("%s is not a member in the faction.", newLeader.describeTo(fme, true)); + msg("%s is not a member in the faction.", newLeader.describeTo(usender, true)); return; } - if (newLeader == fme) + if (newLeader == usender) { msg("The target player musn't be yourself."); return; @@ -75,8 +75,8 @@ public class CmdFactionsLeader extends FCommand if (targetFactionCurrentLeader == newLeader) { targetFaction.promoteNewLeader(); - msg("You have demoted %s from the position of faction leader.", newLeader.describeTo(fme, true)); - newLeader.msg("You have been demoted from the position of faction leader by %s.", fme.describeTo(newLeader, true)); + msg("You have demoted %s from the position of faction leader.", newLeader.describeTo(usender, true)); + newLeader.msg("You have been demoted from the position of faction leader by %s.", usender.describeTo(newLeader, true)); return; } @@ -87,12 +87,12 @@ public class CmdFactionsLeader extends FCommand } newLeader.setFaction(targetFaction); newLeader.setRole(Rel.LEADER); - msg("You have promoted %s to the position of faction leader.", newLeader.describeTo(fme, true)); + msg("You have promoted %s to the position of faction leader.", newLeader.describeTo(usender, true)); // Inform all players for (UPlayer uplayer : UPlayerColls.get().get(sender).getAllOnline()) { - uplayer.msg("%s gave %s the leadership of %s.", senderIsConsole ? "A server admin" : RelationUtil.describeThatToMe(fme, uplayer, true), newLeader.describeTo(uplayer), targetFaction.describeTo(uplayer)); + uplayer.msg("%s gave %s the leadership of %s.", senderIsConsole ? "A server admin" : RelationUtil.describeThatToMe(usender, uplayer, true), newLeader.describeTo(uplayer), targetFaction.describeTo(uplayer)); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsLeave.java b/src/com/massivecraft/factions/cmd/CmdFactionsLeave.java index 3697c4e6..9c553229 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsLeave.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsLeave.java @@ -18,7 +18,7 @@ public class CmdFactionsLeave extends FCommand { @Override public void perform() { - fme.leave(); + usender.leave(); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsList.java b/src/com/massivecraft/factions/cmd/CmdFactionsList.java index 85c47b60..c116398a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsList.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsList.java @@ -57,7 +57,7 @@ public class CmdFactionsList extends FCommand continue; } lines.add(Txt.parse("%s %d/%d online, %d/%d/%d", - faction.getName(fme), + faction.getName(usender), faction.getUPlayersWhereOnline(true).size(), faction.getUPlayers().size(), faction.getLandCount(), diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMap.java b/src/com/massivecraft/factions/cmd/CmdFactionsMap.java index 9b745b56..eb72efa1 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMap.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMap.java @@ -28,11 +28,11 @@ public class CmdFactionsMap extends FCommand return; } - if (this.arg(0, ARBoolean.get(), !mme.isMapAutoUpdating())) + if (this.arg(0, ARBoolean.get(), !msender.isMapAutoUpdating())) { // Turn on - mme.setMapAutoUpdating(true); + msender.setMapAutoUpdating(true); msg("Map auto update ENABLED."); // And show the map once @@ -41,14 +41,14 @@ public class CmdFactionsMap extends FCommand else { // Turn off - mme.setMapAutoUpdating(false); + msender.setMapAutoUpdating(false); msg("Map auto update DISABLED."); } } public void showMap() { - sendMessage(BoardColls.get().getMap(myFaction, PS.valueOf(me), fme.getPlayer().getLocation().getYaw())); + sendMessage(BoardColls.get().getMap(usenderFaction, PS.valueOf(me), usender.getPlayer().getLocation().getYaw())); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java index ed77bb21..6317d92e 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyBalance.java @@ -22,12 +22,12 @@ public class CmdFactionsMoneyBalance extends FCommand @Override public void perform() { - Faction faction = this.arg(0, ARFaction.get(sender), myFaction); + Faction faction = this.arg(0, ARFaction.get(sender), usenderFaction); if (faction == null) return; - if (faction != myFaction && ! Perm.MONEY_BALANCE_ANY.has(sender, true)) return; + if (faction != usenderFaction && ! Perm.MONEY_BALANCE_ANY.has(sender, true)) return; - Econ.sendBalanceInfo(fme, faction); + Econ.sendBalanceInfo(usender, faction); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java index 121c61a3..f7137856 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyDeposit.java @@ -35,14 +35,14 @@ public class CmdFactionsMoneyDeposit extends FCommand Double amount = this.arg(0, ARDouble.get()); if (amount == null) return; - Faction faction = this.arg(1, ARFaction.get(sender), myFaction); + Faction faction = this.arg(1, ARFaction.get(sender), usenderFaction); if (faction == null) return; - boolean success = Econ.transferMoney(fme, fme, faction, amount); + boolean success = Econ.transferMoney(usender, usender, faction, amount); if (success && MConf.get().logMoneyTransactions) { - Factions.get().log(ChatColor.stripColor(Txt.parse("%s deposited %s in the faction bank: %s", fme.getName(), Money.format(fme, amount), faction.describeTo(null)))); + Factions.get().log(ChatColor.stripColor(Txt.parse("%s deposited %s in the faction bank: %s", usender.getName(), Money.format(usender, amount), faction.describeTo(null)))); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java index 9869c081..42814f4a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFf.java @@ -41,11 +41,11 @@ public class CmdFactionsMoneyTransferFf extends FCommand Faction to = this.arg(2, ARFaction.get(sender)); if (to == null) return; - boolean success = Econ.transferMoney(fme, from, to, amount); + 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 faction \"%s\" to the faction \"%s\"", fme.getName(), Money.format(from, amount), from.describeTo(null), to.describeTo(null)))); + Factions.get().log(ChatColor.stripColor(Txt.parse("%s transferred %s from the faction \"%s\" to the faction \"%s\"", usender.getName(), Money.format(from, amount), from.describeTo(null), to.describeTo(null)))); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java index f30ec06a..50e3fc29 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferFp.java @@ -43,11 +43,11 @@ public class CmdFactionsMoneyTransferFp extends FCommand UPlayer to = this.arg(2, ARUPlayer.getStartAny(sender)); if (to == null) return; - boolean success = Econ.transferMoney(fme, from, to, amount); + 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 faction \"%s\" to the player \"%s\"", fme.getName(), Money.format(from, amount), from.describeTo(null), to.describeTo(null)))); + Factions.get().log(ChatColor.stripColor(Txt.parse("%s transferred %s from the faction \"%s\" to the player \"%s\"", usender.getName(), Money.format(from, amount), from.describeTo(null), to.describeTo(null)))); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java index e5ab6d66..13bcaea3 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyTransferPf.java @@ -43,11 +43,11 @@ public class CmdFactionsMoneyTransferPf extends FCommand Faction to = this.arg(2, ARFaction.get(sender)); if (to == null) return; - boolean success = Econ.transferMoney(fme, from, to, amount); + 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\"", fme.getName(), Money.format(from, amount), from.describeTo(null), to.describeTo(null)))); + Factions.get().log(ChatColor.stripColor(Txt.parse("%s transferred %s from the player \"%s\" to the faction \"%s\"", usender.getName(), Money.format(from, amount), from.describeTo(null), to.describeTo(null)))); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java index 9ae37d16..5fd248ef 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsMoneyWithdraw.java @@ -35,16 +35,16 @@ public class CmdFactionsMoneyWithdraw extends FCommand Double amount = this.arg(0, ARDouble.get()); if (amount == null) return; - Faction from = this.arg(1, ARFaction.get(sender), myFaction); + Faction from = this.arg(1, ARFaction.get(sender), usenderFaction); if (from == null) return; - UPlayer to = fme; + UPlayer to = usender; - boolean success = Econ.transferMoney(fme, from, to, amount); + boolean success = Econ.transferMoney(usender, 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)))); + Factions.get().log(ChatColor.stripColor(Txt.parse("%s withdrew %s from the faction bank: %s", usender.getName(), Money.format(from, amount), from.describeTo(null)))); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsName.java b/src/com/massivecraft/factions/cmd/CmdFactionsName.java index f5c43d6f..4d73438d 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsName.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsName.java @@ -33,8 +33,8 @@ public class CmdFactionsName extends FCommand // TODO does not first test cover selfcase? - FactionColl factionColl = FactionColls.get().get(myFaction); - if (factionColl.isNameTaken(newName) && ! MiscUtil.getComparisonString(newName).equals(myFaction.getComparisonName())) + FactionColl factionColl = FactionColls.get().get(usenderFaction); + if (factionColl.isNameTaken(newName) && ! MiscUtil.getComparisonString(newName).equals(usenderFaction.getComparisonName())) { msg("That name is already taken"); return; @@ -49,24 +49,24 @@ public class CmdFactionsName extends FCommand } // Event - FactionsEventNameChange event = new FactionsEventNameChange(sender, myFaction, newName); + FactionsEventNameChange event = new FactionsEventNameChange(sender, usenderFaction, newName); event.run(); if (event.isCancelled()) return; newName = event.getNewName(); // Apply - String oldName = myFaction.getName(); - myFaction.setName(newName); + String oldName = usenderFaction.getName(); + usenderFaction.setName(newName); // Inform - myFaction.msg("%s changed your faction name to %s", fme.describeTo(myFaction, true), myFaction.getName(myFaction)); - for (Faction faction : FactionColls.get().get(myFaction).getAll()) + usenderFaction.msg("%s changed your faction name to %s", usender.describeTo(usenderFaction, true), usenderFaction.getName(usenderFaction)); + for (Faction faction : FactionColls.get().get(usenderFaction).getAll()) { - if (faction == myFaction) + if (faction == usenderFaction) { continue; } - faction.msg("The faction %s changed their name to %s.", fme.getColorTo(faction)+oldName, myFaction.getName(faction)); + faction.msg("The faction %s changed their name to %s.", usender.getColorTo(faction)+oldName, usenderFaction.getName(faction)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsOfficer.java b/src/com/massivecraft/factions/cmd/CmdFactionsOfficer.java index 88cbad53..82ea9e5a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsOfficer.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsOfficer.java @@ -28,19 +28,19 @@ public class CmdFactionsOfficer extends FCommand boolean permAny = Perm.OFFICER_ANY.has(sender, false); Faction targetFaction = you.getFaction(); - if (targetFaction != myFaction && !permAny) + if (targetFaction != usenderFaction && !permAny) { - msg("%s is not a member in your faction.", you.describeTo(fme, true)); + msg("%s is not a member in your faction.", you.describeTo(usender, true)); return; } - if (fme != null && fme.getRole() != Rel.LEADER && !permAny) + if (usender != null && usender.getRole() != Rel.LEADER && !permAny) { msg("You are not the faction leader."); return; } - if (you == fme && !permAny) + if (you == usender && !permAny) { msg("The target player musn't be yourself."); return; @@ -57,14 +57,14 @@ public class CmdFactionsOfficer extends FCommand // Revoke you.setRole(Rel.MEMBER); targetFaction.msg("%s is no longer officer in your faction.", you.describeTo(targetFaction, true)); - msg("You have removed officer status from %s.", you.describeTo(fme, true)); + msg("You have removed officer status from %s.", you.describeTo(usender, true)); } else { // Give you.setRole(Rel.OFFICER); targetFaction.msg("%s was promoted to officer in your faction.", you.describeTo(targetFaction, true)); - msg("You have promoted %s to officer.", you.describeTo(fme, true)); + msg("You have promoted %s to officer.", you.describeTo(usender, true)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsOpen.java b/src/com/massivecraft/factions/cmd/CmdFactionsOpen.java index 6f0cd53e..d4be4d36 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsOpen.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsOpen.java @@ -23,21 +23,21 @@ public class CmdFactionsOpen extends FCommand public void perform() { // Args - Boolean newOpen = this.arg(0, ARBoolean.get(), !myFaction.isOpen()); + Boolean newOpen = this.arg(0, ARBoolean.get(), !usenderFaction.isOpen()); if (newOpen == null) return; // Event - FactionsEventOpenChange event = new FactionsEventOpenChange(sender, myFaction, newOpen); + FactionsEventOpenChange event = new FactionsEventOpenChange(sender, usenderFaction, newOpen); event.run(); if (event.isCancelled()) return; newOpen = event.isNewOpen(); // Apply - myFaction.setOpen(newOpen); + usenderFaction.setOpen(newOpen); // Inform - String descTarget = myFaction.isOpen() ? "open" : "closed"; - myFaction.msg("%s changed the faction to %s.", fme.describeTo(myFaction, true), descTarget); + String descTarget = usenderFaction.isOpen() ? "open" : "closed"; + usenderFaction.msg("%s changed the faction to %s.", usender.describeTo(usenderFaction, true), descTarget); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java b/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java index 2fca529f..bd50c917 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPerm.java @@ -29,12 +29,12 @@ public class CmdFactionsPerm extends FCommand @Override public void perform() { - Faction faction = this.arg(0, ARFaction.get(myFaction), myFaction); + Faction faction = this.arg(0, ARFaction.get(usenderFaction), usenderFaction); if (faction == null) return; if ( ! this.argIsSet(1)) { - msg(Txt.titleize("Perms for " + faction.describeTo(fme, true))); + msg(Txt.titleize("Perms for " + faction.describeTo(usender, true))); msg(FPerm.getStateHeaders()); for (FPerm perm : FPerm.values()) { @@ -48,7 +48,7 @@ public class CmdFactionsPerm extends FCommand if ( ! this.argIsSet(2)) { - msg(Txt.titleize("Perm for " + faction.describeTo(fme, true))); + msg(Txt.titleize("Perm for " + faction.describeTo(usender, true))); msg(FPerm.getStateHeaders()); msg(perm.getStateInfo(faction.getPermittedRelations(perm), true)); return; @@ -72,7 +72,7 @@ public class CmdFactionsPerm extends FCommand faction.setRelationPermitted(FPerm.PERMS, Rel.LEADER, true); } - msg(Txt.titleize("Perm for " + faction.describeTo(fme, true))); + msg(Txt.titleize("Perm for " + faction.describeTo(usender, true))); msg(FPerm.getStateHeaders()); msg(perm.getStateInfo(faction.getPermittedRelations(perm), true)); } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java b/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java index ef1b6384..a311f70c 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPowerBoost.java @@ -22,7 +22,7 @@ public class CmdFactionsPowerBoost extends FCommand @Override public void perform() { - Faction faction = this.arg(0, ARFaction.get(fme)); + Faction faction = this.arg(0, ARFaction.get(usender)); if (faction == null) return; Double amount = this.arg(1, ARDouble.get()); @@ -33,6 +33,6 @@ public class CmdFactionsPowerBoost extends FCommand msg(""+faction.getName()+" now has a power bonus/penalty of "+amount+" to min and max power levels."); // TODO: Inconsistent. Why is there no boolean to toggle this logging of? - Factions.get().log(fme.getName()+" has set the power bonus/penalty for "+faction.getName()+" to "+amount+"."); + Factions.get().log(usender.getName()+" has set the power bonus/penalty for "+faction.getName()+" to "+amount+"."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsPromote.java b/src/com/massivecraft/factions/cmd/CmdFactionsPromote.java index 80e32c7a..f3b99d6f 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsPromote.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsPromote.java @@ -28,13 +28,13 @@ public class CmdFactionsPromote extends FCommand UPlayer you = this.arg(0, ARUPlayer.getStartAny(sender)); if (you == null) return; - if (you.getFaction() != myFaction) + if (you.getFaction() != usenderFaction) { - msg("%s is not a member in your faction.", you.describeTo(fme, true)); + msg("%s is not a member in your faction.", you.describeTo(usender, true)); return; } - if (you == fme) + if (you == usender) { msg("The target player mustn't be yourself."); return; @@ -42,24 +42,24 @@ public class CmdFactionsPromote extends FCommand if (you.getRole() == Rel.RECRUIT) { - if (!fme.getRole().isAtLeast(Rel.OFFICER)) + if (!usender.getRole().isAtLeast(Rel.OFFICER)) { msg("You must be an officer to promote someone to member."); return; } you.setRole(Rel.MEMBER); - myFaction.msg("%s was promoted to being a member of your faction.", you.describeTo(myFaction, true)); + usenderFaction.msg("%s was promoted to being a member of your faction.", you.describeTo(usenderFaction, true)); } else if (you.getRole() == Rel.MEMBER) { - if (!fme.getRole().isAtLeast(Rel.LEADER)) + if (!usender.getRole().isAtLeast(Rel.LEADER)) { msg("You must be the leader to promote someone to officer."); return; } // Give you.setRole(Rel.OFFICER); - myFaction.msg("%s was promoted to being a officer in your faction.", you.describeTo(myFaction, true)); + usenderFaction.msg("%s was promoted to being a officer in your faction.", you.describeTo(usenderFaction, true)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java b/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java index 6173826e..82e44a70 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsRelationAbstract.java @@ -39,40 +39,40 @@ public abstract class CmdFactionsRelationAbstract extends FCommand // Verify - if (otherFaction == myFaction) + if (otherFaction == usenderFaction) { msg("Nope! You can't declare a relation to yourself :)"); return; } - if (myFaction.getRelationWish(otherFaction) == newRelation) + if (usenderFaction.getRelationWish(otherFaction) == newRelation) { msg("You already have that relation wish set with %s.", otherFaction.getName()); return; } // Event - FactionsEventRelationChange event = new FactionsEventRelationChange(sender, myFaction, otherFaction, newRelation); + FactionsEventRelationChange event = new FactionsEventRelationChange(sender, usenderFaction, otherFaction, newRelation); event.run(); if (event.isCancelled()) return; newRelation = event.getNewRelation(); // try to set the new relation - myFaction.setRelationWish(otherFaction, newRelation); - Rel currentRelation = myFaction.getRelationTo(otherFaction, true); + usenderFaction.setRelationWish(otherFaction, newRelation); + Rel currentRelation = usenderFaction.getRelationTo(otherFaction, true); // if the relation change was successful if (newRelation == currentRelation) { - otherFaction.msg("%s is now %s.", myFaction.describeTo(otherFaction, true), newRelation.getDescFactionOne()); - myFaction.msg("%s is now %s.", otherFaction.describeTo(myFaction, true), newRelation.getDescFactionOne()); + otherFaction.msg("%s is now %s.", usenderFaction.describeTo(otherFaction, true), newRelation.getDescFactionOne()); + usenderFaction.msg("%s is now %s.", otherFaction.describeTo(usenderFaction, true), newRelation.getDescFactionOne()); } // inform the other faction of your request else { - otherFaction.msg("%s wishes to be %s.", myFaction.describeTo(otherFaction, true), newRelation.getColor()+newRelation.getDescFactionOne()); - otherFaction.msg("Type /"+ConfServer.baseCommandAliases.get(0)+" "+newRelation+" "+myFaction.getName()+" to accept."); - myFaction.msg("%s were informed that you wish to be %s.", otherFaction.describeTo(myFaction, true), newRelation.getColor()+newRelation.getDescFactionOne()); + otherFaction.msg("%s wishes to be %s.", usenderFaction.describeTo(otherFaction, true), newRelation.getColor()+newRelation.getDescFactionOne()); + otherFaction.msg("Type /"+ConfServer.baseCommandAliases.get(0)+" "+newRelation+" "+usenderFaction.getName()+" to accept."); + usenderFaction.msg("%s were informed that you wish to be %s.", otherFaction.describeTo(usenderFaction, true), newRelation.getColor()+newRelation.getDescFactionOne()); } // TODO: The ally case should work!! @@ -80,13 +80,13 @@ public abstract class CmdFactionsRelationAbstract extends FCommand if ( newRelation != Rel.TRUCE && otherFaction.getFlag(FFlag.PEACEFUL)) { otherFaction.msg("This will have no effect while your faction is peaceful."); - myFaction.msg("This will have no effect while their faction is peaceful."); + usenderFaction.msg("This will have no effect while their faction is peaceful."); } - if ( newRelation != Rel.TRUCE && myFaction.getFlag(FFlag.PEACEFUL)) + if ( newRelation != Rel.TRUCE && usenderFaction.getFlag(FFlag.PEACEFUL)) { otherFaction.msg("This will have no effect while their faction is peaceful."); - myFaction.msg("This will have no effect while your faction is peaceful."); + usenderFaction.msg("This will have no effect while your faction is peaceful."); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java index 7a22e935..d70aa188 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsSethome.java @@ -27,7 +27,7 @@ public class CmdFactionsSethome extends FCommand public void perform() { // Args - Faction faction = this.arg(0, ARFaction.get(myFaction), myFaction); + Faction faction = this.arg(0, ARFaction.get(usenderFaction), usenderFaction); if (faction == null) return; PS newHome = PS.valueOf(me.getLocation()); @@ -35,7 +35,7 @@ public class CmdFactionsSethome extends FCommand // Validate if ( ! UConf.get(faction).homesEnabled) { - fme.msg("Sorry, Faction homes are disabled on this server."); + usender.msg("Sorry, Faction homes are disabled on this server."); return; } @@ -43,9 +43,9 @@ public class CmdFactionsSethome extends FCommand if ( ! FPerm.SETHOME.has(sender, faction, true)) return; // Verify - if (!fme.isUsingAdminMode() && !faction.isValidHome(newHome)) + if (!usender.isUsingAdminMode() && !faction.isValidHome(newHome)) { - fme.msg("Sorry, your faction home can only be set inside your own claimed territory."); + usender.msg("Sorry, your faction home can only be set inside your own claimed territory."); return; } @@ -59,11 +59,11 @@ public class CmdFactionsSethome extends FCommand faction.setHome(newHome); // Inform - faction.msg("%s set the home for your faction. You can now use:", fme.describeTo(myFaction, true)); + faction.msg("%s set the home for your faction. You can now use:", usender.describeTo(usenderFaction, true)); faction.sendMessage(Factions.get().getOuterCmdFactions().cmdFactionsHome.getUseageTemplate()); - if (faction != myFaction) + if (faction != usenderFaction) { - fme.msg("You have set the home for the "+faction.getName(fme)+" faction."); + usender.msg("You have set the home for the "+faction.getName(usender)+" faction."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsShow.java b/src/com/massivecraft/factions/cmd/CmdFactionsShow.java index 3e301cff..55e611d5 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsShow.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsShow.java @@ -33,7 +33,7 @@ public class CmdFactionsShow extends FCommand @Override public void perform() { - Faction faction = this.arg(0, ARFaction.get(myFaction), myFaction); + Faction faction = this.arg(0, ARFaction.get(usenderFaction), usenderFaction); if (faction == null) return; UConf uconf = UConf.get(faction); @@ -43,7 +43,7 @@ public class CmdFactionsShow extends FCommand Collection normals = faction.getUPlayersWhereRole(Rel.MEMBER); Collection recruits = faction.getUPlayersWhereRole(Rel.RECRUIT); - msg(Txt.titleize(faction.getName(fme))); + msg(Txt.titleize(faction.getName(usender))); msg("Description: %s", faction.getDescription()); // Display important flags @@ -99,7 +99,7 @@ public class CmdFactionsShow extends FCommand String sepparator = Txt.parse("")+", "; // List the relations to other factions - Map> relationNames = faction.getFactionNamesPerRelation(fme, true); + Map> relationNames = faction.getFactionNamesPerRelation(usender, true); if (faction.getFlag(FFlag.PEACEFUL)) { @@ -121,11 +121,11 @@ public class CmdFactionsShow extends FCommand { if (follower.isOnline() && Mixin.isVisible(me, follower.getId())) { - memberOnlineNames.add(follower.getNameAndTitle(fme)); + memberOnlineNames.add(follower.getNameAndTitle(usender)); } else { - memberOfflineNames.add(follower.getNameAndTitle(fme)); + memberOfflineNames.add(follower.getNameAndTitle(usender)); } } @@ -133,11 +133,11 @@ public class CmdFactionsShow extends FCommand { if (follower.isOnline() && Mixin.isVisible(me, follower.getId())) { - memberOnlineNames.add(follower.getNameAndTitle(fme)); + memberOnlineNames.add(follower.getNameAndTitle(usender)); } else { - memberOfflineNames.add(follower.getNameAndTitle(fme)); + memberOfflineNames.add(follower.getNameAndTitle(usender)); } } @@ -145,11 +145,11 @@ public class CmdFactionsShow extends FCommand { if (follower.isOnline() && Mixin.isVisible(me, follower.getId())) { - memberOnlineNames.add(follower.getNameAndTitle(fme)); + memberOnlineNames.add(follower.getNameAndTitle(usender)); } else { - memberOfflineNames.add(follower.getNameAndTitle(fme)); + memberOfflineNames.add(follower.getNameAndTitle(usender)); } } @@ -157,11 +157,11 @@ public class CmdFactionsShow extends FCommand { if (follower.isOnline()) { - memberOnlineNames.add(follower.getNameAndTitle(fme)); + memberOnlineNames.add(follower.getNameAndTitle(usender)); } else { - memberOfflineNames.add(follower.getNameAndTitle(fme)); + memberOfflineNames.add(follower.getNameAndTitle(usender)); } } sendMessage(Txt.parse("Members online: ") + Txt.implode(memberOnlineNames, sepparator)); diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java b/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java index c22c94b7..3dee7ce1 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsTitle.java @@ -33,7 +33,7 @@ public class CmdFactionsTitle extends FCommand if (newTitle == null) return; // Verify - if ( ! canIAdministerYou(fme, you)) return; + if ( ! canIAdministerYou(usender, you)) return; // Event FactionsEventTitleChange event = new FactionsEventTitleChange(sender, you, newTitle); @@ -45,7 +45,7 @@ public class CmdFactionsTitle extends FCommand you.setTitle(newTitle); // Inform - myFaction.msg("%s changed a title: %s", fme.describeTo(myFaction, true), you.describeTo(myFaction, true)); + usenderFaction.msg("%s changed a title: %s", usender.describeTo(usenderFaction, true), you.describeTo(usenderFaction, true)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java index 3ebd0a6e..70e6ea29 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaim.java @@ -26,10 +26,10 @@ public class CmdFactionsUnclaim extends FCommand Faction newFaction = FactionColls.get().get(me).getNone(); // FPerm - if (!FPerm.TERRITORY.has(sender, myFaction, true)) return; + if (!FPerm.TERRITORY.has(sender, usenderFaction, true)) return; // Apply - if (fme.tryClaim(newFaction, chunk, true, true)) return; + if (usender.tryClaim(newFaction, chunk, true, true)) return; } } diff --git a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaimall.java b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaimall.java index 03805136..59930b9a 100644 --- a/src/com/massivecraft/factions/cmd/CmdFactionsUnclaimall.java +++ b/src/com/massivecraft/factions/cmd/CmdFactionsUnclaimall.java @@ -30,7 +30,7 @@ public class CmdFactionsUnclaimall extends FCommand public void perform() { // Args - Faction faction = myFaction; + Faction faction = usenderFaction; Faction newFaction = FactionColls.get().get(faction).getNone(); // FPerm @@ -58,12 +58,12 @@ public class CmdFactionsUnclaimall extends FCommand } // Inform - myFaction.msg("%s unclaimed 5 of your 200 faction land. You now have 23 land left.", fme.describeTo(myFaction, true), countSuccess, countTotal, countFail); + usenderFaction.msg("%s unclaimed 5 of your 200 faction land. You now have 23 land left.", usender.describeTo(usenderFaction, true), countSuccess, countTotal, countFail); // Log if (MConf.get().logLandUnclaims) { - Factions.get().log(fme.getName()+" unclaimed everything for the faction: "+myFaction.getName()); + Factions.get().log(usender.getName()+" unclaimed everything for the faction: "+usenderFaction.getName()); } } diff --git a/src/com/massivecraft/factions/cmd/FCommand.java b/src/com/massivecraft/factions/cmd/FCommand.java index cb9503c2..e9d95d99 100644 --- a/src/com/massivecraft/factions/cmd/FCommand.java +++ b/src/com/massivecraft/factions/cmd/FCommand.java @@ -9,16 +9,16 @@ import com.massivecraft.mcore.util.Txt; public abstract class FCommand extends MCommand { - public MPlayer mme; - public UPlayer fme; - public Faction myFaction; + public MPlayer msender; + public UPlayer usender; + public Faction usenderFaction; @Override public void fixSenderVars() { - this.mme = MPlayer.get(sender); - this.fme = UPlayer.get(this.sender); - this.myFaction = this.fme.getFaction(); + this.msender = MPlayer.get(sender); + this.usender = UPlayer.get(this.sender); + this.usenderFaction = this.usender.getFaction(); } // -------------------------------------------- //