First pass at using Txt.

This commit is contained in:
Olof Larsson
2013-04-10 10:32:04 +02:00
parent 433d45ae4c
commit 61b526e387
22 changed files with 89 additions and 252 deletions

View File

@ -5,6 +5,7 @@ import java.util.ArrayList;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.zcore.CommandVisibility;
import com.massivecraft.factions.zcore.MCommand;
import com.massivecraft.mcore.util.Txt;
public class CmdAutoHelp extends MCommand<Factions>
{
@ -43,6 +44,6 @@ public class CmdAutoHelp extends MCommand<Factions>
}
}
sendMessage(p.txt.getPage(lines, this.argAsInt(0, 1), "Help for command \""+pcmd.aliases.get(0)+"\""));
sendMessage(Txt.getPage(lines, this.argAsInt(0, 1), "Help for command \""+pcmd.aliases.get(0)+"\""));
}
}

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FFlag;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Perm;
import com.massivecraft.mcore.util.Txt;
public class CmdFlag extends FCommand
{
@ -38,7 +39,7 @@ public class CmdFlag extends FCommand
if ( ! this.argIsSet(1))
{
msg(p.txt.titleize("Flags for " + faction.describeTo(fme, true)));
msg(Txt.titleize("Flags for " + faction.describeTo(fme, true)));
for (FFlag flag : FFlag.values())
{
msg(flag.getStateInfo(faction.getFlag(flag), true));
@ -50,7 +51,7 @@ public class CmdFlag extends FCommand
if (flag == null) return;
if ( ! this.argIsSet(2))
{
msg(p.txt.titleize("Flag for " + faction.describeTo(fme, true)));
msg(Txt.titleize("Flag for " + faction.describeTo(fme, true)));
msg(flag.getStateInfo(faction.getFlag(flag), true));
return;
}
@ -62,7 +63,7 @@ public class CmdFlag extends FCommand
if ( ! Perm.FLAG_SET.has(sender, true)) return;
// Do the change
msg(p.txt.titleize("Flag for " + faction.describeTo(fme, true)));
msg(Txt.titleize("Flag for " + faction.describeTo(fme, true)));
faction.setFlag(flag, targetValue);
msg(flag.getStateInfo(faction.getFlag(flag), true));
}

View File

@ -1,179 +0,0 @@
package com.massivecraft.factions.cmd;
import java.util.ArrayList;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm;
import com.massivecraft.factions.integration.Econ;
public class CmdHelp extends FCommand
{
public CmdHelp()
{
super();
this.aliases.add("help");
this.aliases.add("h");
this.aliases.add("?");
//this.requiredArgs.add("");
this.optionalArgs.put("page", "1");
this.permission = Perm.HELP.node;
this.disableOnLock = false;
senderMustBePlayer = false;
senderMustBeMember = false;
senderMustBeOfficer = false;
senderMustBeLeader = false;
}
@Override
public void perform()
{
if (helpPages == null) updateHelp();
int page = this.argAsInt(0, 1);
sendMessage(p.txt.titleize("Factions Help ("+page+"/"+helpPages.size()+")"));
page -= 1;
if (page < 0 || page >= helpPages.size())
{
msg("<b>This page does not exist");
return;
}
sendMessage(helpPages.get(page));
}
//----------------------------------------------//
// Build the help pages
//----------------------------------------------//
public ArrayList<ArrayList<String>> helpPages;
public void updateHelp()
{
helpPages = new ArrayList<ArrayList<String>>();
ArrayList<String> pageLines;
pageLines = new ArrayList<String>();
//pageLines.add( p.cmdBase.cmdHelp.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdList.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdShow.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdPower.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdJoin.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdLeave.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdHome.getUseageTemplate(true) );
pageLines.add( p.txt.parse("<i>Learn how to create a faction on the next page.") );
helpPages.add(pageLines);
pageLines = new ArrayList<String>();
pageLines.add( p.cmdBase.cmdCreate.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdDescription.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdTag.getUseageTemplate(true) );
pageLines.add( p.txt.parse("<i>You might want to close it and use invitations:" ));
pageLines.add( p.cmdBase.cmdOpen.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdInvite.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdDeinvite.getUseageTemplate(true) );
pageLines.add( p.txt.parse("<i>And don't forget to set your home:" ));
pageLines.add( p.cmdBase.cmdSethome.getUseageTemplate(true) );
helpPages.add(pageLines);
if (Econ.isSetup() && ConfServer.econEnabled && ConfServer.bankEnabled)
{
pageLines = new ArrayList<String>();
pageLines.add( p.txt.parse("<i>Your faction has a bank which is used to pay for certain" ));
pageLines.add( p.txt.parse("<i>things, so it will need to have money deposited into it." ));
pageLines.add( p.txt.parse("<i>To learn more, use the money command." ));
pageLines.add( "" );
pageLines.add( p.cmdBase.cmdMoney.getUseageTemplate(true) );
pageLines.add( "" );
pageLines.add( "" );
pageLines.add( "" );
helpPages.add(pageLines);
}
pageLines = new ArrayList<String>();
pageLines.add( p.cmdBase.cmdClaim.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdAutoClaim.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdUnclaim.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdUnclaimall.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdKick.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdPromote.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdDemote.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdOfficer.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdLeader.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdTitle.getUseageTemplate(true) );
pageLines.add( p.txt.parse("<i>Player titles are just for fun. No rules connected to them." ));
helpPages.add(pageLines);
pageLines = new ArrayList<String>();
pageLines.add( p.cmdBase.cmdMap.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdSeeChunks.getUseageTemplate(true) );
pageLines.add(p.txt.parse("<i>Claimed land with ownership set is further protected so"));
pageLines.add(p.txt.parse("<i>that only the owner(s), faction admin, and possibly the"));
pageLines.add(p.txt.parse("<i>faction moderators have full access."));
helpPages.add(pageLines);
pageLines = new ArrayList<String>();
pageLines.add( p.cmdBase.cmdDisband.getUseageTemplate(true) );
pageLines.add("");
pageLines.add( p.cmdBase.cmdRelationAlly.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdRelationTruce.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdRelationNeutral.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdRelationEnemy.getUseageTemplate(true) );
pageLines.add(p.txt.parse("<i>Set the relation you WISH to have with another faction."));
pageLines.add(p.txt.parse("<i>Your default relation with other factions will be neutral."));
pageLines.add(p.txt.parse("<i>If BOTH factions choose \"ally\" you will be allies."));
pageLines.add(p.txt.parse("<i>If ONE faction chooses \"enemy\" you will be enemies."));
helpPages.add(pageLines);
pageLines = new ArrayList<String>();
pageLines.add(p.txt.parse("<i>You can never hurt members or allies."));
pageLines.add(p.txt.parse("<i>You can not hurt neutrals in their own territory."));
pageLines.add(p.txt.parse("<i>You can always hurt enemies and players without faction."));
pageLines.add("");
pageLines.add(p.txt.parse("<i>Damage from enemies is reduced in your own territory."));
pageLines.add(p.txt.parse("<i>When you die you lose power. It is restored over time."));
pageLines.add(p.txt.parse("<i>The power of a faction is the sum of all member power."));
pageLines.add(p.txt.parse("<i>The power of a faction determines how much land it can hold."));
pageLines.add(p.txt.parse("<i>You can claim land from factions with too little power."));
helpPages.add(pageLines);
pageLines = new ArrayList<String>();
pageLines.add(p.txt.parse("<i>Only faction members can build and destroy in their own"));
pageLines.add(p.txt.parse("<i>territory. Usage of the following items is also restricted:"));
pageLines.add(p.txt.parse("<i>Door, Chest, Furnace, Dispenser, Diode."));
pageLines.add("");
pageLines.add(p.txt.parse("<i>Make sure to put pressure plates in front of doors for your"));
pageLines.add(p.txt.parse("<i>guest visitors. Otherwise they can't get through. You can"));
pageLines.add(p.txt.parse("<i>also use this to create member only areas."));
pageLines.add(p.txt.parse("<i>As dispensers are protected, you can create traps without"));
pageLines.add(p.txt.parse("<i>worrying about those arrows getting stolen."));
helpPages.add(pageLines);
pageLines = new ArrayList<String>();
pageLines.add("Finally some commands for the server admins:");
pageLines.add( p.cmdBase.cmdBypass.getUseageTemplate(true) );
pageLines.add(p.txt.parse("<c>/f claim safezone <i>claim land for the Safe Zone"));
pageLines.add(p.txt.parse("<c>/f claim warzone <i>claim land for the War Zone"));
pageLines.add(p.txt.parse("<c>/f autoclaim [safezone|warzone] <i>take a guess"));
pageLines.add(p.txt.parse("<i>Note: " + p.cmdBase.cmdUnclaim.getUseageTemplate(false) + Factions.get().txt.parse("<i>") + " works on safe/war zones as well."));
helpPages.add(pageLines);
pageLines = new ArrayList<String>();
pageLines.add(p.txt.parse("<i>More commands for server admins:"));
pageLines.add( p.cmdBase.cmdPowerBoost.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdLock.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdReload.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdSaveAll.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdVersion.getUseageTemplate(true) );
pageLines.add( p.cmdBase.cmdConfig.getUseageTemplate(true) );
helpPages.add(pageLines);
}
}

View File

@ -9,6 +9,7 @@ import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel;
import com.massivecraft.factions.event.FPlayerJoinEvent;
import com.massivecraft.factions.util.RelationUtil;
import com.massivecraft.mcore.util.Txt;
public class CmdLeader extends FCommand
{
@ -50,7 +51,7 @@ public class CmdLeader extends FCommand
// Follow the standard rules
if (fme.getRole() != Rel.LEADER || targetFaction != myFaction)
{
sender.sendMessage(p.txt.parse("<b>You must be leader of the faction to %s.", this.getHelpShort()));
sender.sendMessage(Txt.parse("<b>You must be leader of the faction to %s.", this.getHelpShort()));
return;
}

View File

@ -8,6 +8,7 @@ import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.FactionColl;
import com.massivecraft.factions.Perm;
import com.massivecraft.mcore.util.Txt;
public class CmdList extends FCommand
@ -75,10 +76,10 @@ public class CmdList extends FCommand
ArrayList<String> lines = new ArrayList<String>();
/* // this code was really slow on large servers, getting full info for every faction and then only showing 9 of them; rewritten below
lines.add(p.txt.parse("<i>Factionless<i> %d online", Factions.i.getNone().getFPlayersWhereOnline(true).size()));
lines.add(Txt.parse("<i>Factionless<i> %d online", Factions.i.getNone().getFPlayersWhereOnline(true).size()));
for (Faction faction : factionList)
{
lines.add(p.txt.parse("%s<i> %d/%d online, %d/%d/%d",
lines.add(Txt.parse("%s<i> %d/%d online, %d/%d/%d",
faction.getTag(fme),
faction.getFPlayersWhereOnline(true).size(),
faction.getFPlayers().size(),
@ -88,7 +89,7 @@ public class CmdList extends FCommand
);
}
sendMessage(p.txt.getPage(lines, this.argAsInt(0, 1), "Faction List"));
sendMessage(Txt.getPage(lines, this.argAsInt(0, 1), "Faction List"));
*/
factionList.add(0, FactionColl.i.getNone());
@ -105,16 +106,16 @@ public class CmdList extends FCommand
if (end > factionList.size())
end = factionList.size();
lines.add(p.txt.titleize("Faction List "+pagenumber+"/"+pagecount));
lines.add(Txt.titleize("Faction List "+pagenumber+"/"+pagecount));
for (Faction faction : factionList.subList(start, end))
{
if (faction.isNone())
{
lines.add(p.txt.parse("<i>Factionless<i> %d online", FactionColl.i.getNone().getFPlayersWhereOnline(true).size()));
lines.add(Txt.parse("<i>Factionless<i> %d online", FactionColl.i.getNone().getFPlayersWhereOnline(true).size()));
continue;
}
lines.add(p.txt.parse("%s<i> %d/%d online, %d/%d/%d",
lines.add(Txt.parse("%s<i> %d/%d online, %d/%d/%d",
faction.getTag(fme),
faction.getFPlayersWhereOnline(true).size(),
faction.getFPlayers().size(),

View File

@ -1,6 +1,7 @@
package com.massivecraft.factions.cmd;
import com.massivecraft.factions.Factions;
import com.massivecraft.mcore.util.Txt;
public class CmdMoney extends FCommand
{
@ -27,7 +28,7 @@ public class CmdMoney extends FCommand
senderMustBeLeader = false;
this.setHelpShort("faction money commands");
this.helpLong.add(p.txt.parseTags("<i>The faction money commands."));
this.helpLong.add(Txt.parse("<i>The faction money commands."));
this.addSubCommand(this.cmdMoneyBalance);
this.addSubCommand(this.cmdMoneyDeposit);

View File

@ -5,6 +5,7 @@ import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Perm;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.mcore.util.Txt;
import org.bukkit.ChatColor;
@ -39,7 +40,7 @@ public class CmdMoneyDeposit extends FCommand
boolean success = Econ.transferMoney(fme, fme, faction, amount);
if (success && ConfServer.logMoneyTransactions)
Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s deposited %s in the faction bank: %s", fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
Factions.get().log(ChatColor.stripColor(Txt.parse("%s deposited %s in the faction bank: %s", fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
}
}

View File

@ -5,6 +5,7 @@ import com.massivecraft.factions.Perm;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.mcore.util.Txt;
import org.bukkit.ChatColor;
@ -42,6 +43,6 @@ public class CmdMoneyTransferFf extends FCommand
boolean success = Econ.transferMoney(fme, from, to, amount);
if (success && ConfServer.logMoneyTransactions)
Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s transferred %s from the faction \"%s\" to the faction \"%s\"", fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
Factions.get().log(ChatColor.stripColor(Txt.parse("%s transferred %s from the faction \"%s\" to the faction \"%s\"", fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
}
}

View File

@ -5,6 +5,7 @@ import com.massivecraft.factions.Perm;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.mcore.util.Txt;
import org.bukkit.ChatColor;
@ -42,6 +43,6 @@ public class CmdMoneyTransferFp extends FCommand
boolean success = Econ.transferMoney(fme, from, to, amount);
if (success && ConfServer.logMoneyTransactions)
Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s transferred %s from the faction \"%s\" to the player \"%s\"", fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
Factions.get().log(ChatColor.stripColor(Txt.parse("%s transferred %s from the faction \"%s\" to the player \"%s\"", fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
}
}

View File

@ -5,6 +5,7 @@ import com.massivecraft.factions.Perm;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.mcore.util.Txt;
import org.bukkit.ChatColor;
@ -42,6 +43,6 @@ public class CmdMoneyTransferPf extends FCommand
boolean success = Econ.transferMoney(fme, from, to, amount);
if (success && ConfServer.logMoneyTransactions)
Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s transferred %s from the player \"%s\" to the faction \"%s\"", fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
Factions.get().log(ChatColor.stripColor(Txt.parse("%s transferred %s from the player \"%s\" to the faction \"%s\"", fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
}
}

View File

@ -5,6 +5,7 @@ import com.massivecraft.factions.Perm;
import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.mcore.util.Txt;
import org.bukkit.ChatColor;
@ -37,6 +38,6 @@ public class CmdMoneyWithdraw extends FCommand
boolean success = Econ.transferMoney(fme, faction, fme, amount);
if (success && ConfServer.logMoneyTransactions)
Factions.get().log(ChatColor.stripColor(Factions.get().txt.parse("%s withdrew %s from the faction bank: %s", fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
Factions.get().log(ChatColor.stripColor(Txt.parse("%s withdrew %s from the faction bank: %s", fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
}
}

View File

@ -4,6 +4,7 @@ import com.massivecraft.factions.FPerm;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel;
import com.massivecraft.mcore.util.Txt;
public class CmdPerm extends FCommand
{
@ -41,7 +42,7 @@ public class CmdPerm extends FCommand
if ( ! this.argIsSet(1))
{
msg(p.txt.titleize("Perms for " + faction.describeTo(fme, true)));
msg(Txt.titleize("Perms for " + faction.describeTo(fme, true)));
msg(FPerm.getStateHeaders());
for (FPerm perm : FPerm.values())
{
@ -54,7 +55,7 @@ public class CmdPerm extends FCommand
if (perm == null) return;
if ( ! this.argIsSet(2))
{
msg(p.txt.titleize("Perm for " + faction.describeTo(fme, true)));
msg(Txt.titleize("Perm for " + faction.describeTo(fme, true)));
msg(FPerm.getStateHeaders());
msg(perm.getStateInfo(faction.getPermittedRelations(perm), true));
return;
@ -78,7 +79,7 @@ public class CmdPerm extends FCommand
faction.setRelationPermitted(FPerm.PERMS, Rel.LEADER, true);
}
msg(p.txt.titleize("Perm for " + faction.describeTo(fme, true)));
msg(Txt.titleize("Perm for " + faction.describeTo(fme, true)));
msg(FPerm.getStateHeaders());
msg(perm.getStateInfo(faction.getPermittedRelations(perm), true));
}

View File

@ -13,6 +13,7 @@ import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Perm;
import com.massivecraft.factions.Rel;
import com.massivecraft.factions.zcore.util.TextUtil;
import com.massivecraft.mcore.util.Txt;
public class CmdShow extends FCommand
{
@ -51,7 +52,7 @@ public class CmdShow extends FCommand
Collection<FPlayer> normals = faction.getFPlayersWhereRole(Rel.MEMBER);
Collection<FPlayer> recruits = faction.getFPlayersWhereRole(Rel.RECRUIT);
msg(p.txt.titleize(faction.getTag(fme)));
msg(Txt.titleize(faction.getTag(fme)));
msg("<a>Description: <i>%s", faction.getDescription());
// Display important flags
@ -91,22 +92,22 @@ public class CmdShow extends FCommand
}
}
String sepparator = p.txt.parse("<i>")+", ";
String sepparator = Txt.parse("<i>")+", ";
// List the relations to other factions
Map<Rel, List<String>> relationTags = faction.getFactionTagsPerRelation(fme, true);
if (faction.getFlag(FFlag.PEACEFUL))
{
sendMessage(p.txt.parse("<a>In Truce with:<i> *everyone*"));
sendMessage(Txt.parse("<a>In Truce with:<i> *everyone*"));
}
else
{
sendMessage(p.txt.parse("<a>In Truce with: ") + TextUtil.implode(relationTags.get(Rel.TRUCE), sepparator));
sendMessage(Txt.parse("<a>In Truce with: ") + TextUtil.implode(relationTags.get(Rel.TRUCE), sepparator));
}
sendMessage(p.txt.parse("<a>Allied to: ") + TextUtil.implode(relationTags.get(Rel.ALLY), sepparator));
sendMessage(p.txt.parse("<a>Enemies: ") + TextUtil.implode(relationTags.get(Rel.ENEMY), sepparator));
sendMessage(Txt.parse("<a>Allied to: ") + TextUtil.implode(relationTags.get(Rel.ALLY), sepparator));
sendMessage(Txt.parse("<a>Enemies: ") + TextUtil.implode(relationTags.get(Rel.ENEMY), sepparator));
// List the members...
List<String> memberOnlineNames = new ArrayList<String>();
@ -159,8 +160,8 @@ public class CmdShow extends FCommand
memberOfflineNames.add(follower.getNameAndTitle(fme));
}
}
sendMessage(p.txt.parse("<a>Members online: ") + TextUtil.implode(memberOnlineNames, sepparator));
sendMessage(p.txt.parse("<a>Members offline: ") + TextUtil.implode(memberOfflineNames, sepparator));
sendMessage(Txt.parse("<a>Members online: ") + TextUtil.implode(memberOnlineNames, sepparator));
sendMessage(Txt.parse("<a>Members offline: ") + TextUtil.implode(memberOfflineNames, sepparator));
}
}

View File

@ -4,6 +4,7 @@ import java.util.Collections;
import com.massivecraft.factions.ConfServer;
import com.massivecraft.factions.Factions;
import com.massivecraft.mcore.util.Txt;
public class FCmdRoot extends FCommand
{
@ -67,7 +68,7 @@ public class FCmdRoot extends FCommand
this.disableOnLock = false;
this.setHelpShort("The faction base command");
this.helpLong.add(p.txt.parseTags("<i>This command contains all faction stuff."));
this.helpLong.add(Txt.parse("<i>This command contains all faction stuff."));
this.addSubCommand(Factions.get().cmdAutoHelp);
this.addSubCommand(this.cmdList);

View File

@ -16,6 +16,7 @@ import com.massivecraft.factions.FactionColl;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Rel;
import com.massivecraft.factions.zcore.MCommand;
import com.massivecraft.mcore.util.Txt;
public abstract class FCommand extends MCommand<Factions>
@ -101,19 +102,19 @@ public abstract class FCommand extends MCommand<Factions>
if ( ! fplayer.hasFaction())
{
sender.sendMessage(p.txt.parse("<b>You are not member of any faction."));
sender.sendMessage(Txt.parse("<b>You are not member of any faction."));
return false;
}
if (this.senderMustBeOfficer && ! fplayer.getRole().isAtLeast(Rel.OFFICER))
{
sender.sendMessage(p.txt.parse("<b>Only faction moderators can %s.", this.getHelpShort()));
sender.sendMessage(Txt.parse("<b>Only faction moderators can %s.", this.getHelpShort()));
return false;
}
if (this.senderMustBeLeader && ! fplayer.getRole().isAtLeast(Rel.LEADER))
{
sender.sendMessage(p.txt.parse("<b>Only faction admins can %s.", this.getHelpShort()));
sender.sendMessage(Txt.parse("<b>Only faction admins can %s.", this.getHelpShort()));
return false;
}
@ -392,7 +393,7 @@ public abstract class FCommand extends MCommand<Factions>
{
if ( ! i.getFaction().equals(you.getFaction()))
{
i.sendMessage(p.txt.parse("%s <b>is not in the same faction as you.",you.describeTo(i, true)));
i.sendMessage(Txt.parse("%s <b>is not in the same faction as you.",you.describeTo(i, true)));
return false;
}
@ -403,7 +404,7 @@ public abstract class FCommand extends MCommand<Factions>
if (you.getRole().equals(Rel.LEADER))
{
i.sendMessage(p.txt.parse("<b>Only the faction admin can do that."));
i.sendMessage(Txt.parse("<b>Only the faction admin can do that."));
}
else if (i.getRole().equals(Rel.OFFICER))
{
@ -413,12 +414,12 @@ public abstract class FCommand extends MCommand<Factions>
}
else
{
i.sendMessage(p.txt.parse("<b>Moderators can't control each other..."));
i.sendMessage(Txt.parse("<b>Moderators can't control each other..."));
}
}
else
{
i.sendMessage(p.txt.parse("<b>You must be a faction moderator to do that."));
i.sendMessage(Txt.parse("<b>You must be a faction moderator to do that."));
}
return false;