Reformat.

This commit is contained in:
drtshock 2014-12-11 10:05:04 -06:00
parent 125a8c2050
commit 9aecd5f439
39 changed files with 408 additions and 437 deletions

View File

@ -7,7 +7,6 @@ import com.massivecraft.factions.event.FPlayerJoinEvent;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
public class CmdAdmin extends FCommand {

View File

@ -39,6 +39,6 @@ public class CmdBoom extends FCommand {
String enabled = myFaction.noExplosionsInTerritory() ? TL.GENERIC_DISABLED.toString() : TL.GENERIC_ENABLED.toString();
// Inform
myFaction.msg(TL.COMMAND_BOOM_ENABLED, fme.describeTo(myFaction),enabled);
myFaction.msg(TL.COMMAND_BOOM_ENABLED, fme.describeTo(myFaction), enabled);
}
}

View File

@ -4,7 +4,6 @@ import com.massivecraft.factions.Conf;
import com.massivecraft.factions.P;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@ -143,7 +142,7 @@ public class CmdConfig extends FCommand {
}
if (newColor == null) {
sendMessage(TL.COMMAND_CONFIG_INVALID_COLOUR.format(fieldName,value.toUpperCase()));
sendMessage(TL.COMMAND_CONFIG_INVALID_COLOUR.format(fieldName, value.toUpperCase()));
return;
}
target.set(null, newColor);
@ -170,7 +169,7 @@ public class CmdConfig extends FCommand {
}
if (newMat == null) {
sendMessage(TL.COMMAND_CONFIG_INVALID_MATERIAL.format(fieldName,value.toUpperCase()));
sendMessage(TL.COMMAND_CONFIG_INVALID_MATERIAL.format(fieldName, value.toUpperCase()));
return;
}
@ -180,13 +179,13 @@ public class CmdConfig extends FCommand {
if (matSet.contains(newMat)) {
matSet.remove(newMat);
target.set(null, matSet);
success = TL.COMMAND_CONFIG_MATERIAL_REMOVED.format(fieldName,value.toUpperCase());
success = TL.COMMAND_CONFIG_MATERIAL_REMOVED.format(fieldName, value.toUpperCase());
}
// Material not present yet, add it
else {
matSet.add(newMat);
target.set(null, matSet);
success = TL.COMMAND_CONFIG_MATERIAL_ADDED.format(fieldName,value.toUpperCase());
success = TL.COMMAND_CONFIG_MATERIAL_ADDED.format(fieldName, value.toUpperCase());
}
}
@ -198,13 +197,13 @@ public class CmdConfig extends FCommand {
if (stringSet.contains(value)) {
stringSet.remove(value);
target.set(null, stringSet);
success = TL.COMMAND_CONFIG_SET_REMOVED.format(fieldName,value);
success = TL.COMMAND_CONFIG_SET_REMOVED.format(fieldName, value);
}
// String not present yet, add it
else {
stringSet.add(value);
target.set(null, stringSet);
success = TL.COMMAND_CONFIG_SET_ADDED.format(fieldName,value);
success = TL.COMMAND_CONFIG_SET_ADDED.format(fieldName, value);
}
}
@ -217,21 +216,21 @@ public class CmdConfig extends FCommand {
// unknown type
else {
sendMessage(TL.COMMAND_CONFIG_ERROR_TYPE.format(fieldName,target.getClass().getName()));
sendMessage(TL.COMMAND_CONFIG_ERROR_TYPE.format(fieldName, target.getClass().getName()));
return;
}
} catch (NoSuchFieldException ex) {
sendMessage(TL.COMMAND_CONFIG_ERROR_MATCHING.format(fieldName));
return;
} catch (IllegalAccessException ex) {
sendMessage(TL.COMMAND_CONFIG_ERROR_SETTING.format(fieldName,value));
sendMessage(TL.COMMAND_CONFIG_ERROR_SETTING.format(fieldName, value));
return;
}
if (!success.isEmpty()) {
if (sender instanceof Player) {
sendMessage(success);
P.p.log(success + TL.COMMAND_CONFIG_LOG.format((Player)sender));
P.p.log(success + TL.COMMAND_CONFIG_LOG.format((Player) sender));
} else // using P.p.log() instead of sendMessage if run from server console so that "[Factions v#.#.#]" is prepended in server log
{
P.p.log(success);

View File

@ -4,7 +4,6 @@ import com.massivecraft.factions.Conf;
import com.massivecraft.factions.Conf.Backend;
import com.massivecraft.factions.zcore.persist.json.FactionsJSON;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.command.ConsoleCommandSender;
public class CmdConvert extends FCommand {

View File

@ -7,7 +7,6 @@ import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.MiscUtil;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import java.util.ArrayList;

View File

@ -4,9 +4,7 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
public class CmdDeinvite extends FCommand {

View File

@ -8,7 +8,6 @@ import com.massivecraft.factions.scoreboards.FTeamWrapper;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;

View File

@ -7,7 +7,6 @@ import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.util.SmokeUtil;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
@ -96,7 +95,7 @@ public class CmdHome extends FCommand {
continue;
}
fme.msg(TL.COMMAND_HOME_ENEMYNEAR,String.valueOf(Conf.homesTeleportAllowedEnemyDistance));
fme.msg(TL.COMMAND_HOME_ENEMYNEAR, String.valueOf(Conf.homesTeleportAllowedEnemyDistance));
return;
}
}

View File

@ -4,9 +4,7 @@ import com.massivecraft.factions.Conf;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
public class CmdInvite extends FCommand {

View File

@ -4,7 +4,6 @@ import com.massivecraft.factions.*;
import com.massivecraft.factions.event.FPlayerJoinEvent;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
public class CmdJoin extends FCommand {

View File

@ -5,9 +5,7 @@ import com.massivecraft.factions.Faction;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
import java.util.ArrayList;
@ -37,7 +35,7 @@ public class CmdList extends FCommand {
@Override
public void perform() {
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
if (!payForCommand(Conf.econCostList, TL.COMMAND_LIST_TOLIST.toString() , TL.COMMAND_LIST_FORLIST.toString())) {
if (!payForCommand(Conf.econCostList, TL.COMMAND_LIST_TOLIST.toString(), TL.COMMAND_LIST_FORLIST.toString())) {
return;
}

View File

@ -31,7 +31,7 @@ public class CmdLock extends FCommand {
@Override
public void perform() {
p.setLocked(this.argAsBool(0, !p.getLocked()));
msg(p.getLocked()?TL.COMMAND_LOCK_LOCKED:TL.COMMAND_LOCK_UNLOCKED);
msg(p.getLocked() ? TL.COMMAND_LOCK_LOCKED : TL.COMMAND_LOCK_UNLOCKED);
}
}

View File

@ -5,9 +5,7 @@ import com.massivecraft.factions.Faction;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.util.TL;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
public class CmdMod extends FCommand {

View File

@ -6,7 +6,6 @@ import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;

View File

@ -6,7 +6,6 @@ import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;

View File

@ -6,7 +6,6 @@ import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;

View File

@ -6,7 +6,6 @@ import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;

View File

@ -6,7 +6,6 @@ import com.massivecraft.factions.iface.EconomyParticipator;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.ChatColor;

View File

@ -90,7 +90,7 @@ public class CmdOwner 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.econCostOwner, TL.COMMAND_OWNER_TOSET , TL.COMMAND_OWNER_FORSET)) {
if (!payForCommand(Conf.econCostOwner, TL.COMMAND_OWNER_TOSET, TL.COMMAND_OWNER_FORSET)) {
return;
}

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, TL.COMMAND_POWER_TOSHOW , TL.COMMAND_POWER_FORSHOW)) {
if (!payForCommand(Conf.econCostPower, TL.COMMAND_POWER_TOSHOW, TL.COMMAND_POWER_FORSHOW)) {
return;
}

View File

@ -61,9 +61,9 @@ public class CmdPowerBoost extends FCommand {
target = TL.COMMAND_POWERBOOST_FACTION.format(targetFaction.getTag());
}
msg(TL.COMMAND_POWERBOOST_BOOST,target,targetPower);
msg(TL.COMMAND_POWERBOOST_BOOST, target, targetPower);
if (!senderIsConsole) {
P.p.log(TL.COMMAND_POWERBOOST_BOOSTLOG.toString(),fme.getName(),target,targetPower);
P.p.log(TL.COMMAND_POWERBOOST_BOOSTLOG.toString(), fme.getName(), target, targetPower);
}
}
}

View File

@ -44,6 +44,6 @@ public class CmdSetFWarp extends FCommand {
}
private boolean transact(FPlayer player) {
return !P.p.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(P.p.getConfig().getDouble("warp-cost.setwarp", 5), TL.COMMAND_SETFWARP_TOSET.toString() , TL.COMMAND_SETFWARP_FORSET.toString());
return !P.p.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(P.p.getConfig().getDouble("warp-cost.setwarp", 5), TL.COMMAND_SETFWARP_TOSET.toString(), TL.COMMAND_SETFWARP_FORSET.toString());
}
}

View File

@ -66,7 +66,7 @@ public class CmdSethome extends FCommand {
faction.msg(TL.COMMAND_SETHOME_SET, fme.describeTo(myFaction, true));
faction.sendMessage(p.cmdBase.cmdHome.getUseageTemplate());
if (faction != myFaction) {
fme.msg(TL.COMMAND_SETHOME_SETOTHER,faction.getTag(fme));
fme.msg(TL.COMMAND_SETHOME_SETOTHER, faction.getTag(fme));
}
}

View File

@ -4,9 +4,7 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.FPlayers;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import mkremins.fanciful.FancyMessage;
import org.bukkit.ChatColor;
public class CmdShowInvites extends FCommand {

View File

@ -3,7 +3,6 @@ package com.massivecraft.factions.cmd;
import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.apache.commons.lang.time.DurationFormatUtils;
import org.bukkit.ChatColor;

View File

@ -6,7 +6,6 @@ import com.massivecraft.factions.scoreboards.FTeamWrapper;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.util.MiscUtil;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import java.util.ArrayList;
@ -57,7 +56,7 @@ public class CmdTag extends FCommand {
}
// then make 'em pay (if applicable)
if (!payForCommand(Conf.econCostTag, TL.COMMAND_TAG_TOCHANGE,TL.COMMAND_TAG_FORCHANGE)) {
if (!payForCommand(Conf.econCostTag, TL.COMMAND_TAG_TOCHANGE, TL.COMMAND_TAG_FORCHANGE)) {
return;
}

View File

@ -6,7 +6,6 @@ import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
public class CmdUnclaim extends FCommand {
@ -38,7 +37,7 @@ public class CmdUnclaim extends FCommand {
msg(TL.COMMAND_UNCLAIM_SAFEZONE_SUCCESS);
if (Conf.logLandUnclaims) {
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(),flocation.getCoordString(),otherFaction.getTag()));
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), flocation.getCoordString(), otherFaction.getTag()));
}
} else {
msg(TL.COMMAND_UNCLAIM_SAFEZONE_NOPERM);
@ -50,7 +49,7 @@ public class CmdUnclaim extends FCommand {
msg(TL.COMMAND_UNCLAIM_WARZONE_SUCCESS);
if (Conf.logLandUnclaims) {
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(),flocation.getCoordString(),otherFaction.getTag()));
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), flocation.getCoordString(), otherFaction.getTag()));
}
} else {
msg(TL.COMMAND_UNCLAIM_WARZONE_NOPERM);
@ -65,7 +64,7 @@ public class CmdUnclaim extends FCommand {
msg(TL.COMMAND_UNCLAIM_UNCLAIMS);
if (Conf.logLandUnclaims) {
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(),flocation.getCoordString(),otherFaction.getTag()));
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), flocation.getCoordString(), otherFaction.getTag()));
}
return;
@ -109,7 +108,7 @@ public class CmdUnclaim extends FCommand {
myFaction.msg(TL.COMMAND_UNCLAIM_FACTIONUNCLAIMED, fme.describeTo(myFaction, true));
if (Conf.logLandUnclaims) {
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(),flocation.getCoordString(),otherFaction.getTag()));
P.p.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), flocation.getCoordString(), otherFaction.getTag()));
}
}

View File

@ -7,7 +7,6 @@ import com.massivecraft.factions.event.LandUnclaimAllEvent;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
public class CmdUnclaimall extends FCommand {
@ -51,7 +50,7 @@ public class CmdUnclaimall extends FCommand {
myFaction.msg(TL.COMMAND_UNCLAIMALL_UNCLAIMED, fme.describeTo(myFaction, true));
if (Conf.logLandUnclaims) {
P.p.log(TL.COMMAND_UNCLAIMALL_LOG.format(fme.getName(),myFaction.getTag()));
P.p.log(TL.COMMAND_UNCLAIMALL_LOG.format(fme.getName(), myFaction.getTag()));
}
}

View File

@ -24,9 +24,9 @@ public class CmdVersion extends FCommand {
@Override
public void perform() {
msg(TL.COMMAND_VERSION_VERSION,P.p.getDescription().getFullName());
msg(TL.GENERIC_TRANSLATION_VERSION,TL._LOCALE,TL._LOCAL_LANGUAGE,TL._LOCAL_REGION,TL._LOCAL_STATE);
msg(TL.GENERIC_TRANSLATION_CONTRIBUTORS,TL._LOCAL_AUTHOR);
msg(TL.GENERIC_TRANSLATION_RESPONSIBLE,TL._LOCAL_RESPONSIBLE);
msg(TL.COMMAND_VERSION_VERSION, P.p.getDescription().getFullName());
msg(TL.GENERIC_TRANSLATION_VERSION, TL._LOCALE, TL._LOCAL_LANGUAGE, TL._LOCAL_REGION, TL._LOCAL_STATE);
msg(TL.GENERIC_TRANSLATION_CONTRIBUTORS, TL._LOCAL_AUTHOR);
msg(TL.GENERIC_TRANSLATION_RESPONSIBLE, TL._LOCAL_RESPONSIBLE);
}
}

View File

@ -5,7 +5,6 @@ import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.zcore.MCommand;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender;
@ -277,8 +276,8 @@ public abstract class FCommand extends MCommand<P> {
}
}
public boolean payForCommand(double cost,TL toDoThis,TL forDoingThis){
return payForCommand(cost,toDoThis.toString(),forDoingThis.toString());
public boolean payForCommand(double cost, TL toDoThis, TL forDoingThis) {
return payForCommand(cost, toDoThis.toString(), forDoingThis.toString());
}
// like above, but just make sure they can pay; returns true unless person can't afford the cost

View File

@ -7,7 +7,6 @@ import com.massivecraft.factions.scoreboards.FTeamWrapper;
import com.massivecraft.factions.struct.Permission;
import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -52,7 +51,7 @@ public abstract class FRelationCommand 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(targetRelation.getRelationCost(),TL.COMMAND_RELATIONS_TOMARRY , TL.COMMAND_RELATIONS_FORMARRY)) {
if (!payForCommand(targetRelation.getRelationCost(), TL.COMMAND_RELATIONS_TOMARRY, TL.COMMAND_RELATIONS_FORMARRY)) {
return;
}
@ -68,15 +67,15 @@ public abstract class FRelationCommand extends FCommand {
FactionRelationEvent relationEvent = new FactionRelationEvent(myFaction, them, oldRelation, currentRelation);
Bukkit.getServer().getPluginManager().callEvent(relationEvent);
them.msg(TL.COMMAND_RELATIONS_MUTUAL, currentRelationColor + targetRelation.getTranslation() ,currentRelationColor + myFaction.getTag());
myFaction.msg(TL.COMMAND_RELATIONS_MUTUAL, currentRelationColor + targetRelation.getTranslation() ,currentRelationColor + myFaction.getTag());
them.msg(TL.COMMAND_RELATIONS_MUTUAL, currentRelationColor + targetRelation.getTranslation(), currentRelationColor + myFaction.getTag());
myFaction.msg(TL.COMMAND_RELATIONS_MUTUAL, currentRelationColor + targetRelation.getTranslation(), currentRelationColor + myFaction.getTag());
}
// inform the other faction of your request
else {
them.msg(TL.COMMAND_RELATIONS_PROPOSAL_1,currentRelationColor + myFaction.getTag(),targetRelation.getColor() + targetRelation.getTranslation());
them.msg(TL.COMMAND_RELATIONS_PROPOSAL_2,Conf.baseCommandAliases.get(0),targetRelation,myFaction.getTag());
myFaction.msg(TL.COMMAND_RELATIONS_PROPOSAL_SENT,currentRelationColor + them.getTag(),"" + targetRelation.getColor() + targetRelation);
them.msg(TL.COMMAND_RELATIONS_PROPOSAL_1, currentRelationColor + myFaction.getTag(), targetRelation.getColor() + targetRelation.getTranslation());
them.msg(TL.COMMAND_RELATIONS_PROPOSAL_2, Conf.baseCommandAliases.get(0), targetRelation, myFaction.getTag());
myFaction.msg(TL.COMMAND_RELATIONS_PROPOSAL_SENT, currentRelationColor + them.getTag(), "" + targetRelation.getColor() + targetRelation);
}
if (!targetRelation.isNeutral() && them.isPeaceful()) {

View File

@ -8,5 +8,5 @@ public interface EconomyParticipator extends RelationParticipator {
public void msg(String str, Object... args);
public void msg(TL translation,Object... args);
public void msg(TL translation, Object... args);
}

View File

@ -6,9 +6,7 @@ import com.massivecraft.factions.P;
import com.massivecraft.factions.integration.Econ;
import com.massivecraft.factions.zcore.util.TL;
import com.massivecraft.factions.zcore.util.TextUtil;
import mkremins.fanciful.FancyMessage;
import org.apache.commons.lang.time.DurationFormatUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -257,8 +255,8 @@ public abstract class MCommand<T extends MPlugin> {
sender.sendMessage(p.txt.parse(str, args));
}
public void msg(TL translation,Object... args){
sender.sendMessage(p.txt.parse(translation.toString(),args));
public void msg(TL translation, Object... args) {
sender.sendMessage(p.txt.parse(translation.toString(), args));
}
public void sendMessage(String msg) {

View File

@ -16,7 +16,6 @@ import com.massivecraft.factions.struct.Relation;
import com.massivecraft.factions.struct.Role;
import com.massivecraft.factions.util.RelationUtil;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
@ -767,7 +766,7 @@ public abstract class MemoryFPlayer implements FPlayer {
this.sendMessage(P.p.txt.parse(str, args));
}
public void msg(TL translation,Object... args){
public void msg(TL translation, Object... args) {
this.msg(translation.toString(), args);
}

View File

@ -11,7 +11,6 @@ import com.massivecraft.factions.util.LazyLocation;
import com.massivecraft.factions.util.MiscUtil;
import com.massivecraft.factions.util.RelationUtil;
import com.massivecraft.factions.zcore.util.TL;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
@ -604,8 +603,8 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
}
}
public void msg(TL translation, Object... args){
msg(translation.toString(),args);
public void msg(TL translation, Object... args) {
msg(translation.toString(), args);
}
public void sendMessage(String message) {

View File

@ -20,8 +20,8 @@ import org.bukkit.ChatColor;
import org.bukkit.configuration.file.YamlConfiguration;
/**
* An enum for requesting strings from the language file.
* The contents of this enum file may be subject to frequent changes.
* An enum for requesting strings from the language file. The contents of this enum file may be subject to frequent
* changes.
*/
public enum TL {
/**
@ -109,8 +109,8 @@ public enum TL {
COMMAND_CONFIG_ERROR_MATCHING("Configuration setting \"%s\" couldn't be matched, though it should be... please report this error."),
COMMAND_CONFIG_ERROR_TYPE("'%s' is of type '%s', which cannot be modified with this command."),
COMMAND_CONVERT_BACKEND_RUNNING("command.convert.backend.running","Already running that backend."),
COMMAND_CONVERT_BACKEND_INVALID("command.convert.backend.invalid","Invalid backend"),
COMMAND_CONVERT_BACKEND_RUNNING("command.convert.backend.running", "Already running that backend."),
COMMAND_CONVERT_BACKEND_INVALID("command.convert.backend.invalid", "Invalid backend"),
COMMAND_CREATE_MUSTLEAVE("<b>You must leave your current faction first."),
COMMAND_CREATE_INUSE("<b>That tag is already in use."),
@ -154,7 +154,7 @@ public enum TL {
COMMAND_HELP_404("<b>This page does not exist"),
COMMAND_HELP_NEXTCREATE("<i>Learn how to create a faction on the next page."),
COMMAND_HELP_INVITATIONS("command.help.invitations","<i>You might want to close it and use invitations:"),
COMMAND_HELP_INVITATIONS("command.help.invitations", "<i>You might want to close it and use invitations:"),
COMMAND_HELP_HOME("<i>And don't forget to set your home:"),
COMMAND_HELP_BANK_1("<i>Your faction has a bank which is used to pay for certain"),
COMMAND_HELP_BANK_2("<i>things, so it will need to have money deposited into it."),
@ -470,11 +470,14 @@ public enum TL {
/**
* Lang enum constructor. Use this when your desired path simply exchanges '_' for '.'
*
* @param start The default string.
*/
TL(String start) {
this.path = this.name().replace('_', '.');
if(this.path.startsWith(".")) path="root"+path;
if (this.path.startsWith(".")) {
path = "root" + path;
}
this.def = start;
}
@ -492,7 +495,7 @@ public enum TL {
return this == TITLE ? ChatColor.translateAlternateColorCodes('&', LANG.getString(this.path, def)) + " " : ChatColor.translateAlternateColorCodes('&', LANG.getString(this.path, def));
}
public String format(Object... args){
public String format(Object... args) {
return String.format(toString(), args);
}