Reformatted Code
This commit is contained in:
@@ -40,17 +40,17 @@ public class CmdAdmin extends FCommand {
|
||||
boolean permAny = Permission.ADMIN_ANY.has(sender, false);
|
||||
Faction targetFaction = fyou.getFaction();
|
||||
|
||||
if (targetFaction != myFaction && !permAny) {
|
||||
if (targetFaction != myFaction && ! permAny) {
|
||||
msg(TL.COMMAND_ADMIN_NOTMEMBER, fyou.describeTo(fme, true));
|
||||
return;
|
||||
}
|
||||
|
||||
if (fme != null && fme.getRole() != Role.LEADER && ! permAny) {
|
||||
if (fme != null && fme.getRole() != Role.LEADER && ! permAny) {
|
||||
msg(TL.COMMAND_ADMIN_NOTADMIN);
|
||||
return;
|
||||
}
|
||||
|
||||
if (fyou == fme && !permAny) {
|
||||
if (fyou == fme && ! permAny) {
|
||||
msg(TL.COMMAND_ADMIN_TARGETSELF);
|
||||
return;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public class CmdAdmin extends FCommand {
|
||||
if (admin != null) {
|
||||
admin.setRole(Role.COLEADER);
|
||||
}
|
||||
fyou.setRole(Role.LEADER);
|
||||
fyou.setRole(Role.LEADER);
|
||||
msg(TL.COMMAND_ADMIN_PROMOTES, fyou.describeTo(fme, true));
|
||||
|
||||
// Inform all players
|
||||
|
||||
@@ -32,7 +32,7 @@ public class CmdAutoClaim extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fme.canClaimForFaction(forFaction)) {
|
||||
if (! fme.canClaimForFaction(forFaction)) {
|
||||
if (myFaction == forFaction) {
|
||||
msg(TL.COMMAND_AUTOCLAIM_REQUIREDRANK, Role.MODERATOR.getTranslation());
|
||||
} else {
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.ArrayList;
|
||||
public class CmdAutoHelp extends MCommand<SavageFactions> {
|
||||
|
||||
public CmdAutoHelp() {
|
||||
super(SavageFactions.plugin);
|
||||
super(SavageFactions.plugin);
|
||||
this.aliases.add("?");
|
||||
this.aliases.add("h");
|
||||
this.aliases.add("help");
|
||||
|
||||
@@ -35,9 +35,9 @@ public class CmdBan extends FCommand {
|
||||
public void perform() {
|
||||
|
||||
// Adds bypass to admins and clean permission check
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.BAN);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "ban");
|
||||
return;
|
||||
}
|
||||
@@ -80,7 +80,7 @@ public class CmdBan extends FCommand {
|
||||
|
||||
if (event.isCancelled()) {
|
||||
// if someone cancels a ban, we'll get people complaining here. So lets log it.
|
||||
SavageFactions.plugin.log(Level.WARNING, "Attempted to ban {0} but someone cancelled the kick event. This isn't good.", target.getName());
|
||||
SavageFactions.plugin.log(Level.WARNING, "Attempted to ban {0} but someone cancelled the kick event. This isn't good.", target.getName());
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class CmdBanlist extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
Faction target = myFaction;
|
||||
if (!args.isEmpty()) {
|
||||
if (! args.isEmpty()) {
|
||||
target = argAsFaction(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,30 +31,30 @@ public class CmdBanner extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
|
||||
msg(TL.COMMAND_BANNER_DISABLED);
|
||||
return;
|
||||
}
|
||||
if (! fme.hasMoney(SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Cost", 5000))) {
|
||||
if (! fme.hasMoney(SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Cost", 5000))) {
|
||||
msg(TL.COMMAND_BANNER_NOTENOUGHMONEY);
|
||||
return;
|
||||
}
|
||||
takeMoney(fme, SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Cost", 5000));
|
||||
takeMoney(fme, SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Cost", 5000));
|
||||
|
||||
//ItemStack warBanner = SavageFactions.plugin.createItem(Material.BANNER, 1, (short) 1, SavageFactions.plugin.getConfig().getString("fbanners.Item.Name"), SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
|
||||
//ItemStack warBanner = SavageFactions.plugin.createItem(Material.BANNER, 1, (short) 1, SavageFactions.plugin.getConfig().getString("fbanners.Item.Name"), SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
|
||||
//BannerMeta bannerMeta = (BannerMeta) warBanner.getItemMeta();
|
||||
ItemStack warBanner = fme.getFaction().getBanner();
|
||||
if (warBanner != null) {
|
||||
ItemMeta warmeta = warBanner.getItemMeta();
|
||||
warmeta.setDisplayName(SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fbanners.Item.Name")));
|
||||
warmeta.setLore(SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore")));
|
||||
warmeta.setDisplayName(SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fbanners.Item.Name")));
|
||||
warmeta.setLore(SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore")));
|
||||
warBanner.setItemMeta(warmeta);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
warBanner = SavageFactions.plugin.createItem(SavageFactions.plugin.BANNER, 1, (short) 1, SavageFactions.plugin.getConfig().getString("fbanners.Item.Name"), SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
|
||||
warBanner = SavageFactions.plugin.createItem(SavageFactions.plugin.BANNER, 1, (short) 1, SavageFactions.plugin.getConfig().getString("fbanners.Item.Name"), SavageFactions.plugin.getConfig().getStringList("fbanners.Item.Lore"));
|
||||
}
|
||||
fme.msg(TL.COMMAND_BANNER_SUCCESS);
|
||||
warBanner.setAmount(1);
|
||||
@@ -63,7 +63,7 @@ public class CmdBanner extends FCommand {
|
||||
|
||||
|
||||
public boolean hasMoney(FPlayer fme, int amt) {
|
||||
Economy econ = SavageFactions.plugin.getEcon();
|
||||
Economy econ = SavageFactions.plugin.getEcon();
|
||||
if (econ.getBalance(fme.getPlayer()) >= amt) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -74,7 +74,7 @@ public class CmdBanner extends FCommand {
|
||||
|
||||
public void takeMoney(FPlayer fme, int amt) {
|
||||
if (hasMoney(fme, amt)) {
|
||||
Economy econ = SavageFactions.plugin.getEcon();
|
||||
Economy econ = SavageFactions.plugin.getEcon();
|
||||
econ.withdrawPlayer(fme.getPlayer(), amt);
|
||||
fme.sendMessage(TL.COMMAND_BANNER_MONEYTAKE.toString().replace("{amount}", amt + ""));
|
||||
}
|
||||
|
||||
@@ -27,17 +27,17 @@ public class CmdBoom extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!myFaction.isPeaceful()) {
|
||||
if (! myFaction.isPeaceful()) {
|
||||
fme.msg(TL.COMMAND_BOOM_PEACEFULONLY);
|
||||
return;
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if (!payForCommand(Conf.econCostNoBoom, TL.COMMAND_BOOM_TOTOGGLE, TL.COMMAND_BOOM_FORTOGGLE)) {
|
||||
if (! payForCommand(Conf.econCostNoBoom, TL.COMMAND_BOOM_TOTOGGLE, TL.COMMAND_BOOM_FORTOGGLE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
myFaction.setPeacefulExplosionsEnabled(this.argAsBool(0, !myFaction.getPeacefulExplosionsEnabled()));
|
||||
myFaction.setPeacefulExplosionsEnabled(this.argAsBool(0, ! myFaction.getPeacefulExplosionsEnabled()));
|
||||
|
||||
String enabled = myFaction.noExplosionsInTerritory() ? TL.GENERIC_DISABLED.toString() : TL.GENERIC_ENABLED.toString();
|
||||
|
||||
|
||||
@@ -25,15 +25,15 @@ public class CmdBypass extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
fme.setIsAdminBypassing(this.argAsBool(0, !fme.isAdminBypassing()));
|
||||
fme.setIsAdminBypassing(this.argAsBool(0, ! fme.isAdminBypassing()));
|
||||
|
||||
// TODO: Move this to a transient field in the model??
|
||||
if (fme.isAdminBypassing()) {
|
||||
fme.msg(TL.COMMAND_BYPASS_ENABLE.toString());
|
||||
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_ENABLELOG.toString());
|
||||
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_ENABLELOG.toString());
|
||||
} else {
|
||||
fme.msg(TL.COMMAND_BYPASS_DISABLE.toString());
|
||||
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_DISABLELOG.toString());
|
||||
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_BYPASS_DISABLELOG.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public class CmdChat extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!Conf.factionOnlyChat) {
|
||||
if (! Conf.factionOnlyChat) {
|
||||
msg(TL.COMMAND_CHAT_DISABLED.toString());
|
||||
return;
|
||||
}
|
||||
@@ -41,7 +41,7 @@ public class CmdChat extends FCommand {
|
||||
// Only allow Mods and higher rank to switch to this channel.
|
||||
if (modeString.startsWith("m") && fme.getRole().isAtLeast(Role.MODERATOR)) {
|
||||
modeTarget = ChatMode.MOD;
|
||||
} else if (modeString.startsWith("m") && !fme.getRole().isAtLeast(Role.MODERATOR)) {
|
||||
} else if (modeString.startsWith("m") && ! fme.getRole().isAtLeast(Role.MODERATOR)) {
|
||||
msg(TL.COMMAND_CHAT_MOD_ONLY);
|
||||
return;
|
||||
} else if (modeString.startsWith("p")) {
|
||||
|
||||
@@ -24,14 +24,14 @@ public class CmdChatSpy extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
fme.setSpyingChat(this.argAsBool(0, !fme.isSpyingChat()));
|
||||
fme.setSpyingChat(this.argAsBool(0, ! fme.isSpyingChat()));
|
||||
|
||||
if (fme.isSpyingChat()) {
|
||||
fme.msg(TL.COMMAND_CHATSPY_ENABLE);
|
||||
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_CHATSPY_ENABLELOG.toString());
|
||||
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_CHATSPY_ENABLELOG.toString());
|
||||
} else {
|
||||
fme.msg(TL.COMMAND_CHATSPY_DISABLE);
|
||||
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_CHATSPY_DISABLELOG.toString());
|
||||
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_CHATSPY_DISABLELOG.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CmdCheckpoint extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("checkpoints.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("checkpoints.Enabled")) {
|
||||
fme.msg(TL.COMMAND_CHECKPOINT_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -28,14 +28,14 @@ public class CmdChest extends FCommand {
|
||||
public void perform() {
|
||||
|
||||
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fchest.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fchest.Enabled")) {
|
||||
fme.sendMessage("This command is disabled!");
|
||||
return;
|
||||
}
|
||||
// This permission check is way too explicit but it's clean
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.CHEST);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "access chest");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class CmdClaim extends FCommand {
|
||||
int radius = this.argAsInt(0, 1); // Default to 1
|
||||
final Faction forFaction = this.argAsFaction(1, myFaction); // Default to own
|
||||
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.TERRITORY);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "change faction territory");
|
||||
@@ -56,7 +56,7 @@ public class CmdClaim extends FCommand {
|
||||
fme.attemptClaim(forFaction, me.getLocation(), true);
|
||||
} else {
|
||||
// radius claim
|
||||
if (!Permission.CLAIM_RADIUS.has(sender, false)) {
|
||||
if (! Permission.CLAIM_RADIUS.has(sender, false)) {
|
||||
msg(TL.COMMAND_CLAIM_DENIED);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -50,22 +50,22 @@ public class CmdColeader extends FCommand {
|
||||
boolean permAny = Permission.COLEADER_ANY.has(sender, false);
|
||||
Faction targetFaction = you.getFaction();
|
||||
|
||||
if (targetFaction != myFaction && !permAny) {
|
||||
if (targetFaction != myFaction && ! permAny) {
|
||||
msg(TL.COMMAND_MOD_NOTMEMBER, you.describeTo(fme, true));
|
||||
return;
|
||||
}
|
||||
|
||||
if (fme != null && fme.getRole() != Role.LEADER && ! permAny) {
|
||||
if (fme != null && fme.getRole() != Role.LEADER && ! permAny) {
|
||||
msg(TL.COMMAND_COLEADER_NOTADMIN);
|
||||
return;
|
||||
}
|
||||
|
||||
if (you == fme && !permAny) {
|
||||
if (you == fme && ! permAny) {
|
||||
msg(TL.COMMAND_COLEADER_SELF);
|
||||
return;
|
||||
}
|
||||
|
||||
if (you.getRole() == Role.LEADER) {
|
||||
if (you.getRole() == Role.LEADER) {
|
||||
msg(TL.COMMAND_COLEADER_TARGETISADMIN);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ public class CmdConfig extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked") Set<Material> matSet = (Set<Material>) target.get(null);
|
||||
@SuppressWarnings ("unchecked") Set<Material> matSet = (Set<Material>) target.get(null);
|
||||
|
||||
// Material already present, so remove it
|
||||
if (matSet.contains(newMat)) {
|
||||
@@ -192,7 +192,7 @@ public class CmdConfig extends FCommand {
|
||||
|
||||
// Set<String>
|
||||
else if (innerType == String.class) {
|
||||
@SuppressWarnings("unchecked") Set<String> stringSet = (Set<String>) target.get(null);
|
||||
@SuppressWarnings ("unchecked") Set<String> stringSet = (Set<String>) target.get(null);
|
||||
|
||||
// String already present, so remove it
|
||||
if (stringSet.contains(value.toString())) {
|
||||
@@ -228,13 +228,13 @@ public class CmdConfig extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!success.isEmpty()) {
|
||||
if (! success.isEmpty()) {
|
||||
if (sender instanceof Player) {
|
||||
sendMessage(success);
|
||||
SavageFactions.plugin.log(success + TL.COMMAND_CONFIG_LOG.format((Player) sender));
|
||||
SavageFactions.plugin.log(success + TL.COMMAND_CONFIG_LOG.format((Player) sender));
|
||||
} else // using SavageFactions.plugin.log() instead of sendMessage if run from server console so that "[Factions v#.#.#]" is prepended in server log
|
||||
{
|
||||
SavageFactions.plugin.log(success);
|
||||
SavageFactions.plugin.log(success);
|
||||
}
|
||||
}
|
||||
// save change to disk
|
||||
|
||||
@@ -16,7 +16,7 @@ public class CmdConvert extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!(this.sender instanceof ConsoleCommandSender)) {
|
||||
if (! (this.sender instanceof ConsoleCommandSender)) {
|
||||
this.sender.sendMessage(TL.GENERIC_CONSOLEONLY.toString());
|
||||
}
|
||||
Backend nb = Backend.valueOf(this.argAsString(0).toUpperCase());
|
||||
|
||||
@@ -52,7 +52,7 @@ public class CmdCreate extends FCommand {
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
|
||||
if (!canAffordCommand(Conf.econCostCreate, TL.COMMAND_CREATE_TOCREATE.toString())) {
|
||||
if (! canAffordCommand(Conf.econCostCreate, TL.COMMAND_CREATE_TOCREATE.toString())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public class CmdCreate extends FCommand {
|
||||
}
|
||||
|
||||
// then make 'em pay (if applicable)
|
||||
if (!payForCommand(Conf.econCostCreate, TL.COMMAND_CREATE_TOCREATE, TL.COMMAND_CREATE_FORCREATE)) {
|
||||
if (! payForCommand(Conf.econCostCreate, TL.COMMAND_CREATE_TOCREATE, TL.COMMAND_CREATE_FORCREATE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class CmdCreate extends FCommand {
|
||||
// We should consider adding the role just AFTER joining the faction.
|
||||
// That way we don't have to mess up deleting more stuff.
|
||||
// And prevent the user from being returned to NORMAL after deleting his old faction.
|
||||
fme.setRole(Role.LEADER);
|
||||
fme.setRole(Role.LEADER);
|
||||
|
||||
for (FPlayer follower : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
follower.msg(TL.COMMAND_CREATE_CREATED, fme.describeTo(follower, true), faction.getTag(follower));
|
||||
@@ -98,9 +98,9 @@ public class CmdCreate extends FCommand {
|
||||
msg(TL.COMMAND_CREATE_YOUSHOULD, p.cmdBase.cmdDescription.getUseageTemplate());
|
||||
|
||||
if (Conf.logFactionCreate) {
|
||||
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_CREATE_CREATEDLOG.toString() + tag);
|
||||
SavageFactions.plugin.log(fme.getName() + TL.COMMAND_CREATE_CREATEDLOG.toString() + tag);
|
||||
}
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
this.fme.msg(TL.COMMAND_PAYPALSET_CREATED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ public class CmdDeinvite extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
FPlayer you = this.argAsBestFPlayerMatch(0);
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.INVITE);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "manage invites");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CmdDelFWarp extends FCommand {
|
||||
public void perform() {
|
||||
String warp = argAsString(0);
|
||||
if (myFaction.isWarp(warp)) {
|
||||
if (!transact(fme)) {
|
||||
if (! transact(fme)) {
|
||||
return;
|
||||
}
|
||||
myFaction.removeWarp(warp);
|
||||
@@ -34,7 +34,7 @@ public class CmdDelFWarp extends FCommand {
|
||||
}
|
||||
|
||||
private boolean transact(FPlayer player) {
|
||||
return ! SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SavageFactions.plugin.getConfig().getDouble("warp-cost.delwarp", 5), TL.COMMAND_DELFWARP_TODELETE.toString(), TL.COMMAND_DELFWARP_FORDELETE.toString());
|
||||
return ! SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SavageFactions.plugin.getConfig().getDouble("warp-cost.delwarp", 5), TL.COMMAND_DELFWARP_TODELETE.toString(), TL.COMMAND_DELFWARP_FORDELETE.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,6 +4,6 @@ public class CmdDemote extends FPromoteCommand {
|
||||
|
||||
public CmdDemote() {
|
||||
aliases.add("demote");
|
||||
this.relative = -1;
|
||||
this.relative = - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class CmdDescription 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.econCostDesc, TL.COMMAND_DESCRIPTION_TOCHANGE, TL.COMMAND_DESCRIPTION_FORCHANGE)) {
|
||||
if (! payForCommand(Conf.econCostDesc, TL.COMMAND_DESCRIPTION_TOCHANGE, TL.COMMAND_DESCRIPTION_FORCHANGE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class CmdDescription extends FCommand {
|
||||
// And replace all the % because it messes with string formatting and this is easy way around that.
|
||||
myFaction.setDescription(TextUtil.implode(args, " ").replaceAll("%", "").replaceAll("(&([a-f0-9klmnor]))", "& $2"));
|
||||
|
||||
if (!Conf.broadcastDescriptionChanges) {
|
||||
if (! Conf.broadcastDescriptionChanges) {
|
||||
fme.msg(TL.COMMAND_DESCRIPTION_CHANGED, myFaction.describeTo(fme));
|
||||
fme.sendMessage(myFaction.getDescription());
|
||||
return;
|
||||
|
||||
@@ -31,9 +31,9 @@ public class CmdFWarp extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
//TODO: check if in combat.
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.WARP);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "use warps");
|
||||
return;
|
||||
}
|
||||
@@ -54,13 +54,13 @@ public class CmdFWarp extends FCommand {
|
||||
if (myFaction.isWarp(argAsString(0))) {
|
||||
|
||||
// Check if requires password and if so, check if valid. CASE SENSITIVE
|
||||
if (myFaction.hasWarpPassword(warpName) && !myFaction.isWarpPassword(warpName, passwordAttempt)) {
|
||||
if (myFaction.hasWarpPassword(warpName) && ! myFaction.isWarpPassword(warpName, passwordAttempt)) {
|
||||
fme.msg(TL.COMMAND_FWARP_INVALID_PASSWORD);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check transaction AFTER password check.
|
||||
if (!transact(fme)) {
|
||||
if (! transact(fme)) {
|
||||
return;
|
||||
}
|
||||
final FPlayer fPlayer = fme;
|
||||
@@ -82,7 +82,7 @@ public class CmdFWarp extends FCommand {
|
||||
}
|
||||
|
||||
private boolean transact(FPlayer player) {
|
||||
return ! SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SavageFactions.plugin.getConfig().getDouble("warp-cost.warp", 5), TL.COMMAND_FWARP_TOWARP.toString(), TL.COMMAND_FWARP_FORWARPING.toString());
|
||||
return ! SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SavageFactions.plugin.getConfig().getDouble("warp-cost.warp", 5), TL.COMMAND_FWARP_TOWARP.toString(), TL.COMMAND_FWARP_FORWARPING.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -23,8 +23,8 @@ public class CmdFly extends FCommand {
|
||||
|
||||
|
||||
public static ConcurrentHashMap<String, Boolean> flyMap = new ConcurrentHashMap<String, Boolean>();
|
||||
public static int id = -1;
|
||||
public static int flyid = -1;
|
||||
public static int id = - 1;
|
||||
public static int flyid = - 1;
|
||||
|
||||
public CmdFly() {
|
||||
super();
|
||||
@@ -39,11 +39,11 @@ public class CmdFly extends FCommand {
|
||||
|
||||
public static void startParticles() {
|
||||
// Just a secondary check.
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
|
||||
return;
|
||||
}
|
||||
|
||||
id = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
|
||||
id = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for (String name : flyMap.keySet()) {
|
||||
@@ -51,10 +51,10 @@ public class CmdFly extends FCommand {
|
||||
if (player == null) {
|
||||
continue;
|
||||
}
|
||||
if (!player.isFlying()) {
|
||||
if (! player.isFlying()) {
|
||||
continue;
|
||||
}
|
||||
if (! SavageFactions.plugin.mc17) {
|
||||
if (! SavageFactions.plugin.mc17) {
|
||||
if (player.getGameMode() == GameMode.SPECTATOR) {
|
||||
continue;
|
||||
}
|
||||
@@ -63,31 +63,31 @@ public class CmdFly extends FCommand {
|
||||
if (FPlayers.getInstance().getByPlayer(player).isVanished()) {
|
||||
// Actually, vanished players (such as admins) should not display particles to prevent others from knowing their vanished assistance for moderation.
|
||||
// But we can keep it as a config.
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enable-While-Vanished")) {
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enable-While-Vanished")) {
|
||||
return;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (SavageFactions.plugin.useNonPacketParticles) {
|
||||
if (SavageFactions.plugin.useNonPacketParticles) {
|
||||
// 1.9+ based servers will use the built in particleAPI instead of packet based.
|
||||
// any particle amount higher than 0 made them go everywhere, and the offset at 0 was not working.
|
||||
// So setting the amount to 0 spawns 1 in the precise location
|
||||
player.getWorld().spawnParticle(Particle.CLOUD, player.getLocation().add(0, -0.35, 0), 0);
|
||||
player.getWorld().spawnParticle(Particle.CLOUD, player.getLocation().add(0, - 0.35, 0), 0);
|
||||
} else {
|
||||
ParticleEffect.CLOUD.display((float) 0, (float) 0, (float) 0, (float) 0, 3, player.getLocation().add(0, -0.35, 0), 16);
|
||||
ParticleEffect.CLOUD.display((float) 0, (float) 0, (float) 0, (float) 0, 3, player.getLocation().add(0, - 0.35, 0), 16);
|
||||
}
|
||||
|
||||
}
|
||||
if (flyMap.keySet().size() == 0) {
|
||||
Bukkit.getScheduler().cancelTask(id);
|
||||
id = -1;
|
||||
id = - 1;
|
||||
}
|
||||
}
|
||||
}, 10L, 3L);
|
||||
}
|
||||
|
||||
public static void startFlyCheck() {
|
||||
flyid = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
|
||||
flyid = Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
|
||||
@Override
|
||||
public void run() throws ConcurrentModificationException { //threw the exception for now, until I recode fly :( Cringe.
|
||||
checkTaskState();
|
||||
@@ -100,7 +100,7 @@ public class CmdFly extends FCommand {
|
||||
if (player == null) {
|
||||
continue;
|
||||
}
|
||||
if (!player.isFlying()) {
|
||||
if (! player.isFlying()) {
|
||||
continue;
|
||||
}
|
||||
FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player);
|
||||
@@ -125,7 +125,7 @@ public class CmdFly extends FCommand {
|
||||
FLocation myFloc = new FLocation(player.getLocation());
|
||||
Faction toFac = Board.getInstance().getFactionAt(myFloc);
|
||||
if (Board.getInstance().getFactionAt(myFloc) != myFaction) {
|
||||
if (!checkBypassPerms(fPlayer, player, toFac)) {
|
||||
if (! checkBypassPerms(fPlayer, player, toFac)) {
|
||||
fPlayer.setFlying(false);
|
||||
flyMap.remove(name);
|
||||
continue;
|
||||
@@ -141,25 +141,25 @@ public class CmdFly extends FCommand {
|
||||
|
||||
private static boolean checkBypassPerms(FPlayer fme, Player me, Faction toFac) {
|
||||
if (toFac != fme.getFaction()) {
|
||||
if (!me.hasPermission("factions.fly.wilderness") && toFac.isWilderness() || !me.hasPermission("factions.fly.safezone") && toFac.isSafeZone() || !me.hasPermission("factions.fly.warzone") && toFac.isWarZone()) {
|
||||
if (! me.hasPermission("factions.fly.wilderness") && toFac.isWilderness() || ! me.hasPermission("factions.fly.safezone") && toFac.isSafeZone() || ! me.hasPermission("factions.fly.warzone") && toFac.isWarZone()) {
|
||||
fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
return false;
|
||||
}
|
||||
Access access = toFac.getAccess(fme, PermissableAction.FLY);
|
||||
if ((!(me.hasPermission("factions.fly.enemy") || access == Access.ALLOW)) && toFac.getRelationTo(fme.getFaction()) == Relation.ENEMY) {
|
||||
if ((! (me.hasPermission("factions.fly.enemy") || access == Access.ALLOW)) && toFac.getRelationTo(fme.getFaction()) == Relation.ENEMY) {
|
||||
fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
return false;
|
||||
}
|
||||
if (!(me.hasPermission("factions.fly.ally") || access == Access.ALLOW) && toFac.getRelationTo(fme.getFaction()) == Relation.ALLY) {
|
||||
if (! (me.hasPermission("factions.fly.ally") || access == Access.ALLOW) && toFac.getRelationTo(fme.getFaction()) == Relation.ALLY) {
|
||||
fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
return false;
|
||||
}
|
||||
if (!(me.hasPermission("factions.fly.truce") || access == Access.ALLOW) && toFac.getRelationTo(fme.getFaction()) == Relation.TRUCE) {
|
||||
if (! (me.hasPermission("factions.fly.truce") || access == Access.ALLOW) && toFac.getRelationTo(fme.getFaction()) == Relation.TRUCE) {
|
||||
fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(me.hasPermission("factions.fly.neutral") || access == Access.ALLOW) && toFac.getRelationTo(fme.getFaction()) == Relation.NEUTRAL && !isSystemFaction(toFac)) {
|
||||
if (! (me.hasPermission("factions.fly.neutral") || access == Access.ALLOW) && toFac.getRelationTo(fme.getFaction()) == Relation.NEUTRAL && ! isSystemFaction(toFac)) {
|
||||
fme.msg(TL.COMMAND_FLY_NO_ACCESS, toFac.getTag(fme));
|
||||
return false;
|
||||
}
|
||||
@@ -177,7 +177,7 @@ public class CmdFly extends FCommand {
|
||||
public static void checkTaskState() {
|
||||
if (flyMap.keySet().size() == 0) {
|
||||
Bukkit.getScheduler().cancelTask(flyid);
|
||||
flyid = -1;
|
||||
flyid = - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,21 +188,21 @@ public class CmdFly extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
// Disabled by default.
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
|
||||
fme.msg(TL.COMMAND_FLY_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
FLocation myfloc = new FLocation(me.getLocation());
|
||||
Faction toFac = Board.getInstance().getFactionAt(myfloc);
|
||||
if (!checkBypassPerms(fme, me, toFac)) return;
|
||||
if (! checkBypassPerms(fme, me, toFac)) return;
|
||||
List<Entity> entities = this.me.getNearbyEntities(16.0D, 256.0D, 16.0D);
|
||||
|
||||
for(int i = 0; i <= entities.size() - 1; ++i) {
|
||||
for (int i = 0; i <= entities.size() - 1; ++ i) {
|
||||
if (entities.get(i) instanceof Player) {
|
||||
Player eplayer = (Player)entities.get(i);
|
||||
Player eplayer = (Player) entities.get(i);
|
||||
FPlayer efplayer = FPlayers.getInstance().getByPlayer(eplayer);
|
||||
if (efplayer.getRelationTo(this.fme) == Relation.ENEMY && !efplayer.isStealthEnabled()) {
|
||||
if (efplayer.getRelationTo(this.fme) == Relation.ENEMY && ! efplayer.isStealthEnabled()) {
|
||||
this.fme.msg(TL.COMMAND_FLY_CHECK_ENEMY);
|
||||
return;
|
||||
}
|
||||
@@ -210,14 +210,14 @@ public class CmdFly extends FCommand {
|
||||
}
|
||||
|
||||
if (args.size() == 0) {
|
||||
toggleFlight(!fme.isFlying(), me);
|
||||
toggleFlight(! fme.isFlying(), me);
|
||||
} else if (args.size() == 1) {
|
||||
toggleFlight(argAsBool(0), me);
|
||||
}
|
||||
}
|
||||
|
||||
private void toggleFlight(final boolean toggle, final Player player) {
|
||||
if (!toggle) {
|
||||
if (! toggle) {
|
||||
fme.setFlying(false);
|
||||
flyMap.remove(player.getName());
|
||||
return;
|
||||
@@ -230,12 +230,12 @@ public class CmdFly extends FCommand {
|
||||
public void run() {
|
||||
fme.setFlying(true);
|
||||
flyMap.put(player.getName(), true);
|
||||
if (id == -1) {
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
|
||||
if (id == - 1) {
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("ffly.Particles.Enabled")) {
|
||||
startParticles();
|
||||
}
|
||||
}
|
||||
if (flyid == -1) {
|
||||
if (flyid == - 1) {
|
||||
startFlyCheck();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,12 +26,12 @@ public class CmdGetVault extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fvault.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fvault.Enabled")) {
|
||||
fme.sendMessage("This command is disabled!");
|
||||
return;
|
||||
}
|
||||
Location vaultLocation = fme.getFaction().getVault();
|
||||
ItemStack vault = SavageFactions.plugin.createItem(Material.CHEST, 1, (short) 0, SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fvault.Item.Name")), SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fvault.Item.Lore")));
|
||||
ItemStack vault = SavageFactions.plugin.createItem(Material.CHEST, 1, (short) 0, SavageFactions.plugin.color(SavageFactions.plugin.getConfig().getString("fvault.Item.Name")), SavageFactions.plugin.colorList(SavageFactions.plugin.getConfig().getStringList("fvault.Item.Lore")));
|
||||
|
||||
|
||||
//check if vault is set
|
||||
@@ -42,8 +42,8 @@ public class CmdGetVault extends FCommand {
|
||||
|
||||
|
||||
//has enough money?
|
||||
int amount = SavageFactions.plugin.getConfig().getInt("fvault.Price");
|
||||
if (!fme.hasMoney(amount)) {
|
||||
int amount = SavageFactions.plugin.getConfig().getInt("fvault.Price");
|
||||
if (! fme.hasMoney(amount)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class CmdHelp extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("use-old-help", true)) {
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("use-old-help", true)) {
|
||||
if (helpPages == null) {
|
||||
updateHelp();
|
||||
}
|
||||
@@ -57,9 +57,9 @@ public class CmdHelp extends FCommand {
|
||||
sendMessage(helpPages.get(page));
|
||||
return;
|
||||
}
|
||||
ConfigurationSection help = SavageFactions.plugin.getConfig().getConfigurationSection("help");
|
||||
ConfigurationSection help = SavageFactions.plugin.getConfig().getConfigurationSection("help");
|
||||
if (help == null) {
|
||||
help = SavageFactions.plugin.getConfig().createSection("help"); // create new help section
|
||||
help = SavageFactions.plugin.getConfig().createSection("help"); // create new help section
|
||||
List<String> error = new ArrayList<>();
|
||||
error.add("&cUpdate help messages in config.yml!");
|
||||
error.add("&cSet use-old-help for legacy help messages");
|
||||
@@ -72,7 +72,7 @@ public class CmdHelp extends FCommand {
|
||||
return;
|
||||
}
|
||||
for (String helpLine : page) {
|
||||
sendMessage(SavageFactions.plugin.txt.parse(helpLine));
|
||||
sendMessage(SavageFactions.plugin.txt.parse(helpLine));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ public class CmdHelp extends FCommand {
|
||||
pageLines.add(p.cmdBase.cmdSafeunclaimall.getUseageTemplate(true));
|
||||
pageLines.add(p.cmdBase.cmdWarunclaimall.getUseageTemplate(true));
|
||||
//TODO:TL
|
||||
pageLines.add(p.txt.parse("<i>Note: " + p.cmdBase.cmdUnclaim.getUseageTemplate(false) + SavageFactions.plugin.txt.parse("<i>") + " works on safe/war zones as well."));
|
||||
pageLines.add(p.txt.parse("<i>Note: " + p.cmdBase.cmdUnclaim.getUseageTemplate(false) + SavageFactions.plugin.txt.parse("<i>") + " works on safe/war zones as well."));
|
||||
pageLines.add(p.cmdBase.cmdPeaceful.getUseageTemplate(true));
|
||||
helpPages.add(pageLines);
|
||||
|
||||
|
||||
@@ -40,36 +40,36 @@ public class CmdHome extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
// TODO: Hide this command on help also.
|
||||
if (!Conf.homesEnabled) {
|
||||
if (! Conf.homesEnabled) {
|
||||
fme.msg(TL.COMMAND_HOME_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Conf.homesTeleportCommandEnabled) {
|
||||
if (! Conf.homesTeleportCommandEnabled) {
|
||||
fme.msg(TL.COMMAND_HOME_TELEPORTDISABLED);
|
||||
return;
|
||||
}
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.HOME);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "teleport home");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!myFaction.hasHome()) {
|
||||
if (! myFaction.hasHome()) {
|
||||
fme.msg(TL.COMMAND_HOME_NOHOME.toString() + (fme.getRole().value < Role.MODERATOR.value ? TL.GENERIC_ASKYOURLEADER.toString() : TL.GENERIC_YOUSHOULD.toString()));
|
||||
fme.sendMessage(p.cmdBase.cmdSethome.getUseageTemplate());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Conf.homesTeleportAllowedFromEnemyTerritory && fme.isInEnemyTerritory()) {
|
||||
if (! Conf.homesTeleportAllowedFromEnemyTerritory && fme.isInEnemyTerritory()) {
|
||||
fme.msg(TL.COMMAND_HOME_INENEMY);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Conf.homesTeleportAllowedFromDifferentWorld && me.getWorld().getUID() != myFaction.getHome().getWorld().getUID()) {
|
||||
if (! Conf.homesTeleportAllowedFromDifferentWorld && me.getWorld().getUID() != myFaction.getHome().getWorld().getUID()) {
|
||||
fme.msg(TL.COMMAND_HOME_WRONGWORLD);
|
||||
return;
|
||||
}
|
||||
@@ -79,15 +79,15 @@ public class CmdHome extends FCommand {
|
||||
|
||||
// if player is not in a safe zone or their own faction territory, only allow teleport if no enemies are nearby
|
||||
if (Conf.homesTeleportAllowedEnemyDistance > 0 &&
|
||||
!faction.isSafeZone() &&
|
||||
(!fme.isInOwnTerritory() || (fme.isInOwnTerritory() && !Conf.homesTeleportIgnoreEnemiesIfInOwnTerritory))) {
|
||||
! faction.isSafeZone() &&
|
||||
(! fme.isInOwnTerritory() || (fme.isInOwnTerritory() && ! Conf.homesTeleportIgnoreEnemiesIfInOwnTerritory))) {
|
||||
World w = loc.getWorld();
|
||||
double x = loc.getX();
|
||||
double y = loc.getY();
|
||||
double z = loc.getZ();
|
||||
|
||||
for (Player p : me.getServer().getOnlinePlayers()) {
|
||||
if (p == null || !p.isOnline() || p.isDead() || p == me || p.getWorld() != w) {
|
||||
if (p == null || ! p.isOnline() || p.isDead() || p == me || p.getWorld() != w) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class CmdHome 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.econCostHome, TL.COMMAND_HOME_TOTELEPORT.toString(), TL.COMMAND_HOME_FORTELEPORT.toString())) {
|
||||
if (! payForCommand(Conf.econCostHome, TL.COMMAND_HOME_TOTELEPORT.toString(), TL.COMMAND_HOME_FORTELEPORT.toString())) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -44,13 +44,13 @@ public class CmdInvite 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.econCostInvite, TL.COMMAND_INVITE_TOINVITE.toString(), TL.COMMAND_INVITE_FORINVITE.toString())) {
|
||||
if (! payForCommand(Conf.econCostInvite, TL.COMMAND_INVITE_TOINVITE.toString(), TL.COMMAND_INVITE_FORINVITE.toString())) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.INVITE);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "manage invites");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -35,12 +35,12 @@ public class CmdJoin extends FCommand {
|
||||
FPlayer fplayer = this.argAsBestFPlayerMatch(1, fme, false);
|
||||
boolean samePlayer = fplayer == fme;
|
||||
|
||||
if (!samePlayer && !Permission.JOIN_OTHERS.has(sender, false)) {
|
||||
if (! samePlayer && ! Permission.JOIN_OTHERS.has(sender, false)) {
|
||||
msg(TL.COMMAND_JOIN_CANNOTFORCE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!faction.isNormal()) {
|
||||
if (! faction.isNormal()) {
|
||||
msg(TL.COMMAND_JOIN_SYSTEMFACTION);
|
||||
return;
|
||||
}
|
||||
@@ -62,12 +62,12 @@ public class CmdJoin extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Conf.canLeaveWithNegativePower && fplayer.getPower() < 0) {
|
||||
if (! Conf.canLeaveWithNegativePower && fplayer.getPower() < 0) {
|
||||
msg(TL.COMMAND_JOIN_NEGATIVEPOWER, fplayer.describeTo(fme, true));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(faction.getOpen() || faction.isInvited(fplayer) || fme.isAdminBypassing() || Permission.JOIN_ANY.has(sender, false))) {
|
||||
if (! (faction.getOpen() || faction.isInvited(fplayer) || fme.isAdminBypassing() || Permission.JOIN_ANY.has(sender, false))) {
|
||||
msg(TL.COMMAND_JOIN_REQUIRESINVITATION);
|
||||
if (samePlayer) {
|
||||
faction.msg(TL.COMMAND_JOIN_ATTEMPTEDJOIN, fplayer.describeTo(faction, true));
|
||||
@@ -76,12 +76,12 @@ public class CmdJoin extends FCommand {
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
|
||||
if (samePlayer && !canAffordCommand(Conf.econCostJoin, TL.COMMAND_JOIN_TOJOIN.toString())) {
|
||||
if (samePlayer && ! canAffordCommand(Conf.econCostJoin, TL.COMMAND_JOIN_TOJOIN.toString())) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for ban
|
||||
if (!fme.isAdminBypassing() && faction.isBanned(fme)) {
|
||||
if (! fme.isAdminBypassing() && faction.isBanned(fme)) {
|
||||
fme.msg(TL.COMMAND_JOIN_BANNED, faction.getTag(fme));
|
||||
return;
|
||||
}
|
||||
@@ -94,13 +94,13 @@ public class CmdJoin extends FCommand {
|
||||
}
|
||||
|
||||
// then make 'em pay (if applicable)
|
||||
if (samePlayer && !payForCommand(Conf.econCostJoin, TL.COMMAND_JOIN_TOJOIN.toString(), TL.COMMAND_JOIN_FORJOIN.toString())) {
|
||||
if (samePlayer && ! payForCommand(Conf.econCostJoin, TL.COMMAND_JOIN_TOJOIN.toString(), TL.COMMAND_JOIN_FORJOIN.toString())) {
|
||||
return;
|
||||
}
|
||||
|
||||
fme.msg(TL.COMMAND_JOIN_SUCCESS, fplayer.describeTo(fme, true), faction.getTag(fme));
|
||||
|
||||
if (!samePlayer) {
|
||||
if (! samePlayer) {
|
||||
fplayer.msg(TL.COMMAND_JOIN_MOVED, fme.describeTo(fplayer, true), faction.getTag(fplayer));
|
||||
}
|
||||
faction.msg(TL.COMMAND_JOIN_JOINED, fplayer.describeTo(faction, true));
|
||||
@@ -112,9 +112,9 @@ public class CmdJoin extends FCommand {
|
||||
|
||||
if (Conf.logFactionJoin) {
|
||||
if (samePlayer) {
|
||||
SavageFactions.plugin.log(TL.COMMAND_JOIN_JOINEDLOG.toString(), fplayer.getName(), faction.getTag());
|
||||
SavageFactions.plugin.log(TL.COMMAND_JOIN_JOINEDLOG.toString(), fplayer.getName(), faction.getTag());
|
||||
} else {
|
||||
SavageFactions.plugin.log(TL.COMMAND_JOIN_MOVEDLOG.toString(), fme.getName(), fplayer.getName(), faction.getTag());
|
||||
SavageFactions.plugin.log(TL.COMMAND_JOIN_MOVEDLOG.toString(), fme.getName(), fplayer.getName(), faction.getTag());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public class CmdKick extends FCommand {
|
||||
String s = player.getName();
|
||||
msg.then(s + " ").color(ChatColor.GRAY).tooltip(TL.COMMAND_KICK_CLICKTOKICK.toString() + s).command("/" + Conf.baseCommandAliases.get(0) + " kick " + s);
|
||||
}
|
||||
if (fme.getRole() == Role.LEADER) {
|
||||
if (fme.getRole() == Role.LEADER) {
|
||||
// Only add coleader to this for the leader.
|
||||
for (FPlayer player : myFaction.getFPlayersWhereRole(Role.COLEADER)) {
|
||||
String s = player.getName();
|
||||
@@ -78,9 +78,9 @@ public class CmdKick extends FCommand {
|
||||
// - Check for the kick permission.
|
||||
// - Make sure the player is in the faction.
|
||||
// - Make sure the kicked player has lower rank than the kicker.
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.KICK);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_NOPERMISSION, "kick");
|
||||
return;
|
||||
}
|
||||
@@ -92,14 +92,14 @@ public class CmdKick extends FCommand {
|
||||
msg(TL.COMMAND_KICK_INSUFFICIENTRANK);
|
||||
return;
|
||||
}
|
||||
if (!Conf.canLeaveWithNegativePower && toKick.getPower() < 0) {
|
||||
if (! Conf.canLeaveWithNegativePower && toKick.getPower() < 0) {
|
||||
msg(TL.COMMAND_KICK_NEGATIVEPOWER);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
|
||||
if (!canAffordCommand(Conf.econCostKick, TL.COMMAND_KICK_TOKICK.toString())) {
|
||||
if (! canAffordCommand(Conf.econCostKick, TL.COMMAND_KICK_TOKICK.toString())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class CmdKick extends FCommand {
|
||||
}
|
||||
|
||||
// then make 'em pay (if applicable)
|
||||
if (!payForCommand(Conf.econCostKick, TL.COMMAND_KICK_TOKICK.toString(), TL.COMMAND_KICK_FORKICK.toString())) {
|
||||
if (! payForCommand(Conf.econCostKick, TL.COMMAND_KICK_TOKICK.toString(), TL.COMMAND_KICK_FORKICK.toString())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -122,9 +122,9 @@ public class CmdKick extends FCommand {
|
||||
fme.msg(TL.COMMAND_KICK_KICKS, toKick.describeTo(fme), toKickFaction.describeTo(fme));
|
||||
}
|
||||
if (Conf.logFactionKick) {
|
||||
SavageFactions.plugin.log((senderIsConsole ? "A console command" : fme.getName()) + " kicked " + toKick.getName() + " from the faction: " + toKickFaction.getTag());
|
||||
SavageFactions.plugin.log((senderIsConsole ? "A console command" : fme.getName()) + " kicked " + toKick.getName() + " from the faction: " + toKickFaction.getTag());
|
||||
}
|
||||
if (toKick.getRole() == Role.LEADER) {
|
||||
if (toKick.getRole() == Role.LEADER) {
|
||||
toKickFaction.promoteNewLeader();
|
||||
}
|
||||
toKickFaction.deinvite(toKick);
|
||||
|
||||
@@ -41,7 +41,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, "to list the factions", "for listing the factions")) {
|
||||
if (! payForCommand(Conf.econCostList, "to list the factions", "for listing the factions")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -51,8 +51,8 @@ public class CmdList extends FCommand {
|
||||
factionList.remove(Factions.getInstance().getWarZone());
|
||||
|
||||
// remove exempt factions
|
||||
if (!fme.getPlayer().hasPermission("factions.show.bypassexempt")) {
|
||||
List<String> exemptFactions = SavageFactions.plugin.getConfig().getStringList("show-exempt");
|
||||
if (! fme.getPlayer().hasPermission("factions.show.bypassexempt")) {
|
||||
List<String> exemptFactions = SavageFactions.plugin.getConfig().getStringList("show-exempt");
|
||||
Iterator<Faction> factionIterator = factionList.iterator();
|
||||
while (factionIterator.hasNext()) {
|
||||
Faction next = factionIterator.next();
|
||||
@@ -71,7 +71,7 @@ public class CmdList extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return -1;
|
||||
return - 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class CmdList extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return -1;
|
||||
return - 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ public class CmdLock extends FCommand {
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ public class CmdLogins extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
boolean monitor = fme.isMonitoringJoins();
|
||||
fme.msg(TL.COMMAND_LOGINS_TOGGLE, String.valueOf(!monitor));
|
||||
fme.setMonitorJoins(!monitor);
|
||||
fme.msg(TL.COMMAND_LOGINS_TOGGLE, String.valueOf(! monitor));
|
||||
fme.setMonitorJoins(! monitor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -29,11 +29,11 @@ public class CmdMap extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
if (this.argIsSet(0)) {
|
||||
if (this.argAsBool(0, !fme.isMapAutoUpdating())) {
|
||||
if (this.argAsBool(0, ! fme.isMapAutoUpdating())) {
|
||||
// Turn on
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if (!payForCommand(Conf.econCostMap, "to show the map", "for showing the map")) {
|
||||
if (! payForCommand(Conf.econCostMap, "to show the map", "for showing the map")) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class CmdMap extends FCommand {
|
||||
}
|
||||
} else {
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if (!payForCommand(Conf.econCostMap, TL.COMMAND_MAP_TOSHOW, TL.COMMAND_MAP_FORSHOW)) {
|
||||
if (! payForCommand(Conf.econCostMap, TL.COMMAND_MAP_TOSHOW, TL.COMMAND_MAP_FORSHOW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class CmdMod extends FCommand {
|
||||
|
||||
boolean permAny = Permission.MOD_ANY.has(sender, false);
|
||||
Faction targetFaction = you.getFaction();
|
||||
if (targetFaction != myFaction && !permAny) {
|
||||
if (targetFaction != myFaction && ! permAny) {
|
||||
msg(TL.COMMAND_MOD_NOTMEMBER, you.describeTo(fme, true));
|
||||
return;
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class CmdMod extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (you == fme && !permAny) {
|
||||
if (you == fme && ! permAny) {
|
||||
msg(TL.COMMAND_MOD_SELF);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class CmdMoneyBalance extends FCommand {
|
||||
if (faction == null) {
|
||||
return;
|
||||
}
|
||||
if (faction != myFaction && !Permission.MONEY_BALANCE_ANY.has(sender, true)) {
|
||||
if (faction != myFaction && ! Permission.MONEY_BALANCE_ANY.has(sender, true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public class CmdMoneyDeposit extends FCommand {
|
||||
boolean success = Econ.transferMoney(fme, fme, faction, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYDEPOSIT_DEPOSITED.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYDEPOSIT_DEPOSITED.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class CmdMoneyTransferFf extends FCommand {
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
String name = sender instanceof Player ? fme.getName() : sender.getName();
|
||||
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERFF_TRANSFER.toString(), name, Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERFF_TRANSFER.toString(), name, Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class CmdMoneyTransferFp extends FCommand {
|
||||
boolean success = Econ.transferMoney(fme, from, to, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERFP_TRANSFER.toString(), fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERFP_TRANSFER.toString(), fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ public class CmdMoneyTransferPf extends FCommand {
|
||||
boolean success = Econ.transferMoney(fme, from, to, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERPF_TRANSFER.toString(), fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYTRANSFERPF_TRANSFER.toString(), fme.getName(), Econ.moneyString(amount), from.describeTo(null), to.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class CmdMoneyWithdraw extends FCommand {
|
||||
boolean success = Econ.transferMoney(fme, faction, fme, amount);
|
||||
|
||||
if (success && Conf.logMoneyTransactions) {
|
||||
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYWITHDRAW_WITHDRAW.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
SavageFactions.plugin.log(ChatColor.stripColor(SavageFactions.plugin.txt.parse(TL.COMMAND_MONEYWITHDRAW_WITHDRAW.toString(), fme.getName(), Econ.moneyString(amount), faction.describeTo(null))));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,12 +25,12 @@ public class CmdNear extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fnear.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fnear.Enabled")) {
|
||||
fme.msg(TL.COMMAND_NEAR_DISABLED_MSG);
|
||||
return;
|
||||
}
|
||||
|
||||
double range = SavageFactions.plugin.getConfig().getInt("fnear.Radius");
|
||||
double range = SavageFactions.plugin.getConfig().getInt("fnear.Radius");
|
||||
String format = TL.COMMAND_NEAR_FORMAT.toString();
|
||||
fme.msg(TL.COMMAND_NEAR_USE_MSG);
|
||||
for (Entity e : me.getNearbyEntities(range, 255, range)) {
|
||||
|
||||
@@ -28,11 +28,11 @@ public class CmdOpen 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.econCostOpen, TL.COMMAND_OPEN_TOOPEN, TL.COMMAND_OPEN_FOROPEN)) {
|
||||
if (! payForCommand(Conf.econCostOpen, TL.COMMAND_OPEN_TOOPEN, TL.COMMAND_OPEN_FOROPEN)) {
|
||||
return;
|
||||
}
|
||||
|
||||
myFaction.setOpen(this.argAsBool(0, !myFaction.getOpen()));
|
||||
myFaction.setOpen(this.argAsBool(0, ! myFaction.getOpen()));
|
||||
|
||||
String open = myFaction.getOpen() ? TL.COMMAND_OPEN_OPEN.toString() : TL.COMMAND_OPEN_CLOSED.toString();
|
||||
|
||||
|
||||
@@ -31,21 +31,21 @@ public class CmdOwner extends FCommand {
|
||||
public void perform() {
|
||||
boolean hasBypass = fme.isAdminBypassing();
|
||||
|
||||
if (!hasBypass && !assertHasFaction()) {
|
||||
if (! hasBypass && ! assertHasFaction()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Conf.ownedAreasEnabled) {
|
||||
if (! Conf.ownedAreasEnabled) {
|
||||
fme.msg(TL.COMMAND_OWNER_DISABLED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hasBypass && Conf.ownedAreasLimitPerFaction > 0 && myFaction.getCountOfClaimsWithOwners() >= Conf.ownedAreasLimitPerFaction) {
|
||||
if (! hasBypass && Conf.ownedAreasLimitPerFaction > 0 && myFaction.getCountOfClaimsWithOwners() >= Conf.ownedAreasLimitPerFaction) {
|
||||
fme.msg(TL.COMMAND_OWNER_LIMIT, Conf.ownedAreasLimitPerFaction);
|
||||
return;
|
||||
}
|
||||
|
||||
if (! hasBypass && ! assertMinRole(Conf.ownedAreasModeratorsCanSet ? Role.MODERATOR : Role.LEADER)) {
|
||||
if (! hasBypass && ! assertMinRole(Conf.ownedAreasModeratorsCanSet ? Role.MODERATOR : Role.LEADER)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -53,12 +53,12 @@ public class CmdOwner extends FCommand {
|
||||
|
||||
Faction factionHere = Board.getInstance().getFactionAt(flocation);
|
||||
if (factionHere != myFaction) {
|
||||
if (!factionHere.isNormal()) {
|
||||
if (! factionHere.isNormal()) {
|
||||
fme.msg(TL.COMMAND_OWNER_NOTCLAIMED);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!hasBypass) {
|
||||
if (! hasBypass) {
|
||||
fme.msg(TL.COMMAND_OWNER_WRONGFACTION);
|
||||
return;
|
||||
}
|
||||
@@ -91,7 +91,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -30,11 +30,11 @@ public class CmdOwnerList extends FCommand {
|
||||
public void perform() {
|
||||
boolean hasBypass = fme.isAdminBypassing();
|
||||
|
||||
if (!hasBypass && !assertHasFaction()) {
|
||||
if (! hasBypass && ! assertHasFaction()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Conf.ownedAreasEnabled) {
|
||||
if (! Conf.ownedAreasEnabled) {
|
||||
fme.msg(TL.COMMAND_OWNERLIST_DISABLED);
|
||||
return;
|
||||
}
|
||||
@@ -42,13 +42,13 @@ public class CmdOwnerList extends FCommand {
|
||||
FLocation flocation = new FLocation(fme);
|
||||
|
||||
if (Board.getInstance().getFactionAt(flocation) != myFaction) {
|
||||
if (!hasBypass) {
|
||||
if (! hasBypass) {
|
||||
fme.msg(TL.COMMAND_OWNERLIST_WRONGFACTION);
|
||||
return;
|
||||
}
|
||||
//TODO: This code won't ever be called.
|
||||
myFaction = Board.getInstance().getFactionAt(flocation);
|
||||
if (!myFaction.isNormal()) {
|
||||
if (! myFaction.isNormal()) {
|
||||
fme.msg(TL.COMMAND_OWNERLIST_NOTCLAIMED);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import com.massivecraft.factions.SavageFactions;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdPaypalSee extends FCommand{
|
||||
public class CmdPaypalSee extends FCommand {
|
||||
public CmdPaypalSee() {
|
||||
aliases.add("seepaypal");
|
||||
aliases.add("getpaypal");
|
||||
@@ -20,14 +20,14 @@ public class CmdPaypalSee extends FCommand{
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
} else {
|
||||
Faction faction = argAsFaction(0);
|
||||
String paypal = argAsString(1);
|
||||
|
||||
if (faction != null) {
|
||||
if (!faction.isWilderness() && !faction.isSafeZone() && !faction.isWarZone()) {
|
||||
if (! faction.isWilderness() && ! faction.isSafeZone() && ! faction.isWarZone()) {
|
||||
if (faction.getPaypal() != null) {
|
||||
fme.msg(TL.COMMAND_PAYPALSEE_FACTION_PAYPAL.toString(), faction.getTag(), faction.getPaypal());
|
||||
} else {
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.massivecraft.factions.SavageFactions;
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
|
||||
public class CmdPaypalSet extends FCommand{
|
||||
public class CmdPaypalSet extends FCommand {
|
||||
|
||||
public CmdPaypalSet() {
|
||||
this.aliases.add("setpaypal");
|
||||
@@ -20,7 +20,7 @@ public class CmdPaypalSet extends FCommand{
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
fme.msg(TL.GENERIC_DISABLED);
|
||||
} else {
|
||||
String paypal = argAsString(0);
|
||||
|
||||
@@ -104,7 +104,7 @@ public class CmdPerm extends FCommand {
|
||||
}
|
||||
|
||||
fme.msg(TL.COMMAND_PERM_SET, argAsString(1), access.name(), argAsString(0));
|
||||
SavageFactions.plugin.log(String.format(TL.COMMAND_PERM_SET.toString(), argAsString(1), access.name(), argAsString(0)) + " for faction " + fme.getTag());
|
||||
SavageFactions.plugin.log(String.format(TL.COMMAND_PERM_SET.toString(), argAsString(1), access.name(), argAsString(0)) + " for faction " + fme.getTag());
|
||||
}
|
||||
|
||||
private Permissable getPermissable(String name) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class CmdPermanent extends FCommand {
|
||||
faction.setPermanent(true);
|
||||
}
|
||||
|
||||
SavageFactions.plugin.log((fme == null ? "A server admin" : fme.getName()) + " " + change + " the faction \"" + faction.getTag() + "\".");
|
||||
SavageFactions.plugin.log((fme == null ? "A server admin" : fme.getName()) + " " + change + " the faction \"" + faction.getTag() + "\".");
|
||||
|
||||
// Inform all players
|
||||
for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) {
|
||||
|
||||
@@ -32,12 +32,12 @@ public class CmdPower extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (target != fme && !Permission.POWER_ANY.has(sender, true)) {
|
||||
if (target != fme && ! Permission.POWER_ANY.has(sender, true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ public class CmdPowerBoost extends FCommand {
|
||||
super();
|
||||
this.aliases.add("powerboost");
|
||||
|
||||
this.requiredArgs.add("plugin|f|player|faction");
|
||||
this.requiredArgs.add("plugin|f|player|faction");
|
||||
this.requiredArgs.add("name");
|
||||
this.requiredArgs.add("# or reset");
|
||||
|
||||
@@ -76,8 +76,8 @@ public class CmdPowerBoost extends FCommand {
|
||||
|
||||
int roundedPower = (int) Math.round(targetPower);
|
||||
msg(TL.COMMAND_POWERBOOST_BOOST, target, roundedPower);
|
||||
if (!senderIsConsole) {
|
||||
SavageFactions.plugin.log(TL.COMMAND_POWERBOOST_BOOSTLOG.toString(), fme.getName(), target, roundedPower);
|
||||
if (! senderIsConsole) {
|
||||
SavageFactions.plugin.log(TL.COMMAND_POWERBOOST_BOOSTLOG.toString(), fme.getName(), target, roundedPower);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,13 +26,13 @@ public class CmdReload extends FCommand {
|
||||
public void perform() {
|
||||
long timeInitStart = System.currentTimeMillis();
|
||||
Conf.load();
|
||||
SavageFactions.plugin.reloadConfig();
|
||||
SavageFactions.plugin.loadLang();
|
||||
SavageFactions.plugin.reloadConfig();
|
||||
SavageFactions.plugin.loadLang();
|
||||
int version = Integer.parseInt(ReflectionUtils.PackageType.getServerVersion().split("_")[1]);
|
||||
|
||||
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight")) {
|
||||
SavageFactions.plugin.factionsFlight = true;
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight")) {
|
||||
SavageFactions.plugin.factionsFlight = true;
|
||||
}
|
||||
long timeReload = (System.currentTimeMillis() - timeInitStart);
|
||||
|
||||
|
||||
@@ -28,19 +28,19 @@ public class CmdRules extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("frules.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("frules.Enabled")) {
|
||||
fme.msg(TL.COMMAND_RULES_DISABLED_MSG);
|
||||
return;
|
||||
}
|
||||
if (this.args.size() == 0) {
|
||||
HashMap<Integer, String> rules = fme.getFaction().getRulesMap();
|
||||
if (rules.size() == 0) {
|
||||
List<String> ruleList = SavageFactions.plugin.getConfig().getStringList("frules.default-rules");
|
||||
fme.sendMessage(SavageFactions.plugin.colorList(ruleList));
|
||||
List<String> ruleList = SavageFactions.plugin.getConfig().getStringList("frules.default-rules");
|
||||
fme.sendMessage(SavageFactions.plugin.colorList(ruleList));
|
||||
|
||||
} else {
|
||||
for (int i = 0; i <= rules.size() - 1; i++) {
|
||||
fme.sendMessage(SavageFactions.plugin.color(rules.get(i)));
|
||||
fme.sendMessage(SavageFactions.plugin.color(rules.get(i)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class CmdSB extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
boolean toggleTo = !fme.showScoreboard();
|
||||
boolean toggleTo = ! fme.showScoreboard();
|
||||
FScoreboard board = FScoreboard.get(fme);
|
||||
if (board == null) {
|
||||
me.sendMessage(TL.COMMAND_TOGGLESB_DISABLED.toString());
|
||||
|
||||
@@ -49,7 +49,7 @@ public class CmdSafeunclaimall extends FCommand {
|
||||
msg(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMED);
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SavageFactions.plugin.log(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMEDLOG.format(sender.getName()));
|
||||
SavageFactions.plugin.log(TL.COMMAND_SAFEUNCLAIMALL_UNCLAIMEDLOG.format(sender.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public class CmdSeeChunk extends FCommand {
|
||||
private boolean useParticles;
|
||||
private int length;
|
||||
private ParticleEffect effect;
|
||||
private int taskID = -1;
|
||||
private int taskID = - 1;
|
||||
|
||||
|
||||
//I remade it cause of people getting mad that I had the same seechunk as drtshock
|
||||
@@ -62,10 +62,10 @@ public class CmdSeeChunk extends FCommand {
|
||||
}
|
||||
|
||||
private void manageTask() {
|
||||
if (taskID != -1) {
|
||||
if (taskID != - 1) {
|
||||
if (seeChunkMap.keySet().size() == 0) {
|
||||
Bukkit.getScheduler().cancelTask(taskID);
|
||||
taskID = -1;
|
||||
taskID = - 1;
|
||||
}
|
||||
} else {
|
||||
startTask();
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import com.massivecraft.factions.struct.Permission;
|
||||
import com.massivecraft.factions.zcore.util.TL;
|
||||
import org.bukkit.Material;
|
||||
|
||||
public class CmdSetBanner extends FCommand {
|
||||
|
||||
@@ -20,7 +19,7 @@ public class CmdSetBanner extends FCommand {
|
||||
}
|
||||
|
||||
public void perform() {
|
||||
if (!me.getItemInHand().getType().toString().contains("BANNER")) {
|
||||
if (! me.getItemInHand().getType().toString().contains("BANNER")) {
|
||||
fme.msg(TL.COMMAND_SETBANNER_NOTBANNER);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CmdSetDefaultRole extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (target == Role.LEADER) {
|
||||
if (target == Role.LEADER) {
|
||||
msg(TL.COMMAND_SETDEFAULTROLE_NOTTHATROLE, argAsString(0));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -30,29 +30,29 @@ public class CmdSetFWarp extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!(fme.getRelationToLocation() == Relation.MEMBER)) {
|
||||
if (! (fme.getRelationToLocation() == Relation.MEMBER)) {
|
||||
fme.msg(TL.COMMAND_SETFWARP_NOTCLAIMED);
|
||||
return;
|
||||
}
|
||||
|
||||
// This statement allows us to check if they've specifically denied it, or default to
|
||||
// the old setting of allowing moderators to set warps.
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.SETWARP);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "set warps");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int maxWarps = SavageFactions.plugin.getConfig().getInt("max-warps", 5);
|
||||
int maxWarps = SavageFactions.plugin.getConfig().getInt("max-warps", 5);
|
||||
if (maxWarps <= myFaction.getWarps().size()) {
|
||||
fme.msg(TL.COMMAND_SETFWARP_LIMIT, maxWarps);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!transact(fme)) {
|
||||
if (! transact(fme)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class CmdSetFWarp extends FCommand {
|
||||
}
|
||||
|
||||
private boolean transact(FPlayer player) {
|
||||
return ! SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SavageFactions.plugin.getConfig().getDouble("warp-cost.setwarp", 5), TL.COMMAND_SETFWARP_TOSET.toString(), TL.COMMAND_SETFWARP_FORSET.toString());
|
||||
return ! SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing() || payForCommand(SavageFactions.plugin.getConfig().getDouble("warp-cost.setwarp", 5), TL.COMMAND_SETFWARP_TOSET.toString(), TL.COMMAND_SETFWARP_FORSET.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,7 +27,7 @@ public class CmdSetMaxVaults extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
Faction targetFaction = argAsFaction(0);
|
||||
int value = argAsInt(1, -1);
|
||||
int value = argAsInt(1, - 1);
|
||||
if (value < 0) {
|
||||
sender.sendMessage(ChatColor.RED + "Number must be greater than 0.");
|
||||
return;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CmdSethome extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!Conf.homesEnabled) {
|
||||
if (! Conf.homesEnabled) {
|
||||
fme.msg(TL.COMMAND_SETHOME_DISABLED);
|
||||
return;
|
||||
}
|
||||
@@ -40,16 +40,16 @@ public class CmdSethome extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.SETHOME);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER && ! Permission.SETHOME_ANY.has(sender, true)) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER && ! Permission.SETHOME_ANY.has(sender, true)) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "set home");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Can the player set the faction home HERE?
|
||||
if (!Permission.BYPASS.has(me) &&
|
||||
if (! Permission.BYPASS.has(me) &&
|
||||
Conf.homesMustBeInClaimedTerritory &&
|
||||
Board.getInstance().getFactionAt(new FLocation(me)) != faction) {
|
||||
fme.msg(TL.COMMAND_SETHOME_NOTCLAIMED);
|
||||
@@ -57,7 +57,7 @@ public class CmdSethome 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.econCostSethome, TL.COMMAND_SETHOME_TOSET, TL.COMMAND_SETHOME_FORSET)) {
|
||||
if (! payForCommand(Conf.econCostSethome, TL.COMMAND_SETHOME_TOSET, TL.COMMAND_SETHOME_FORSET)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,23 +54,23 @@ public class CmdShow extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (fme != null && !fme.getPlayer().hasPermission("factions.show.bypassexempt")
|
||||
if (fme != null && ! fme.getPlayer().hasPermission("factions.show.bypassexempt")
|
||||
&& SavageFactions.plugin.getConfig().getStringList("show-exempt").contains(faction.getTag())) {
|
||||
msg(TL.COMMAND_SHOW_EXEMPT);
|
||||
return;
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if (!payForCommand(Conf.econCostShow, TL.COMMAND_SHOW_TOSHOW, TL.COMMAND_SHOW_FORSHOW)) {
|
||||
if (! payForCommand(Conf.econCostShow, TL.COMMAND_SHOW_TOSHOW, TL.COMMAND_SHOW_FORSHOW)) {
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> show = SavageFactions.plugin.getConfig().getStringList("show");
|
||||
List<String> show = SavageFactions.plugin.getConfig().getStringList("show");
|
||||
if (show == null || show.isEmpty()) {
|
||||
show = defaults;
|
||||
}
|
||||
|
||||
if (!faction.isNormal()) {
|
||||
if (! faction.isNormal()) {
|
||||
String tag = faction.getTag(fme);
|
||||
// send header and that's all
|
||||
String header = show.get(0);
|
||||
@@ -99,7 +99,7 @@ public class CmdShow extends FCommand {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (!parsed.contains("{notFrozen}") && !parsed.contains("{notPermanent}")) {
|
||||
if (! parsed.contains("{notFrozen}") && ! parsed.contains("{notPermanent}")) {
|
||||
if (parsed.contains("{ig}")) {
|
||||
// replaces all variables with no home TL
|
||||
parsed = parsed.substring(0, parsed.indexOf("{ig}")) + TL.COMMAND_SHOW_NOHOME.toString();
|
||||
|
||||
@@ -21,8 +21,8 @@ public class CmdStealth extends FCommand {
|
||||
|
||||
public void perform() {
|
||||
Faction faction = fme.getFaction();
|
||||
if (faction != null && !faction.getId().equalsIgnoreCase("0") && !faction.getId().equalsIgnoreCase("none") && !faction.getId().equalsIgnoreCase("safezone") && !faction.getId().equalsIgnoreCase("warzone")) {
|
||||
fme.setStealth(!fme.isStealthEnabled());
|
||||
if (faction != null && ! faction.getId().equalsIgnoreCase("0") && ! faction.getId().equalsIgnoreCase("none") && ! faction.getId().equalsIgnoreCase("safezone") && ! faction.getId().equalsIgnoreCase("warzone")) {
|
||||
fme.setStealth(! fme.isStealthEnabled());
|
||||
fme.msg(fme.isStealthEnabled() ? TL.COMMAND_STEALTH_ENABLE : TL.COMMAND_STEALTH_DISABLE);
|
||||
} else {
|
||||
fme.msg(TL.COMMAND_STEALTH_MUSTBEMEMBER);
|
||||
|
||||
@@ -34,25 +34,25 @@ public class CmdStuck extends FCommand {
|
||||
final Player player = fme.getPlayer();
|
||||
final Location sentAt = player.getLocation();
|
||||
final FLocation chunk = fme.getLastStoodAt();
|
||||
final long delay = SavageFactions.plugin.getConfig().getLong("hcf.stuck.delay", 30);
|
||||
final int radius = SavageFactions.plugin.getConfig().getInt("hcf.stuck.radius", 10);
|
||||
final long delay = SavageFactions.plugin.getConfig().getLong("hcf.stuck.delay", 30);
|
||||
final int radius = SavageFactions.plugin.getConfig().getInt("hcf.stuck.radius", 10);
|
||||
|
||||
if (SavageFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) {
|
||||
long wait = SavageFactions.plugin.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
|
||||
if (SavageFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) {
|
||||
long wait = SavageFactions.plugin.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
|
||||
String time = DurationFormatUtils.formatDuration(wait, TL.COMMAND_STUCK_TIMEFORMAT.toString(), true);
|
||||
msg(TL.COMMAND_STUCK_EXISTS, time);
|
||||
} else {
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if (!payForCommand(Conf.econCostStuck, TL.COMMAND_STUCK_TOSTUCK.format(fme.getName()), TL.COMMAND_STUCK_FORSTUCK.format(fme.getName()))) {
|
||||
if (! payForCommand(Conf.econCostStuck, TL.COMMAND_STUCK_TOSTUCK.format(fme.getName()), TL.COMMAND_STUCK_FORSTUCK.format(fme.getName()))) {
|
||||
return;
|
||||
}
|
||||
|
||||
final int id = Bukkit.getScheduler().runTaskLater(SavageFactions.plugin, new BukkitRunnable() {
|
||||
final int id = Bukkit.getScheduler().runTaskLater(SavageFactions.plugin, new BukkitRunnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (! SavageFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) {
|
||||
if (! SavageFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -60,8 +60,8 @@ public class CmdStuck extends FCommand {
|
||||
final World world = chunk.getWorld();
|
||||
if (world.getUID() != player.getWorld().getUID() || sentAt.distance(player.getLocation()) > radius) {
|
||||
msg(TL.COMMAND_STUCK_OUTSIDE.format(radius));
|
||||
SavageFactions.plugin.getTimers().remove(player.getUniqueId());
|
||||
SavageFactions.plugin.getStuckMap().remove(player.getUniqueId());
|
||||
SavageFactions.plugin.getTimers().remove(player.getUniqueId());
|
||||
SavageFactions.plugin.getStuckMap().remove(player.getUniqueId());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -73,18 +73,18 @@ public class CmdStuck extends FCommand {
|
||||
public boolean work() {
|
||||
FLocation chunk = currentFLocation();
|
||||
Faction faction = board.getFactionAt(chunk);
|
||||
int buffer = SavageFactions.plugin.getConfig().getInt("world-border.buffer", 0);
|
||||
if (faction.isWilderness() && !chunk.isOutsideWorldBorder(buffer)) {
|
||||
int buffer = SavageFactions.plugin.getConfig().getInt("world-border.buffer", 0);
|
||||
if (faction.isWilderness() && ! chunk.isOutsideWorldBorder(buffer)) {
|
||||
int cx = FLocation.chunkToBlock((int) chunk.getX());
|
||||
int cz = FLocation.chunkToBlock((int) chunk.getZ());
|
||||
int y = world.getHighestBlockYAt(cx, cz);
|
||||
Location tp = new Location(world, cx, y, cz);
|
||||
msg(TL.COMMAND_STUCK_TELEPORT, tp.getBlockX(), tp.getBlockY(), tp.getBlockZ());
|
||||
SavageFactions.plugin.getTimers().remove(player.getUniqueId());
|
||||
SavageFactions.plugin.getStuckMap().remove(player.getUniqueId());
|
||||
if (!Essentials.handleTeleport(player, tp)) {
|
||||
SavageFactions.plugin.getTimers().remove(player.getUniqueId());
|
||||
SavageFactions.plugin.getStuckMap().remove(player.getUniqueId());
|
||||
if (! Essentials.handleTeleport(player, tp)) {
|
||||
player.teleport(tp);
|
||||
SavageFactions.plugin.debug("/f stuck used regular teleport, not essentials!");
|
||||
SavageFactions.plugin.debug("/f stuck used regular teleport, not essentials!");
|
||||
}
|
||||
this.stop();
|
||||
return false;
|
||||
@@ -95,11 +95,11 @@ public class CmdStuck extends FCommand {
|
||||
}
|
||||
}, delay * 20).getTaskId();
|
||||
|
||||
SavageFactions.plugin.getTimers().put(player.getUniqueId(), System.currentTimeMillis() + (delay * 1000));
|
||||
long wait = SavageFactions.plugin.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
|
||||
SavageFactions.plugin.getTimers().put(player.getUniqueId(), System.currentTimeMillis() + (delay * 1000));
|
||||
long wait = SavageFactions.plugin.getTimers().get(player.getUniqueId()) - System.currentTimeMillis();
|
||||
String time = DurationFormatUtils.formatDuration(wait, TL.COMMAND_STUCK_TIMEFORMAT.toString(), true);
|
||||
msg(TL.COMMAND_STUCK_START, time);
|
||||
SavageFactions.plugin.getStuckMap().put(player.getUniqueId(), id);
|
||||
SavageFactions.plugin.getStuckMap().put(player.getUniqueId(), id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class CmdTag extends FCommand {
|
||||
String tag = this.argAsString(0);
|
||||
|
||||
// TODO does not first test cover selfcase?
|
||||
if (Factions.getInstance().isTagTaken(tag) && !MiscUtil.getComparisonString(tag).equals(myFaction.getComparisonTag())) {
|
||||
if (Factions.getInstance().isTagTaken(tag) && ! MiscUtil.getComparisonString(tag).equals(myFaction.getComparisonTag())) {
|
||||
msg(TL.COMMAND_TAG_TAKEN);
|
||||
return;
|
||||
}
|
||||
@@ -45,7 +45,7 @@ public class CmdTag extends FCommand {
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make sure they can pay
|
||||
if (!canAffordCommand(Conf.econCostTag, TL.COMMAND_TAG_TOCHANGE.toString())) {
|
||||
if (! canAffordCommand(Conf.econCostTag, TL.COMMAND_TAG_TOCHANGE.toString())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,12 +34,12 @@ public class CmdTitle extends FCommand {
|
||||
args.remove(0);
|
||||
String title = TextUtil.implode(args, " ");
|
||||
|
||||
if (!canIAdministerYou(fme, you)) {
|
||||
if (! canIAdministerYou(fme, you)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// if economy is enabled, they're not on the bypass list, and this command has a cost set, make 'em pay
|
||||
if (!payForCommand(Conf.econCostTitle, TL.COMMAND_TITLE_TOCHANGE, TL.COMMAND_TITLE_FORCHANGE)) {
|
||||
if (! payForCommand(Conf.econCostTitle, TL.COMMAND_TITLE_TOCHANGE, TL.COMMAND_TITLE_FORCHANGE)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,14 +31,14 @@ public class CmdTnt extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("ftnt.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("ftnt.Enabled")) {
|
||||
fme.msg(TL.COMMAND_TNT_DISABLED_MSG);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.TNTBANK);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "use tnt bank");
|
||||
return;
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class CmdTnt extends FCommand {
|
||||
|
||||
if (args.size() == 2) {
|
||||
if (args.get(0).equalsIgnoreCase("add") || args.get(0).equalsIgnoreCase("a")) {
|
||||
int testNumber = -1;
|
||||
int testNumber = - 1;
|
||||
try {
|
||||
testNumber = Integer.parseInt(args.get(1));
|
||||
} catch (NumberFormatException e) {
|
||||
@@ -73,7 +73,7 @@ public class CmdTnt extends FCommand {
|
||||
return;
|
||||
}
|
||||
ItemStack tnt = new ItemStack(Material.TNT, amount);
|
||||
if (fme.getFaction().getTnt() + amount > SavageFactions.plugin.getConfig().getInt("ftnt.Bank-Limit")) {
|
||||
if (fme.getFaction().getTnt() + amount > SavageFactions.plugin.getConfig().getInt("ftnt.Bank-Limit")) {
|
||||
msg(TL.COMMAND_TNT_EXCEEDLIMIT);
|
||||
return;
|
||||
}
|
||||
@@ -82,12 +82,12 @@ public class CmdTnt extends FCommand {
|
||||
|
||||
fme.getFaction().addTnt(amount);
|
||||
fme.msg(TL.COMMAND_TNT_DEPOSIT_SUCCESS);
|
||||
fme.sendMessage(SavageFactions.plugin.color(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", fme.getFaction().getTnt() + "")));
|
||||
fme.sendMessage(SavageFactions.plugin.color(TL.COMMAND_TNT_AMOUNT.toString().replace("{amount}", fme.getFaction().getTnt() + "")));
|
||||
return;
|
||||
|
||||
}
|
||||
if (args.get(0).equalsIgnoreCase("take") || args.get(0).equalsIgnoreCase("t")) {
|
||||
int testNumber = -1;
|
||||
int testNumber = - 1;
|
||||
try {
|
||||
testNumber = Integer.parseInt(args.get(1));
|
||||
} catch (NumberFormatException e) {
|
||||
@@ -105,11 +105,11 @@ public class CmdTnt extends FCommand {
|
||||
}
|
||||
int fullStacks = amount / 64;
|
||||
int remainderAmt = amount % 64;
|
||||
if ((remainderAmt == 0 && !hasAvaliableSlot(me, fullStacks))) {
|
||||
if ((remainderAmt == 0 && ! hasAvaliableSlot(me, fullStacks))) {
|
||||
fme.msg(TL.COMMAND_TNT_WIDTHDRAW_NOTENOUGH_SPACE);
|
||||
return;
|
||||
}
|
||||
if (!hasAvaliableSlot(me, fullStacks + 1)) {
|
||||
if (! hasAvaliableSlot(me, fullStacks + 1)) {
|
||||
fme.msg(TL.COMMAND_TNT_WIDTHDRAW_NOTENOUGH_SPACE);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -34,9 +34,9 @@ public class CmdTntFill extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.TNTFILL);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "use tnt fill");
|
||||
return;
|
||||
}
|
||||
@@ -46,15 +46,15 @@ public class CmdTntFill extends FCommand {
|
||||
msg(TL.COMMAND_TNTFILL_HEADER);
|
||||
int radius = argAsInt(0, 16);
|
||||
int amount = argAsInt(1, 16);
|
||||
if (radius > SavageFactions.plugin.getConfig().getInt("Tntfill.max-radius")) {
|
||||
msg(TL.COMMAND_TNTFILL_RADIUSMAX.toString().replace("{max}", SavageFactions.plugin.getConfig().getInt("Tntfill.max-radius") + ""));
|
||||
if (radius > SavageFactions.plugin.getConfig().getInt("Tntfill.max-radius")) {
|
||||
msg(TL.COMMAND_TNTFILL_RADIUSMAX.toString().replace("{max}", SavageFactions.plugin.getConfig().getInt("Tntfill.max-radius") + ""));
|
||||
return;
|
||||
}
|
||||
if (amount > SavageFactions.plugin.getConfig().getInt("Tntfill.max-amount")) {
|
||||
msg(TL.COMMAND_TNTFILL_AMOUNTMAX.toString().replace("{max}", SavageFactions.plugin.getConfig().getInt("Tntfill.max-amount") + ""));
|
||||
if (amount > SavageFactions.plugin.getConfig().getInt("Tntfill.max-amount")) {
|
||||
msg(TL.COMMAND_TNTFILL_AMOUNTMAX.toString().replace("{max}", SavageFactions.plugin.getConfig().getInt("Tntfill.max-amount") + ""));
|
||||
return;
|
||||
}
|
||||
int testNumber = -1;
|
||||
int testNumber = - 1;
|
||||
try {
|
||||
testNumber = Integer.parseInt(args.get(1));
|
||||
} catch (NumberFormatException e) {
|
||||
@@ -78,8 +78,8 @@ public class CmdTntFill extends FCommand {
|
||||
if (canHold(dispenser, amount)) {
|
||||
int fullStacks = amount / 64;
|
||||
int remainderAmt = amount % 64;
|
||||
if (!inventoryContains(me.getInventory(), new ItemStack(Material.TNT, amount))) {
|
||||
if (!fme.getRole().isAtLeast(Role.MODERATOR)) {
|
||||
if (! inventoryContains(me.getInventory(), new ItemStack(Material.TNT, amount))) {
|
||||
if (! fme.getRole().isAtLeast(Role.MODERATOR)) {
|
||||
msg(TL.COMMAND_TNTFILL_NOTENOUGH);
|
||||
sendMessage(TL.COMMAND_TNTFILL_SUCCESS.toString().replace("{amount}", amount + "").replace("{dispensers}", counter + ""));
|
||||
me.updateInventory();
|
||||
@@ -88,7 +88,7 @@ public class CmdTntFill extends FCommand {
|
||||
//msg(TL.COMMAND_TNTFILL_MOD.toString().replace("{role}",fme.getRole().nicename));
|
||||
bankMode = true;
|
||||
removeFromBank(amount);
|
||||
if (!inventoryContains(me.getInventory(), new ItemStack(Material.TNT, amount))) {
|
||||
if (! inventoryContains(me.getInventory(), new ItemStack(Material.TNT, amount))) {
|
||||
msg(TL.COMMAND_TNTFILL_NOTENOUGH);
|
||||
sendMessage(TL.COMMAND_TNTFILL_SUCCESS.toString().replace("{amount}", amount + "").replace("{dispensers}", counter + ""));
|
||||
me.updateInventory();
|
||||
@@ -124,7 +124,7 @@ public class CmdTntFill extends FCommand {
|
||||
}
|
||||
|
||||
private void removeFromBank(int amount) {
|
||||
int testNumber = -1;
|
||||
int testNumber = - 1;
|
||||
try {
|
||||
testNumber = Integer.parseInt(args.get(1));
|
||||
} catch (NumberFormatException e) {
|
||||
@@ -177,7 +177,7 @@ public class CmdTntFill extends FCommand {
|
||||
return;
|
||||
}
|
||||
ItemStack tnt = new ItemStack(Material.TNT, amount);
|
||||
if (fme.getFaction().getTnt() + amount > SavageFactions.plugin.getConfig().getInt("ftnt.Bank-Limit")) {
|
||||
if (fme.getFaction().getTnt() + amount > SavageFactions.plugin.getConfig().getInt("ftnt.Bank-Limit")) {
|
||||
msg(TL.COMMAND_TNT_EXCEEDLIMIT);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CmdToggleAllianceChat extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!Conf.factionOnlyChat) {
|
||||
if (! Conf.factionOnlyChat) {
|
||||
msg(TL.COMMAND_CHAT_DISABLED.toString());
|
||||
return;
|
||||
}
|
||||
@@ -38,6 +38,6 @@ public class CmdToggleAllianceChat extends FCommand {
|
||||
boolean ignoring = fme.isIgnoreAllianceChat();
|
||||
|
||||
msg(ignoring ? TL.COMMAND_TOGGLEALLIANCECHAT_UNIGNORE : TL.COMMAND_TOGGLEALLIANCECHAT_IGNORE);
|
||||
fme.setIgnoreAllianceChat(!ignoring);
|
||||
fme.setIgnoreAllianceChat(! ignoring);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class CmdTop extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return -1;
|
||||
return - 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class CmdTop extends FCommand {
|
||||
if (f1start > f2start) {
|
||||
return 1;
|
||||
} else if (f1start < f2start) {
|
||||
return -1;
|
||||
return - 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ public class CmdTop extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return -1;
|
||||
return - 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class CmdTop extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return -1;
|
||||
return - 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public class CmdTop extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return -1;
|
||||
return - 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public class CmdTop extends FCommand {
|
||||
if (f1Size < f2Size) {
|
||||
return 1;
|
||||
} else if (f1Size > f2Size) {
|
||||
return -1;
|
||||
return - 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -25,19 +25,19 @@ public class CmdTpBanner extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
final FactionsPlayerListener fpl = new FactionsPlayerListener(SavageFactions.plugin);
|
||||
final FactionsPlayerListener fpl = new FactionsPlayerListener(SavageFactions.plugin);
|
||||
|
||||
if (FactionsBlockListener.bannerLocations.containsKey(fme.getTag())) {
|
||||
if (FactionsBlockListener.bannerLocations.containsKey(fme.getTag())) {
|
||||
fme.msg(TL.COMMAND_TPBANNER_SUCCESS);
|
||||
this.doWarmUp(WarmUpUtil.Warmup.BANNER, TL.WARMUPS_NOTIFY_TELEPORT, "Banner", new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
me.teleport(FactionsBlockListener.bannerLocations.get(fme.getTag()));
|
||||
me.teleport(FactionsBlockListener.bannerLocations.get(fme.getTag()));
|
||||
}
|
||||
}, this.p.getConfig().getLong("warmups.f-banner", 0));
|
||||
} else {
|
||||
|
||||
@@ -26,9 +26,9 @@ public class CmdUnban extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.BAN);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER && ! Permission.BAN.has(sender, true)) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER && ! Permission.BAN.has(sender, true)) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "manage bans");
|
||||
return;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ public class CmdUnban extends FCommand {
|
||||
return; // the above method sends a message if fails to find someone.
|
||||
}
|
||||
|
||||
if (!myFaction.isBanned(target)) {
|
||||
if (! myFaction.isBanned(target)) {
|
||||
fme.msg(TL.COMMAND_UNBAN_NOTBANNED, target.getName());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ public class CmdUnclaim extends FCommand {
|
||||
int radius = this.argAsInt(0, 1); // Default to 1
|
||||
final Faction forFaction = this.argAsFaction(1, myFaction); // Default to own
|
||||
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.TERRITORY);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "manage faction territory");
|
||||
return;
|
||||
}
|
||||
@@ -53,7 +53,7 @@ public class CmdUnclaim extends FCommand {
|
||||
unClaim(new FLocation(me));
|
||||
} else {
|
||||
// radius claim
|
||||
if (!Permission.CLAIM_RADIUS.has(sender, false)) {
|
||||
if (! Permission.CLAIM_RADIUS.has(sender, false)) {
|
||||
msg(TL.COMMAND_CLAIM_DENIED);
|
||||
return;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ public class CmdUnclaim extends FCommand {
|
||||
msg(TL.COMMAND_UNCLAIM_SAFEZONE_SUCCESS);
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
@@ -99,7 +99,7 @@ public class CmdUnclaim extends FCommand {
|
||||
msg(TL.COMMAND_UNCLAIM_WARZONE_SUCCESS);
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
@@ -121,7 +121,7 @@ public class CmdUnclaim extends FCommand {
|
||||
msg(TL.COMMAND_UNCLAIM_UNCLAIMS);
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -133,11 +133,11 @@ public class CmdUnclaim extends FCommand {
|
||||
}
|
||||
|
||||
|
||||
if (!assertHasFaction()) {
|
||||
if (! assertHasFaction()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (targetFaction.getAccess(fme, PermissableAction.TERRITORY) != Access.ALLOW && !assertMinRole(Role.MODERATOR)) {
|
||||
if (targetFaction.getAccess(fme, PermissableAction.TERRITORY) != Access.ALLOW && ! assertMinRole(Role.MODERATOR)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -158,11 +158,11 @@ public class CmdUnclaim extends FCommand {
|
||||
double refund = Econ.calculateClaimRefund(myFaction.getLandRounded());
|
||||
|
||||
if (Conf.bankEnabled && Conf.bankFactionPaysLandCosts) {
|
||||
if (!Econ.modifyMoney(myFaction, refund, TL.COMMAND_UNCLAIM_TOUNCLAIM.toString(), TL.COMMAND_UNCLAIM_FORUNCLAIM.toString())) {
|
||||
if (! Econ.modifyMoney(myFaction, refund, TL.COMMAND_UNCLAIM_TOUNCLAIM.toString(), TL.COMMAND_UNCLAIM_FORUNCLAIM.toString())) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!Econ.modifyMoney(fme, refund, TL.COMMAND_UNCLAIM_TOUNCLAIM.toString(), TL.COMMAND_UNCLAIM_FORUNCLAIM.toString())) {
|
||||
if (! Econ.modifyMoney(fme, refund, TL.COMMAND_UNCLAIM_TOUNCLAIM.toString(), TL.COMMAND_UNCLAIM_FORUNCLAIM.toString())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -172,7 +172,7 @@ public class CmdUnclaim extends FCommand {
|
||||
myFaction.msg(TL.COMMAND_UNCLAIM_FACTIONUNCLAIMED, fme.describeTo(myFaction, true));
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
SavageFactions.plugin.log(TL.COMMAND_UNCLAIM_LOG.format(fme.getName(), target.getCoordString(), targetFaction.getTag()));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -32,11 +32,11 @@ public class CmdUnclaimall extends FCommand {
|
||||
if (Econ.shouldBeUsed()) {
|
||||
double refund = Econ.calculateTotalLandRefund(myFaction.getLandRounded());
|
||||
if (Conf.bankEnabled && Conf.bankFactionPaysLandCosts) {
|
||||
if (!Econ.modifyMoney(myFaction, refund, TL.COMMAND_UNCLAIMALL_TOUNCLAIM.toString(), TL.COMMAND_UNCLAIMALL_FORUNCLAIM.toString())) {
|
||||
if (! Econ.modifyMoney(myFaction, refund, TL.COMMAND_UNCLAIMALL_TOUNCLAIM.toString(), TL.COMMAND_UNCLAIMALL_FORUNCLAIM.toString())) {
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!Econ.modifyMoney(fme, refund, TL.COMMAND_UNCLAIMALL_TOUNCLAIM.toString(), TL.COMMAND_UNCLAIMALL_FORUNCLAIM.toString())) {
|
||||
if (! Econ.modifyMoney(fme, refund, TL.COMMAND_UNCLAIMALL_TOUNCLAIM.toString(), TL.COMMAND_UNCLAIMALL_FORUNCLAIM.toString())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class CmdUnclaimall extends FCommand {
|
||||
myFaction.msg(TL.COMMAND_UNCLAIMALL_UNCLAIMED, fme.describeTo(myFaction, true));
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SavageFactions.plugin.log(TL.COMMAND_UNCLAIMALL_LOG.format(fme.getName(), myFaction.getTag()));
|
||||
SavageFactions.plugin.log(TL.COMMAND_UNCLAIMALL_LOG.format(fme.getName(), myFaction.getTag()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public class CmdUpgrades extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fupgrades.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fupgrades.Enabled")) {
|
||||
fme.sendMessage("This command is disabled!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class CmdVault extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fvault.Enabled")) {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fvault.Enabled")) {
|
||||
fme.sendMessage("This command is disabled!");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class CmdVersion extends FCommand {
|
||||
@Override
|
||||
public void perform() {
|
||||
msg(TL.COMMAND_VERSION_NAME); // Did this so people can differentiate between SavageFactions and FactionsUUID (( Requested Feature ))
|
||||
msg(TL.COMMAND_VERSION_VERSION, SavageFactions.plugin.getDescription().getFullName());
|
||||
msg(TL.COMMAND_VERSION_VERSION, SavageFactions.plugin.getDescription().getFullName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,7 +48,7 @@ public class CmdWarunclaimall extends FCommand {
|
||||
|
||||
|
||||
if (Conf.logLandUnclaims) {
|
||||
SavageFactions.plugin.log(TL.COMMAND_WARUNCLAIMALL_LOG.format(fme.getName()));
|
||||
SavageFactions.plugin.log(TL.COMMAND_WARUNCLAIMALL_LOG.format(fme.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ public class FCmdRoot extends FCommand {
|
||||
this.setHelpShort("The faction base command");
|
||||
this.helpLong.add(p.txt.parseTags("<i>This command contains all faction stuff."));
|
||||
|
||||
//this.subCommands.add(plugin.cmdHelp);
|
||||
//this.subCommands.add(plugin.cmdHelp);
|
||||
|
||||
this.addSubCommand(this.cmdAdmin);
|
||||
this.addSubCommand(this.cmdAutoClaim);
|
||||
@@ -218,22 +218,22 @@ public class FCmdRoot extends FCommand {
|
||||
|
||||
|
||||
if (Bukkit.getServer().getPluginManager().getPlugin("CoreProtect") != null) {
|
||||
SavageFactions.plugin.log("Found CoreProtect, enabling Inspect");
|
||||
SavageFactions.plugin.log("Found CoreProtect, enabling Inspect");
|
||||
this.addSubCommand(this.cmdInspect);
|
||||
} else {
|
||||
SavageFactions.plugin.log("CoreProtect not found, disabling Inspect");
|
||||
SavageFactions.plugin.log("CoreProtect not found, disabling Inspect");
|
||||
}
|
||||
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("enable-faction-flight", false)) {
|
||||
this.addSubCommand(this.cmdFly);
|
||||
}
|
||||
if (Bukkit.getServer().getPluginManager().isPluginEnabled("FactionsTop")) {
|
||||
SavageFactions.plugin.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command.");
|
||||
SavageFactions.plugin.log(Level.INFO, "Found FactionsTop plugin. Disabling our own /f top command.");
|
||||
} else {
|
||||
SavageFactions.plugin.log(Level.INFO, "Enabling FactionsTop command, this is a very basic /f top please get a dedicated /f top resource if you want land calculation etc.");
|
||||
SavageFactions.plugin.log(Level.INFO, "Enabling FactionsTop command, this is a very basic /f top please get a dedicated /f top resource if you want land calculation etc.");
|
||||
this.addSubCommand(this.cmdTop);
|
||||
}
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("fpaypal.Enabled")) {
|
||||
this.addSubCommand(this.cmdPaypalSet);
|
||||
this.addSubCommand(this.cmdPaypalSee);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
public boolean isMoneyCommand;
|
||||
|
||||
public FCommand() {
|
||||
super(SavageFactions.plugin);
|
||||
super(SavageFactions.plugin);
|
||||
|
||||
// Due to safety reasons it defaults to disable on lock.
|
||||
disableOnLock = true;
|
||||
@@ -62,12 +62,12 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isMoneyCommand && !Conf.econEnabled) {
|
||||
if (this.isMoneyCommand && ! Conf.econEnabled) {
|
||||
msg("<b>Faction economy features are disabled on this server.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.isMoneyCommand && !Conf.bankEnabled) {
|
||||
if (this.isMoneyCommand && ! Conf.bankEnabled) {
|
||||
msg("<b>The faction bank system is disabled on this server.");
|
||||
return false;
|
||||
}
|
||||
@@ -78,29 +78,29 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
@Override
|
||||
public boolean validSenderType(CommandSender sender, boolean informSenderIfNot) {
|
||||
boolean superValid = super.validSenderType(sender, informSenderIfNot);
|
||||
if (!superValid) {
|
||||
if (! superValid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(this.senderMustBeMember || this.senderMustBeModerator || this.senderMustBeAdmin || this.senderMustBeColeader)) {
|
||||
if (! (this.senderMustBeMember || this.senderMustBeModerator || this.senderMustBeAdmin || this.senderMustBeColeader)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
if (! (sender instanceof Player)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!fme.hasFaction()) {
|
||||
if (! fme.hasFaction()) {
|
||||
sender.sendMessage(p.txt.parse("<b>You are not member of any faction."));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.senderMustBeModerator && !fme.getRole().isAtLeast(Role.MODERATOR)) {
|
||||
if (this.senderMustBeModerator && ! fme.getRole().isAtLeast(Role.MODERATOR)) {
|
||||
sender.sendMessage(p.txt.parse("<b>Only faction moderators can %s.", this.getHelpShort()));
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.senderMustBeColeader && !fme.getRole().isAtLeast(Role.COLEADER)) {
|
||||
if (this.senderMustBeColeader && ! fme.getRole().isAtLeast(Role.COLEADER)) {
|
||||
sender.sendMessage(p.txt.parse("<b>Only faction coleaders can %s.", this.getHelpShort()));
|
||||
return false;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!fme.hasFaction()) {
|
||||
if (! fme.hasFaction()) {
|
||||
sendMessage("You are not member of any faction.");
|
||||
return false;
|
||||
}
|
||||
@@ -160,7 +160,7 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
}
|
||||
|
||||
if (msg && ret == null) {
|
||||
this.msg("<b>No player \"<plugin>%s<b>\" could be found.", name);
|
||||
this.msg("<b>No player \"<plugin>%s<b>\" could be found.", name);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -233,7 +233,7 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
}
|
||||
|
||||
if (msg && ret == null) {
|
||||
this.msg("<b>The faction or player \"<plugin>%s<b>\" could not be found.", name);
|
||||
this.msg("<b>The faction or player \"<plugin>%s<b>\" could not be found.", name);
|
||||
}
|
||||
|
||||
return ret;
|
||||
@@ -256,7 +256,7 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
// -------------------------------------------- //
|
||||
|
||||
public boolean canIAdministerYou(FPlayer i, FPlayer you) {
|
||||
if (!i.getFaction().equals(you.getFaction())) {
|
||||
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)));
|
||||
return false;
|
||||
}
|
||||
@@ -290,14 +290,14 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
|
||||
// if economy is enabled and they're not on the bypass list, make 'em pay; returns true unless person can't afford the cost
|
||||
public boolean payForCommand(double cost, String toDoThis, String forDoingThis) {
|
||||
if (!Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.isAdminBypassing()) {
|
||||
if (! Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.isAdminBypassing()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Conf.bankEnabled && Conf.bankFactionPaysCosts && fme.hasFaction()) {
|
||||
return Econ.modifyMoney(myFaction, -cost, toDoThis, forDoingThis);
|
||||
return Econ.modifyMoney(myFaction, - cost, toDoThis, forDoingThis);
|
||||
} else {
|
||||
return Econ.modifyMoney(fme, -cost, toDoThis, forDoingThis);
|
||||
return Econ.modifyMoney(fme, - cost, toDoThis, forDoingThis);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ public abstract class FCommand extends MCommand<SavageFactions> {
|
||||
|
||||
// like above, but just make sure they can pay; returns true unless person can't afford the cost
|
||||
public boolean canAffordCommand(double cost, String toDoThis) {
|
||||
if (!Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.isAdminBypassing()) {
|
||||
if (! Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.isAdminBypassing()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,18 +33,18 @@ public class FPromoteCommand extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!target.getFaction().equals(myFaction)) {
|
||||
if (! target.getFaction().equals(myFaction)) {
|
||||
msg(TL.COMMAND_PROMOTE_WRONGFACTION, target.getName());
|
||||
return;
|
||||
}
|
||||
|
||||
Role current = target.getRole();
|
||||
Role promotion = Role.getRelative(current, +relative);
|
||||
Role promotion = Role.getRelative(current, + relative);
|
||||
|
||||
// Now it ain't that messy
|
||||
if (!fme.isAdminBypassing()) {
|
||||
if (! fme.isAdminBypassing()) {
|
||||
Access access = myFaction.getAccess(fme, PermissableAction.PROMOTE);
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
if (access != Access.ALLOW && fme.getRole() != Role.LEADER) {
|
||||
fme.msg(TL.GENERIC_NOPERMISSION, "manage ranks");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public abstract class FRelationCommand extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!them.isNormal()) {
|
||||
if (! them.isNormal()) {
|
||||
msg(TL.COMMAND_RELATIONS_ALLTHENOPE);
|
||||
return;
|
||||
}
|
||||
@@ -64,7 +64,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;
|
||||
}
|
||||
|
||||
@@ -88,12 +88,12 @@ public abstract class FRelationCommand extends FCommand {
|
||||
myFaction.msg(TL.COMMAND_RELATIONS_PROPOSAL_SENT, currentRelationColor + them.getTag(), "" + targetRelation.getColor() + targetRelation);
|
||||
}
|
||||
|
||||
if (!targetRelation.isNeutral() && them.isPeaceful()) {
|
||||
if (! targetRelation.isNeutral() && them.isPeaceful()) {
|
||||
them.msg(TL.COMMAND_RELATIONS_PEACEFUL);
|
||||
myFaction.msg(TL.COMMAND_RELATIONS_PEACEFULOTHER);
|
||||
}
|
||||
|
||||
if (!targetRelation.isNeutral() && myFaction.isPeaceful()) {
|
||||
if (! targetRelation.isNeutral() && myFaction.isPeaceful()) {
|
||||
them.msg(TL.COMMAND_RELATIONS_PEACEFULOTHER);
|
||||
myFaction.msg(TL.COMMAND_RELATIONS_PEACEFUL);
|
||||
}
|
||||
@@ -103,9 +103,9 @@ public abstract class FRelationCommand extends FCommand {
|
||||
}
|
||||
|
||||
private boolean hasMaxRelations(Faction them, Relation targetRelation) {
|
||||
int max = SavageFactions.plugin.getConfig().getInt("max-relations." + targetRelation.toString(), - 1);
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("max-relations.enabled", false)) {
|
||||
if (max != -1) {
|
||||
int max = SavageFactions.plugin.getConfig().getInt("max-relations." + targetRelation.toString(), - 1);
|
||||
if (SavageFactions.plugin.getConfig().getBoolean("max-relations.enabled", false)) {
|
||||
if (max != - 1) {
|
||||
if (myFaction.getRelationCount(targetRelation) >= max) {
|
||||
msg(TL.COMMAND_RELATIONS_EXCEEDS_ME, max, targetRelation.getPluralTranslation());
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user