Fixed spacing in code around ! operator.
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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -35,7 +35,7 @@ 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) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "ban");
|
||||
|
||||
@@ -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,11 +31,11 @@ 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;
|
||||
}
|
||||
|
||||
@@ -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,7 +25,7 @@ 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()) {
|
||||
|
||||
@@ -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,7 +24,7 @@ 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);
|
||||
|
||||
@@ -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,12 +28,12 @@ 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) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "access chest");
|
||||
|
||||
@@ -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,17 +50,17 @@ 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;
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ 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));
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ 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) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "manage invites");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class CmdDisband extends FCommand {
|
||||
boolean isMyFaction = fme != null && faction == myFaction;
|
||||
|
||||
|
||||
if (! fme.isAdminBypassing()) {
|
||||
if (!fme.isAdminBypassing()) {
|
||||
Access access = faction.getAccess(fme, PermissableAction.DISBAND);
|
||||
if (fme.getRole() != Role.LEADER && access != Access.ALLOW) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "disband " + faction.getTag());
|
||||
@@ -66,7 +66,7 @@ public class CmdDisband extends FCommand {
|
||||
|
||||
// check for tnt before disbanding.
|
||||
|
||||
if (! disbandMap.containsKey(me.getUniqueId().toString()) && faction.getTnt() > 0) {
|
||||
if (!disbandMap.containsKey(me.getUniqueId().toString()) && faction.getTnt() > 0) {
|
||||
msg(TL.COMMAND_DISBAND_CONFIRM.toString().replace("{tnt}", faction.getTnt() + ""));
|
||||
disbandMap.put(me.getUniqueId().toString(), faction.getId());
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, new Runnable() {
|
||||
|
||||
@@ -31,7 +31,7 @@ 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) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "use warps");
|
||||
@@ -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
|
||||
|
||||
@@ -39,7 +39,7 @@ 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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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);
|
||||
@@ -110,7 +110,7 @@ public class CmdFly extends FCommand {
|
||||
if (player.getGameMode() == GameMode.CREATIVE) {
|
||||
continue;
|
||||
}
|
||||
if (! SavageFactions.plugin.mc17 && player.getGameMode() == GameMode.SPECTATOR) {
|
||||
if (!SavageFactions.plugin.mc17 && player.getGameMode() == GameMode.SPECTATOR) {
|
||||
continue;
|
||||
}
|
||||
Faction myFaction = fPlayer.getFaction();
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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) {
|
||||
if (entities.get(i) instanceof Player) {
|
||||
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;
|
||||
|
||||
@@ -26,7 +26,7 @@ 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;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class CmdGetVault extends FCommand {
|
||||
|
||||
//has enough money?
|
||||
int amount = SavageFactions.plugin.getConfig().getInt("fvault.Price");
|
||||
if (! fme.hasMoney(amount)) {
|
||||
if (!fme.hasMoney(amount)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,16 +40,16 @@ 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) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "teleport home");
|
||||
@@ -58,18 +58,18 @@ public class CmdHome extends FCommand {
|
||||
}
|
||||
|
||||
|
||||
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,11 +44,11 @@ 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) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "manage invites");
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -78,7 +78,7 @@ 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) {
|
||||
fme.msg(TL.GENERIC_NOPERMISSION, "kick");
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,7 +51,7 @@ public class CmdList extends FCommand {
|
||||
factionList.remove(Factions.getInstance().getWarZone());
|
||||
|
||||
// remove exempt factions
|
||||
if (! fme.getPlayer().hasPermission("factions.show.bypassexempt")) {
|
||||
if (!fme.getPlayer().hasPermission("factions.show.bypassexempt")) {
|
||||
List<String> exemptFactions = SavageFactions.plugin.getConfig().getStringList("show-exempt");
|
||||
Iterator<Faction> factionIterator = factionList.iterator();
|
||||
while (factionIterator.hasNext()) {
|
||||
|
||||
@@ -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,17 +47,17 @@ 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;
|
||||
}
|
||||
|
||||
if (fme != null && fme.getRole() != Role.LEADER && ! permAny) {
|
||||
if (fme != null && fme.getRole() != Role.LEADER && !permAny) {
|
||||
msg(TL.COMMAND_MOD_NOTADMIN);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ 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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class CmdPowerBoost extends FCommand {
|
||||
boolean doPlayer = true;
|
||||
if (type.equals("f") || type.equals("faction")) {
|
||||
doPlayer = false;
|
||||
} else if (! type.equals("plugin") && ! type.equals("player")) {
|
||||
} else if (!type.equals("plugin") && !type.equals("player")) {
|
||||
msg(TL.COMMAND_POWERBOOST_HELP_1);
|
||||
msg(TL.COMMAND_POWERBOOST_HELP_2);
|
||||
return;
|
||||
@@ -76,7 +76,7 @@ public class CmdPowerBoost extends FCommand {
|
||||
|
||||
int roundedPower = (int) Math.round(targetPower);
|
||||
msg(TL.COMMAND_POWERBOOST_BOOST, target, roundedPower);
|
||||
if (! senderIsConsole) {
|
||||
if (!senderIsConsole) {
|
||||
SavageFactions.plugin.log(TL.COMMAND_POWERBOOST_BOOSTLOG.toString(), fme.getName(), target, roundedPower);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ 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;
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -19,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,14 +30,14 @@ 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) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "set warps");
|
||||
@@ -52,7 +52,7 @@ public class CmdSetFWarp extends FCommand {
|
||||
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
|
||||
|
||||
@@ -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,14 +54,14 @@ 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;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class CmdShow extends FCommand {
|
||||
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);
|
||||
|
||||
@@ -18,7 +18,7 @@ public class CmdStuck extends FCommand {
|
||||
super();
|
||||
|
||||
this.aliases.add("stuck");
|
||||
this.aliases.add("halp!"); // halp! c:
|
||||
this.aliases.add("halp!"); // halp!c:
|
||||
|
||||
this.permission = Permission.STUCK.node;
|
||||
this.disableOnLock = true;
|
||||
@@ -44,7 +44,7 @@ public class CmdStuck 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.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;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class CmdStuck extends FCommand {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (! SavageFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) {
|
||||
if (!SavageFactions.plugin.getStuckMap().containsKey(player.getUniqueId())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ public class CmdStuck extends FCommand {
|
||||
FLocation chunk = currentFLocation();
|
||||
Faction faction = board.getFactionAt(chunk);
|
||||
int buffer = SavageFactions.plugin.getConfig().getInt("world-border.buffer", 0);
|
||||
if (faction.isWilderness() && ! chunk.isOutsideWorldBorder(buffer)) {
|
||||
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);
|
||||
@@ -82,7 +82,7 @@ public class CmdStuck extends FCommand {
|
||||
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)) {
|
||||
if (!Essentials.handleTeleport(player, tp)) {
|
||||
player.teleport(tp);
|
||||
SavageFactions.plugin.debug("/f stuck used regular teleport, not essentials!");
|
||||
}
|
||||
|
||||
@@ -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,12 +31,12 @@ 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) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "use tnt bank");
|
||||
@@ -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,7 +34,7 @@ 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) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "use tnt fill");
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class CmdTpBanner extends FCommand {
|
||||
|
||||
@Override
|
||||
public void perform() {
|
||||
if (! SavageFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
|
||||
if (!SavageFactions.plugin.getConfig().getBoolean("fbanners.Enabled")) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,7 +35,7 @@ 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) {
|
||||
fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "manage faction territory");
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,34 +78,34 @@ 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;
|
||||
}
|
||||
|
||||
if (this.senderMustBeAdmin && ! fme.getRole().isAtLeast(Role.LEADER)) {
|
||||
if (this.senderMustBeAdmin && !fme.getRole().isAtLeast(Role.LEADER)) {
|
||||
sender.sendMessage(p.txt.parse("<b>Only faction admins 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;
|
||||
}
|
||||
@@ -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,7 +290,7 @@ 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;
|
||||
}
|
||||
|
||||
@@ -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,7 +33,7 @@ public class FPromoteCommand extends FCommand {
|
||||
return;
|
||||
}
|
||||
|
||||
if (! target.getFaction().equals(myFaction)) {
|
||||
if (!target.getFaction().equals(myFaction)) {
|
||||
msg(TL.COMMAND_PROMOTE_WRONGFACTION, target.getName());
|
||||
return;
|
||||
}
|
||||
@@ -42,7 +42,7 @@ public class FPromoteCommand extends FCommand {
|
||||
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) {
|
||||
fme.msg(TL.GENERIC_NOPERMISSION, "manage ranks");
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user