Renamed sendMessageParsed to msg

This commit is contained in:
Olof Larsson 2011-10-10 13:40:24 +02:00
parent aceeea8b0e
commit 1d44aa0c9c
48 changed files with 191 additions and 191 deletions

View File

@ -558,13 +558,13 @@ public class FPlayer extends PlayerEntity
if (!perm && this.getRole() == Role.ADMIN && myFaction.getFPlayers().size() > 1)
{
sendMessageParsed("<b>You must give the admin role to someone else first.");
msg("<b>You must give the admin role to someone else first.");
return;
}
if (!Conf.CanLeaveWithNegativePower && this.getPower() < 0)
{
sendMessageParsed("<b>You cannot leave until your power is positive.");
msg("<b>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("<b>It costs <h>%s<b> to leave your faction, which you can't currently afford.", costString);
msg("<b>It costs <h>%s<b> to leave your faction, which you can't currently afford.", costString);
return;
}
sendMessageParsed("<i>You have paid <h>%s<i> to leave your faction.", costString);
msg("<i>You have paid <h>%s<i> 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("<i>You have been paid <h>%s<i> for leaving your faction.", costString);
msg("<i>You have been paid <h>%s<i> for leaving your faction.", costString);
}
}
if (myFaction.isNormal())
{
myFaction.sendMessageParsed("%s<i> left your faction.", this.getNameAndRelevant(myFaction));
myFaction.msg("%s<i> 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("<i>The faction %s<i> was disbanded.", myFaction.getTag(fplayer));
fplayer.msg("<i>The faction %s<i> 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("<b>This land is protected");
msg("<b>This land is protected");
return false;
}
if (myFaction == otherFaction)
{
if (notifyFailure)
sendMessageParsed("<i>You already own this land.");
msg("<i>You already own this land.");
return false;
}
if (this.getRole().value < Role.MODERATOR.value)
{
sendMessageParsed("<i>You must be "+Role.MODERATOR+" to claim land.");
msg("<i>You must be "+Role.MODERATOR+" to claim land.");
return false;
}
if (myFaction.getFPlayers().size() < Conf.claimsRequireMinFactionMembers && ! this.isAdminBypassing())
{
sendMessageParsed("<b>Your faction must have at least <h>%s<b> members to claim land.", Conf.claimsRequireMinFactionMembers);
msg("<b>Your faction must have at least <h>%s<b> members to claim land.", Conf.claimsRequireMinFactionMembers);
return false;
}
if (Conf.worldsNoClaiming.contains(flocation.getWorldName()))
{
sendMessageParsed("<b>Sorry, this world has land claiming disabled.");
msg("<b>Sorry, this world has land claiming disabled.");
return false;
}
if (otherFaction.isSafeZone())
{
if (notifyFailure)
sendMessageParsed("<b>You can not claim a Safe Zone.");
msg("<b>You can not claim a Safe Zone.");
return false;
}
else if (otherFaction.isWarZone())
{
if (notifyFailure)
sendMessageParsed("<b>You can not claim a War Zone.");
msg("<b>You can not claim a War Zone.");
return false;
}
int ownedLand = myFaction.getLandRounded();
if (ownedLand >= myFaction.getPowerRounded())
{
sendMessageParsed("<b>You can't claim more land! You need more power!");
msg("<b>You can't claim more land! You need more power!");
return false;
}
if (otherFaction.getRelation(this) == Relation.ALLY)
{
if (notifyFailure)
sendMessageParsed("<b>You can't claim the land of your allies.");
msg("<b>You can't claim the land of your allies.");
return false;
}
@ -688,9 +688,9 @@ public class FPlayer extends PlayerEntity
)
{
if (Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction)
sendMessageParsed("<b>You can only claim additional land which is connected to your first claim or controlled by another faction!");
msg("<b>You can only claim additional land which is connected to your first claim or controlled by another faction!");
else
sendMessageParsed("<b>You can only claim additional land which is connected to your first claim!");
msg("<b>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<i> owns this land. Your faction is peaceful, so you cannot claim land from other factions.", otherFaction.getTag(this));
msg("%s<i> 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<i> owns this land, and is a peaceful faction. You cannot claim land from them.", otherFaction.getTag(this));
msg("%s<i> 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<i> owns this land and is strong enough to keep it.", otherFaction.getTag(this));
msg("%s<i> owns this land and is strong enough to keep it.", otherFaction.getTag(this));
return false;
}
if ( ! Board.isBorderLocation(flocation))
{
sendMessageParsed("<b>You must start claiming land at the border of the territory.");
msg("<b>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("<b>It costs <h>%s<b> to claim this land, which your faction can't currently afford.", costString);
msg("<b>It costs <h>%s<b> to claim this land, which your faction can't currently afford.", costString);
return false;
}
else
{
// TODO: Only I can see this right?
sendMessageParsed("%s<i> has paid <h>%s<i> to claim some land.", faction.getTag(this), costString);
msg("%s<i> has paid <h>%s<i> to claim some land.", faction.getTag(this), costString);
}
}
else
{
if ( ! Econ.deductMoney(this.getId(), cost))
{
sendMessageParsed("<b>Claiming this land will cost <h>%s<b>, which you can't currently afford.", costString);
msg("<b>Claiming this land will cost <h>%s<b>, 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));
}

View File

@ -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);

View File

@ -32,13 +32,13 @@ public class CmdAdmin extends FCommand
if (fyou.getFaction() != myFaction)
{
sendMessageParsed("%s<i> is not a member in your faction.", fyou.getNameAndRelevant(fme));
msg("%s<i> is not a member in your faction.", fyou.getNameAndRelevant(fme));
return;
}
if (fyou == fme)
{
sendMessageParsed("<b>The target player musn't be yourself.");
msg("<b>The target player musn't be yourself.");
return;
}
@ -50,11 +50,11 @@ public class CmdAdmin extends FCommand
{
if (fplayer.getFaction() == myFaction)
{
fplayer.sendMessageParsed("%s<i> gave %s<i> the leadership of your faction.", fme.getNameAndRelevant(fme), fyou.getNameAndRelevant(fme));
fplayer.msg("%s<i> gave %s<i> the leadership of your faction.", fme.getNameAndRelevant(fme), fyou.getNameAndRelevant(fme));
}
else
{
fplayer.sendMessageParsed("%s<i> gave %s<i> the leadership of %s", fme.getNameAndRelevant(fplayer), fyou.getNameAndRelevant(fplayer), myFaction.getTag(fplayer));
fplayer.msg("%s<i> gave %s<i> the leadership of %s", fme.getNameAndRelevant(fplayer), fyou.getNameAndRelevant(fplayer), myFaction.getTag(fplayer));
}
}
}

View File

@ -32,7 +32,7 @@ public class CmdAutoClaim extends FCommand
if ( ! enabled)
{
sendMessageParsed("<i>Auto-claiming of land disabled.");
msg("<i>Auto-claiming of land disabled.");
return;
}
@ -40,19 +40,19 @@ public class CmdAutoClaim extends FCommand
if (Conf.worldsNoClaiming.contains(flocation.getWorldName()))
{
sendMessageParsed("<b>Sorry, this world has land claiming disabled.");
msg("<b>Sorry, this world has land claiming disabled.");
fme.setIsAutoClaimEnabled(false);
return;
}
if (myFaction.getLandRounded() >= myFaction.getPowerRounded())
{
sendMessageParsed("<b>You can't claim more land! You need more power!");
msg("<b>You can't claim more land! You need more power!");
fme.setIsAutoClaimEnabled(false);
return;
}
sendMessageParsed("<i>Auto-claiming of land enabled.");
msg("<i>Auto-claiming of land enabled.");
fme.attemptClaim(false);
}

View File

@ -36,18 +36,18 @@ public class CmdAutoSafeclaim extends FCommand
if ( ! enabled)
{
sendMessageParsed("<i>Auto-claiming of safe zone disabled.");
msg("<i>Auto-claiming of safe zone disabled.");
return;
}
sendMessageParsed("<i>Auto-claiming of safe zone enabled.");
msg("<i>Auto-claiming of safe zone enabled.");
FLocation playerFlocation = new FLocation(fme);
if (!Board.getFactionAt(playerFlocation).isSafeZone())
{
Board.setFactionAt(Factions.i.getSafeZone(), playerFlocation);
sendMessageParsed("<i>This land is now a safe zone.");
msg("<i>This land is now a safe zone.");
}
}

View File

@ -39,18 +39,18 @@ public class CmdAutoWarclaim extends FCommand
if ( ! enabled)
{
sendMessageParsed("<i>Auto-claiming of war zone disabled.");
msg("<i>Auto-claiming of war zone disabled.");
return;
}
sendMessageParsed("<i>Auto-claiming of war zone enabled.");
msg("<i>Auto-claiming of war zone enabled.");
FLocation playerFlocation = new FLocation(fme);
if (!Board.getFactionAt(playerFlocation).isWarZone())
{
Board.setFactionAt(Factions.i.getWarZone(), playerFlocation);
sendMessageParsed("<i>This land is now a war zone.");
msg("<i>This land is now a war zone.");
}
}

View File

@ -38,17 +38,17 @@ public class CmdBalance extends FCommand
// TODO MAKE HIERARCHIAL COMMAND STRUCTURE HERE
if ( faction != myFaction && ! Permission.BALANCE_ANY.has(sender))
{
sendMessageParsed("<b>You do not have sufficient permissions to view the bank balance of other factions.");
msg("<b>You do not have sufficient permissions to view the bank balance of other factions.");
return;
}
if (faction == null)
{
sendMessageParsed("<b>Faction %s<b> could not be found.", args.get(0));
msg("<b>Faction %s<b> could not be found.", args.get(0));
return;
}
sendMessageParsed("<a>%s balance: %s", faction.getTag(fme), Econ.moneyString(faction.getMoney()));
msg("<a>%s balance: %s", faction.getTag(fme), Econ.moneyString(faction.getMoney()));
}
}

View File

@ -27,7 +27,7 @@ public class CmdBoom extends FCommand
{
if ( ! myFaction.isPeaceful())
{
fme.sendMessageParsed("<b>This command is only usable by factions which are specially designated as peaceful.");
fme.msg("<b>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<i> has "+enabled+" explosions in your faction's territory.", fme.getNameAndRelevant(myFaction));
myFaction.msg("%s<i> has "+enabled+" explosions in your faction's territory.", fme.getNameAndRelevant(myFaction));
}
}

View File

@ -30,12 +30,12 @@ public class CmdBypass extends FCommand
// TODO: Move this to a transient field in the model??
if ( fme.isAdminBypassing())
{
fme.sendMessageParsed("<i>You have enabled admin bypass mode. You will be able to build or destroy anywhere.");
fme.msg("<i>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("<i>You have disabled admin bypass mode.");
fme.msg("<i>You have disabled admin bypass mode.");
P.p.log(fme.getName() + " DISABLED admin bypass mode.");
}
}

View File

@ -30,7 +30,7 @@ public class CmdChat extends FCommand
{
if ( ! Conf.factionOnlyChat )
{
sendMessageParsed("<b>Faction-only chat is disabled on this server.");
msg("<b>Faction-only chat is disabled on this server.");
return;
}
@ -54,7 +54,7 @@ public class CmdChat extends FCommand
}
else
{
sendMessageParsed("<b>Unrecognised chat mode. <i>Please enter either 'a','f' or 'p'");
msg("<b>Unrecognised chat mode. <i>Please enter either 'a','f' or 'p'");
return;
}
}
@ -63,15 +63,15 @@ public class CmdChat extends FCommand
if(fme.getChatMode() == ChatMode.PUBLIC)
{
sendMessageParsed("<i>Public chat mode.");
msg("<i>Public chat mode.");
}
else if (fme.getChatMode() == ChatMode.ALLIANCE )
{
sendMessageParsed("<i>Alliance only chat mode.");
msg("<i>Alliance only chat mode.");
}
else
{
sendMessageParsed("<i>Faction only chat mode.");
msg("<i>Faction only chat mode.");
}
}
}

View File

@ -61,7 +61,7 @@ public class CmdConfig extends FCommand
if (fieldName == null || fieldName.isEmpty())
{
sendMessageParsed("<b>No configuration setting \"<h>%s<b>\" exists.", field);
msg("<b>No configuration setting \"<h>%s<b>\" exists.", field);
return;
}

View File

@ -37,13 +37,13 @@ public class CmdCreate extends FCommand
if (fme.hasFaction())
{
sendMessageParsed("<b>You must leave your current faction first.");
msg("<b>You must leave your current faction first.");
return;
}
if (Factions.i.isTagTaken(tag))
{
sendMessageParsed("<b>That tag is already in use.");
msg("<b>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<i> created a new faction %s", fme.getNameAndRelevant(follower), faction.getTag(follower));
follower.msg("%s<i> created a new faction %s", fme.getNameAndRelevant(follower), faction.getTag(follower));
}
sendMessageParsed("<i>You should now: %s", p.cmdBase.cmdDescription.getUseageTemplate());
msg("<i>You should now: %s", p.cmdBase.cmdDescription.getUseageTemplate());
}
}

View File

@ -32,15 +32,15 @@ public class CmdDeinvite extends FCommand
if (you.getFaction() == myFaction)
{
sendMessageParsed("%s<i> is already a member of %s", you.getName(), myFaction.getTag());
sendMessageParsed("<i>You might want to: %s", new CmdKick().getUseageTemplate(false));
msg("%s<i> is already a member of %s", you.getName(), myFaction.getTag());
msg("<i>You might want to: %s", new CmdKick().getUseageTemplate(false));
return;
}
myFaction.deinvite(you);
you.sendMessageParsed("%s<i> revoked your invitation to %s", fme.getNameAndRelevant(you), myFaction.getTag(you));
myFaction.sendMessageParsed("%s<i> revoked %s's<i> invitation.", fme.getNameAndRelevant(fme), you.getNameAndRelevant(fme));
you.msg("%s<i> revoked your invitation to %s", fme.getNameAndRelevant(you), myFaction.getTag(you));
myFaction.msg("%s<i> revoked %s's<i> invitation.", fme.getNameAndRelevant(fme), you.getNameAndRelevant(fme));
}
}

View File

@ -44,20 +44,20 @@ public class CmdDeposit extends FCommand
if( ! Econ.deductMoney(fme.getName(), amount ) )
{
sendMessageParsed("<b>You cannot afford to deposit that much.");
msg("<b>You cannot afford to deposit that much.");
}
else
{
faction.addMoney(amount);
sendMessageParsed("<i>You have deposited <h>%s<i> into <h>%s's<i> bank.", amountString, faction.getTag());
sendMessageParsed("%s<i> now has <h>%s", faction.getTag(fme), Econ.moneyString(faction.getMoney()));
msg("<i>You have deposited <h>%s<i> into <h>%s's<i> bank.", amountString, faction.getTag());
msg("%s<i> now has <h>%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<i> has deposited <h>%s", fme.getNameAndRelevant(fplayer), amountString);
fplayer.msg("%s<i> has deposited <h>%s", fme.getNameAndRelevant(fplayer), amountString);
}
}
}

View File

@ -39,8 +39,8 @@ public class CmdDescription extends FCommand
// Broadcast the description to everyone
for (FPlayer fplayer : FPlayers.i.getOnline())
{
fplayer.sendMessageParsed("<i>The faction "+fplayer.getRelationColor(fme)+myFaction.getTag()+"<i> changed their description to:");
fplayer.sendMessageParsed("<h>"+myFaction.getDescription());
fplayer.msg("<i>The faction "+fplayer.getRelationColor(fme)+myFaction.getTag()+"<i> changed their description to:");
fplayer.msg("<h>"+myFaction.getDescription());
}
}

View File

@ -53,7 +53,7 @@ public class CmdDisband extends FCommand
if (faction.isPermanent())
{
sendMessageParsed("<i>This faction is designated as permanent, so you cannot disband it.");
msg("<i>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("<h>%s<i> disbanded your faction.", who);
fplayer.msg("<h>%s<i> disbanded your faction.", who);
}
else
{
fplayer.sendMessageParsed("<h>%s<i> disbanded the faction %s.", who, faction.getTag(fplayer));
fplayer.msg("<h>%s<i> 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("<i>You have been given the disbanded faction's bank, totaling %s.", amountString);
msg("<i>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()+".");
}
}

View File

@ -43,7 +43,7 @@ public class CmdHelp extends FCommand
if (page < 0 || page >= helpPages.size())
{
sendMessageParsed("<b>This page does not exist");
msg("<b>This page does not exist");
return;
}
sendMessage(helpPages.get(page));

View File

@ -40,32 +40,32 @@ public class CmdHome extends FCommand
// TODO: Hide this command on help also.
if ( ! Conf.homesEnabled)
{
fme.sendMessageParsed("<b>Sorry, Faction homes are disabled on this server.");
fme.msg("<b>Sorry, Faction homes are disabled on this server.");
return;
}
if ( ! Conf.homesTeleportCommandEnabled)
{
fme.sendMessageParsed("<b>Sorry, the ability to teleport to Faction homes is disabled on this server.");
fme.msg("<b>Sorry, the ability to teleport to Faction homes is disabled on this server.");
return;
}
if ( ! myFaction.hasHome())
{
fme.sendMessageParsed("<b>You faction does not have a home. " + (fme.getRole().value < Role.MODERATOR.value ? "<i> Ask your leader to:" : "<i>You should:"));
fme.msg("<b>You faction does not have a home. " + (fme.getRole().value < Role.MODERATOR.value ? "<i> Ask your leader to:" : "<i>You should:"));
fme.sendMessage(p.cmdBase.cmdSethome.getUseageTemplate());
return;
}
if ( ! Conf.homesTeleportAllowedFromEnemyTerritory && fme.isInEnemyTerritory())
{
fme.sendMessageParsed("<b>You cannot teleport to your faction home while in the territory of an enemy faction.");
fme.msg("<b>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("<b>You cannot teleport to your faction home while in a different world.");
fme.msg("<b>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("<b>You cannot teleport to your faction home while an enemy is within " + Conf.homesTeleportAllowedEnemyDistance + " blocks of you.");
fme.msg("<b>You cannot teleport to your faction home while an enemy is within " + Conf.homesTeleportAllowedEnemyDistance + " blocks of you.");
return;
}
}

View File

@ -32,8 +32,8 @@ public class CmdInvite extends FCommand
if (you.getFaction() == myFaction)
{
sendMessageParsed("%s<i> is already a member of %s", you.getName(), myFaction.getTag());
sendMessageParsed("<i>You might want to: " + new CmdKick().getUseageTemplate(false));
msg("%s<i> is already a member of %s", you.getName(), myFaction.getTag());
msg("<i>You might want to: " + new CmdKick().getUseageTemplate(false));
return;
}
@ -45,8 +45,8 @@ public class CmdInvite extends FCommand
myFaction.invite(you);
you.sendMessageParsed("%s<i> invited you to %s", fme.getNameAndRelevant(you), myFaction.getTag(you));
myFaction.sendMessageParsed("%s<i> invited %s<i> to your faction.", fme.getNameAndRelevant(fme), you.getNameAndRelevant(fme));
you.msg("%s<i> invited you to %s", fme.getNameAndRelevant(you), myFaction.getTag(you));
myFaction.msg("%s<i> invited %s<i> to your faction.", fme.getNameAndRelevant(fme), you.getNameAndRelevant(fme));
}
}

View File

@ -31,32 +31,32 @@ public class CmdJoin extends FCommand
if ( ! faction.isNormal())
{
sendMessageParsed("<b>You may only join normal factions. This is a system faction.");
msg("<b>You may only join normal factions. This is a system faction.");
return;
}
if (faction == myFaction)
{
sendMessageParsed("<b>You are already a member of %s", faction.getTag(fme));
msg("<b>You are already a member of %s", faction.getTag(fme));
return;
}
if (fme.hasFaction())
{
sendMessageParsed("<b>You must leave your current faction first.");
msg("<b>You must leave your current faction first.");
return;
}
if (!Conf.CanLeaveWithNegativePower && fme.getPower() < 0)
{
sendMessageParsed("<b>You cannot join a faction until your power is positive.");
msg("<b>You cannot join a faction until your power is positive.");
return;
}
if( ! faction.getOpen() && ! faction.isInvited(fme))
{
sendMessageParsed("<i>This faction requires invitation.");
faction.sendMessageParsed("%s<i> tried to join your faction.", fme.getNameAndRelevant(faction));
msg("<i>This faction requires invitation.");
faction.msg("%s<i> tried to join your faction.", fme.getNameAndRelevant(faction));
return;
}
@ -66,8 +66,8 @@ public class CmdJoin extends FCommand
return;
}
fme.sendMessageParsed("<i>You successfully joined %s", faction.getTag(fme));
faction.sendMessageParsed("<i>%s joined your faction.", fme.getNameAndRelevant(faction));
fme.msg("<i>You successfully joined %s", faction.getTag(fme));
faction.msg("<i>%s joined your faction.", fme.getNameAndRelevant(faction));
fme.resetFactionData();
fme.setFaction(faction);

View File

@ -34,8 +34,8 @@ public class CmdKick extends FCommand
if (fme == you)
{
sendMessageParsed("<b>You cannot kick yourself.");
sendMessageParsed("<i>You might want to: %s", new CmdLeave().getUseageTemplate(false));
msg("<b>You cannot kick yourself.");
msg("<i>You might want to: %s", new CmdLeave().getUseageTemplate(false));
return;
}
@ -46,20 +46,20 @@ public class CmdKick extends FCommand
{
if (yourFaction != myFaction)
{
sendMessageParsed("%s<b> is not a member of %s", you.getNameAndRelevant(fme), myFaction.getTag(fme));
msg("%s<b> 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("<b>Your rank is too low to kick this player.");
msg("<b>Your rank is too low to kick this player.");
return;
}
if ( ! Conf.CanLeaveWithNegativePower && you.getPower() < 0)
{
sendMessageParsed("<b>You cannot kick that member until their power is positive.");
msg("<b>You cannot kick that member until their power is positive.");
return;
}
}
@ -70,11 +70,11 @@ public class CmdKick extends FCommand
return;
}
yourFaction.sendMessageParsed("%s<i> kicked %s<i> from the faction! :O", fme.getNameAndRelevant(yourFaction), you.getNameAndRelevant(yourFaction));
you.sendMessageParsed("%s<i> kicked you from %s<i>! :O", fme.getNameAndRelevant(you), yourFaction.getTag(you));
yourFaction.msg("%s<i> kicked %s<i> from the faction! :O", fme.getNameAndRelevant(yourFaction), you.getNameAndRelevant(yourFaction));
you.msg("%s<i> kicked you from %s<i>! :O", fme.getNameAndRelevant(you), yourFaction.getTag(you));
if (yourFaction != myFaction)
{
fme.sendMessageParsed("<i>You kicked %s<i> from the faction %s<i>!", you.getNameAndRelevant(myFaction), yourFaction.getTag(fme));
fme.msg("<i>You kicked %s<i> from the faction %s<i>!", 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<i> was disbanded.", yourFaction.getTag(fplayer));
fplayer.msg("The faction %s<i> was disbanded.", yourFaction.getTag(fplayer));
}
yourFaction.detach();
}

View File

@ -35,11 +35,11 @@ public class CmdLock extends FCommand {
if( p.getLocked())
{
sendMessageParsed("<i>Factions is now locked");
msg("<i>Factions is now locked");
}
else
{
sendMessageParsed("<i>Factions in now unlocked");
msg("<i>Factions in now unlocked");
}
}

View File

@ -38,7 +38,7 @@ public class CmdMap extends FCommand
if ( ! payForCommand(Conf.econCostMap)) return;
fme.setMapAutoUpdating(true);
sendMessageParsed("<i>Map auto update <green>ENABLED.");
msg("<i>Map auto update <green>ENABLED.");
// And show the map once
showMap();
@ -47,7 +47,7 @@ public class CmdMap extends FCommand
{
// Turn off
fme.setMapAutoUpdating(false);
sendMessageParsed("<i>Map auto update <red>DISABLED.");
msg("<i>Map auto update <red>DISABLED.");
}
}
else

View File

@ -32,13 +32,13 @@ public class CmdMod extends FCommand
if (you.getFaction() != myFaction)
{
sendMessageParsed("%s<b> is not a member in your faction.", you.getNameAndRelevant(fme));
msg("%s<b> is not a member in your faction.", you.getNameAndRelevant(fme));
return;
}
if (you == fme)
{
sendMessageParsed("<b>The target player musn't be yourself.");
msg("<b>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<i> is no longer moderator in your faction.", you.getNameAndRelevant(myFaction));
myFaction.msg("%s<i> is no longer moderator in your faction.", you.getNameAndRelevant(myFaction));
}
else
{
// Give
you.setRole(Role.MODERATOR);
myFaction.sendMessageParsed("%s<i> was promoted to moderator in your faction.", you.getNameAndRelevant(myFaction));
myFaction.msg("%s<i> was promoted to moderator in your faction.", you.getNameAndRelevant(myFaction));
}
}

View File

@ -35,14 +35,14 @@ public class CmdOpen extends FCommand
String open = myFaction.getOpen() ? "open" : "closed";
// Inform
myFaction.sendMessageParsed("%s<i> changed the faction to <h>%s<i>.", fme.getNameAndRelevant(myFaction), open);
myFaction.msg("%s<i> changed the faction to <h>%s<i>.", fme.getNameAndRelevant(myFaction), open);
for (Faction faction : Factions.i.get())
{
if (faction == myFaction)
{
continue;
}
faction.sendMessageParsed("<i>The faction %s<i> is now %s", myFaction.getTag(faction), open);
faction.msg("<i>The faction %s<i> is now %s", myFaction.getTag(faction), open);
}
}

View File

@ -42,13 +42,13 @@ public class CmdOwner extends FCommand
if ( ! Conf.ownedAreasEnabled)
{
fme.sendMessageParsed("<b>Sorry, but owned areas are disabled on this server.");
fme.msg("<b>Sorry, but owned areas are disabled on this server.");
return;
}
if ( ! hasBypass && Conf.ownedAreasLimitPerFaction > 0 && myFaction.getCountOfClaimsWithOwners() >= Conf.ownedAreasLimitPerFaction)
{
fme.sendMessageParsed("<b>Sorry, but you have reached the server's <h>limit of %d <b>owned areas per faction.", Conf.ownedAreasLimitPerFaction);
fme.msg("<b>Sorry, but you have reached the server's <h>limit of %d <b>owned areas per faction.", Conf.ownedAreasLimitPerFaction);
return;
}
@ -64,13 +64,13 @@ public class CmdOwner extends FCommand
{
if ( ! hasBypass)
{
fme.sendMessageParsed("<b>This land is not claimed by your faction, so you can't set ownership of it.");
fme.msg("<b>This land is not claimed by your faction, so you can't set ownership of it.");
return;
}
if ( ! factionHere.isNormal())
{
fme.sendMessageParsed("<b>This land is not claimed by a faction. Ownership is not possible.");
fme.msg("<b>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<i> is not a member of this faction.", playerName);
fme.msg("%s<i> 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("<i>You have cleared ownership for this claimed area.");
fme.msg("<i>You have cleared ownership for this claimed area.");
return;
}
if (myFaction.isPlayerInOwnerList(playerName, flocation))
{
myFaction.removePlayerAsOwner(playerName, flocation);
fme.sendMessageParsed("<i>You have removed ownership of this claimed land from %s<i>.", playerName);
fme.msg("<i>You have removed ownership of this claimed land from %s<i>.", playerName);
return;
}
@ -105,6 +105,6 @@ public class CmdOwner extends FCommand
if ( ! payForCommand(Conf.econCostOwner)) return;
myFaction.setPlayerAsOwner(playerName, flocation);
fme.sendMessageParsed("<i>You have added %s<i> to the owner list for this claimed land.", playerName);
fme.msg("<i>You have added %s<i> to the owner list for this claimed land.", playerName);
}
}

View File

@ -38,7 +38,7 @@ public class CmdOwnerList extends FCommand
if ( ! Conf.ownedAreasEnabled)
{
fme.sendMessageParsed("<b>Owned areas are disabled on this server.");
fme.msg("<b>Owned areas are disabled on this server.");
return;
}
@ -48,14 +48,14 @@ public class CmdOwnerList extends FCommand
{
if (!hasBypass)
{
fme.sendMessageParsed("<b>This land is not claimed by your faction.");
fme.msg("<b>This land is not claimed by your faction.");
return;
}
myFaction = Board.getFactionAt(flocation);
if (!myFaction.isNormal())
{
fme.sendMessageParsed("<i>This land is not claimed by any faction, thus no owners.");
fme.msg("<i>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("<i>No owners are set here; everyone in the faction has access.");
fme.msg("<i>No owners are set here; everyone in the faction has access.");
return;
}
fme.sendMessageParsed("<i>Current owner(s) of this land: %s", owners);
fme.msg("<i>Current owner(s) of this land: %s", owners);
}
}

View File

@ -36,7 +36,7 @@ public class CmdPay extends FCommand
if ( ! Conf.bankMembersCanWithdraw && ! assertMinRole(Role.MODERATOR))
{
sendMessageParsed("<b>Only faction moderators or admins are able to pay another faction.");
msg("<b>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("<i>You have paid "+amountString+" from "+us.getTag()+"'s bank to "+them.getTag()+"'s bank.");
sendMessageParsed("<i>"+us.getTag()+" now has "+Econ.moneyString(us.getMoney()));
msg("<i>You have paid "+amountString+" from "+us.getTag()+"'s bank to "+them.getTag()+"'s bank.");
msg("<i>"+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)+"<i> has sent "+amountString+" from "+us.getTag()+" to "+them.getTag());
fplayer.msg(fme.getNameAndRelevant(fplayer)+"<i> has sent "+amountString+" from "+us.getTag()+" to "+them.getTag());
}
}
}

View File

@ -49,11 +49,11 @@ public class CmdPeaceful extends FCommand
{
if (fplayer.getFaction() == faction)
{
fplayer.sendMessageParsed(fme.getNameAndRelevant(fplayer)+"<i> has "+change+" your faction.");
fplayer.msg(fme.getNameAndRelevant(fplayer)+"<i> has "+change+" your faction.");
}
else
{
fplayer.sendMessageParsed(fme.getNameAndRelevant(fplayer)+"<i> has "+change+" the faction \"" + faction.getTag(fplayer) + "\".");
fplayer.msg(fme.getNameAndRelevant(fplayer)+"<i> has "+change+" the faction \"" + faction.getTag(fplayer) + "\".");
}
}

View File

@ -48,11 +48,11 @@ public class CmdPermanent extends FCommand
{
if (fplayer.getFaction() == faction)
{
fplayer.sendMessageParsed(fme.getNameAndRelevant(fplayer)+"<i> has "+change+" your faction.");
fplayer.msg(fme.getNameAndRelevant(fplayer)+"<i> has "+change+" your faction.");
}
else
{
fplayer.sendMessageParsed(fme.getNameAndRelevant(fplayer)+"<i> has "+change+" the faction \"" + faction.getTag(fplayer) + "\".");
fplayer.msg(fme.getNameAndRelevant(fplayer)+"<i> has "+change+" the faction \"" + faction.getTag(fplayer) + "\".");
}
}
}

View File

@ -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<a> - Power / Maxpower: <i>%d / %d", target.getNameAndRelevant(fme), target.getPowerRounded(), target.getPowerMaxRounded());
msg("%s<a> - Power / Maxpower: <i>%d / %d", target.getNameAndRelevant(fme), target.getPowerRounded(), target.getPowerMaxRounded());
}
}

View File

@ -66,13 +66,13 @@ public class CmdReload extends FCommand
else
{
P.p.log("RELOAD CANCELLED - SPECIFIED FILE INVALID");
sendMessageParsed("<b>Invalid file specified. <i>Valid files: all, conf, board, factions, players");
msg("<b>Invalid file specified. <i>Valid files: all, conf, board, factions, players");
return;
}
long timeReload = (System.currentTimeMillis()-timeInitStart);
sendMessageParsed("<i>Reloaded <h>%s <i>from disk, took <h>%dms<i>.", fileName, timeReload);
msg("<i>Reloaded <h>%s <i>from disk, took <h>%dms<i>.", fileName, timeReload);
}
}

View File

@ -44,7 +44,7 @@ public class CmdSafeclaim extends FCommand
Board.setFactionAt(Factions.i.getSafeZone(), locToClaim);
}
sendMessageParsed("<i>You claimed <h>%d chunks<i> for the <a>safe zone<i>.", (1+radius*2)*(1+radius*2));
msg("<i>You claimed <h>%d chunks<i> for the <a>safe zone<i>.", (1+radius*2)*(1+radius*2));
}
}

View File

@ -30,7 +30,7 @@ public class CmdSafeunclaimall extends FCommand
public void perform()
{
Board.unclaimAll(Factions.i.getSafeZone().getId());
sendMessageParsed("<i>You unclaimed ALL safe zone land.");
msg("<i>You unclaimed ALL safe zone land.");
}
}

View File

@ -34,7 +34,7 @@ public class CmdSaveAll extends FCommand
Factions.i.saveToDisc();
Board.save();
Conf.save();
sendMessageParsed("<i>Factions saved to disk!");
msg("<i>Factions saved to disk!");
}
}

View File

@ -30,7 +30,7 @@ public class CmdSethome extends FCommand
{
if ( ! Conf.homesEnabled)
{
fme.sendMessageParsed("<b>Sorry, Faction homes are disabled on this server.");
fme.msg("<b>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("<b>Sorry, your faction home can only be set inside your own claimed territory.");
fme.msg("<b>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<i> set the home for your faction. You can now use:", fme.getNameAndRelevant(myFaction));
faction.msg("%s<i> set the home for your faction. You can now use:", fme.getNameAndRelevant(myFaction));
faction.sendMessage(p.cmdBase.cmdHome.getUseageTemplate());
if (faction != myFaction)
{
fme.sendMessageParsed("<b>You have set the home for the "+faction.getTag(fme)+"<i> faction.");
fme.msg("<b>You have set the home for the "+faction.getTag(fme)+"<i> faction.");
}
}

View File

@ -47,8 +47,8 @@ public class CmdShow extends FCommand
Collection<FPlayer> mods = faction.getFPlayersWhereRole(Role.MODERATOR);
Collection<FPlayer> normals = faction.getFPlayersWhereRole(Role.NORMAL);
sendMessageParsed(p.txt.titleize(faction.getTag(fme)));
sendMessageParsed("<a>Description: <i>%s", faction.getDescription());
msg(p.txt.titleize(faction.getTag(fme)));
msg("<a>Description: <i>%s", faction.getDescription());
if ( ! faction.isNormal())
{
return;
@ -60,12 +60,12 @@ public class CmdShow extends FCommand
peaceStatus = " "+Conf.colorNeutral+"This faction is Peaceful";
}
sendMessageParsed("<a>Joining: <i>"+(faction.getOpen() ? "no invitation is needed" : "invitation is required")+peaceStatus);
sendMessageParsed("<a>Land / Power / Maxpower: <i> %d/%d/%d", faction.getLandRounded(), faction.getPowerRounded(), faction.getPowerMaxRounded());
msg("<a>Joining: <i>"+(faction.getOpen() ? "no invitation is needed" : "invitation is required")+peaceStatus);
msg("<a>Land / Power / Maxpower: <i> %d/%d/%d", faction.getLandRounded(), faction.getPowerRounded(), faction.getPowerMaxRounded());
if (faction.isPermanent())
{
sendMessageParsed("<a>This faction is permanent, remaining even with no members.");
msg("<a>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("<a>Total land value: <i>" + stringValue + stringRefund);
msg("<a>Total land value: <i>" + stringValue + stringRefund);
}
//Show bank contents
if(Conf.bankEnabled) {
sendMessageParsed("<a>Bank contains: <i>"+Econ.moneyString(faction.getMoney()));
msg("<a>Bank contains: <i>"+Econ.moneyString(faction.getMoney()));
}
}

View File

@ -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("<b>That tag is already taken");
msg("<b>That tag is already taken");
return;
}
@ -55,14 +55,14 @@ public class CmdTag extends FCommand
myFaction.setTag(tag);
// Inform
myFaction.sendMessageParsed("%s<i> changed your faction tag to %s", fme.getNameAndRelevant(myFaction), myFaction.getTag(myFaction));
myFaction.msg("%s<i> changed your faction tag to %s", fme.getNameAndRelevant(myFaction), myFaction.getTag(myFaction));
for (Faction faction : Factions.i.get())
{
if (faction == myFaction)
{
continue;
}
faction.sendMessageParsed("<i>The faction %s<i> changed their name to %s.", fme.getRelationColor(faction)+oldtag, myFaction.getTag(faction));
faction.msg("<i>The faction %s<i> changed their name to %s.", fme.getRelationColor(faction)+oldtag, myFaction.getTag(faction));
}
if (Conf.spoutFactionTagsOverNames)

View File

@ -41,7 +41,7 @@ public class CmdTitle extends FCommand
you.setTitle(title);
// Inform
myFaction.sendMessageParsed("%s<i> changed a title: %s", fme.getNameAndRelevant(myFaction), you.getNameAndRelevant(myFaction));
myFaction.msg("%s<i> changed a title: %s", fme.getNameAndRelevant(myFaction), you.getNameAndRelevant(myFaction));
if (Conf.spoutFactionTitlesOverNames)
{

View File

@ -38,11 +38,11 @@ public class CmdUnclaim extends FCommand
if (Permission.MANAGE_SAFE_ZONE.has(sender))
{
Board.removeAt(flocation);
sendMessageParsed("<i>Safe zone was unclaimed.");
msg("<i>Safe zone was unclaimed.");
}
else
{
sendMessageParsed("<b>This is a safe zone. You lack permissions to unclaim.");
msg("<b>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("<i>War zone was unclaimed.");
msg("<i>War zone was unclaimed.");
}
else
{
sendMessageParsed("<b>This is a war zone. You lack permissions to unclaim.");
msg("<b>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<i> unclaimed some of your land.", fme.getNameAndRelevant(otherFaction));
sendMessageParsed("<i>You unclaimed this land.");
otherFaction.msg("%s<i> unclaimed some of your land.", fme.getNameAndRelevant(otherFaction));
msg("<i>You unclaimed this land.");
return;
}
@ -82,7 +82,7 @@ public class CmdUnclaim extends FCommand
if ( myFaction != otherFaction)
{
sendMessageParsed("<b>You don't own this land.");
msg("<b>You don't own this land.");
return;
}
@ -113,7 +113,7 @@ public class CmdUnclaim extends FCommand
Faction faction = myFaction;
if(!faction.removeMoney(-refund))
{
sendMessageParsed("<b>Unclaiming this land will cost <h>%s<b> which your faction can't currently afford.", Econ.moneyString(-refund));
msg("<b>Unclaiming this land will cost <h>%s<b> which your faction can't currently afford.", Econ.moneyString(-refund));
return;
}
moneyBack = " It cost "+faction.getTag()+" <h>"+Econ.moneyString(refund)+"<i>.";
@ -122,7 +122,7 @@ public class CmdUnclaim extends FCommand
{
if (!Econ.deductMoney(fme.getName(), -refund))
{
sendMessageParsed("<b>Unclaiming this land will cost <h>%s<b> which you can't currently afford.", Econ.moneyString(-refund));
msg("<b>Unclaiming this land will cost <h>%s<b> which you can't currently afford.", Econ.moneyString(-refund));
return;
}
moneyBack = " It cost them <h>"+Econ.moneyString(refund)+"<i>.";
@ -136,7 +136,7 @@ public class CmdUnclaim extends FCommand
}
Board.removeAt(flocation);
myFaction.sendMessageParsed("%s<i> unclaimed some land."+moneyBack, fme.getNameAndRelevant(myFaction));
myFaction.msg("%s<i> unclaimed some land."+moneyBack, fme.getNameAndRelevant(myFaction));
}
}

View File

@ -55,7 +55,7 @@ public class CmdUnclaimall extends FCommand
Faction faction = myFaction;
if(!faction.removeMoney(-refund))
{
sendMessageParsed("<b>Unclaiming all faction land will cost <h>"+Econ.moneyString(-refund)+"<b>, which your faction can't currently afford.");
msg("<b>Unclaiming all faction land will cost <h>"+Econ.moneyString(-refund)+"<b>, 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("<b>Unclaiming all faction land will cost <h>"+Econ.moneyString(-refund)+"<b>, which you can't currently afford.");
msg("<b>Unclaiming all faction land will cost <h>"+Econ.moneyString(-refund)+"<b>, which you can't currently afford.");
return;
}
moneyBack = "<i> It cost them <h>"+Econ.moneyString(refund)+"<i>.";
@ -79,7 +79,7 @@ public class CmdUnclaimall extends FCommand
}
Board.unclaimAll(myFaction.getId());
myFaction.sendMessageParsed("%s<i> unclaimed ALL of your faction's land."+moneyBack, fme.getNameAndRelevant(myFaction));
myFaction.msg("%s<i> unclaimed ALL of your faction's land."+moneyBack, fme.getNameAndRelevant(myFaction));
}
}

View File

@ -25,6 +25,6 @@ public class CmdVersion extends FCommand
@Override
public void perform()
{
sendMessageParsed("<i>You are running "+P.p.getDescription().getFullName());
msg("<i>You are running "+P.p.getDescription().getFullName());
}
}

View File

@ -43,6 +43,6 @@ public class CmdWarclaim extends FCommand
Board.setFactionAt(Factions.i.getWarZone(), locToClaim);
}
sendMessageParsed("<i>You claimed <h>%d chunks<i> for the <a>war zone<i>.", (1+radius*2)*(1+radius*2));
msg("<i>You claimed <h>%d chunks<i> for the <a>war zone<i>.", (1+radius*2)*(1+radius*2));
}
}

View File

@ -30,7 +30,7 @@ public class CmdWarunclaimall extends FCommand
public void perform()
{
Board.unclaimAll(Factions.i.getWarZone().getId());
sendMessageParsed("<i>You unclaimed ALL war zone land.");
msg("<i>You unclaimed ALL war zone land.");
}
}

View File

@ -36,7 +36,7 @@ public class CmdWithdraw extends FCommand
if ( ! Conf.bankMembersCanWithdraw && ! assertMinRole(Role.MODERATOR))
{
sendMessageParsed("<b>Only faction moderators or admins are able to withdraw from the bank.");
msg("<b>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("<i>You have withdrawn "+amountString+" from "+faction.getTag()+"'s bank.");
sendMessageParsed("<i>"+faction.getTag()+" now has "+Econ.moneyString(faction.getMoney()));
msg("<i>You have withdrawn "+amountString+" from "+faction.getTag()+"'s bank.");
msg("<i>"+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<i> has withdrawn %s", fme.getNameAndRelevant(fplayer), amountString);
fplayer.msg("%s<i> has withdrawn %s", fme.getNameAndRelevant(fplayer), amountString);
}
}
}

View File

@ -59,7 +59,7 @@ public abstract class FCommand extends MCommand<P>
{
if (p.getLocked() && this.disableOnLock)
{
sendMessageParsed("<b>Factions was locked by an admin. Please try again later.");
msg("<b>Factions was locked by an admin. Please try again later.");
return false;
}
return true;
@ -120,7 +120,7 @@ public abstract class FCommand extends MCommand<P>
if (fme.getRole().value < role.value)
{
sendMessageParsed("<b>You <h>must be "+role+"<b> to "+this.getHelpShort()+".");
msg("<b>You <h>must be "+role+"<b> to "+this.getHelpShort()+".");
return false;
}
return true;

View File

@ -35,13 +35,13 @@ public abstract class FRelationCommand extends FCommand
if ( ! them.isNormal())
{
sendMessageParsed("<b>Nope! You can't.");
msg("<b>Nope! You can't.");
return;
}
if (them == myFaction)
{
sendMessageParsed("<b>Nope! You can't declare a relation to yourself :)");
msg("<b>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("<i>Your faction is now "+currentRelationColor+targetRelation.toString()+"<i> to "+currentRelationColor+myFaction.getTag());
myFaction.sendMessageParsed("<i>Your faction is now "+currentRelationColor+targetRelation.toString()+"<i> to "+currentRelationColor+them.getTag());
them.msg("<i>Your faction is now "+currentRelationColor+targetRelation.toString()+"<i> to "+currentRelationColor+myFaction.getTag());
myFaction.msg("<i>Your faction is now "+currentRelationColor+targetRelation.toString()+"<i> to "+currentRelationColor+them.getTag());
}
else
{
them.sendMessageParsed(currentRelationColor+myFaction.getTag()+"<i> wishes to be your "+targetRelation.getColor()+targetRelation.toString());
them.sendMessageParsed("<i>Type <c>/"+Conf.baseCommandAliases.get(0)+" "+targetRelation+" "+myFaction.getTag()+"<i> to accept.");
myFaction.sendMessageParsed(currentRelationColor+them.getTag()+"<i> were informed that you wish to be "+targetRelation.getColor()+targetRelation);
them.msg(currentRelationColor+myFaction.getTag()+"<i> wishes to be your "+targetRelation.getColor()+targetRelation.toString());
them.msg("<i>Type <c>/"+Conf.baseCommandAliases.get(0)+" "+targetRelation+" "+myFaction.getTag()+"<i> to accept.");
myFaction.msg(currentRelationColor+them.getTag()+"<i> were informed that you wish to be "+targetRelation.getColor()+targetRelation);
}
if ( ! targetRelation.isNeutral() && them.isPeaceful())
{
them.sendMessageParsed("<i>This will have no effect while your faction is peaceful.");
myFaction.sendMessageParsed("<i>This will have no effect while their faction is peaceful.");
them.msg("<i>This will have no effect while your faction is peaceful.");
myFaction.msg("<i>This will have no effect while their faction is peaceful.");
}
if ( ! targetRelation.isNeutral() && myFaction.isPeaceful())
{
them.sendMessageParsed("<i>This will have no effect while their faction is peaceful.");
myFaction.sendMessageParsed("<i>This will have no effect while your faction is peaceful.");
them.msg("<i>This will have no effect while their faction is peaceful.");
myFaction.msg("<i>This will have no effect while your faction is peaceful.");
}
SpoutFeatures.updateAppearances(myFaction, them);

View File

@ -173,7 +173,7 @@ public abstract class MCommand<T extends MPlugin>
{
if (informSenderIfNot)
{
sendMessageParsed(Lang.commandSenderMustBePlayer);
msg(Lang.commandSenderMustBePlayer);
}
return false;
}
@ -192,7 +192,7 @@ public abstract class MCommand<T extends MPlugin>
{
if (sender != null)
{
sendMessageParsed(Lang.commandToFewArgs);
msg(Lang.commandToFewArgs);
sender.sendMessage(this.getUseageTemplate());
}
return false;
@ -204,7 +204,7 @@ public abstract class MCommand<T extends MPlugin>
{
// Get the to many string slice
List<String> 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<T extends MPlugin>
// 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<T extends MPlugin>
if (msg && ret == null)
{
this.sendMessageParsed("<b>No player \"<p>%s<b>\" could not be found.", name);
this.msg("<b>No player \"<p>%s<b>\" could not be found.", name);
}
return ret;
@ -450,7 +450,7 @@ public abstract class MCommand<T extends MPlugin>
if (msg && ret == null)
{
this.sendMessageParsed("<b>No player match found for \"<p>%s<b>\".", name);
this.msg("<b>No player match found for \"<p>%s<b>\".", name);
}
return ret;