From 1d44aa0c9cbb0e0d08a47f03660c9b3b0d23d035 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Mon, 10 Oct 2011 13:40:24 +0200 Subject: [PATCH] Renamed sendMessageParsed to msg --- src/com/massivecraft/factions/FPlayer.java | 52 +++++++++---------- src/com/massivecraft/factions/Faction.java | 2 +- .../massivecraft/factions/cmd/CmdAdmin.java | 8 +-- .../factions/cmd/CmdAutoClaim.java | 8 +-- .../factions/cmd/CmdAutoSafeclaim.java | 6 +-- .../factions/cmd/CmdAutoWarclaim.java | 6 +-- .../massivecraft/factions/cmd/CmdBalance.java | 6 +-- .../massivecraft/factions/cmd/CmdBoom.java | 4 +- .../massivecraft/factions/cmd/CmdBypass.java | 4 +- .../massivecraft/factions/cmd/CmdChat.java | 10 ++-- .../massivecraft/factions/cmd/CmdConfig.java | 2 +- .../massivecraft/factions/cmd/CmdCreate.java | 8 +-- .../factions/cmd/CmdDeinvite.java | 8 +-- .../massivecraft/factions/cmd/CmdDeposit.java | 8 +-- .../factions/cmd/CmdDescription.java | 4 +- .../massivecraft/factions/cmd/CmdDisband.java | 8 +-- .../massivecraft/factions/cmd/CmdHelp.java | 2 +- .../massivecraft/factions/cmd/CmdHome.java | 12 ++--- .../massivecraft/factions/cmd/CmdInvite.java | 8 +-- .../massivecraft/factions/cmd/CmdJoin.java | 16 +++--- .../massivecraft/factions/cmd/CmdKick.java | 18 +++---- .../massivecraft/factions/cmd/CmdLock.java | 4 +- src/com/massivecraft/factions/cmd/CmdMap.java | 4 +- src/com/massivecraft/factions/cmd/CmdMod.java | 8 +-- .../massivecraft/factions/cmd/CmdOpen.java | 4 +- .../massivecraft/factions/cmd/CmdOwner.java | 16 +++--- .../factions/cmd/CmdOwnerList.java | 10 ++-- src/com/massivecraft/factions/cmd/CmdPay.java | 8 +-- .../factions/cmd/CmdPeaceful.java | 4 +- .../factions/cmd/CmdPermanent.java | 4 +- .../massivecraft/factions/cmd/CmdPower.java | 2 +- .../massivecraft/factions/cmd/CmdReload.java | 4 +- .../factions/cmd/CmdSafeclaim.java | 2 +- .../factions/cmd/CmdSafeunclaimall.java | 2 +- .../massivecraft/factions/cmd/CmdSaveAll.java | 2 +- .../massivecraft/factions/cmd/CmdSethome.java | 8 +-- .../massivecraft/factions/cmd/CmdShow.java | 14 ++--- src/com/massivecraft/factions/cmd/CmdTag.java | 6 +-- .../massivecraft/factions/cmd/CmdTitle.java | 2 +- .../massivecraft/factions/cmd/CmdUnclaim.java | 20 +++---- .../factions/cmd/CmdUnclaimall.java | 6 +-- .../massivecraft/factions/cmd/CmdVersion.java | 2 +- .../factions/cmd/CmdWarclaim.java | 2 +- .../factions/cmd/CmdWarunclaimall.java | 2 +- .../factions/cmd/CmdWithdraw.java | 8 +-- .../massivecraft/factions/cmd/FCommand.java | 4 +- .../factions/cmd/FRelationCommand.java | 22 ++++---- .../massivecraft/factions/zcore/MCommand.java | 12 ++--- 48 files changed, 191 insertions(+), 191 deletions(-) diff --git a/src/com/massivecraft/factions/FPlayer.java b/src/com/massivecraft/factions/FPlayer.java index 09cf7dfd..87630db7 100644 --- a/src/com/massivecraft/factions/FPlayer.java +++ b/src/com/massivecraft/factions/FPlayer.java @@ -558,13 +558,13 @@ public class FPlayer extends PlayerEntity if (!perm && this.getRole() == Role.ADMIN && myFaction.getFPlayers().size() > 1) { - sendMessageParsed("You must give the admin role to someone else first."); + msg("You must give the admin role to someone else first."); return; } if (!Conf.CanLeaveWithNegativePower && this.getPower() < 0) { - sendMessageParsed("You cannot leave until your power is positive."); + msg("You cannot leave until your power is positive."); return; } @@ -576,23 +576,23 @@ public class FPlayer extends PlayerEntity if (cost > 0.0) { String costString = Econ.moneyString(cost); if (!Econ.deductMoney(this.getName(), cost)) { - sendMessageParsed("It costs %s to leave your faction, which you can't currently afford.", costString); + msg("It costs %s to leave your faction, which you can't currently afford.", costString); return; } - sendMessageParsed("You have paid %s to leave your faction.", costString); + msg("You have paid %s to leave your faction.", costString); } // wait... we pay you to leave? else if (cost < 0.0) { String costString = Econ.moneyString(-cost); Econ.addMoney(this.getName(), -cost); - sendMessageParsed("You have been paid %s for leaving your faction.", costString); + msg("You have been paid %s for leaving your faction.", costString); } } if (myFaction.isNormal()) { - myFaction.sendMessageParsed("%s left your faction.", this.getNameAndRelevant(myFaction)); + myFaction.msg("%s left your faction.", this.getNameAndRelevant(myFaction)); } this.resetFactionData(); @@ -602,7 +602,7 @@ public class FPlayer extends PlayerEntity // Remove this faction for (FPlayer fplayer : FPlayers.i.getOnline()) { - fplayer.sendMessageParsed("The faction %s was disbanded.", myFaction.getTag(fplayer)); + fplayer.msg("The faction %s was disbanded.", myFaction.getTag(fplayer)); } //Faction.delete(myFaction.getId()); myFaction.detach(); @@ -622,59 +622,59 @@ public class FPlayer extends PlayerEntity if (Conf.worldGuardChecking && Worldguard.checkForRegionsInChunk(loc)) { // Checks for WorldGuard regions in the chunk attempting to be claimed - sendMessageParsed("This land is protected"); + msg("This land is protected"); return false; } if (myFaction == otherFaction) { if (notifyFailure) - sendMessageParsed("You already own this land."); + msg("You already own this land."); return false; } if (this.getRole().value < Role.MODERATOR.value) { - sendMessageParsed("You must be "+Role.MODERATOR+" to claim land."); + msg("You must be "+Role.MODERATOR+" to claim land."); return false; } if (myFaction.getFPlayers().size() < Conf.claimsRequireMinFactionMembers && ! this.isAdminBypassing()) { - sendMessageParsed("Your faction must have at least %s members to claim land.", Conf.claimsRequireMinFactionMembers); + msg("Your faction must have at least %s members to claim land.", Conf.claimsRequireMinFactionMembers); return false; } if (Conf.worldsNoClaiming.contains(flocation.getWorldName())) { - sendMessageParsed("Sorry, this world has land claiming disabled."); + msg("Sorry, this world has land claiming disabled."); return false; } if (otherFaction.isSafeZone()) { if (notifyFailure) - sendMessageParsed("You can not claim a Safe Zone."); + msg("You can not claim a Safe Zone."); return false; } else if (otherFaction.isWarZone()) { if (notifyFailure) - sendMessageParsed("You can not claim a War Zone."); + msg("You can not claim a War Zone."); return false; } int ownedLand = myFaction.getLandRounded(); if (ownedLand >= myFaction.getPowerRounded()) { - sendMessageParsed("You can't claim more land! You need more power!"); + msg("You can't claim more land! You need more power!"); return false; } if (otherFaction.getRelation(this) == Relation.ALLY) { if (notifyFailure) - sendMessageParsed("You can't claim the land of your allies."); + msg("You can't claim the land of your allies."); return false; } @@ -688,9 +688,9 @@ public class FPlayer extends PlayerEntity ) { if (Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction) - sendMessageParsed("You can only claim additional land which is connected to your first claim or controlled by another faction!"); + msg("You can only claim additional land which is connected to your first claim or controlled by another faction!"); else - sendMessageParsed("You can only claim additional land which is connected to your first claim!"); + msg("You can only claim additional land which is connected to your first claim!"); return false; } @@ -698,26 +698,26 @@ public class FPlayer extends PlayerEntity { if (myFaction.isPeaceful()) { - sendMessageParsed("%s owns this land. Your faction is peaceful, so you cannot claim land from other factions.", otherFaction.getTag(this)); + msg("%s owns this land. Your faction is peaceful, so you cannot claim land from other factions.", otherFaction.getTag(this)); return false; } if (otherFaction.isPeaceful()) { - sendMessageParsed("%s owns this land, and is a peaceful faction. You cannot claim land from them.", otherFaction.getTag(this)); + msg("%s owns this land, and is a peaceful faction. You cannot claim land from them.", otherFaction.getTag(this)); return false; } if ( ! otherFaction.hasLandInflation()) { // TODO more messages WARN current faction most importantly - sendMessageParsed("%s owns this land and is strong enough to keep it.", otherFaction.getTag(this)); + msg("%s owns this land and is strong enough to keep it.", otherFaction.getTag(this)); return false; } if ( ! Board.isBorderLocation(flocation)) { - sendMessageParsed("You must start claiming land at the border of the territory."); + msg("You must start claiming land at the border of the territory."); return false; } } @@ -734,20 +734,20 @@ public class FPlayer extends PlayerEntity if( ! faction.removeMoney(cost)) { - sendMessageParsed("It costs %s to claim this land, which your faction can't currently afford.", costString); + msg("It costs %s to claim this land, which your faction can't currently afford.", costString); return false; } else { // TODO: Only I can see this right? - sendMessageParsed("%s has paid %s to claim some land.", faction.getTag(this), costString); + msg("%s has paid %s to claim some land.", faction.getTag(this), costString); } } else { if ( ! Econ.deductMoney(this.getId(), cost)) { - sendMessageParsed("Claiming this land will cost %s, which you can't currently afford.", costString); + msg("Claiming this land will cost %s, which you can't currently afford.", costString); return false; } sendMessage("You have paid "+costString+" to claim this land."); @@ -894,7 +894,7 @@ public class FPlayer extends PlayerEntity return true; }*/ - public void sendMessageParsed(String str, Object... args) + public void msg(String str, Object... args) { this.sendMessage(P.p.txt.parse(str, args)); } diff --git a/src/com/massivecraft/factions/Faction.java b/src/com/massivecraft/factions/Faction.java index 63f19ff6..3e0b3dac 100644 --- a/src/com/massivecraft/factions/Faction.java +++ b/src/com/massivecraft/factions/Faction.java @@ -412,7 +412,7 @@ public class Faction extends Entity //----------------------------------------------// // Messages //----------------------------------------------// - public void sendMessageParsed(String message, Object... args) + public void msg(String message, Object... args) { message = P.p.txt.parse(message, args); diff --git a/src/com/massivecraft/factions/cmd/CmdAdmin.java b/src/com/massivecraft/factions/cmd/CmdAdmin.java index e777ecb8..b9910bd2 100644 --- a/src/com/massivecraft/factions/cmd/CmdAdmin.java +++ b/src/com/massivecraft/factions/cmd/CmdAdmin.java @@ -32,13 +32,13 @@ public class CmdAdmin extends FCommand if (fyou.getFaction() != myFaction) { - sendMessageParsed("%s is not a member in your faction.", fyou.getNameAndRelevant(fme)); + msg("%s is not a member in your faction.", fyou.getNameAndRelevant(fme)); return; } if (fyou == fme) { - sendMessageParsed("The target player musn't be yourself."); + msg("The target player musn't be yourself."); return; } @@ -50,11 +50,11 @@ public class CmdAdmin extends FCommand { if (fplayer.getFaction() == myFaction) { - fplayer.sendMessageParsed("%s gave %s the leadership of your faction.", fme.getNameAndRelevant(fme), fyou.getNameAndRelevant(fme)); + fplayer.msg("%s gave %s the leadership of your faction.", fme.getNameAndRelevant(fme), fyou.getNameAndRelevant(fme)); } else { - fplayer.sendMessageParsed("%s gave %s the leadership of %s", fme.getNameAndRelevant(fplayer), fyou.getNameAndRelevant(fplayer), myFaction.getTag(fplayer)); + fplayer.msg("%s gave %s the leadership of %s", fme.getNameAndRelevant(fplayer), fyou.getNameAndRelevant(fplayer), myFaction.getTag(fplayer)); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdAutoClaim.java b/src/com/massivecraft/factions/cmd/CmdAutoClaim.java index 209939ae..cd45cf8e 100644 --- a/src/com/massivecraft/factions/cmd/CmdAutoClaim.java +++ b/src/com/massivecraft/factions/cmd/CmdAutoClaim.java @@ -32,7 +32,7 @@ public class CmdAutoClaim extends FCommand if ( ! enabled) { - sendMessageParsed("Auto-claiming of land disabled."); + msg("Auto-claiming of land disabled."); return; } @@ -40,19 +40,19 @@ public class CmdAutoClaim extends FCommand if (Conf.worldsNoClaiming.contains(flocation.getWorldName())) { - sendMessageParsed("Sorry, this world has land claiming disabled."); + msg("Sorry, this world has land claiming disabled."); fme.setIsAutoClaimEnabled(false); return; } if (myFaction.getLandRounded() >= myFaction.getPowerRounded()) { - sendMessageParsed("You can't claim more land! You need more power!"); + msg("You can't claim more land! You need more power!"); fme.setIsAutoClaimEnabled(false); return; } - sendMessageParsed("Auto-claiming of land enabled."); + msg("Auto-claiming of land enabled."); fme.attemptClaim(false); } diff --git a/src/com/massivecraft/factions/cmd/CmdAutoSafeclaim.java b/src/com/massivecraft/factions/cmd/CmdAutoSafeclaim.java index 2e519577..bf87439c 100644 --- a/src/com/massivecraft/factions/cmd/CmdAutoSafeclaim.java +++ b/src/com/massivecraft/factions/cmd/CmdAutoSafeclaim.java @@ -36,18 +36,18 @@ public class CmdAutoSafeclaim extends FCommand if ( ! enabled) { - sendMessageParsed("Auto-claiming of safe zone disabled."); + msg("Auto-claiming of safe zone disabled."); return; } - sendMessageParsed("Auto-claiming of safe zone enabled."); + msg("Auto-claiming of safe zone enabled."); FLocation playerFlocation = new FLocation(fme); if (!Board.getFactionAt(playerFlocation).isSafeZone()) { Board.setFactionAt(Factions.i.getSafeZone(), playerFlocation); - sendMessageParsed("This land is now a safe zone."); + msg("This land is now a safe zone."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdAutoWarclaim.java b/src/com/massivecraft/factions/cmd/CmdAutoWarclaim.java index 5c5cb1fc..33142f3e 100644 --- a/src/com/massivecraft/factions/cmd/CmdAutoWarclaim.java +++ b/src/com/massivecraft/factions/cmd/CmdAutoWarclaim.java @@ -39,18 +39,18 @@ public class CmdAutoWarclaim extends FCommand if ( ! enabled) { - sendMessageParsed("Auto-claiming of war zone disabled."); + msg("Auto-claiming of war zone disabled."); return; } - sendMessageParsed("Auto-claiming of war zone enabled."); + msg("Auto-claiming of war zone enabled."); FLocation playerFlocation = new FLocation(fme); if (!Board.getFactionAt(playerFlocation).isWarZone()) { Board.setFactionAt(Factions.i.getWarZone(), playerFlocation); - sendMessageParsed("This land is now a war zone."); + msg("This land is now a war zone."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdBalance.java b/src/com/massivecraft/factions/cmd/CmdBalance.java index f9cbbdaf..74b9920e 100644 --- a/src/com/massivecraft/factions/cmd/CmdBalance.java +++ b/src/com/massivecraft/factions/cmd/CmdBalance.java @@ -38,17 +38,17 @@ public class CmdBalance extends FCommand // TODO MAKE HIERARCHIAL COMMAND STRUCTURE HERE if ( faction != myFaction && ! Permission.BALANCE_ANY.has(sender)) { - sendMessageParsed("You do not have sufficient permissions to view the bank balance of other factions."); + msg("You do not have sufficient permissions to view the bank balance of other factions."); return; } if (faction == null) { - sendMessageParsed("Faction %s could not be found.", args.get(0)); + msg("Faction %s could not be found.", args.get(0)); return; } - sendMessageParsed("%s balance: %s", faction.getTag(fme), Econ.moneyString(faction.getMoney())); + msg("%s balance: %s", faction.getTag(fme), Econ.moneyString(faction.getMoney())); } } diff --git a/src/com/massivecraft/factions/cmd/CmdBoom.java b/src/com/massivecraft/factions/cmd/CmdBoom.java index 13ec5dec..245fb81c 100644 --- a/src/com/massivecraft/factions/cmd/CmdBoom.java +++ b/src/com/massivecraft/factions/cmd/CmdBoom.java @@ -27,7 +27,7 @@ public class CmdBoom extends FCommand { if ( ! myFaction.isPeaceful()) { - fme.sendMessageParsed("This command is only usable by factions which are specially designated as peaceful."); + fme.msg("This command is only usable by factions which are specially designated as peaceful."); return; } @@ -39,6 +39,6 @@ public class CmdBoom extends FCommand String enabled = myFaction.noExplosionsInTerritory() ? "disabled" : "enabled"; // Inform - myFaction.sendMessageParsed("%s has "+enabled+" explosions in your faction's territory.", fme.getNameAndRelevant(myFaction)); + myFaction.msg("%s has "+enabled+" explosions in your faction's territory.", fme.getNameAndRelevant(myFaction)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdBypass.java b/src/com/massivecraft/factions/cmd/CmdBypass.java index c24523a5..d9ba4abd 100644 --- a/src/com/massivecraft/factions/cmd/CmdBypass.java +++ b/src/com/massivecraft/factions/cmd/CmdBypass.java @@ -30,12 +30,12 @@ public class CmdBypass extends FCommand // TODO: Move this to a transient field in the model?? if ( fme.isAdminBypassing()) { - fme.sendMessageParsed("You have enabled admin bypass mode. You will be able to build or destroy anywhere."); + fme.msg("You have enabled admin bypass mode. You will be able to build or destroy anywhere."); P.p.log(fme.getName() + " has ENABLED admin bypass mode."); } else { - fme.sendMessageParsed("You have disabled admin bypass mode."); + fme.msg("You have disabled admin bypass mode."); P.p.log(fme.getName() + " DISABLED admin bypass mode."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdChat.java b/src/com/massivecraft/factions/cmd/CmdChat.java index 72f8e694..801dedcf 100644 --- a/src/com/massivecraft/factions/cmd/CmdChat.java +++ b/src/com/massivecraft/factions/cmd/CmdChat.java @@ -30,7 +30,7 @@ public class CmdChat extends FCommand { if ( ! Conf.factionOnlyChat ) { - sendMessageParsed("Faction-only chat is disabled on this server."); + msg("Faction-only chat is disabled on this server."); return; } @@ -54,7 +54,7 @@ public class CmdChat extends FCommand } else { - sendMessageParsed("Unrecognised chat mode. Please enter either 'a','f' or 'p'"); + msg("Unrecognised chat mode. Please enter either 'a','f' or 'p'"); return; } } @@ -63,15 +63,15 @@ public class CmdChat extends FCommand if(fme.getChatMode() == ChatMode.PUBLIC) { - sendMessageParsed("Public chat mode."); + msg("Public chat mode."); } else if (fme.getChatMode() == ChatMode.ALLIANCE ) { - sendMessageParsed("Alliance only chat mode."); + msg("Alliance only chat mode."); } else { - sendMessageParsed("Faction only chat mode."); + msg("Faction only chat mode."); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdConfig.java b/src/com/massivecraft/factions/cmd/CmdConfig.java index dcd3d58c..bc6208ff 100644 --- a/src/com/massivecraft/factions/cmd/CmdConfig.java +++ b/src/com/massivecraft/factions/cmd/CmdConfig.java @@ -61,7 +61,7 @@ public class CmdConfig extends FCommand if (fieldName == null || fieldName.isEmpty()) { - sendMessageParsed("No configuration setting \"%s\" exists.", field); + msg("No configuration setting \"%s\" exists.", field); return; } diff --git a/src/com/massivecraft/factions/cmd/CmdCreate.java b/src/com/massivecraft/factions/cmd/CmdCreate.java index ee4c499f..81eeaaec 100644 --- a/src/com/massivecraft/factions/cmd/CmdCreate.java +++ b/src/com/massivecraft/factions/cmd/CmdCreate.java @@ -37,13 +37,13 @@ public class CmdCreate extends FCommand if (fme.hasFaction()) { - sendMessageParsed("You must leave your current faction first."); + msg("You must leave your current faction first."); return; } if (Factions.i.isTagTaken(tag)) { - sendMessageParsed("That tag is already in use."); + msg("That tag is already in use."); return; } @@ -67,10 +67,10 @@ public class CmdCreate extends FCommand for (FPlayer follower : FPlayers.i.getOnline()) { - follower.sendMessageParsed("%s created a new faction %s", fme.getNameAndRelevant(follower), faction.getTag(follower)); + follower.msg("%s created a new faction %s", fme.getNameAndRelevant(follower), faction.getTag(follower)); } - sendMessageParsed("You should now: %s", p.cmdBase.cmdDescription.getUseageTemplate()); + msg("You should now: %s", p.cmdBase.cmdDescription.getUseageTemplate()); } } diff --git a/src/com/massivecraft/factions/cmd/CmdDeinvite.java b/src/com/massivecraft/factions/cmd/CmdDeinvite.java index 6c33009c..c004561d 100644 --- a/src/com/massivecraft/factions/cmd/CmdDeinvite.java +++ b/src/com/massivecraft/factions/cmd/CmdDeinvite.java @@ -32,15 +32,15 @@ public class CmdDeinvite extends FCommand if (you.getFaction() == myFaction) { - sendMessageParsed("%s is already a member of %s", you.getName(), myFaction.getTag()); - sendMessageParsed("You might want to: %s", new CmdKick().getUseageTemplate(false)); + msg("%s is already a member of %s", you.getName(), myFaction.getTag()); + msg("You might want to: %s", new CmdKick().getUseageTemplate(false)); return; } myFaction.deinvite(you); - you.sendMessageParsed("%s revoked your invitation to %s", fme.getNameAndRelevant(you), myFaction.getTag(you)); - myFaction.sendMessageParsed("%s revoked %s's invitation.", fme.getNameAndRelevant(fme), you.getNameAndRelevant(fme)); + you.msg("%s revoked your invitation to %s", fme.getNameAndRelevant(you), myFaction.getTag(you)); + myFaction.msg("%s revoked %s's invitation.", fme.getNameAndRelevant(fme), you.getNameAndRelevant(fme)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdDeposit.java b/src/com/massivecraft/factions/cmd/CmdDeposit.java index f6489bbc..93d7835a 100644 --- a/src/com/massivecraft/factions/cmd/CmdDeposit.java +++ b/src/com/massivecraft/factions/cmd/CmdDeposit.java @@ -44,20 +44,20 @@ public class CmdDeposit extends FCommand if( ! Econ.deductMoney(fme.getName(), amount ) ) { - sendMessageParsed("You cannot afford to deposit that much."); + msg("You cannot afford to deposit that much."); } else { faction.addMoney(amount); - sendMessageParsed("You have deposited %s into %s's bank.", amountString, faction.getTag()); - sendMessageParsed("%s now has %s", faction.getTag(fme), Econ.moneyString(faction.getMoney())); + msg("You have deposited %s into %s's bank.", amountString, faction.getTag()); + msg("%s now has %s", faction.getTag(fme), Econ.moneyString(faction.getMoney())); P.p.log(fme.getName() + " deposited "+amountString+" into "+faction.getTag()+"'s bank."); for (FPlayer fplayer : FPlayers.i.getOnline()) { if (fplayer.getFaction() == faction) { - fplayer.sendMessageParsed("%s has deposited %s", fme.getNameAndRelevant(fplayer), amountString); + fplayer.msg("%s has deposited %s", fme.getNameAndRelevant(fplayer), amountString); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdDescription.java b/src/com/massivecraft/factions/cmd/CmdDescription.java index b4da39b7..cd476bad 100644 --- a/src/com/massivecraft/factions/cmd/CmdDescription.java +++ b/src/com/massivecraft/factions/cmd/CmdDescription.java @@ -39,8 +39,8 @@ public class CmdDescription extends FCommand // Broadcast the description to everyone for (FPlayer fplayer : FPlayers.i.getOnline()) { - fplayer.sendMessageParsed("The faction "+fplayer.getRelationColor(fme)+myFaction.getTag()+" changed their description to:"); - fplayer.sendMessageParsed(""+myFaction.getDescription()); + fplayer.msg("The faction "+fplayer.getRelationColor(fme)+myFaction.getTag()+" changed their description to:"); + fplayer.msg(""+myFaction.getDescription()); } } diff --git a/src/com/massivecraft/factions/cmd/CmdDisband.java b/src/com/massivecraft/factions/cmd/CmdDisband.java index 4cb9ca89..cee2cc8a 100644 --- a/src/com/massivecraft/factions/cmd/CmdDisband.java +++ b/src/com/massivecraft/factions/cmd/CmdDisband.java @@ -53,7 +53,7 @@ public class CmdDisband extends FCommand if (faction.isPermanent()) { - sendMessageParsed("This faction is designated as permanent, so you cannot disband it."); + msg("This faction is designated as permanent, so you cannot disband it."); return; } @@ -63,11 +63,11 @@ public class CmdDisband extends FCommand String who = senderIsConsole ? "A server admin" : fme.getNameAndRelevant(fplayer); if (fplayer.getFaction() == faction) { - fplayer.sendMessageParsed("%s disbanded your faction.", who); + fplayer.msg("%s disbanded your faction.", who); } else { - fplayer.sendMessageParsed("%s disbanded the faction %s.", who, faction.getTag(fplayer)); + fplayer.msg("%s disbanded the faction %s.", who, faction.getTag(fplayer)); } } @@ -78,7 +78,7 @@ public class CmdDisband extends FCommand if (amount > 0.0) { String amountString = Econ.moneyString(amount); - sendMessageParsed("You have been given the disbanded faction's bank, totaling %s.", amountString); + msg("You have been given the disbanded faction's bank, totaling %s.", amountString); P.p.log(fme.getName() + " has been given bank holdings of "+amountString+" from disbanding "+faction.getTag()+"."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdHelp.java b/src/com/massivecraft/factions/cmd/CmdHelp.java index 987ed120..15bb30c2 100644 --- a/src/com/massivecraft/factions/cmd/CmdHelp.java +++ b/src/com/massivecraft/factions/cmd/CmdHelp.java @@ -43,7 +43,7 @@ public class CmdHelp extends FCommand if (page < 0 || page >= helpPages.size()) { - sendMessageParsed("This page does not exist"); + msg("This page does not exist"); return; } sendMessage(helpPages.get(page)); diff --git a/src/com/massivecraft/factions/cmd/CmdHome.java b/src/com/massivecraft/factions/cmd/CmdHome.java index 454126df..847bf29b 100644 --- a/src/com/massivecraft/factions/cmd/CmdHome.java +++ b/src/com/massivecraft/factions/cmd/CmdHome.java @@ -40,32 +40,32 @@ public class CmdHome extends FCommand // TODO: Hide this command on help also. if ( ! Conf.homesEnabled) { - fme.sendMessageParsed("Sorry, Faction homes are disabled on this server."); + fme.msg("Sorry, Faction homes are disabled on this server."); return; } if ( ! Conf.homesTeleportCommandEnabled) { - fme.sendMessageParsed("Sorry, the ability to teleport to Faction homes is disabled on this server."); + fme.msg("Sorry, the ability to teleport to Faction homes is disabled on this server."); return; } if ( ! myFaction.hasHome()) { - fme.sendMessageParsed("You faction does not have a home. " + (fme.getRole().value < Role.MODERATOR.value ? " Ask your leader to:" : "You should:")); + fme.msg("You faction does not have a home. " + (fme.getRole().value < Role.MODERATOR.value ? " Ask your leader to:" : "You should:")); fme.sendMessage(p.cmdBase.cmdSethome.getUseageTemplate()); return; } if ( ! Conf.homesTeleportAllowedFromEnemyTerritory && fme.isInEnemyTerritory()) { - fme.sendMessageParsed("You cannot teleport to your faction home while in the territory of an enemy faction."); + fme.msg("You cannot teleport to your faction home while in the territory of an enemy faction."); return; } if ( ! Conf.homesTeleportAllowedFromDifferentWorld && me.getWorld().getUID() != myFaction.getHome().getWorld().getUID()) { - fme.sendMessageParsed("You cannot teleport to your faction home while in a different world."); + fme.msg("You cannot teleport to your faction home while in a different world."); return; } @@ -114,7 +114,7 @@ public class CmdHome extends FCommand if (dx > max || dy > max || dz > max) continue; - fme.sendMessageParsed("You cannot teleport to your faction home while an enemy is within " + Conf.homesTeleportAllowedEnemyDistance + " blocks of you."); + fme.msg("You cannot teleport to your faction home while an enemy is within " + Conf.homesTeleportAllowedEnemyDistance + " blocks of you."); return; } } diff --git a/src/com/massivecraft/factions/cmd/CmdInvite.java b/src/com/massivecraft/factions/cmd/CmdInvite.java index e9b107de..c9db369a 100644 --- a/src/com/massivecraft/factions/cmd/CmdInvite.java +++ b/src/com/massivecraft/factions/cmd/CmdInvite.java @@ -32,8 +32,8 @@ public class CmdInvite extends FCommand if (you.getFaction() == myFaction) { - sendMessageParsed("%s is already a member of %s", you.getName(), myFaction.getTag()); - sendMessageParsed("You might want to: " + new CmdKick().getUseageTemplate(false)); + msg("%s is already a member of %s", you.getName(), myFaction.getTag()); + msg("You might want to: " + new CmdKick().getUseageTemplate(false)); return; } @@ -45,8 +45,8 @@ public class CmdInvite extends FCommand myFaction.invite(you); - you.sendMessageParsed("%s invited you to %s", fme.getNameAndRelevant(you), myFaction.getTag(you)); - myFaction.sendMessageParsed("%s invited %s to your faction.", fme.getNameAndRelevant(fme), you.getNameAndRelevant(fme)); + you.msg("%s invited you to %s", fme.getNameAndRelevant(you), myFaction.getTag(you)); + myFaction.msg("%s invited %s to your faction.", fme.getNameAndRelevant(fme), you.getNameAndRelevant(fme)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdJoin.java b/src/com/massivecraft/factions/cmd/CmdJoin.java index eb360987..bc08f90f 100644 --- a/src/com/massivecraft/factions/cmd/CmdJoin.java +++ b/src/com/massivecraft/factions/cmd/CmdJoin.java @@ -31,32 +31,32 @@ public class CmdJoin extends FCommand if ( ! faction.isNormal()) { - sendMessageParsed("You may only join normal factions. This is a system faction."); + msg("You may only join normal factions. This is a system faction."); return; } if (faction == myFaction) { - sendMessageParsed("You are already a member of %s", faction.getTag(fme)); + msg("You are already a member of %s", faction.getTag(fme)); return; } if (fme.hasFaction()) { - sendMessageParsed("You must leave your current faction first."); + msg("You must leave your current faction first."); return; } if (!Conf.CanLeaveWithNegativePower && fme.getPower() < 0) { - sendMessageParsed("You cannot join a faction until your power is positive."); + msg("You cannot join a faction until your power is positive."); return; } if( ! faction.getOpen() && ! faction.isInvited(fme)) { - sendMessageParsed("This faction requires invitation."); - faction.sendMessageParsed("%s tried to join your faction.", fme.getNameAndRelevant(faction)); + msg("This faction requires invitation."); + faction.msg("%s tried to join your faction.", fme.getNameAndRelevant(faction)); return; } @@ -66,8 +66,8 @@ public class CmdJoin extends FCommand return; } - fme.sendMessageParsed("You successfully joined %s", faction.getTag(fme)); - faction.sendMessageParsed("%s joined your faction.", fme.getNameAndRelevant(faction)); + fme.msg("You successfully joined %s", faction.getTag(fme)); + faction.msg("%s joined your faction.", fme.getNameAndRelevant(faction)); fme.resetFactionData(); fme.setFaction(faction); diff --git a/src/com/massivecraft/factions/cmd/CmdKick.java b/src/com/massivecraft/factions/cmd/CmdKick.java index 07b9e08e..78ef0824 100644 --- a/src/com/massivecraft/factions/cmd/CmdKick.java +++ b/src/com/massivecraft/factions/cmd/CmdKick.java @@ -34,8 +34,8 @@ public class CmdKick extends FCommand if (fme == you) { - sendMessageParsed("You cannot kick yourself."); - sendMessageParsed("You might want to: %s", new CmdLeave().getUseageTemplate(false)); + msg("You cannot kick yourself."); + msg("You might want to: %s", new CmdLeave().getUseageTemplate(false)); return; } @@ -46,20 +46,20 @@ public class CmdKick extends FCommand { if (yourFaction != myFaction) { - sendMessageParsed("%s is not a member of %s", you.getNameAndRelevant(fme), myFaction.getTag(fme)); + msg("%s is not a member of %s", you.getNameAndRelevant(fme), myFaction.getTag(fme)); return; } if (you.getRole().value >= fme.getRole().value) { // TODO add more informative messages. - sendMessageParsed("Your rank is too low to kick this player."); + msg("Your rank is too low to kick this player."); return; } if ( ! Conf.CanLeaveWithNegativePower && you.getPower() < 0) { - sendMessageParsed("You cannot kick that member until their power is positive."); + msg("You cannot kick that member until their power is positive."); return; } } @@ -70,11 +70,11 @@ public class CmdKick extends FCommand return; } - yourFaction.sendMessageParsed("%s kicked %s from the faction! :O", fme.getNameAndRelevant(yourFaction), you.getNameAndRelevant(yourFaction)); - you.sendMessageParsed("%s kicked you from %s! :O", fme.getNameAndRelevant(you), yourFaction.getTag(you)); + yourFaction.msg("%s kicked %s from the faction! :O", fme.getNameAndRelevant(yourFaction), you.getNameAndRelevant(yourFaction)); + you.msg("%s kicked you from %s! :O", fme.getNameAndRelevant(you), yourFaction.getTag(you)); if (yourFaction != myFaction) { - fme.sendMessageParsed("You kicked %s from the faction %s!", you.getNameAndRelevant(myFaction), yourFaction.getTag(fme)); + fme.msg("You kicked %s from the faction %s!", you.getNameAndRelevant(myFaction), yourFaction.getTag(fme)); } yourFaction.deinvite(you); @@ -85,7 +85,7 @@ public class CmdKick extends FCommand // Remove this faction for (FPlayer fplayer : FPlayers.i.getOnline()) { - fplayer.sendMessageParsed("The faction %s was disbanded.", yourFaction.getTag(fplayer)); + fplayer.msg("The faction %s was disbanded.", yourFaction.getTag(fplayer)); } yourFaction.detach(); } diff --git a/src/com/massivecraft/factions/cmd/CmdLock.java b/src/com/massivecraft/factions/cmd/CmdLock.java index e16c76a8..d811d0a6 100644 --- a/src/com/massivecraft/factions/cmd/CmdLock.java +++ b/src/com/massivecraft/factions/cmd/CmdLock.java @@ -35,11 +35,11 @@ public class CmdLock extends FCommand { if( p.getLocked()) { - sendMessageParsed("Factions is now locked"); + msg("Factions is now locked"); } else { - sendMessageParsed("Factions in now unlocked"); + msg("Factions in now unlocked"); } } diff --git a/src/com/massivecraft/factions/cmd/CmdMap.java b/src/com/massivecraft/factions/cmd/CmdMap.java index 9a1f831b..50bca56b 100644 --- a/src/com/massivecraft/factions/cmd/CmdMap.java +++ b/src/com/massivecraft/factions/cmd/CmdMap.java @@ -38,7 +38,7 @@ public class CmdMap extends FCommand if ( ! payForCommand(Conf.econCostMap)) return; fme.setMapAutoUpdating(true); - sendMessageParsed("Map auto update ENABLED."); + msg("Map auto update ENABLED."); // And show the map once showMap(); @@ -47,7 +47,7 @@ public class CmdMap extends FCommand { // Turn off fme.setMapAutoUpdating(false); - sendMessageParsed("Map auto update DISABLED."); + msg("Map auto update DISABLED."); } } else diff --git a/src/com/massivecraft/factions/cmd/CmdMod.java b/src/com/massivecraft/factions/cmd/CmdMod.java index dc29e31c..49e376d7 100644 --- a/src/com/massivecraft/factions/cmd/CmdMod.java +++ b/src/com/massivecraft/factions/cmd/CmdMod.java @@ -32,13 +32,13 @@ public class CmdMod extends FCommand if (you.getFaction() != myFaction) { - sendMessageParsed("%s is not a member in your faction.", you.getNameAndRelevant(fme)); + msg("%s is not a member in your faction.", you.getNameAndRelevant(fme)); return; } if (you == fme) { - sendMessageParsed("The target player musn't be yourself."); + msg("The target player musn't be yourself."); return; } @@ -46,13 +46,13 @@ public class CmdMod extends FCommand { // Revoke you.setRole(Role.NORMAL); - myFaction.sendMessageParsed("%s is no longer moderator in your faction.", you.getNameAndRelevant(myFaction)); + myFaction.msg("%s is no longer moderator in your faction.", you.getNameAndRelevant(myFaction)); } else { // Give you.setRole(Role.MODERATOR); - myFaction.sendMessageParsed("%s was promoted to moderator in your faction.", you.getNameAndRelevant(myFaction)); + myFaction.msg("%s was promoted to moderator in your faction.", you.getNameAndRelevant(myFaction)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdOpen.java b/src/com/massivecraft/factions/cmd/CmdOpen.java index d7db64db..5478c478 100644 --- a/src/com/massivecraft/factions/cmd/CmdOpen.java +++ b/src/com/massivecraft/factions/cmd/CmdOpen.java @@ -35,14 +35,14 @@ public class CmdOpen extends FCommand String open = myFaction.getOpen() ? "open" : "closed"; // Inform - myFaction.sendMessageParsed("%s changed the faction to %s.", fme.getNameAndRelevant(myFaction), open); + myFaction.msg("%s changed the faction to %s.", fme.getNameAndRelevant(myFaction), open); for (Faction faction : Factions.i.get()) { if (faction == myFaction) { continue; } - faction.sendMessageParsed("The faction %s is now %s", myFaction.getTag(faction), open); + faction.msg("The faction %s is now %s", myFaction.getTag(faction), open); } } diff --git a/src/com/massivecraft/factions/cmd/CmdOwner.java b/src/com/massivecraft/factions/cmd/CmdOwner.java index 74d2c0b6..0928b4cb 100644 --- a/src/com/massivecraft/factions/cmd/CmdOwner.java +++ b/src/com/massivecraft/factions/cmd/CmdOwner.java @@ -42,13 +42,13 @@ public class CmdOwner extends FCommand if ( ! Conf.ownedAreasEnabled) { - fme.sendMessageParsed("Sorry, but owned areas are disabled on this server."); + fme.msg("Sorry, but owned areas are disabled on this server."); return; } if ( ! hasBypass && Conf.ownedAreasLimitPerFaction > 0 && myFaction.getCountOfClaimsWithOwners() >= Conf.ownedAreasLimitPerFaction) { - fme.sendMessageParsed("Sorry, but you have reached the server's limit of %d owned areas per faction.", Conf.ownedAreasLimitPerFaction); + fme.msg("Sorry, but you have reached the server's limit of %d owned areas per faction.", Conf.ownedAreasLimitPerFaction); return; } @@ -64,13 +64,13 @@ public class CmdOwner extends FCommand { if ( ! hasBypass) { - fme.sendMessageParsed("This land is not claimed by your faction, so you can't set ownership of it."); + fme.msg("This land is not claimed by your faction, so you can't set ownership of it."); return; } if ( ! factionHere.isNormal()) { - fme.sendMessageParsed("This land is not claimed by a faction. Ownership is not possible."); + fme.msg("This land is not claimed by a faction. Ownership is not possible."); return; } } @@ -82,7 +82,7 @@ public class CmdOwner extends FCommand if (target.getFaction() != myFaction) { - fme.sendMessageParsed("%s is not a member of this faction.", playerName); + fme.msg("%s is not a member of this faction.", playerName); return; } @@ -90,14 +90,14 @@ public class CmdOwner extends FCommand if (args.isEmpty() && myFaction.doesLocationHaveOwnersSet(flocation)) { myFaction.clearClaimOwnership(flocation); - fme.sendMessageParsed("You have cleared ownership for this claimed area."); + fme.msg("You have cleared ownership for this claimed area."); return; } if (myFaction.isPlayerInOwnerList(playerName, flocation)) { myFaction.removePlayerAsOwner(playerName, flocation); - fme.sendMessageParsed("You have removed ownership of this claimed land from %s.", playerName); + fme.msg("You have removed ownership of this claimed land from %s.", playerName); return; } @@ -105,6 +105,6 @@ public class CmdOwner extends FCommand if ( ! payForCommand(Conf.econCostOwner)) return; myFaction.setPlayerAsOwner(playerName, flocation); - fme.sendMessageParsed("You have added %s to the owner list for this claimed land.", playerName); + fme.msg("You have added %s to the owner list for this claimed land.", playerName); } } diff --git a/src/com/massivecraft/factions/cmd/CmdOwnerList.java b/src/com/massivecraft/factions/cmd/CmdOwnerList.java index d7b1f4e6..3f8d8c75 100644 --- a/src/com/massivecraft/factions/cmd/CmdOwnerList.java +++ b/src/com/massivecraft/factions/cmd/CmdOwnerList.java @@ -38,7 +38,7 @@ public class CmdOwnerList extends FCommand if ( ! Conf.ownedAreasEnabled) { - fme.sendMessageParsed("Owned areas are disabled on this server."); + fme.msg("Owned areas are disabled on this server."); return; } @@ -48,14 +48,14 @@ public class CmdOwnerList extends FCommand { if (!hasBypass) { - fme.sendMessageParsed("This land is not claimed by your faction."); + fme.msg("This land is not claimed by your faction."); return; } myFaction = Board.getFactionAt(flocation); if (!myFaction.isNormal()) { - fme.sendMessageParsed("This land is not claimed by any faction, thus no owners."); + fme.msg("This land is not claimed by any faction, thus no owners."); return; } } @@ -64,10 +64,10 @@ public class CmdOwnerList extends FCommand if (owners == null || owners.isEmpty()) { - fme.sendMessageParsed("No owners are set here; everyone in the faction has access."); + fme.msg("No owners are set here; everyone in the faction has access."); return; } - fme.sendMessageParsed("Current owner(s) of this land: %s", owners); + fme.msg("Current owner(s) of this land: %s", owners); } } diff --git a/src/com/massivecraft/factions/cmd/CmdPay.java b/src/com/massivecraft/factions/cmd/CmdPay.java index a5ece5fc..12345507 100644 --- a/src/com/massivecraft/factions/cmd/CmdPay.java +++ b/src/com/massivecraft/factions/cmd/CmdPay.java @@ -36,7 +36,7 @@ public class CmdPay extends FCommand if ( ! Conf.bankMembersCanWithdraw && ! assertMinRole(Role.MODERATOR)) { - sendMessageParsed("Only faction moderators or admins are able to pay another faction."); + msg("Only faction moderators or admins are able to pay another faction."); return; } @@ -57,15 +57,15 @@ public class CmdPay extends FCommand us.removeMoney(amount); them.addMoney(amount); - sendMessageParsed("You have paid "+amountString+" from "+us.getTag()+"'s bank to "+them.getTag()+"'s bank."); - sendMessageParsed(""+us.getTag()+" now has "+Econ.moneyString(us.getMoney())); + msg("You have paid "+amountString+" from "+us.getTag()+"'s bank to "+them.getTag()+"'s bank."); + msg(""+us.getTag()+" now has "+Econ.moneyString(us.getMoney())); P.p.log(fme.getName() + " paid "+amountString+" from "+us.getTag()+"'s bank to "+them.getTag()+"'s bank."); for (FPlayer fplayer : FPlayers.i.getOnline()) { if (fplayer.getFaction() == us || fplayer.getFaction() == them) { - fplayer.sendMessageParsed(fme.getNameAndRelevant(fplayer)+" has sent "+amountString+" from "+us.getTag()+" to "+them.getTag()); + fplayer.msg(fme.getNameAndRelevant(fplayer)+" has sent "+amountString+" from "+us.getTag()+" to "+them.getTag()); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdPeaceful.java b/src/com/massivecraft/factions/cmd/CmdPeaceful.java index a8a62321..d4879356 100644 --- a/src/com/massivecraft/factions/cmd/CmdPeaceful.java +++ b/src/com/massivecraft/factions/cmd/CmdPeaceful.java @@ -49,11 +49,11 @@ public class CmdPeaceful extends FCommand { if (fplayer.getFaction() == faction) { - fplayer.sendMessageParsed(fme.getNameAndRelevant(fplayer)+" has "+change+" your faction."); + fplayer.msg(fme.getNameAndRelevant(fplayer)+" has "+change+" your faction."); } else { - fplayer.sendMessageParsed(fme.getNameAndRelevant(fplayer)+" has "+change+" the faction \"" + faction.getTag(fplayer) + "\"."); + fplayer.msg(fme.getNameAndRelevant(fplayer)+" has "+change+" the faction \"" + faction.getTag(fplayer) + "\"."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdPermanent.java b/src/com/massivecraft/factions/cmd/CmdPermanent.java index 8cc40a0a..d9883740 100644 --- a/src/com/massivecraft/factions/cmd/CmdPermanent.java +++ b/src/com/massivecraft/factions/cmd/CmdPermanent.java @@ -48,11 +48,11 @@ public class CmdPermanent extends FCommand { if (fplayer.getFaction() == faction) { - fplayer.sendMessageParsed(fme.getNameAndRelevant(fplayer)+" has "+change+" your faction."); + fplayer.msg(fme.getNameAndRelevant(fplayer)+" has "+change+" your faction."); } else { - fplayer.sendMessageParsed(fme.getNameAndRelevant(fplayer)+" has "+change+" the faction \"" + faction.getTag(fplayer) + "\"."); + fplayer.msg(fme.getNameAndRelevant(fplayer)+" has "+change+" the faction \"" + faction.getTag(fplayer) + "\"."); } } } diff --git a/src/com/massivecraft/factions/cmd/CmdPower.java b/src/com/massivecraft/factions/cmd/CmdPower.java index 146b8830..bbefc5bf 100644 --- a/src/com/massivecraft/factions/cmd/CmdPower.java +++ b/src/com/massivecraft/factions/cmd/CmdPower.java @@ -36,7 +36,7 @@ public class CmdPower extends FCommand // if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay if ( ! payForCommand(Conf.econCostPower)) return; - sendMessageParsed("%s - Power / Maxpower: %d / %d", target.getNameAndRelevant(fme), target.getPowerRounded(), target.getPowerMaxRounded()); + msg("%s - Power / Maxpower: %d / %d", target.getNameAndRelevant(fme), target.getPowerRounded(), target.getPowerMaxRounded()); } } diff --git a/src/com/massivecraft/factions/cmd/CmdReload.java b/src/com/massivecraft/factions/cmd/CmdReload.java index 2aca7f24..2aae4132 100644 --- a/src/com/massivecraft/factions/cmd/CmdReload.java +++ b/src/com/massivecraft/factions/cmd/CmdReload.java @@ -66,13 +66,13 @@ public class CmdReload extends FCommand else { P.p.log("RELOAD CANCELLED - SPECIFIED FILE INVALID"); - sendMessageParsed("Invalid file specified. Valid files: all, conf, board, factions, players"); + msg("Invalid file specified. Valid files: all, conf, board, factions, players"); return; } long timeReload = (System.currentTimeMillis()-timeInitStart); - sendMessageParsed("Reloaded %s from disk, took %dms.", fileName, timeReload); + msg("Reloaded %s from disk, took %dms.", fileName, timeReload); } } diff --git a/src/com/massivecraft/factions/cmd/CmdSafeclaim.java b/src/com/massivecraft/factions/cmd/CmdSafeclaim.java index 6854150c..f6169f00 100644 --- a/src/com/massivecraft/factions/cmd/CmdSafeclaim.java +++ b/src/com/massivecraft/factions/cmd/CmdSafeclaim.java @@ -44,7 +44,7 @@ public class CmdSafeclaim extends FCommand Board.setFactionAt(Factions.i.getSafeZone(), locToClaim); } - sendMessageParsed("You claimed %d chunks for the safe zone.", (1+radius*2)*(1+radius*2)); + msg("You claimed %d chunks for the safe zone.", (1+radius*2)*(1+radius*2)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdSafeunclaimall.java b/src/com/massivecraft/factions/cmd/CmdSafeunclaimall.java index a01ad132..415ffeaa 100644 --- a/src/com/massivecraft/factions/cmd/CmdSafeunclaimall.java +++ b/src/com/massivecraft/factions/cmd/CmdSafeunclaimall.java @@ -30,7 +30,7 @@ public class CmdSafeunclaimall extends FCommand public void perform() { Board.unclaimAll(Factions.i.getSafeZone().getId()); - sendMessageParsed("You unclaimed ALL safe zone land."); + msg("You unclaimed ALL safe zone land."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdSaveAll.java b/src/com/massivecraft/factions/cmd/CmdSaveAll.java index 13854470..bf0e85bd 100644 --- a/src/com/massivecraft/factions/cmd/CmdSaveAll.java +++ b/src/com/massivecraft/factions/cmd/CmdSaveAll.java @@ -34,7 +34,7 @@ public class CmdSaveAll extends FCommand Factions.i.saveToDisc(); Board.save(); Conf.save(); - sendMessageParsed("Factions saved to disk!"); + msg("Factions saved to disk!"); } } \ No newline at end of file diff --git a/src/com/massivecraft/factions/cmd/CmdSethome.java b/src/com/massivecraft/factions/cmd/CmdSethome.java index 1d04850c..465f8590 100644 --- a/src/com/massivecraft/factions/cmd/CmdSethome.java +++ b/src/com/massivecraft/factions/cmd/CmdSethome.java @@ -30,7 +30,7 @@ public class CmdSethome extends FCommand { if ( ! Conf.homesEnabled) { - fme.sendMessageParsed("Sorry, Faction homes are disabled on this server."); + fme.msg("Sorry, Faction homes are disabled on this server."); return; } @@ -57,7 +57,7 @@ public class CmdSethome extends FCommand Board.getFactionAt(new FLocation(me)) != faction ) { - fme.sendMessageParsed("Sorry, your faction home can only be set inside your own claimed territory."); + fme.msg("Sorry, your faction home can only be set inside your own claimed territory."); return; } @@ -66,11 +66,11 @@ public class CmdSethome extends FCommand faction.setHome(me.getLocation()); - faction.sendMessageParsed("%s set the home for your faction. You can now use:", fme.getNameAndRelevant(myFaction)); + faction.msg("%s set the home for your faction. You can now use:", fme.getNameAndRelevant(myFaction)); faction.sendMessage(p.cmdBase.cmdHome.getUseageTemplate()); if (faction != myFaction) { - fme.sendMessageParsed("You have set the home for the "+faction.getTag(fme)+" faction."); + fme.msg("You have set the home for the "+faction.getTag(fme)+" faction."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdShow.java b/src/com/massivecraft/factions/cmd/CmdShow.java index 976cabd5..cfa78676 100644 --- a/src/com/massivecraft/factions/cmd/CmdShow.java +++ b/src/com/massivecraft/factions/cmd/CmdShow.java @@ -47,8 +47,8 @@ public class CmdShow extends FCommand Collection mods = faction.getFPlayersWhereRole(Role.MODERATOR); Collection normals = faction.getFPlayersWhereRole(Role.NORMAL); - sendMessageParsed(p.txt.titleize(faction.getTag(fme))); - sendMessageParsed("Description: %s", faction.getDescription()); + msg(p.txt.titleize(faction.getTag(fme))); + msg("Description: %s", faction.getDescription()); if ( ! faction.isNormal()) { return; @@ -60,12 +60,12 @@ public class CmdShow extends FCommand peaceStatus = " "+Conf.colorNeutral+"This faction is Peaceful"; } - sendMessageParsed("Joining: "+(faction.getOpen() ? "no invitation is needed" : "invitation is required")+peaceStatus); - sendMessageParsed("Land / Power / Maxpower: %d/%d/%d", faction.getLandRounded(), faction.getPowerRounded(), faction.getPowerMaxRounded()); + msg("Joining: "+(faction.getOpen() ? "no invitation is needed" : "invitation is required")+peaceStatus); + msg("Land / Power / Maxpower: %d/%d/%d", faction.getLandRounded(), faction.getPowerRounded(), faction.getPowerMaxRounded()); if (faction.isPermanent()) { - sendMessageParsed("This faction is permanent, remaining even with no members."); + msg("This faction is permanent, remaining even with no members."); } // show the land value @@ -77,12 +77,12 @@ public class CmdShow extends FCommand { String stringValue = Econ.moneyString(value); String stringRefund = (refund > 0.0) ? (" ("+Econ.moneyString(refund)+" depreciated)") : ""; - sendMessageParsed("Total land value: " + stringValue + stringRefund); + msg("Total land value: " + stringValue + stringRefund); } //Show bank contents if(Conf.bankEnabled) { - sendMessageParsed("Bank contains: "+Econ.moneyString(faction.getMoney())); + msg("Bank contains: "+Econ.moneyString(faction.getMoney())); } } diff --git a/src/com/massivecraft/factions/cmd/CmdTag.java b/src/com/massivecraft/factions/cmd/CmdTag.java index f1b8e630..f9b0d105 100644 --- a/src/com/massivecraft/factions/cmd/CmdTag.java +++ b/src/com/massivecraft/factions/cmd/CmdTag.java @@ -36,7 +36,7 @@ public class CmdTag extends FCommand // TODO does not first test cover selfcase? if (Factions.i.isTagTaken(tag) && ! MiscUtil.getComparisonString(tag).equals(myFaction.getComparisonTag())) { - sendMessageParsed("That tag is already taken"); + msg("That tag is already taken"); return; } @@ -55,14 +55,14 @@ public class CmdTag extends FCommand myFaction.setTag(tag); // Inform - myFaction.sendMessageParsed("%s changed your faction tag to %s", fme.getNameAndRelevant(myFaction), myFaction.getTag(myFaction)); + myFaction.msg("%s changed your faction tag to %s", fme.getNameAndRelevant(myFaction), myFaction.getTag(myFaction)); for (Faction faction : Factions.i.get()) { if (faction == myFaction) { continue; } - faction.sendMessageParsed("The faction %s changed their name to %s.", fme.getRelationColor(faction)+oldtag, myFaction.getTag(faction)); + faction.msg("The faction %s changed their name to %s.", fme.getRelationColor(faction)+oldtag, myFaction.getTag(faction)); } if (Conf.spoutFactionTagsOverNames) diff --git a/src/com/massivecraft/factions/cmd/CmdTitle.java b/src/com/massivecraft/factions/cmd/CmdTitle.java index 4974c8b6..28a6c6ca 100644 --- a/src/com/massivecraft/factions/cmd/CmdTitle.java +++ b/src/com/massivecraft/factions/cmd/CmdTitle.java @@ -41,7 +41,7 @@ public class CmdTitle extends FCommand you.setTitle(title); // Inform - myFaction.sendMessageParsed("%s changed a title: %s", fme.getNameAndRelevant(myFaction), you.getNameAndRelevant(myFaction)); + myFaction.msg("%s changed a title: %s", fme.getNameAndRelevant(myFaction), you.getNameAndRelevant(myFaction)); if (Conf.spoutFactionTitlesOverNames) { diff --git a/src/com/massivecraft/factions/cmd/CmdUnclaim.java b/src/com/massivecraft/factions/cmd/CmdUnclaim.java index 72ab2173..4ddf55d7 100644 --- a/src/com/massivecraft/factions/cmd/CmdUnclaim.java +++ b/src/com/massivecraft/factions/cmd/CmdUnclaim.java @@ -38,11 +38,11 @@ public class CmdUnclaim extends FCommand if (Permission.MANAGE_SAFE_ZONE.has(sender)) { Board.removeAt(flocation); - sendMessageParsed("Safe zone was unclaimed."); + msg("Safe zone was unclaimed."); } else { - sendMessageParsed("This is a safe zone. You lack permissions to unclaim."); + msg("This is a safe zone. You lack permissions to unclaim."); } return; } @@ -51,11 +51,11 @@ public class CmdUnclaim extends FCommand if (Permission.MANAGE_WAR_ZONE.has(sender)) { Board.removeAt(flocation); - sendMessageParsed("War zone was unclaimed."); + msg("War zone was unclaimed."); } else { - sendMessageParsed("This is a war zone. You lack permissions to unclaim."); + msg("This is a war zone. You lack permissions to unclaim."); } return; } @@ -64,8 +64,8 @@ public class CmdUnclaim extends FCommand { Board.removeAt(flocation); - otherFaction.sendMessageParsed("%s unclaimed some of your land.", fme.getNameAndRelevant(otherFaction)); - sendMessageParsed("You unclaimed this land."); + otherFaction.msg("%s unclaimed some of your land.", fme.getNameAndRelevant(otherFaction)); + msg("You unclaimed this land."); return; } @@ -82,7 +82,7 @@ public class CmdUnclaim extends FCommand if ( myFaction != otherFaction) { - sendMessageParsed("You don't own this land."); + msg("You don't own this land."); return; } @@ -113,7 +113,7 @@ public class CmdUnclaim extends FCommand Faction faction = myFaction; if(!faction.removeMoney(-refund)) { - sendMessageParsed("Unclaiming this land will cost %s which your faction can't currently afford.", Econ.moneyString(-refund)); + msg("Unclaiming this land will cost %s which your faction can't currently afford.", Econ.moneyString(-refund)); return; } moneyBack = " It cost "+faction.getTag()+" "+Econ.moneyString(refund)+"."; @@ -122,7 +122,7 @@ public class CmdUnclaim extends FCommand { if (!Econ.deductMoney(fme.getName(), -refund)) { - sendMessageParsed("Unclaiming this land will cost %s which you can't currently afford.", Econ.moneyString(-refund)); + msg("Unclaiming this land will cost %s which you can't currently afford.", Econ.moneyString(-refund)); return; } moneyBack = " It cost them "+Econ.moneyString(refund)+"."; @@ -136,7 +136,7 @@ public class CmdUnclaim extends FCommand } Board.removeAt(flocation); - myFaction.sendMessageParsed("%s unclaimed some land."+moneyBack, fme.getNameAndRelevant(myFaction)); + myFaction.msg("%s unclaimed some land."+moneyBack, fme.getNameAndRelevant(myFaction)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdUnclaimall.java b/src/com/massivecraft/factions/cmd/CmdUnclaimall.java index dee26730..78422f84 100644 --- a/src/com/massivecraft/factions/cmd/CmdUnclaimall.java +++ b/src/com/massivecraft/factions/cmd/CmdUnclaimall.java @@ -55,7 +55,7 @@ public class CmdUnclaimall extends FCommand Faction faction = myFaction; if(!faction.removeMoney(-refund)) { - sendMessageParsed("Unclaiming all faction land will cost "+Econ.moneyString(-refund)+", which your faction can't currently afford."); + msg("Unclaiming all faction land will cost "+Econ.moneyString(-refund)+", which your faction can't currently afford."); return; } moneyBack = " It cost "+faction.getTag()+" "+Econ.moneyString(refund)+"."; @@ -64,7 +64,7 @@ public class CmdUnclaimall extends FCommand { if (!Econ.deductMoney(fme.getName(), -refund)) { - sendMessageParsed("Unclaiming all faction land will cost "+Econ.moneyString(-refund)+", which you can't currently afford."); + msg("Unclaiming all faction land will cost "+Econ.moneyString(-refund)+", which you can't currently afford."); return; } moneyBack = " It cost them "+Econ.moneyString(refund)+"."; @@ -79,7 +79,7 @@ public class CmdUnclaimall extends FCommand } Board.unclaimAll(myFaction.getId()); - myFaction.sendMessageParsed("%s unclaimed ALL of your faction's land."+moneyBack, fme.getNameAndRelevant(myFaction)); + myFaction.msg("%s unclaimed ALL of your faction's land."+moneyBack, fme.getNameAndRelevant(myFaction)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdVersion.java b/src/com/massivecraft/factions/cmd/CmdVersion.java index 0517ab05..8614cf51 100644 --- a/src/com/massivecraft/factions/cmd/CmdVersion.java +++ b/src/com/massivecraft/factions/cmd/CmdVersion.java @@ -25,6 +25,6 @@ public class CmdVersion extends FCommand @Override public void perform() { - sendMessageParsed("You are running "+P.p.getDescription().getFullName()); + msg("You are running "+P.p.getDescription().getFullName()); } } diff --git a/src/com/massivecraft/factions/cmd/CmdWarclaim.java b/src/com/massivecraft/factions/cmd/CmdWarclaim.java index b512ac38..6a460efc 100644 --- a/src/com/massivecraft/factions/cmd/CmdWarclaim.java +++ b/src/com/massivecraft/factions/cmd/CmdWarclaim.java @@ -43,6 +43,6 @@ public class CmdWarclaim extends FCommand Board.setFactionAt(Factions.i.getWarZone(), locToClaim); } - sendMessageParsed("You claimed %d chunks for the war zone.", (1+radius*2)*(1+radius*2)); + msg("You claimed %d chunks for the war zone.", (1+radius*2)*(1+radius*2)); } } diff --git a/src/com/massivecraft/factions/cmd/CmdWarunclaimall.java b/src/com/massivecraft/factions/cmd/CmdWarunclaimall.java index 5117a5d9..4caac2eb 100644 --- a/src/com/massivecraft/factions/cmd/CmdWarunclaimall.java +++ b/src/com/massivecraft/factions/cmd/CmdWarunclaimall.java @@ -30,7 +30,7 @@ public class CmdWarunclaimall extends FCommand public void perform() { Board.unclaimAll(Factions.i.getWarZone().getId()); - sendMessageParsed("You unclaimed ALL war zone land."); + msg("You unclaimed ALL war zone land."); } } diff --git a/src/com/massivecraft/factions/cmd/CmdWithdraw.java b/src/com/massivecraft/factions/cmd/CmdWithdraw.java index b8a184d3..960f9a8d 100644 --- a/src/com/massivecraft/factions/cmd/CmdWithdraw.java +++ b/src/com/massivecraft/factions/cmd/CmdWithdraw.java @@ -36,7 +36,7 @@ public class CmdWithdraw extends FCommand if ( ! Conf.bankMembersCanWithdraw && ! assertMinRole(Role.MODERATOR)) { - sendMessageParsed("Only faction moderators or admins are able to withdraw from the bank."); + msg("Only faction moderators or admins are able to withdraw from the bank."); return; } @@ -57,8 +57,8 @@ public class CmdWithdraw extends FCommand faction.removeMoney(amount); Econ.addMoney(fme.getName(), amount); - sendMessageParsed("You have withdrawn "+amountString+" from "+faction.getTag()+"'s bank."); - sendMessageParsed(""+faction.getTag()+" now has "+Econ.moneyString(faction.getMoney())); + msg("You have withdrawn "+amountString+" from "+faction.getTag()+"'s bank."); + msg(""+faction.getTag()+" now has "+Econ.moneyString(faction.getMoney())); P.p.log(fme.getName() + " withdrew "+amountString+" from "+faction.getTag()+"'s bank."); // TODO: FAction.getOnlineMembers(). @@ -66,7 +66,7 @@ public class CmdWithdraw extends FCommand { if (fplayer.getFaction() == faction) { - fplayer.sendMessageParsed("%s has withdrawn %s", fme.getNameAndRelevant(fplayer), amountString); + fplayer.msg("%s has withdrawn %s", fme.getNameAndRelevant(fplayer), amountString); } } } diff --git a/src/com/massivecraft/factions/cmd/FCommand.java b/src/com/massivecraft/factions/cmd/FCommand.java index 053cf13f..874587f4 100644 --- a/src/com/massivecraft/factions/cmd/FCommand.java +++ b/src/com/massivecraft/factions/cmd/FCommand.java @@ -59,7 +59,7 @@ public abstract class FCommand extends MCommand

{ if (p.getLocked() && this.disableOnLock) { - sendMessageParsed("Factions was locked by an admin. Please try again later."); + msg("Factions was locked by an admin. Please try again later."); return false; } return true; @@ -120,7 +120,7 @@ public abstract class FCommand extends MCommand

if (fme.getRole().value < role.value) { - sendMessageParsed("You must be "+role+" to "+this.getHelpShort()+"."); + msg("You must be "+role+" to "+this.getHelpShort()+"."); return false; } return true; diff --git a/src/com/massivecraft/factions/cmd/FRelationCommand.java b/src/com/massivecraft/factions/cmd/FRelationCommand.java index 933c808b..fa154169 100644 --- a/src/com/massivecraft/factions/cmd/FRelationCommand.java +++ b/src/com/massivecraft/factions/cmd/FRelationCommand.java @@ -35,13 +35,13 @@ public abstract class FRelationCommand extends FCommand if ( ! them.isNormal()) { - sendMessageParsed("Nope! You can't."); + msg("Nope! You can't."); return; } if (them == myFaction) { - sendMessageParsed("Nope! You can't declare a relation to yourself :)"); + msg("Nope! You can't declare a relation to yourself :)"); return; } @@ -53,26 +53,26 @@ public abstract class FRelationCommand extends FCommand ChatColor currentRelationColor = currentRelation.getColor(); if (targetRelation.value == currentRelation.value) { - them.sendMessageParsed("Your faction is now "+currentRelationColor+targetRelation.toString()+" to "+currentRelationColor+myFaction.getTag()); - myFaction.sendMessageParsed("Your faction is now "+currentRelationColor+targetRelation.toString()+" to "+currentRelationColor+them.getTag()); + them.msg("Your faction is now "+currentRelationColor+targetRelation.toString()+" to "+currentRelationColor+myFaction.getTag()); + myFaction.msg("Your faction is now "+currentRelationColor+targetRelation.toString()+" to "+currentRelationColor+them.getTag()); } else { - them.sendMessageParsed(currentRelationColor+myFaction.getTag()+" wishes to be your "+targetRelation.getColor()+targetRelation.toString()); - them.sendMessageParsed("Type /"+Conf.baseCommandAliases.get(0)+" "+targetRelation+" "+myFaction.getTag()+" to accept."); - myFaction.sendMessageParsed(currentRelationColor+them.getTag()+" were informed that you wish to be "+targetRelation.getColor()+targetRelation); + them.msg(currentRelationColor+myFaction.getTag()+" wishes to be your "+targetRelation.getColor()+targetRelation.toString()); + them.msg("Type /"+Conf.baseCommandAliases.get(0)+" "+targetRelation+" "+myFaction.getTag()+" to accept."); + myFaction.msg(currentRelationColor+them.getTag()+" were informed that you wish to be "+targetRelation.getColor()+targetRelation); } if ( ! targetRelation.isNeutral() && them.isPeaceful()) { - them.sendMessageParsed("This will have no effect while your faction is peaceful."); - myFaction.sendMessageParsed("This will have no effect while their faction is peaceful."); + them.msg("This will have no effect while your faction is peaceful."); + myFaction.msg("This will have no effect while their faction is peaceful."); } if ( ! targetRelation.isNeutral() && myFaction.isPeaceful()) { - them.sendMessageParsed("This will have no effect while their faction is peaceful."); - myFaction.sendMessageParsed("This will have no effect while your faction is peaceful."); + them.msg("This will have no effect while their faction is peaceful."); + myFaction.msg("This will have no effect while your faction is peaceful."); } SpoutFeatures.updateAppearances(myFaction, them); diff --git a/src/com/massivecraft/factions/zcore/MCommand.java b/src/com/massivecraft/factions/zcore/MCommand.java index 87007dc2..63180d96 100644 --- a/src/com/massivecraft/factions/zcore/MCommand.java +++ b/src/com/massivecraft/factions/zcore/MCommand.java @@ -173,7 +173,7 @@ public abstract class MCommand { if (informSenderIfNot) { - sendMessageParsed(Lang.commandSenderMustBePlayer); + msg(Lang.commandSenderMustBePlayer); } return false; } @@ -192,7 +192,7 @@ public abstract class MCommand { if (sender != null) { - sendMessageParsed(Lang.commandToFewArgs); + msg(Lang.commandToFewArgs); sender.sendMessage(this.getUseageTemplate()); } return false; @@ -204,7 +204,7 @@ public abstract class MCommand { // Get the to many string slice List theToMany = args.subList(this.requiredArgs.size() + this.optionalArgs.size(), args.size()); - sendMessageParsed(Lang.commandToManyArgs, TextUtil.implode(theToMany, " ")); + msg(Lang.commandToManyArgs, TextUtil.implode(theToMany, " ")); sender.sendMessage(this.getUseageTemplate()); } return false; @@ -284,7 +284,7 @@ public abstract class MCommand // Message Sending Helpers // -------------------------------------------- // - public void sendMessageParsed(String str, Object... args) + public void msg(String str, Object... args) { sender.sendMessage(p.txt.parse(str, args)); } @@ -415,7 +415,7 @@ public abstract class MCommand if (msg && ret == null) { - this.sendMessageParsed("No player \"

%s\" could not be found.", name); + this.msg("No player \"

%s\" could not be found.", name); } return ret; @@ -450,7 +450,7 @@ public abstract class MCommand if (msg && ret == null) { - this.sendMessageParsed("No player match found for \"

%s\".", name); + this.msg("No player match found for \"

%s\".", name); } return ret;