Reformat.
This commit is contained in:
parent
125a8c2050
commit
9aecd5f439
@ -7,7 +7,6 @@ import com.massivecraft.factions.event.FPlayerJoinEvent;
|
|||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
public class CmdAdmin extends FCommand {
|
public class CmdAdmin extends FCommand {
|
||||||
|
@ -39,6 +39,6 @@ public class CmdBoom extends FCommand {
|
|||||||
String enabled = myFaction.noExplosionsInTerritory() ? TL.GENERIC_DISABLED.toString() : TL.GENERIC_ENABLED.toString();
|
String enabled = myFaction.noExplosionsInTerritory() ? TL.GENERIC_DISABLED.toString() : TL.GENERIC_ENABLED.toString();
|
||||||
|
|
||||||
// Inform
|
// Inform
|
||||||
myFaction.msg(TL.COMMAND_BOOM_ENABLED, fme.describeTo(myFaction),enabled);
|
myFaction.msg(TL.COMMAND_BOOM_ENABLED, fme.describeTo(myFaction), enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,6 @@ import com.massivecraft.factions.Conf;
|
|||||||
import com.massivecraft.factions.P;
|
import com.massivecraft.factions.P;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -143,7 +142,7 @@ public class CmdConfig extends FCommand {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (newColor == null) {
|
if (newColor == null) {
|
||||||
sendMessage(TL.COMMAND_CONFIG_INVALID_COLOUR.format(fieldName,value.toUpperCase()));
|
sendMessage(TL.COMMAND_CONFIG_INVALID_COLOUR.format(fieldName, value.toUpperCase()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
target.set(null, newColor);
|
target.set(null, newColor);
|
||||||
@ -170,7 +169,7 @@ public class CmdConfig extends FCommand {
|
|||||||
|
|
||||||
}
|
}
|
||||||
if (newMat == null) {
|
if (newMat == null) {
|
||||||
sendMessage(TL.COMMAND_CONFIG_INVALID_MATERIAL.format(fieldName,value.toUpperCase()));
|
sendMessage(TL.COMMAND_CONFIG_INVALID_MATERIAL.format(fieldName, value.toUpperCase()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,13 +179,13 @@ public class CmdConfig extends FCommand {
|
|||||||
if (matSet.contains(newMat)) {
|
if (matSet.contains(newMat)) {
|
||||||
matSet.remove(newMat);
|
matSet.remove(newMat);
|
||||||
target.set(null, matSet);
|
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
|
// Material not present yet, add it
|
||||||
else {
|
else {
|
||||||
matSet.add(newMat);
|
matSet.add(newMat);
|
||||||
target.set(null, matSet);
|
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)) {
|
if (stringSet.contains(value)) {
|
||||||
stringSet.remove(value);
|
stringSet.remove(value);
|
||||||
target.set(null, stringSet);
|
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
|
// String not present yet, add it
|
||||||
else {
|
else {
|
||||||
stringSet.add(value);
|
stringSet.add(value);
|
||||||
target.set(null, stringSet);
|
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
|
// unknown type
|
||||||
else {
|
else {
|
||||||
sendMessage(TL.COMMAND_CONFIG_ERROR_TYPE.format(fieldName,target.getClass().getName()));
|
sendMessage(TL.COMMAND_CONFIG_ERROR_TYPE.format(fieldName, target.getClass().getName()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} catch (NoSuchFieldException ex) {
|
} catch (NoSuchFieldException ex) {
|
||||||
sendMessage(TL.COMMAND_CONFIG_ERROR_MATCHING.format(fieldName));
|
sendMessage(TL.COMMAND_CONFIG_ERROR_MATCHING.format(fieldName));
|
||||||
return;
|
return;
|
||||||
} catch (IllegalAccessException ex) {
|
} catch (IllegalAccessException ex) {
|
||||||
sendMessage(TL.COMMAND_CONFIG_ERROR_SETTING.format(fieldName,value));
|
sendMessage(TL.COMMAND_CONFIG_ERROR_SETTING.format(fieldName, value));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!success.isEmpty()) {
|
if (!success.isEmpty()) {
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
sendMessage(success);
|
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
|
} 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);
|
P.p.log(success);
|
||||||
|
@ -4,7 +4,6 @@ import com.massivecraft.factions.Conf;
|
|||||||
import com.massivecraft.factions.Conf.Backend;
|
import com.massivecraft.factions.Conf.Backend;
|
||||||
import com.massivecraft.factions.zcore.persist.json.FactionsJSON;
|
import com.massivecraft.factions.zcore.persist.json.FactionsJSON;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
import org.bukkit.command.ConsoleCommandSender;
|
||||||
|
|
||||||
public class CmdConvert extends FCommand {
|
public class CmdConvert extends FCommand {
|
||||||
|
@ -7,7 +7,6 @@ import com.massivecraft.factions.struct.Permission;
|
|||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.util.MiscUtil;
|
import com.massivecraft.factions.util.MiscUtil;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -4,9 +4,7 @@ import com.massivecraft.factions.FPlayer;
|
|||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayers;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import mkremins.fanciful.FancyMessage;
|
import mkremins.fanciful.FancyMessage;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdDeinvite extends FCommand {
|
public class CmdDeinvite extends FCommand {
|
||||||
|
@ -8,7 +8,6 @@ import com.massivecraft.factions.scoreboards.FTeamWrapper;
|
|||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ import com.massivecraft.factions.struct.Relation;
|
|||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.zcore.util.SmokeUtil;
|
import com.massivecraft.factions.zcore.util.SmokeUtil;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -96,7 +95,7 @@ public class CmdHome extends FCommand {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
fme.msg(TL.COMMAND_HOME_ENEMYNEAR,String.valueOf(Conf.homesTeleportAllowedEnemyDistance));
|
fme.msg(TL.COMMAND_HOME_ENEMYNEAR, String.valueOf(Conf.homesTeleportAllowedEnemyDistance));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,7 @@ import com.massivecraft.factions.Conf;
|
|||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import mkremins.fanciful.FancyMessage;
|
import mkremins.fanciful.FancyMessage;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdInvite extends FCommand {
|
public class CmdInvite extends FCommand {
|
||||||
|
@ -4,7 +4,6 @@ import com.massivecraft.factions.*;
|
|||||||
import com.massivecraft.factions.event.FPlayerJoinEvent;
|
import com.massivecraft.factions.event.FPlayerJoinEvent;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
public class CmdJoin extends FCommand {
|
public class CmdJoin extends FCommand {
|
||||||
|
@ -5,9 +5,7 @@ import com.massivecraft.factions.Faction;
|
|||||||
import com.massivecraft.factions.Factions;
|
import com.massivecraft.factions.Factions;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import mkremins.fanciful.FancyMessage;
|
import mkremins.fanciful.FancyMessage;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -37,7 +35,7 @@ public class CmdList extends FCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void perform() {
|
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 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ public class CmdLock extends FCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void perform() {
|
public void perform() {
|
||||||
p.setLocked(this.argAsBool(0, !p.getLocked()));
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,7 @@ import com.massivecraft.factions.Faction;
|
|||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import mkremins.fanciful.FancyMessage;
|
import mkremins.fanciful.FancyMessage;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdMod extends FCommand {
|
public class CmdMod extends FCommand {
|
||||||
|
@ -6,7 +6,6 @@ import com.massivecraft.factions.iface.EconomyParticipator;
|
|||||||
import com.massivecraft.factions.integration.Econ;
|
import com.massivecraft.factions.integration.Econ;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import com.massivecraft.factions.iface.EconomyParticipator;
|
|||||||
import com.massivecraft.factions.integration.Econ;
|
import com.massivecraft.factions.integration.Econ;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import com.massivecraft.factions.iface.EconomyParticipator;
|
|||||||
import com.massivecraft.factions.integration.Econ;
|
import com.massivecraft.factions.integration.Econ;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import com.massivecraft.factions.iface.EconomyParticipator;
|
|||||||
import com.massivecraft.factions.integration.Econ;
|
import com.massivecraft.factions.integration.Econ;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import com.massivecraft.factions.iface.EconomyParticipator;
|
|||||||
import com.massivecraft.factions.integration.Econ;
|
import com.massivecraft.factions.integration.Econ;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
|
|
||||||
|
@ -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 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,9 +61,9 @@ public class CmdPowerBoost extends FCommand {
|
|||||||
target = TL.COMMAND_POWERBOOST_FACTION.format(targetFaction.getTag());
|
target = TL.COMMAND_POWERBOOST_FACTION.format(targetFaction.getTag());
|
||||||
}
|
}
|
||||||
|
|
||||||
msg(TL.COMMAND_POWERBOOST_BOOST,target,targetPower);
|
msg(TL.COMMAND_POWERBOOST_BOOST, target, targetPower);
|
||||||
if (!senderIsConsole) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,6 +44,6 @@ public class CmdSetFWarp extends FCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean transact(FPlayer player) {
|
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());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ public class CmdSethome extends FCommand {
|
|||||||
faction.msg(TL.COMMAND_SETHOME_SET, fme.describeTo(myFaction, true));
|
faction.msg(TL.COMMAND_SETHOME_SET, fme.describeTo(myFaction, true));
|
||||||
faction.sendMessage(p.cmdBase.cmdHome.getUseageTemplate());
|
faction.sendMessage(p.cmdBase.cmdHome.getUseageTemplate());
|
||||||
if (faction != myFaction) {
|
if (faction != myFaction) {
|
||||||
fme.msg(TL.COMMAND_SETHOME_SETOTHER,faction.getTag(fme));
|
fme.msg(TL.COMMAND_SETHOME_SETOTHER, faction.getTag(fme));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,9 +4,7 @@ import com.massivecraft.factions.FPlayer;
|
|||||||
import com.massivecraft.factions.FPlayers;
|
import com.massivecraft.factions.FPlayers;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import mkremins.fanciful.FancyMessage;
|
import mkremins.fanciful.FancyMessage;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
public class CmdShowInvites extends FCommand {
|
public class CmdShowInvites extends FCommand {
|
||||||
|
@ -3,7 +3,6 @@ package com.massivecraft.factions.cmd;
|
|||||||
import com.massivecraft.factions.FPlayer;
|
import com.massivecraft.factions.FPlayer;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.apache.commons.lang.time.DurationFormatUtils;
|
import org.apache.commons.lang.time.DurationFormatUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import com.massivecraft.factions.scoreboards.FTeamWrapper;
|
|||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.util.MiscUtil;
|
import com.massivecraft.factions.util.MiscUtil;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -57,7 +56,7 @@ public class CmdTag extends FCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// then make 'em pay (if applicable)
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ import com.massivecraft.factions.integration.Econ;
|
|||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
public class CmdUnclaim extends FCommand {
|
public class CmdUnclaim extends FCommand {
|
||||||
@ -38,7 +37,7 @@ public class CmdUnclaim extends FCommand {
|
|||||||
msg(TL.COMMAND_UNCLAIM_SAFEZONE_SUCCESS);
|
msg(TL.COMMAND_UNCLAIM_SAFEZONE_SUCCESS);
|
||||||
|
|
||||||
if (Conf.logLandUnclaims) {
|
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 {
|
} else {
|
||||||
msg(TL.COMMAND_UNCLAIM_SAFEZONE_NOPERM);
|
msg(TL.COMMAND_UNCLAIM_SAFEZONE_NOPERM);
|
||||||
@ -50,7 +49,7 @@ public class CmdUnclaim extends FCommand {
|
|||||||
msg(TL.COMMAND_UNCLAIM_WARZONE_SUCCESS);
|
msg(TL.COMMAND_UNCLAIM_WARZONE_SUCCESS);
|
||||||
|
|
||||||
if (Conf.logLandUnclaims) {
|
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 {
|
} else {
|
||||||
msg(TL.COMMAND_UNCLAIM_WARZONE_NOPERM);
|
msg(TL.COMMAND_UNCLAIM_WARZONE_NOPERM);
|
||||||
@ -65,7 +64,7 @@ public class CmdUnclaim extends FCommand {
|
|||||||
msg(TL.COMMAND_UNCLAIM_UNCLAIMS);
|
msg(TL.COMMAND_UNCLAIM_UNCLAIMS);
|
||||||
|
|
||||||
if (Conf.logLandUnclaims) {
|
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;
|
return;
|
||||||
@ -109,7 +108,7 @@ public class CmdUnclaim extends FCommand {
|
|||||||
myFaction.msg(TL.COMMAND_UNCLAIM_FACTIONUNCLAIMED, fme.describeTo(myFaction, true));
|
myFaction.msg(TL.COMMAND_UNCLAIM_FACTIONUNCLAIMED, fme.describeTo(myFaction, true));
|
||||||
|
|
||||||
if (Conf.logLandUnclaims) {
|
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()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,7 +7,6 @@ import com.massivecraft.factions.event.LandUnclaimAllEvent;
|
|||||||
import com.massivecraft.factions.integration.Econ;
|
import com.massivecraft.factions.integration.Econ;
|
||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
|
||||||
public class CmdUnclaimall extends FCommand {
|
public class CmdUnclaimall extends FCommand {
|
||||||
@ -51,7 +50,7 @@ public class CmdUnclaimall extends FCommand {
|
|||||||
myFaction.msg(TL.COMMAND_UNCLAIMALL_UNCLAIMED, fme.describeTo(myFaction, true));
|
myFaction.msg(TL.COMMAND_UNCLAIMALL_UNCLAIMED, fme.describeTo(myFaction, true));
|
||||||
|
|
||||||
if (Conf.logLandUnclaims) {
|
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()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,9 +24,9 @@ public class CmdVersion extends FCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void perform() {
|
public void perform() {
|
||||||
msg(TL.COMMAND_VERSION_VERSION,P.p.getDescription().getFullName());
|
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_VERSION, TL._LOCALE, TL._LOCAL_LANGUAGE, TL._LOCAL_REGION, TL._LOCAL_STATE);
|
||||||
msg(TL.GENERIC_TRANSLATION_CONTRIBUTORS,TL._LOCAL_AUTHOR);
|
msg(TL.GENERIC_TRANSLATION_CONTRIBUTORS, TL._LOCAL_AUTHOR);
|
||||||
msg(TL.GENERIC_TRANSLATION_RESPONSIBLE,TL._LOCAL_RESPONSIBLE);
|
msg(TL.GENERIC_TRANSLATION_RESPONSIBLE, TL._LOCAL_RESPONSIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,6 @@ import com.massivecraft.factions.integration.Econ;
|
|||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.zcore.MCommand;
|
import com.massivecraft.factions.zcore.MCommand;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.command.CommandSender;
|
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){
|
public boolean payForCommand(double cost, TL toDoThis, TL forDoingThis) {
|
||||||
return payForCommand(cost,toDoThis.toString(),forDoingThis.toString());
|
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
|
// like above, but just make sure they can pay; returns true unless person can't afford the cost
|
||||||
|
@ -7,7 +7,6 @@ import com.massivecraft.factions.scoreboards.FTeamWrapper;
|
|||||||
import com.massivecraft.factions.struct.Permission;
|
import com.massivecraft.factions.struct.Permission;
|
||||||
import com.massivecraft.factions.struct.Relation;
|
import com.massivecraft.factions.struct.Relation;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
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 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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,15 +67,15 @@ public abstract class FRelationCommand extends FCommand {
|
|||||||
FactionRelationEvent relationEvent = new FactionRelationEvent(myFaction, them, oldRelation, currentRelation);
|
FactionRelationEvent relationEvent = new FactionRelationEvent(myFaction, them, oldRelation, currentRelation);
|
||||||
Bukkit.getServer().getPluginManager().callEvent(relationEvent);
|
Bukkit.getServer().getPluginManager().callEvent(relationEvent);
|
||||||
|
|
||||||
them.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());
|
myFaction.msg(TL.COMMAND_RELATIONS_MUTUAL, currentRelationColor + targetRelation.getTranslation(), currentRelationColor + myFaction.getTag());
|
||||||
}
|
}
|
||||||
// inform the other faction of your request
|
// inform the other faction of your request
|
||||||
else {
|
else {
|
||||||
|
|
||||||
them.msg(TL.COMMAND_RELATIONS_PROPOSAL_1,currentRelationColor + myFaction.getTag(),targetRelation.getColor() + targetRelation.getTranslation());
|
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());
|
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);
|
myFaction.msg(TL.COMMAND_RELATIONS_PROPOSAL_SENT, currentRelationColor + them.getTag(), "" + targetRelation.getColor() + targetRelation);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!targetRelation.isNeutral() && them.isPeaceful()) {
|
if (!targetRelation.isNeutral() && them.isPeaceful()) {
|
||||||
|
@ -8,5 +8,5 @@ public interface EconomyParticipator extends RelationParticipator {
|
|||||||
|
|
||||||
public void msg(String str, Object... args);
|
public void msg(String str, Object... args);
|
||||||
|
|
||||||
public void msg(TL translation,Object... args);
|
public void msg(TL translation, Object... args);
|
||||||
}
|
}
|
@ -6,9 +6,7 @@ import com.massivecraft.factions.P;
|
|||||||
import com.massivecraft.factions.integration.Econ;
|
import com.massivecraft.factions.integration.Econ;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
import com.massivecraft.factions.zcore.util.TextUtil;
|
import com.massivecraft.factions.zcore.util.TextUtil;
|
||||||
|
|
||||||
import mkremins.fanciful.FancyMessage;
|
import mkremins.fanciful.FancyMessage;
|
||||||
|
|
||||||
import org.apache.commons.lang.time.DurationFormatUtils;
|
import org.apache.commons.lang.time.DurationFormatUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -257,8 +255,8 @@ public abstract class MCommand<T extends MPlugin> {
|
|||||||
sender.sendMessage(p.txt.parse(str, args));
|
sender.sendMessage(p.txt.parse(str, args));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void msg(TL translation,Object... args){
|
public void msg(TL translation, Object... args) {
|
||||||
sender.sendMessage(p.txt.parse(translation.toString(),args));
|
sender.sendMessage(p.txt.parse(translation.toString(), args));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendMessage(String msg) {
|
public void sendMessage(String msg) {
|
||||||
|
@ -16,7 +16,6 @@ import com.massivecraft.factions.struct.Relation;
|
|||||||
import com.massivecraft.factions.struct.Role;
|
import com.massivecraft.factions.struct.Role;
|
||||||
import com.massivecraft.factions.util.RelationUtil;
|
import com.massivecraft.factions.util.RelationUtil;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -767,7 +766,7 @@ public abstract class MemoryFPlayer implements FPlayer {
|
|||||||
this.sendMessage(P.p.txt.parse(str, args));
|
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);
|
this.msg(translation.toString(), args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ import com.massivecraft.factions.util.LazyLocation;
|
|||||||
import com.massivecraft.factions.util.MiscUtil;
|
import com.massivecraft.factions.util.MiscUtil;
|
||||||
import com.massivecraft.factions.util.RelationUtil;
|
import com.massivecraft.factions.util.RelationUtil;
|
||||||
import com.massivecraft.factions.zcore.util.TL;
|
import com.massivecraft.factions.zcore.util.TL;
|
||||||
|
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
@ -604,8 +603,8 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void msg(TL translation, Object... args){
|
public void msg(TL translation, Object... args) {
|
||||||
msg(translation.toString(),args);
|
msg(translation.toString(), args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendMessage(String message) {
|
public void sendMessage(String message) {
|
||||||
|
@ -20,8 +20,8 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.configuration.file.YamlConfiguration;
|
import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An enum for requesting strings from the language file.
|
* An enum for requesting strings from the language file. The contents of this enum file may be subject to frequent
|
||||||
* The contents of this enum file may be subject to frequent changes.
|
* changes.
|
||||||
*/
|
*/
|
||||||
public enum TL {
|
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_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_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_RUNNING("command.convert.backend.running", "Already running that backend."),
|
||||||
COMMAND_CONVERT_BACKEND_INVALID("command.convert.backend.invalid","Invalid backend"),
|
COMMAND_CONVERT_BACKEND_INVALID("command.convert.backend.invalid", "Invalid backend"),
|
||||||
|
|
||||||
COMMAND_CREATE_MUSTLEAVE("<b>You must leave your current faction first."),
|
COMMAND_CREATE_MUSTLEAVE("<b>You must leave your current faction first."),
|
||||||
COMMAND_CREATE_INUSE("<b>That tag is already in use."),
|
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_404("<b>This page does not exist"),
|
||||||
COMMAND_HELP_NEXTCREATE("<i>Learn how to create a faction on the next page."),
|
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_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_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."),
|
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 '.'
|
* Lang enum constructor. Use this when your desired path simply exchanges '_' for '.'
|
||||||
|
*
|
||||||
* @param start The default string.
|
* @param start The default string.
|
||||||
*/
|
*/
|
||||||
TL(String start) {
|
TL(String start) {
|
||||||
this.path = this.name().replace('_', '.');
|
this.path = this.name().replace('_', '.');
|
||||||
if(this.path.startsWith(".")) path="root"+path;
|
if (this.path.startsWith(".")) {
|
||||||
|
path = "root" + path;
|
||||||
|
}
|
||||||
this.def = start;
|
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));
|
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);
|
return String.format(toString(), args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user