From 84f1d354eb0cbb032d041bf849a84193e90097d8 Mon Sep 17 00:00:00 2001 From: ProSavage Date: Wed, 7 Nov 2018 10:14:42 -0600 Subject: [PATCH] Fixed spacing in code around ! operator. --- .../java/com/massivecraft/factions/Conf.java | 4 +- .../com/massivecraft/factions/FLocation.java | 4 +- .../massivecraft/factions/MassiveStats.java | 4 +- .../massivecraft/factions/SavageFactions.java | 12 +- .../massivecraft/factions/cmd/CmdAdmin.java | 6 +- .../factions/cmd/CmdAutoClaim.java | 2 +- .../com/massivecraft/factions/cmd/CmdBan.java | 2 +- .../massivecraft/factions/cmd/CmdBanlist.java | 2 +- .../massivecraft/factions/cmd/CmdBanner.java | 4 +- .../massivecraft/factions/cmd/CmdBoom.java | 6 +- .../massivecraft/factions/cmd/CmdBypass.java | 2 +- .../massivecraft/factions/cmd/CmdChat.java | 4 +- .../massivecraft/factions/cmd/CmdChatSpy.java | 2 +- .../factions/cmd/CmdCheckpoint.java | 2 +- .../massivecraft/factions/cmd/CmdChest.java | 4 +- .../massivecraft/factions/cmd/CmdClaim.java | 4 +- .../factions/cmd/CmdColeader.java | 6 +- .../massivecraft/factions/cmd/CmdConfig.java | 2 +- .../massivecraft/factions/cmd/CmdConvert.java | 2 +- .../massivecraft/factions/cmd/CmdCreate.java | 4 +- .../factions/cmd/CmdDeinvite.java | 2 +- .../factions/cmd/CmdDelFWarp.java | 4 +- .../factions/cmd/CmdDescription.java | 4 +- .../massivecraft/factions/cmd/CmdDisband.java | 4 +- .../massivecraft/factions/cmd/CmdFWarp.java | 8 +- .../com/massivecraft/factions/cmd/CmdFly.java | 32 ++--- .../factions/cmd/CmdGetVault.java | 4 +- .../massivecraft/factions/cmd/CmdHome.java | 20 ++-- .../massivecraft/factions/cmd/CmdInvite.java | 4 +- .../massivecraft/factions/cmd/CmdJoin.java | 16 +-- .../massivecraft/factions/cmd/CmdKick.java | 8 +- .../massivecraft/factions/cmd/CmdList.java | 4 +- .../massivecraft/factions/cmd/CmdLock.java | 2 +- .../massivecraft/factions/cmd/CmdLogins.java | 4 +- .../com/massivecraft/factions/cmd/CmdMap.java | 6 +- .../com/massivecraft/factions/cmd/CmdMod.java | 6 +- .../factions/cmd/CmdMoneyBalance.java | 2 +- .../massivecraft/factions/cmd/CmdNear.java | 2 +- .../massivecraft/factions/cmd/CmdOpen.java | 4 +- .../massivecraft/factions/cmd/CmdOwner.java | 14 +-- .../factions/cmd/CmdOwnerList.java | 8 +- .../factions/cmd/CmdPaypalSee.java | 4 +- .../factions/cmd/CmdPaypalSet.java | 2 +- .../massivecraft/factions/cmd/CmdPower.java | 4 +- .../factions/cmd/CmdPowerBoost.java | 4 +- .../massivecraft/factions/cmd/CmdRules.java | 2 +- .../com/massivecraft/factions/cmd/CmdSB.java | 2 +- .../factions/cmd/CmdSetBanner.java | 2 +- .../factions/cmd/CmdSetFWarp.java | 8 +- .../massivecraft/factions/cmd/CmdSethome.java | 10 +- .../massivecraft/factions/cmd/CmdShow.java | 8 +- .../massivecraft/factions/cmd/CmdStealth.java | 4 +- .../massivecraft/factions/cmd/CmdStuck.java | 10 +- .../com/massivecraft/factions/cmd/CmdTag.java | 6 +- .../massivecraft/factions/cmd/CmdTitle.java | 4 +- .../com/massivecraft/factions/cmd/CmdTnt.java | 8 +- .../massivecraft/factions/cmd/CmdTntFill.java | 8 +- .../factions/cmd/CmdToggleAllianceChat.java | 4 +- .../factions/cmd/CmdTpBanner.java | 2 +- .../massivecraft/factions/cmd/CmdUnban.java | 6 +- .../massivecraft/factions/cmd/CmdUnclaim.java | 12 +- .../factions/cmd/CmdUnclaimall.java | 4 +- .../factions/cmd/CmdUpgrades.java | 2 +- .../massivecraft/factions/cmd/CmdVault.java | 2 +- .../massivecraft/factions/cmd/FCommand.java | 26 ++--- .../factions/cmd/FPromoteCommand.java | 4 +- .../factions/cmd/FRelationCommand.java | 8 +- .../factions/integration/Econ.java | 34 +++--- .../factions/integration/Essentials.java | 2 +- .../factions/integration/Worldguard.java | 10 +- .../integration/dynmap/EngineDynmap.java | 38 +++--- .../integration/dynmap/TempAreaMarker.java | 6 +- .../integration/dynmap/TempMarker.java | 6 +- .../integration/dynmap/TempMarkerSet.java | 2 +- .../listeners/FactionsBlockListener.java | 64 +++++----- .../listeners/FactionsChatListener.java | 14 +-- .../listeners/FactionsEntityListener.java | 80 ++++++------- .../listeners/FactionsExploitListener.java | 4 +- .../listeners/FactionsPlayerListener.java | 110 +++++++++--------- .../scoreboards/BufferedObjective.java | 6 +- .../factions/scoreboards/FScoreboard.java | 6 +- .../factions/scoreboards/FTeamWrapper.java | 22 ++-- .../massivecraft/factions/struct/Role.java | 2 +- .../factions/util/AutoLeaveProcessTask.java | 4 +- .../factions/util/AutoLeaveTask.java | 2 +- .../factions/util/EnumTypeAdapter.java | 4 +- .../util/MapFLocToStringSetTypeAdapter.java | 2 +- .../massivecraft/factions/util/MiscUtil.java | 4 +- .../util/Particles/ParticleEffect.java | 66 +++++------ .../util/Particles/ReflectionUtils.java | 4 +- .../factions/util/RelationUtil.java | 4 +- .../factions/util/SpiralTask.java | 16 +-- .../massivecraft/factions/util/WarpGUI.java | 10 +- .../massivecraft/factions/zcore/MCommand.java | 6 +- .../massivecraft/factions/zcore/MPlugin.java | 6 +- .../zcore/fperms/PermissableAction.java | 4 +- .../fperms/gui/PermissableActionGUI.java | 10 +- .../fperms/gui/PermissableRelationGUI.java | 6 +- .../zcore/fupgrades/FUpgradesGUI.java | 26 ++--- .../factions/zcore/nbtapi/NBTFile.java | 2 +- .../factions/zcore/nbtapi/NBTList.java | 2 +- .../zcore/nbtapi/NBTReflectionUtil.java | 88 +++++++------- .../zcore/nbtapi/utils/MinecraftVersion.java | 4 +- .../factions/zcore/persist/MemoryBoard.java | 10 +- .../factions/zcore/persist/MemoryFPlayer.java | 56 ++++----- .../zcore/persist/MemoryFPlayers.java | 2 +- .../factions/zcore/persist/MemoryFaction.java | 34 +++--- .../zcore/persist/MemoryFactions.java | 20 ++-- .../factions/zcore/persist/SaveTask.java | 2 +- .../zcore/persist/json/FactionsJSON.java | 6 +- .../zcore/persist/json/JSONBoard.java | 4 +- .../zcore/persist/json/JSONFPlayers.java | 10 +- .../zcore/persist/json/JSONFactions.java | 8 +- .../factions/zcore/util/PermUtil.java | 2 +- .../factions/zcore/util/Persist.java | 2 +- .../massivecraft/factions/zcore/util/TL.java | 6 +- .../factions/zcore/util/TagReplacer.java | 2 +- .../factions/zcore/util/TagUtil.java | 4 +- .../factions/zcore/util/TextUtil.java | 2 +- 119 files changed, 619 insertions(+), 619 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/Conf.java b/src/main/java/com/massivecraft/factions/Conf.java index 020c82a2..7d7bf6dd 100644 --- a/src/main/java/com/massivecraft/factions/Conf.java +++ b/src/main/java/com/massivecraft/factions/Conf.java @@ -377,7 +377,7 @@ public class Conf { territoryDenyUseageMaterials.add(MultiversionMaterials.JUNGLE_BUTTON.parseMaterial()); territoryDenyUseageMaterials.add(MultiversionMaterials.OAK_BUTTON.parseMaterial()); territoryDenyUseageMaterials.add(MultiversionMaterials.STONE_BUTTON.parseMaterial()); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { territoryDenyUseageMaterials.add(Material.ARMOR_STAND); } @@ -413,7 +413,7 @@ public class Conf { territoryDenyUseageMaterialsWhenOffline.add(MultiversionMaterials.JUNGLE_BUTTON.parseMaterial()); territoryDenyUseageMaterialsWhenOffline.add(MultiversionMaterials.OAK_BUTTON.parseMaterial()); territoryDenyUseageMaterialsWhenOffline.add(MultiversionMaterials.STONE_BUTTON.parseMaterial()); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { territoryDenyUseageMaterialsWhenOffline.add(Material.ARMOR_STAND); } safeZoneNerfedCreatureTypes.add(EntityType.BLAZE); diff --git a/src/main/java/com/massivecraft/factions/FLocation.java b/src/main/java/com/massivecraft/factions/FLocation.java index 04a2aa8a..00a79b76 100644 --- a/src/main/java/com/massivecraft/factions/FLocation.java +++ b/src/main/java/com/massivecraft/factions/FLocation.java @@ -191,7 +191,7 @@ public class FLocation implements Serializable { * @return whether this location is outside of the border */ public boolean isOutsideWorldBorder(int buffer) { - if (! worldBorderSupport) { + if (!worldBorderSupport) { return false; } @@ -247,7 +247,7 @@ public class FLocation implements Serializable { if (obj == this) { return true; } - if (! (obj instanceof FLocation)) { + if (!(obj instanceof FLocation)) { return false; } diff --git a/src/main/java/com/massivecraft/factions/MassiveStats.java b/src/main/java/com/massivecraft/factions/MassiveStats.java index b42c43d3..6fe86bb3 100644 --- a/src/main/java/com/massivecraft/factions/MassiveStats.java +++ b/src/main/java/com/massivecraft/factions/MassiveStats.java @@ -224,7 +224,7 @@ public class MassiveStats implements Listener { } // and only notify operators - or players with the correct permission. - if (! event.getPlayer().isOp() && ! event.getPlayer().hasPermission(MassiveStats.MASSIVE_UPDATE_PERMISSION)) { + if (!event.getPlayer().isOp() && !event.getPlayer().hasPermission(MassiveStats.MASSIVE_UPDATE_PERMISSION)) { return; } @@ -456,7 +456,7 @@ final class MassiveStatsDataResponse { MassiveStatsDataResponse(boolean isUpToDate, String newVersion, String updateMessage) { this.isUpToDate = isUpToDate; - if (! isUpToDate) { + if (!isUpToDate) { this.newVersion = newVersion; this.updateMessage = updateMessage; return; diff --git a/src/main/java/com/massivecraft/factions/SavageFactions.java b/src/main/java/com/massivecraft/factions/SavageFactions.java index 127a4cae..8c8373c3 100644 --- a/src/main/java/com/massivecraft/factions/SavageFactions.java +++ b/src/main/java/com/massivecraft/factions/SavageFactions.java @@ -145,7 +145,7 @@ public class SavageFactions extends MPlugin { setupMultiversionMaterials(); log("==== End Setup ===="); - if (! preEnable()) { + if (!preEnable()) { return; } this.loadSuccessful = false; @@ -256,7 +256,7 @@ public class SavageFactions extends MPlugin { FIREBALL = Material.valueOf("LEGACY_FIREBALL"); } else { - if (! mc17) { + if (!mc17) { BANNER = Material.valueOf("BANNER"); } CROPS = Material.valueOf("CROPS"); @@ -420,7 +420,7 @@ public class SavageFactions extends MPlugin { public void startAutoLeaveTask(boolean restartIfRunning) { if (AutoLeaveTask != null) { - if (! restartIfRunning) { + if (!restartIfRunning) { return; } this.getServer().getScheduler().cancelTask(AutoLeaveTask); @@ -540,7 +540,7 @@ public class SavageFactions extends MPlugin { // TODO: GET THIS BACK AND WORKING public boolean isFactionsCommand(String check) { - return ! (check == null || check.isEmpty()) && this.handleCommand(null, check, true); + return !(check == null || check.isEmpty()) && this.handleCommand(null, check, true); } // Get a player's faction tag (faction name), mainly for usage by chat plugins for local/channel chat @@ -562,7 +562,7 @@ public class SavageFactions extends MPlugin { } // if listener isn't set, or config option is disabled, give back uncolored tag - if (listener == null || ! Conf.chatTagRelationColored) { + if (listener == null || !Conf.chatTagRelationColored) { tag = me.getChatTag().trim(); } else { FPlayer you = FPlayers.getInstance().getByPlayer(listener); @@ -641,7 +641,7 @@ public class SavageFactions extends MPlugin { } public String getPrimaryGroup(OfflinePlayer player) { - return perms == null || ! perms.hasGroupSupport() ? " " : perms.getPrimaryGroup(Bukkit.getWorlds().get(0).toString(), player); + return perms == null || !perms.hasGroupSupport() ? " " : perms.getPrimaryGroup(Bukkit.getWorlds().get(0).toString(), player); } public void debug(Level level, String s) { diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdAdmin.java b/src/main/java/com/massivecraft/factions/cmd/CmdAdmin.java index 90e6dff7..afb99361 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdAdmin.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdAdmin.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdAutoClaim.java b/src/main/java/com/massivecraft/factions/cmd/CmdAutoClaim.java index 8ee61620..5aa47e72 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdAutoClaim.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdAutoClaim.java @@ -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 { diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdBan.java b/src/main/java/com/massivecraft/factions/cmd/CmdBan.java index f13107f9..64551254 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdBan.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdBan.java @@ -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"); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdBanlist.java b/src/main/java/com/massivecraft/factions/cmd/CmdBanlist.java index 4bf83013..42d8c7e5 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdBanlist.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdBanlist.java @@ -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); } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdBanner.java b/src/main/java/com/massivecraft/factions/cmd/CmdBanner.java index 0d93de8e..26ae7584 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdBanner.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdBanner.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdBoom.java b/src/main/java/com/massivecraft/factions/cmd/CmdBoom.java index 1bcccfd9..fcbe859f 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdBoom.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdBoom.java @@ -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(); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdBypass.java b/src/main/java/com/massivecraft/factions/cmd/CmdBypass.java index 4fc38e1e..3dd55678 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdBypass.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdBypass.java @@ -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()) { diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdChat.java b/src/main/java/com/massivecraft/factions/cmd/CmdChat.java index 9c5f6d1b..69cff8d8 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdChat.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdChat.java @@ -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")) { diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdChatSpy.java b/src/main/java/com/massivecraft/factions/cmd/CmdChatSpy.java index 555dd379..f6cd198f 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdChatSpy.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdChatSpy.java @@ -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); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdCheckpoint.java b/src/main/java/com/massivecraft/factions/cmd/CmdCheckpoint.java index eb342657..01021f8d 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdCheckpoint.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdCheckpoint.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdChest.java b/src/main/java/com/massivecraft/factions/cmd/CmdChest.java index 22fd632b..aeb22468 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdChest.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdChest.java @@ -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"); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdClaim.java b/src/main/java/com/massivecraft/factions/cmd/CmdClaim.java index 44111920..2ef27129 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdClaim.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdClaim.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdColeader.java b/src/main/java/com/massivecraft/factions/cmd/CmdColeader.java index 51f6c53c..eab9becf 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdColeader.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdColeader.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdConfig.java b/src/main/java/com/massivecraft/factions/cmd/CmdConfig.java index d9e8300c..14b1c392 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdConfig.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdConfig.java @@ -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)); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdConvert.java b/src/main/java/com/massivecraft/factions/cmd/CmdConvert.java index d4d1a194..42cf9173 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdConvert.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdConvert.java @@ -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()); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdCreate.java b/src/main/java/com/massivecraft/factions/cmd/CmdCreate.java index 6687ea63..b89d1281 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdCreate.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdCreate.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdDeinvite.java b/src/main/java/com/massivecraft/factions/cmd/CmdDeinvite.java index a5e8e058..f719b59b 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdDeinvite.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdDeinvite.java @@ -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"); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdDelFWarp.java b/src/main/java/com/massivecraft/factions/cmd/CmdDelFWarp.java index 31e6bf85..50ff1578 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdDelFWarp.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdDelFWarp.java @@ -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 diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdDescription.java b/src/main/java/com/massivecraft/factions/cmd/CmdDescription.java index aaa30e1d..98dc3509 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdDescription.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdDescription.java @@ -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; diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java b/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java index 85f13ef3..4e2785c5 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdDisband.java @@ -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() { diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFWarp.java b/src/main/java/com/massivecraft/factions/cmd/CmdFWarp.java index fac2b070..c330f4eb 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFWarp.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFWarp.java @@ -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 diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdFly.java b/src/main/java/com/massivecraft/factions/cmd/CmdFly.java index 84cf01af..ef04243a 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdFly.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdFly.java @@ -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 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; diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdGetVault.java b/src/main/java/com/massivecraft/factions/cmd/CmdGetVault.java index 5a507d00..5ab717ce 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdGetVault.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdGetVault.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdHome.java b/src/main/java/com/massivecraft/factions/cmd/CmdHome.java index 6bb93bc6..f3b8822c 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdHome.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdHome.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdInvite.java b/src/main/java/com/massivecraft/factions/cmd/CmdInvite.java index c21aee88..59dd63f1 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdInvite.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdInvite.java @@ -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"); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdJoin.java b/src/main/java/com/massivecraft/factions/cmd/CmdJoin.java index 14befe22..e607dd84 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdJoin.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdJoin.java @@ -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)); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdKick.java b/src/main/java/com/massivecraft/factions/cmd/CmdKick.java index 090c638a..b465eae2 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdKick.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdKick.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdList.java b/src/main/java/com/massivecraft/factions/cmd/CmdList.java index 8b537559..bf29af82 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdList.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdList.java @@ -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 exemptFactions = SavageFactions.plugin.getConfig().getStringList("show-exempt"); Iterator factionIterator = factionList.iterator(); while (factionIterator.hasNext()) { diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdLock.java b/src/main/java/com/massivecraft/factions/cmd/CmdLock.java index 9b38481b..c27603bd 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdLock.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdLock.java @@ -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); } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdLogins.java b/src/main/java/com/massivecraft/factions/cmd/CmdLogins.java index ef42dc46..08900c48 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdLogins.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdLogins.java @@ -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 diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdMap.java b/src/main/java/com/massivecraft/factions/cmd/CmdMap.java index 1a57001c..6b87bd66 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdMap.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdMap.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdMod.java b/src/main/java/com/massivecraft/factions/cmd/CmdMod.java index 6333bd7a..ee78ab8c 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdMod.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdMod.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdMoneyBalance.java b/src/main/java/com/massivecraft/factions/cmd/CmdMoneyBalance.java index 8ab055ce..db30f81f 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdMoneyBalance.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdMoneyBalance.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdNear.java b/src/main/java/com/massivecraft/factions/cmd/CmdNear.java index a7d4041b..e58c2cb4 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdNear.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdNear.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdOpen.java b/src/main/java/com/massivecraft/factions/cmd/CmdOpen.java index ba6c2c93..460e594b 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdOpen.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdOpen.java @@ -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(); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdOwner.java b/src/main/java/com/massivecraft/factions/cmd/CmdOwner.java index 80893f89..fa23b088 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdOwner.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdOwner.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdOwnerList.java b/src/main/java/com/massivecraft/factions/cmd/CmdOwnerList.java index 8ad4806a..4bcb5e02 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdOwnerList.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdOwnerList.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdPaypalSee.java b/src/main/java/com/massivecraft/factions/cmd/CmdPaypalSee.java index e7009f47..d13bc8f7 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdPaypalSee.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdPaypalSee.java @@ -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 { diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdPaypalSet.java b/src/main/java/com/massivecraft/factions/cmd/CmdPaypalSet.java index e0b47133..df792b59 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdPaypalSet.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdPaypalSet.java @@ -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); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdPower.java b/src/main/java/com/massivecraft/factions/cmd/CmdPower.java index e7c03fd5..5a735ebb 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdPower.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdPower.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdPowerBoost.java b/src/main/java/com/massivecraft/factions/cmd/CmdPowerBoost.java index f7949a40..53290afe 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdPowerBoost.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdPowerBoost.java @@ -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); } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdRules.java b/src/main/java/com/massivecraft/factions/cmd/CmdRules.java index 52ea1ec8..91dbfea6 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdRules.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdRules.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdSB.java b/src/main/java/com/massivecraft/factions/cmd/CmdSB.java index cfd3d79a..e0f18a3b 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdSB.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdSB.java @@ -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()); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdSetBanner.java b/src/main/java/com/massivecraft/factions/cmd/CmdSetBanner.java index a23ddd38..c73e29ac 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdSetBanner.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdSetBanner.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdSetFWarp.java b/src/main/java/com/massivecraft/factions/cmd/CmdSetFWarp.java index 5d6e1e0f..e3910af5 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdSetFWarp.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdSetFWarp.java @@ -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 diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdSethome.java b/src/main/java/com/massivecraft/factions/cmd/CmdSethome.java index 1dae2898..2483b35d 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdSethome.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdSethome.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdShow.java b/src/main/java/com/massivecraft/factions/cmd/CmdShow.java index 19781f3d..affb658e 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdShow.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdShow.java @@ -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(); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdStealth.java b/src/main/java/com/massivecraft/factions/cmd/CmdStealth.java index 8f1c5238..a1e95c28 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdStealth.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdStealth.java @@ -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); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdStuck.java b/src/main/java/com/massivecraft/factions/cmd/CmdStuck.java index b36a669f..e04aa5f1 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdStuck.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdStuck.java @@ -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!"); } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdTag.java b/src/main/java/com/massivecraft/factions/cmd/CmdTag.java index 3dcf19cd..6de99040 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdTag.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdTag.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdTitle.java b/src/main/java/com/massivecraft/factions/cmd/CmdTitle.java index 22f541eb..acd7c6a9 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdTitle.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdTitle.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdTnt.java b/src/main/java/com/massivecraft/factions/cmd/CmdTnt.java index 082ab336..54f95ad9 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdTnt.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdTnt.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdTntFill.java b/src/main/java/com/massivecraft/factions/cmd/CmdTntFill.java index 9f39ae8d..86e01d5c 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdTntFill.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdTntFill.java @@ -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(); diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdToggleAllianceChat.java b/src/main/java/com/massivecraft/factions/cmd/CmdToggleAllianceChat.java index 4752d9d2..5bea5ac8 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdToggleAllianceChat.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdToggleAllianceChat.java @@ -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); } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdTpBanner.java b/src/main/java/com/massivecraft/factions/cmd/CmdTpBanner.java index af6b29e2..bd1359a1 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdTpBanner.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdTpBanner.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdUnban.java b/src/main/java/com/massivecraft/factions/cmd/CmdUnban.java index 307c9349..5cf9a581 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdUnban.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdUnban.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdUnclaim.java b/src/main/java/com/massivecraft/factions/cmd/CmdUnclaim.java index 3de8f184..2e23ee75 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdUnclaim.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdUnclaim.java @@ -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; } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdUnclaimall.java b/src/main/java/com/massivecraft/factions/cmd/CmdUnclaimall.java index 632fa8a0..dbe0614e 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdUnclaimall.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdUnclaimall.java @@ -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; } } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdUpgrades.java b/src/main/java/com/massivecraft/factions/cmd/CmdUpgrades.java index 1016ca28..57c25067 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdUpgrades.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdUpgrades.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/CmdVault.java b/src/main/java/com/massivecraft/factions/cmd/CmdVault.java index 6faf40a4..77478f28 100644 --- a/src/main/java/com/massivecraft/factions/cmd/CmdVault.java +++ b/src/main/java/com/massivecraft/factions/cmd/CmdVault.java @@ -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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/FCommand.java b/src/main/java/com/massivecraft/factions/cmd/FCommand.java index a082f926..179a7f25 100644 --- a/src/main/java/com/massivecraft/factions/cmd/FCommand.java +++ b/src/main/java/com/massivecraft/factions/cmd/FCommand.java @@ -62,12 +62,12 @@ public abstract class FCommand extends MCommand { return false; } - if (this.isMoneyCommand && ! Conf.econEnabled) { + if (this.isMoneyCommand && !Conf.econEnabled) { msg("Faction economy features are disabled on this server."); return false; } - if (this.isMoneyCommand && ! Conf.bankEnabled) { + if (this.isMoneyCommand && !Conf.bankEnabled) { msg("The faction bank system is disabled on this server."); return false; } @@ -78,34 +78,34 @@ public abstract class FCommand extends MCommand { @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("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("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("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("Only faction admins can %s.", this.getHelpShort())); return false; } @@ -123,7 +123,7 @@ public abstract class FCommand extends MCommand { 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 { // -------------------------------------------- // 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 is not in the same faction as you.", you.describeTo(i, true))); return false; } @@ -290,7 +290,7 @@ public abstract class FCommand extends MCommand { // 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 { // 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; } diff --git a/src/main/java/com/massivecraft/factions/cmd/FPromoteCommand.java b/src/main/java/com/massivecraft/factions/cmd/FPromoteCommand.java index 88ed62f5..3a960a8d 100644 --- a/src/main/java/com/massivecraft/factions/cmd/FPromoteCommand.java +++ b/src/main/java/com/massivecraft/factions/cmd/FPromoteCommand.java @@ -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"); diff --git a/src/main/java/com/massivecraft/factions/cmd/FRelationCommand.java b/src/main/java/com/massivecraft/factions/cmd/FRelationCommand.java index 50afdc70..15450bb0 100644 --- a/src/main/java/com/massivecraft/factions/cmd/FRelationCommand.java +++ b/src/main/java/com/massivecraft/factions/cmd/FRelationCommand.java @@ -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); } diff --git a/src/main/java/com/massivecraft/factions/integration/Econ.java b/src/main/java/com/massivecraft/factions/integration/Econ.java index 07fe8509..e5ce225c 100644 --- a/src/main/java/com/massivecraft/factions/integration/Econ.java +++ b/src/main/java/com/massivecraft/factions/integration/Econ.java @@ -47,7 +47,7 @@ public class Econ { SavageFactions.plugin.log("Economy integration through Vault plugin successful."); - if (! Conf.econEnabled) { + if (!Conf.econEnabled) { SavageFactions.plugin.log("NOTE: Economy is disabled. You can enable it with the command: f config econEnabled true"); } @@ -63,7 +63,7 @@ public class Econ { } public static void modifyUniverseMoney(double delta) { - if (! shouldBeUsed()) { + if (!shouldBeUsed()) { return; } @@ -73,7 +73,7 @@ public class Econ { if (Conf.econUniverseAccount.length() == 0) { return; } - if (! econ.hasAccount(Conf.econUniverseAccount)) { + if (!econ.hasAccount(Conf.econUniverseAccount)) { return; } @@ -81,7 +81,7 @@ public class Econ { } public static void sendBalanceInfo(FPlayer to, EconomyParticipator about) { - if (! shouldBeUsed()) { + if (!shouldBeUsed()) { SavageFactions.plugin.log(Level.WARNING, "Vault does not appear to be hooked into an economy plugin."); return; } @@ -124,7 +124,7 @@ public class Econ { return true; } - // Otherwise you may not! ;,,; + // Otherwise you may not!;,,; i.msg("%s lacks permission to control %s's money.", i.describeTo(i, true), you.describeTo(i)); return false; } @@ -134,7 +134,7 @@ public class Econ { } public static boolean transferMoney(EconomyParticipator invoker, EconomyParticipator from, EconomyParticipator to, double amount, boolean notify) { - if (! shouldBeUsed()) { + if (!shouldBeUsed()) { return false; } @@ -148,7 +148,7 @@ public class Econ { } // Check the rights - if (! canIControllYou(invoker, from)) { + if (!canIControllYou(invoker, from)) { return false; } @@ -174,7 +174,7 @@ public class Econ { } // Is there enough money for the transaction to happen? - if (! econ.has(fromAcc, amount)) { + if (!econ.has(fromAcc, amount)) { // There was not enough money to pay if (invoker != null && notify) { invoker.msg("%s can't afford to transfer %s to %s.", from.describeTo(invoker, true), moneyString(amount), to.describeTo(invoker)); @@ -247,7 +247,7 @@ public class Econ { } public static boolean hasAtLeast(EconomyParticipator ep, double delta, String toDoThis) { - if (! shouldBeUsed()) { + if (!shouldBeUsed()) { return true; } @@ -270,8 +270,8 @@ public class Econ { affordable = true; } - if (! affordable) { - if (toDoThis != null && ! toDoThis.isEmpty()) { + if (!affordable) { + if (toDoThis != null && !toDoThis.isEmpty()) { ep.msg("%s can't afford %s %s.", ep.describeTo(ep, true), moneyString(delta), toDoThis); } return false; @@ -280,7 +280,7 @@ public class Econ { } public static boolean modifyMoney(EconomyParticipator ep, double delta, String toDoThis, String forDoingThis) { - if (! shouldBeUsed()) { + if (!shouldBeUsed()) { return false; } @@ -309,13 +309,13 @@ public class Econ { EconomyResponse er = econ.depositPlayer(acc, delta); if (er.transactionSuccess()) { modifyUniverseMoney(- delta); - if (forDoingThis != null && ! forDoingThis.isEmpty()) { + if (forDoingThis != null && !forDoingThis.isEmpty()) { ep.msg("%s gained %s %s.", You, moneyString(delta), forDoingThis); } return true; } else { // transfer to account failed - if (forDoingThis != null && ! forDoingThis.isEmpty()) { + if (forDoingThis != null && !forDoingThis.isEmpty()) { ep.msg("%s would have gained %s %s, but the deposit failed.", You, moneyString(delta), forDoingThis); } return false; @@ -327,13 +327,13 @@ public class Econ { if (econ.has(acc, - delta) && econ.withdrawPlayer(acc, - delta).transactionSuccess()) { // There is enough money to pay modifyUniverseMoney(- delta); - if (forDoingThis != null && ! forDoingThis.isEmpty()) { + if (forDoingThis != null && !forDoingThis.isEmpty()) { ep.msg("%s lost %s %s.", You, moneyString(- delta), forDoingThis); } return true; } else { // There was not enough money to pay - if (toDoThis != null && ! toDoThis.isEmpty()) { + if (toDoThis != null && !toDoThis.isEmpty()) { ep.msg("%s can't afford %s %s.", You, moneyString(- delta), toDoThis); } return false; @@ -347,7 +347,7 @@ public class Econ { // calculate the cost for claiming land public static double calculateClaimCost(int ownedLand, boolean takingFromAnotherFaction) { - if (! shouldBeUsed()) { + if (!shouldBeUsed()) { return 0d; } diff --git a/src/main/java/com/massivecraft/factions/integration/Essentials.java b/src/main/java/com/massivecraft/factions/integration/Essentials.java index e1abc4d0..0c9310ed 100644 --- a/src/main/java/com/massivecraft/factions/integration/Essentials.java +++ b/src/main/java/com/massivecraft/factions/integration/Essentials.java @@ -23,7 +23,7 @@ public class Essentials { // return false if feature is disabled or Essentials isn't available public static boolean handleTeleport(Player player, Location loc) { - if (! Conf.homesTeleportCommandEssentialsIntegration || essentials == null) { + if (!Conf.homesTeleportCommandEssentialsIntegration || essentials == null) { return false; } diff --git a/src/main/java/com/massivecraft/factions/integration/Worldguard.java b/src/main/java/com/massivecraft/factions/integration/Worldguard.java index 73639c95..b70623a6 100644 --- a/src/main/java/com/massivecraft/factions/integration/Worldguard.java +++ b/src/main/java/com/massivecraft/factions/integration/Worldguard.java @@ -35,7 +35,7 @@ public class Worldguard { public static void init(Plugin plugin) { Plugin wgplug = plugin.getServer().getPluginManager().getPlugin("WorldGuard"); - if (wgplug == null || ! (wgplug instanceof WorldGuardPlugin)) { + if (wgplug == null || !(wgplug instanceof WorldGuardPlugin)) { enabled = false; wg = null; SavageFactions.plugin.log("Could not hook to WorldGuard. WorldGuard checks are disabled."); @@ -55,7 +55,7 @@ public class Worldguard { // True: PVP is allowed // False: PVP is disallowed public static boolean isPVP(Player player) { - if (! enabled) { + if (!enabled) { // No WG hooks so we'll always bypass this check. return true; } @@ -74,7 +74,7 @@ public class Worldguard { // True: Player can build in the region. // False: Player can not build in the region. public static boolean playerCanBuild(Player player, Location loc) { - if (! enabled) { + if (!enabled) { // No WG hooks so we'll always bypass this check. return false; } @@ -103,7 +103,7 @@ public class Worldguard { } public static boolean checkForRegionsInChunk(Chunk chunk) { - if (! enabled) { + if (!enabled) { // No WG hooks so we'll always bypass this check. return false; } @@ -128,7 +128,7 @@ public class Worldguard { try { overlaps = region.getIntersectingRegions(allregionslist); - foundregions = overlaps != null && ! overlaps.isEmpty(); + foundregions = overlaps != null && !overlaps.isEmpty(); } catch (Exception e) { e.printStackTrace(); } diff --git a/src/main/java/com/massivecraft/factions/integration/dynmap/EngineDynmap.java b/src/main/java/com/massivecraft/factions/integration/dynmap/EngineDynmap.java index 02174449..d4bdac38 100644 --- a/src/main/java/com/massivecraft/factions/integration/dynmap/EngineDynmap.java +++ b/src/main/java/com/massivecraft/factions/integration/dynmap/EngineDynmap.java @@ -104,12 +104,12 @@ public class EngineDynmap { public void init() { Plugin dynmap = Bukkit.getServer().getPluginManager().getPlugin("dynmap"); - if (dynmap == null || ! dynmap.isEnabled()) { + if (dynmap == null || !dynmap.isEnabled()) { return; } // Should we even use dynmap? - if (! Conf.dynmapUse) { + if (!Conf.dynmapUse) { if (this.markerset != null) { this.markerset.deleteMarkerSet(); this.markerset = null; @@ -126,12 +126,12 @@ public class EngineDynmap { final Map areas = createAreas(); final Map> playerSets = createPlayersets(); - if (! updateCore()) { + if (!updateCore()) { return; } // createLayer() is thread safe but it makes use of fields set in updateCore() so we must have it after. - if (! updateLayer(createLayer())) { + if (!updateLayer(createLayer())) { return; } @@ -171,7 +171,7 @@ public class EngineDynmap { ret.label = Conf.dynmapLayerName; ret.minimumZoom = Conf.dynmapLayerMinimumZoom; ret.priority = Conf.dynmapLayerPriority; - ret.hideByDefault = ! Conf.dynmapLayerVisible; + ret.hideByDefault = !Conf.dynmapLayerVisible; return ret; } @@ -323,7 +323,7 @@ public class EngineDynmap { Map ret = new HashMap<>(); // If the faction is visible ... - if (! isVisible(faction, world)) { + if (!isVisible(faction, world)) { return ret; } @@ -407,10 +407,10 @@ public class EngineDynmap { while ((currentX != initialX) || (currentZ != initialZ) || (direction != Direction.ZMINUS)) { switch (direction) { case XPLUS: // Segment in X+ direction - if (! ourChunkFlags.getFlag(currentX + 1, currentZ)) { // Right turn? + if (!ourChunkFlags.getFlag(currentX + 1, currentZ)) { // Right turn? linelist.add(new int[]{currentX + 1, currentZ}); // Finish line direction = Direction.ZPLUS; // Change direction - } else if (! ourChunkFlags.getFlag(currentX + 1, currentZ - 1)) { // Straight? + } else if (!ourChunkFlags.getFlag(currentX + 1, currentZ - 1)) { // Straight? currentX++; } else { // Left turn linelist.add(new int[]{currentX + 1, currentZ}); // Finish line @@ -420,10 +420,10 @@ public class EngineDynmap { } break; case ZPLUS: // Segment in Z+ direction - if (! ourChunkFlags.getFlag(currentX, currentZ + 1)) { // Right turn? + if (!ourChunkFlags.getFlag(currentX, currentZ + 1)) { // Right turn? linelist.add(new int[]{currentX + 1, currentZ + 1}); // Finish line direction = Direction.XMINUS; // Change direction - } else if (! ourChunkFlags.getFlag(currentX + 1, currentZ + 1)) { // Straight? + } else if (!ourChunkFlags.getFlag(currentX + 1, currentZ + 1)) { // Straight? currentZ++; } else { // Left turn linelist.add(new int[]{currentX + 1, currentZ + 1}); // Finish line @@ -433,10 +433,10 @@ public class EngineDynmap { } break; case XMINUS: // Segment in X- direction - if (! ourChunkFlags.getFlag(currentX - 1, currentZ)) { // Right turn? + if (!ourChunkFlags.getFlag(currentX - 1, currentZ)) { // Right turn? linelist.add(new int[]{currentX, currentZ + 1}); // Finish line direction = Direction.ZMINUS; // Change direction - } else if (! ourChunkFlags.getFlag(currentX - 1, currentZ + 1)) { // Straight? + } else if (!ourChunkFlags.getFlag(currentX - 1, currentZ + 1)) { // Straight? currentX--; } else { // Left turn linelist.add(new int[]{currentX, currentZ + 1}); // Finish line @@ -446,10 +446,10 @@ public class EngineDynmap { } break; case ZMINUS: // Segment in Z- direction - if (! ourChunkFlags.getFlag(currentX, currentZ - 1)) { // Right turn? + if (!ourChunkFlags.getFlag(currentX, currentZ - 1)) { // Right turn? linelist.add(new int[]{currentX, currentZ}); // Finish line direction = Direction.XPLUS; // Change direction - } else if (! ourChunkFlags.getFlag(currentX - 1, currentZ - 1)) { // Straight? + } else if (!ourChunkFlags.getFlag(currentX - 1, currentZ - 1)) { // Straight? currentZ--; } else { // Left turn linelist.add(new int[]{currentX, currentZ}); // Finish line @@ -571,7 +571,7 @@ public class EngineDynmap { // Thread Safe / Asynchronous: Yes public Map> createPlayersets() { - if (! Conf.dynmapVisibilityByFaction) { + if (!Conf.dynmapVisibilityByFaction) { return null; } @@ -600,7 +600,7 @@ public class EngineDynmap { // Remove for (PlayerSet set : this.markerApi.getPlayerSets()) { - if (! set.getSetID().startsWith(FACTIONS_PLAYERSET_)) { + if (!set.getSetID().startsWith(FACTIONS_PLAYERSET_)) { continue; } @@ -714,11 +714,11 @@ public class EngineDynmap { Set visible = Conf.dynmapVisibleFactions; Set hidden = Conf.dynmapHiddenFactions; - if (! visible.isEmpty() && ! visible.contains(factionId) && ! visible.contains(factionName) && ! visible.contains("world:" + world)) { + if (!visible.isEmpty() && !visible.contains(factionId) && !visible.contains(factionName) && !visible.contains("world:" + world)) { return false; } - return ! hidden.contains(factionId) && ! hidden.contains(factionName) && ! hidden.contains("world:" + world); + return !hidden.contains(factionId) && !hidden.contains(factionName) && !hidden.contains("world:" + world); } // Thread Safe / Asynchronous: Yes @@ -744,7 +744,7 @@ public class EngineDynmap { ArrayDeque stack = new ArrayDeque<>(); stack.push(new int[]{x, y}); - while (! stack.isEmpty()) { + while (!stack.isEmpty()) { int[] nxt = stack.pop(); x = nxt[0]; y = nxt[1]; diff --git a/src/main/java/com/massivecraft/factions/integration/dynmap/TempAreaMarker.java b/src/main/java/com/massivecraft/factions/integration/dynmap/TempAreaMarker.java index 8179895d..1346aad8 100644 --- a/src/main/java/com/massivecraft/factions/integration/dynmap/TempAreaMarker.java +++ b/src/main/java/com/massivecraft/factions/integration/dynmap/TempAreaMarker.java @@ -82,17 +82,17 @@ public class TempAreaMarker { public void update(AreaMarker marker) { // Corner Locations - if (! equals(marker, this.x, this.z)) { + if (!equals(marker, this.x, this.z)) { marker.setCornerLocations(this.x, this.z); } // Label - if (! marker.getLabel().equals(this.label)) { + if (!marker.getLabel().equals(this.label)) { marker.setLabel(this.label); } // Description - if (! marker.getDescription().equals(this.description)) { + if (!marker.getDescription().equals(this.description)) { marker.setDescription(this.description); } diff --git a/src/main/java/com/massivecraft/factions/integration/dynmap/TempMarker.java b/src/main/java/com/massivecraft/factions/integration/dynmap/TempMarker.java index 4427c5c9..b8eefdbe 100644 --- a/src/main/java/com/massivecraft/factions/integration/dynmap/TempMarker.java +++ b/src/main/java/com/massivecraft/factions/integration/dynmap/TempMarker.java @@ -53,11 +53,11 @@ public class TempMarker { // -------------------------------------------- // public void update(MarkerAPI markerApi, Marker marker) { - if (! this.world.equals(marker.getWorld()) || this.x != marker.getX() || this.y != marker.getY() || this.z != marker.getZ()) { + if (!this.world.equals(marker.getWorld()) || this.x != marker.getX() || this.y != marker.getY() || this.z != marker.getZ()) { marker.setLocation(this.world, this.x, this.y, this.z); } - if (! marker.getLabel().equals(this.label)) { + if (!marker.getLabel().equals(this.label)) { marker.setLabel(this.label); } @@ -66,7 +66,7 @@ public class TempMarker { marker.setMarkerIcon(icon); } - if (! marker.getDescription().equals(this.description)) { + if (!marker.getDescription().equals(this.description)) { marker.setDescription(this.description); } } diff --git a/src/main/java/com/massivecraft/factions/integration/dynmap/TempMarkerSet.java b/src/main/java/com/massivecraft/factions/integration/dynmap/TempMarkerSet.java index efcd9c93..553bbde6 100644 --- a/src/main/java/com/massivecraft/factions/integration/dynmap/TempMarkerSet.java +++ b/src/main/java/com/massivecraft/factions/integration/dynmap/TempMarkerSet.java @@ -33,7 +33,7 @@ public class TempMarkerSet { public void update(MarkerSet markerset) { // Name - if (! markerset.getMarkerSetLabel().equals(this.label)) { + if (!markerset.getMarkerSetLabel().equals(this.label)) { markerset.setMarkerSetLabel(this.label); } diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java index b22877a5..ced8a6da 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java @@ -59,11 +59,11 @@ public class FactionsBlockListener implements Listener { return true; } - if (! Conf.wildernessDenyBuild || Conf.worldsNoWildernessProtection.contains(location.getWorld().getName())) { + if (!Conf.wildernessDenyBuild || Conf.worldsNoWildernessProtection.contains(location.getWorld().getName())) { return true; // This is not faction territory. Use whatever you like here. } - if (! justCheck) { + if (!justCheck) { me.msg("You can't " + action + " in the wilderness."); } @@ -73,11 +73,11 @@ public class FactionsBlockListener implements Listener { return true; } - if (! Conf.safeZoneDenyBuild || Permission.MANAGE_SAFE_ZONE.has(player)) { + if (!Conf.safeZoneDenyBuild || Permission.MANAGE_SAFE_ZONE.has(player)) { return true; } - if (! justCheck) { + if (!justCheck) { me.msg("You can't " + action + " in a safe zone."); } @@ -87,11 +87,11 @@ public class FactionsBlockListener implements Listener { return true; } - if (! Conf.warZoneDenyBuild || Permission.MANAGE_WAR_ZONE.has(player)) { + if (!Conf.warZoneDenyBuild || Permission.MANAGE_WAR_ZONE.has(player)) { return true; } - if (! justCheck) { + if (!justCheck) { me.msg("You can't " + action + " in a war zone."); } @@ -104,7 +104,7 @@ public class FactionsBlockListener implements Listener { Faction myFaction = me.getFaction(); Relation rel = myFaction.getRelationTo(otherFaction); boolean online = otherFaction.hasPlayersOnline(); - boolean pain = ! justCheck && rel.confPainBuild(online); + boolean pain = !justCheck && rel.confPainBuild(online); boolean deny = rel.confDenyBuild(online); Access access = otherFaction.getAccess(me, PermissableAction.fromString(action)); @@ -115,7 +115,7 @@ public class FactionsBlockListener implements Listener { if (pain) { player.damage(Conf.actionDeniedPainAmount); - if (! deny) { + if (!deny) { me.msg("It is painful to try to " + action + " in the territory of " + otherFaction.getTag(myFaction)); } } @@ -123,7 +123,7 @@ public class FactionsBlockListener implements Listener { // cancel building/destroying in other territory? if (deny) { - if (! justCheck) { + if (!justCheck) { me.msg("You can't " + action + " in the territory of " + otherFaction.getTag(myFaction)); } @@ -131,15 +131,15 @@ public class FactionsBlockListener implements Listener { } // Also cancel and/or cause pain if player doesn't have ownership rights for this claim - if (Conf.ownedAreasEnabled && (Conf.ownedAreaDenyBuild || Conf.ownedAreaPainBuild) && ! otherFaction.playerHasOwnershipRights(me, loc)) { - if (! pain && Conf.ownedAreaPainBuild && ! justCheck) { + if (Conf.ownedAreasEnabled && (Conf.ownedAreaDenyBuild || Conf.ownedAreaPainBuild) && !otherFaction.playerHasOwnershipRights(me, loc)) { + if (!pain && Conf.ownedAreaPainBuild && !justCheck) { player.damage(Conf.actionDeniedPainAmount); - if (! Conf.ownedAreaDenyBuild) { + if (!Conf.ownedAreaDenyBuild) { me.msg("It is painful to try to " + action + " in this territory, it is owned by: " + otherFaction.getOwnerListString(loc)); } } if (Conf.ownedAreaDenyBuild) { - if (! justCheck) { + if (!justCheck) { me.msg("You can't " + action + " in this territory, it is owned by: " + otherFaction.getOwnerListString(loc)); return false; } @@ -153,7 +153,7 @@ public class FactionsBlockListener implements Listener { if (access == Access.DENY) { me.msg(TL.GENERIC_NOPERMISSION, action); return false; - } else if (myFaction.getOwnerListString(loc) != null && ! myFaction.getOwnerListString(loc).isEmpty() && ! myFaction.getOwnerListString(loc).contains(player.getName())) { + } else if (myFaction.getOwnerListString(loc) != null && !myFaction.getOwnerListString(loc).isEmpty() && !myFaction.getOwnerListString(loc).contains(player.getName())) { me.msg("You can't " + action + " in this territory, it is owned by: " + myFaction.getOwnerListString(loc)); return false; } @@ -163,7 +163,7 @@ public class FactionsBlockListener implements Listener { @EventHandler (priority = EventPriority.NORMAL, ignoreCancelled = true) public void onBlockPlace(BlockPlaceEvent event) { - if (! event.canBuild()) { + if (!event.canBuild()) { return; } @@ -172,14 +172,14 @@ public class FactionsBlockListener implements Listener { return; } - if (! playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "build", false)) { + if (!playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "build", false)) { event.setCancelled(true); } } @EventHandler (priority = EventPriority.NORMAL, ignoreCancelled = true) public void onBlockFromTo(BlockFromToEvent event) { - if (! Conf.handleExploitLiquidFlow) { + if (!Conf.handleExploitLiquidFlow) { return; } if (event.getBlock().isLiquid()) { @@ -203,14 +203,14 @@ public class FactionsBlockListener implements Listener { @EventHandler (priority = EventPriority.NORMAL, ignoreCancelled = true) public void onBlockDamage(BlockDamageEvent event) { - if (event.getInstaBreak() && ! playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "destroy", false)) { + if (event.getInstaBreak() && !playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "destroy", false)) { event.setCancelled(true); } } @EventHandler (priority = EventPriority.NORMAL, ignoreCancelled = true) public void onBlockPistonExtend(BlockPistonExtendEvent event) { - if (! Conf.pistonProtectionThroughDenyBuild) { + if (!Conf.pistonProtectionThroughDenyBuild) { return; } @@ -220,7 +220,7 @@ public class FactionsBlockListener implements Listener { Block targetBlock = event.getBlock().getRelative(event.getDirection(), event.getLength() + 1); // if potentially pushing into air/water/lava in another territory, we need to check it out - if ((targetBlock.isEmpty() || targetBlock.isLiquid()) && ! canPistonMoveBlock(pistonFaction, targetBlock.getLocation())) { + if ((targetBlock.isEmpty() || targetBlock.isLiquid()) && !canPistonMoveBlock(pistonFaction, targetBlock.getLocation())) { event.setCancelled(true); } @@ -279,7 +279,7 @@ public class FactionsBlockListener implements Listener { @EventHandler public void onHopperPlace(BlockPlaceEvent e) { - if (e.getItemInHand().getType() != Material.HOPPER && ! SavageFactions.plugin.getConfig().getBoolean("fvault.No-Hoppers-near-vault")) { + if (e.getItemInHand().getType() != Material.HOPPER && !SavageFactions.plugin.getConfig().getBoolean("fvault.No-Hoppers-near-vault")) { return; } @@ -318,7 +318,7 @@ public class FactionsBlockListener implements Listener { @EventHandler (priority = EventPriority.NORMAL, ignoreCancelled = true) public void onBlockPistonRetract(BlockPistonRetractEvent event) { // if not a sticky piston, retraction should be fine - if (! event.isSticky() || ! Conf.pistonProtectionThroughDenyBuild) { + if (!event.isSticky() || !Conf.pistonProtectionThroughDenyBuild) { return; } @@ -338,7 +338,7 @@ public class FactionsBlockListener implements Listener { Faction pistonFaction = Board.getInstance().getFactionAt(new FLocation(event.getBlock())); - if (! canPistonMoveBlock(pistonFaction, targetLoc)) { + if (!canPistonMoveBlock(pistonFaction, targetLoc)) { event.setCancelled(true); } } @@ -462,12 +462,12 @@ public class FactionsBlockListener implements Listener { // only notify every 10 seconds FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player); boolean justCheck = fPlayer.getLastFrostwalkerMessage() + 10000 > System.currentTimeMillis(); - if (! justCheck) { + if (!justCheck) { fPlayer.setLastFrostwalkerMessage(); } // Check if they have build permissions here. If not, block this from happening. - if (! playerCanBuildDestroyBlock(player, location, "frostwalk", justCheck)) { + if (!playerCanBuildDestroyBlock(player, location, "frostwalk", justCheck)) { event.setCancelled(true); } } @@ -481,33 +481,33 @@ public class FactionsBlockListener implements Listener { } if (otherFaction.isWilderness()) { - return ! Conf.wildernessDenyBuild || Conf.worldsNoWildernessProtection.contains(target.getWorld().getName()); + return !Conf.wildernessDenyBuild || Conf.worldsNoWildernessProtection.contains(target.getWorld().getName()); } else if (otherFaction.isSafeZone()) { - return ! Conf.safeZoneDenyBuild; + return !Conf.safeZoneDenyBuild; } else if (otherFaction.isWarZone()) { - return ! Conf.warZoneDenyBuild; + return !Conf.warZoneDenyBuild; } Relation rel = pistonFaction.getRelationTo(otherFaction); - return ! rel.confDenyBuild(otherFaction.hasPlayersOnline()); + return !rel.confDenyBuild(otherFaction.hasPlayersOnline()); } @EventHandler (priority = EventPriority.NORMAL, ignoreCancelled = true) public void onBlockBreak(BlockBreakEvent event) { - if (! playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "destroy", false)) { + if (!playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "destroy", false)) { event.setCancelled(true); return; } FPlayer fme = FPlayers.getInstance().getByPlayer(event.getPlayer()); - if (! fme.hasFaction()) { + if (!fme.hasFaction()) { return; } if (event.getBlock().getType() == SavageFactions.plugin.MOB_SPANWER) { - if (! fme.isAdminBypassing()) { + if (!fme.isAdminBypassing()) { Access access = fme.getFaction().getAccess(fme, PermissableAction.SPAWNER); if (access != Access.ALLOW && fme.getRole() != Role.LEADER) { fme.msg(TL.GENERIC_FPERM_NOPERMISSION, "mine spawners"); diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsChatListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsChatListener.java index c49ca256..d9150a44 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsChatListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsChatListener.java @@ -100,7 +100,7 @@ public class FactionsChatListener implements Listener { //Send to all our allies for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) { - if (myFaction.getRelationTo(fplayer) == Relation.ALLY && ! fplayer.isIgnoreAllianceChat()) { + if (myFaction.getRelationTo(fplayer) == Relation.ALLY && !fplayer.isIgnoreAllianceChat()) { fplayer.sendMessage(message); } else if (fplayer.isSpyingChat() && me != fplayer) { fplayer.sendMessage("[ACspy]: " + message); @@ -138,7 +138,7 @@ public class FactionsChatListener implements Listener { public void onPlayerChat(AsyncPlayerChatEvent event) { // Are we to insert the Faction tag into the format? // If we are not to insert it - we are done. - if (! Conf.chatTagEnabled || Conf.chatTagHandledByAnotherPlugin) { + if (!Conf.chatTagEnabled || Conf.chatTagHandledByAnotherPlugin) { return; } @@ -148,7 +148,7 @@ public class FactionsChatListener implements Listener { FPlayer me = FPlayers.getInstance().getByPlayer(talkingPlayer); int InsertIndex; - if (! Conf.chatTagReplaceString.isEmpty() && eventFormat.contains(Conf.chatTagReplaceString)) { + if (!Conf.chatTagReplaceString.isEmpty() && eventFormat.contains(Conf.chatTagReplaceString)) { // we're using the "replace" method of inserting the faction tags if (eventFormat.contains("[FACTION_TITLE]")) { eventFormat = eventFormat.replace("[FACTION_TITLE]", me.getTitle()); @@ -158,10 +158,10 @@ public class FactionsChatListener implements Listener { eventFormat = eventFormat.replace(Conf.chatTagReplaceString, ""); Conf.chatTagPadAfter = false; Conf.chatTagPadBefore = false; - } else if (! Conf.chatTagInsertAfterString.isEmpty() && eventFormat.contains(Conf.chatTagInsertAfterString)) { + } else if (!Conf.chatTagInsertAfterString.isEmpty() && eventFormat.contains(Conf.chatTagInsertAfterString)) { // we're using the "insert after string" method InsertIndex = eventFormat.indexOf(Conf.chatTagInsertAfterString) + Conf.chatTagInsertAfterString.length(); - } else if (! Conf.chatTagInsertBeforeString.isEmpty() && eventFormat.contains(Conf.chatTagInsertBeforeString)) { + } else if (!Conf.chatTagInsertBeforeString.isEmpty() && eventFormat.contains(Conf.chatTagInsertBeforeString)) { // we're using the "insert before string" method InsertIndex = eventFormat.indexOf(Conf.chatTagInsertBeforeString); } else { @@ -172,8 +172,8 @@ public class FactionsChatListener implements Listener { } } - String formatStart = eventFormat.substring(0, InsertIndex) + ((Conf.chatTagPadBefore && ! me.getChatTag().isEmpty()) ? " " : ""); - String formatEnd = ((Conf.chatTagPadAfter && ! me.getChatTag().isEmpty()) ? " " : "") + eventFormat.substring(InsertIndex); + String formatStart = eventFormat.substring(0, InsertIndex) + ((Conf.chatTagPadBefore && !me.getChatTag().isEmpty()) ? " " : ""); + String formatEnd = ((Conf.chatTagPadAfter && !me.getChatTag().isEmpty()) ? " " : "") + eventFormat.substring(InsertIndex); String nonColoredMsgFormat = formatStart + me.getChatTag().trim() + formatEnd; diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java index 12705009..a3ab5daf 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsEntityListener.java @@ -41,7 +41,7 @@ public class FactionsEntityListener implements Listener { @EventHandler (priority = EventPriority.NORMAL) public void onEntityDeath(EntityDeathEvent event) { Entity entity = event.getEntity(); - if (! (entity instanceof Player)) { + if (!(entity instanceof Player)) { return; } @@ -53,14 +53,14 @@ public class FactionsEntityListener implements Listener { // Check for no power loss conditions if (faction.isWarZone()) { // war zones always override worldsNoPowerLoss either way, thus this layout - if (! Conf.warZonePowerLoss) { + if (!Conf.warZonePowerLoss) { powerLossEvent.setMessage(TL.PLAYER_POWER_NOLOSS_WARZONE.toString()); powerLossEvent.setCancelled(true); } if (Conf.worldsNoPowerLoss.contains(player.getWorld().getName())) { powerLossEvent.setMessage(TL.PLAYER_POWER_LOSS_WARZONE.toString()); } - } else if (faction.isWilderness() && ! Conf.wildernessPowerLoss && ! Conf.worldsNoWildernessProtection.contains(player.getWorld().getName())) { + } else if (faction.isWilderness() && !Conf.wildernessPowerLoss && !Conf.worldsNoWildernessProtection.contains(player.getWorld().getName())) { powerLossEvent.setMessage(TL.PLAYER_POWER_NOLOSS_WILDERNESS.toString()); powerLossEvent.setCancelled(true); } else if (Conf.worldsNoPowerLoss.contains(player.getWorld().getName())) { @@ -77,12 +77,12 @@ public class FactionsEntityListener implements Listener { Bukkit.getPluginManager().callEvent(powerLossEvent); // Call player onDeath if the event is not cancelled - if (! powerLossEvent.isCancelled()) { + if (!powerLossEvent.isCancelled()) { fplayer.onDeath(); } // Send the message from the powerLossEvent final String msg = powerLossEvent.getMessage(); - if (msg != null && ! msg.isEmpty()) { + if (msg != null && !msg.isEmpty()) { fplayer.msg(msg, fplayer.getPowerRounded(), fplayer.getPowerMaxRounded()); } } @@ -95,7 +95,7 @@ public class FactionsEntityListener implements Listener { public void onEntityDamage(EntityDamageEvent event) { if (event instanceof EntityDamageByEntityEvent) { EntityDamageByEntityEvent sub = (EntityDamageByEntityEvent) event; - if (! this.canDamagerHurtDamagee(sub, true)) { + if (!this.canDamagerHurtDamagee(sub, true)) { event.setCancelled(true); } // event is not cancelled by factions @@ -152,13 +152,13 @@ public class FactionsEntityListener implements Listener { entityAction = "armor stands"; } - if (! FactionsBlockListener.playerCanBuildDestroyBlock((Player) damager, damagee.getLocation(), "destroy " + entityAction, false)) { + if (!FactionsBlockListener.playerCanBuildDestroyBlock((Player) damager, damagee.getLocation(), "destroy " + entityAction, false)) { event.setCancelled(true); } } else { // we don't want to let mobs/arrows destroy item frames/armor stands // so we only have to run the check as if there had been an explosion at the damager location - if (! this.checkExplosionForBlock(damager, damagee.getLocation().getBlock())) { + if (!this.checkExplosionForBlock(damager, damagee.getLocation().getBlock())) { event.setCancelled(true); } } @@ -198,7 +198,7 @@ public class FactionsEntityListener implements Listener { } else if (event.getCause() == EntityDamageEvent.DamageCause.FALL && event.getEntity() instanceof Player) { Player player = (Player) event.getEntity(); FPlayer fPlayer = FPlayers.getInstance().getByPlayer(player); - if (fPlayer != null && ! fPlayer.shouldTakeFallDamage()) { + if (fPlayer != null && !fPlayer.shouldTakeFallDamage()) { event.setCancelled(true); // Falling after /f fly } } @@ -243,7 +243,7 @@ public class FactionsEntityListener implements Listener { Entity boomer = event.getEntity(); // Before we need to check the location where the block is placed - if (! this.checkExplosionForBlock(boomer, event.getLocation().getBlock())) { + if (!this.checkExplosionForBlock(boomer, event.getLocation().getBlock())) { event.setCancelled(true); return; } @@ -254,7 +254,7 @@ public class FactionsEntityListener implements Listener { while (blockList.hasNext()) { Block block = blockList.next(); - if (! this.checkExplosionForBlock(boomer, block)) { + if (!this.checkExplosionForBlock(boomer, block)) { // The block don't have to explode blockList.remove(); } @@ -301,7 +301,7 @@ public class FactionsEntityListener implements Listener { boolean online = faction.hasPlayersOnline(); - if (boomer instanceof Creeper && ((faction.isWilderness() && Conf.wildernessBlockCreepers && ! Conf.worldsNoWildernessProtection.contains(block.getWorld().getName())) || + if (boomer instanceof Creeper && ((faction.isWilderness() && Conf.wildernessBlockCreepers && !Conf.worldsNoWildernessProtection.contains(block.getWorld().getName())) || (faction.isNormal() && (online ? Conf.territoryBlockCreepers : Conf.territoryBlockCreepersWhenOffline)) || (faction.isWarZone() && Conf.warZoneBlockCreepers) || faction.isSafeZone())) { @@ -309,17 +309,17 @@ public class FactionsEntityListener implements Listener { return false; } else if ( // it's a bit crude just using fireball protection for Wither boss too, but I'd rather not add in a whole new set of xxxBlockWitherExplosion or whatever - (boomer instanceof Fireball || boomer instanceof WitherSkull || boomer instanceof Wither) && ((faction.isWilderness() && Conf.wildernessBlockFireballs && ! Conf.worldsNoWildernessProtection.contains(block.getWorld().getName())) || + (boomer instanceof Fireball || boomer instanceof WitherSkull || boomer instanceof Wither) && ((faction.isWilderness() && Conf.wildernessBlockFireballs && !Conf.worldsNoWildernessProtection.contains(block.getWorld().getName())) || (faction.isNormal() && (online ? Conf.territoryBlockFireballs : Conf.territoryBlockFireballsWhenOffline)) || (faction.isWarZone() && Conf.warZoneBlockFireballs) || faction.isSafeZone())) { // ghast fireball which needs prevention return false; } else - return (! (boomer instanceof TNTPrimed) && ! (boomer instanceof ExplosiveMinecart)) || ((! faction.isWilderness() || ! Conf.wildernessBlockTNT || Conf.worldsNoWildernessProtection.contains(block.getWorld().getName())) && - (! faction.isNormal() || (online ? ! Conf.territoryBlockTNT : ! Conf.territoryBlockTNTWhenOffline)) && - (! faction.isWarZone() || ! Conf.warZoneBlockTNT) && - (! faction.isSafeZone() || ! Conf.safeZoneBlockTNT)); + return (!(boomer instanceof TNTPrimed) && !(boomer instanceof ExplosiveMinecart)) || ((!faction.isWilderness() || !Conf.wildernessBlockTNT || Conf.worldsNoWildernessProtection.contains(block.getWorld().getName())) && + (!faction.isNormal() || (online ? !Conf.territoryBlockTNT : !Conf.territoryBlockTNTWhenOffline)) && + (!faction.isWarZone() || !Conf.warZoneBlockTNT) && + (!faction.isSafeZone() || !Conf.safeZoneBlockTNT)); // No condition retained, destroy the block! } @@ -328,7 +328,7 @@ public class FactionsEntityListener implements Listener { @EventHandler (priority = EventPriority.NORMAL, ignoreCancelled = true) public void onEntityCombustByEntity(EntityCombustByEntityEvent event) { EntityDamageByEntityEvent sub = new EntityDamageByEntityEvent(event.getCombuster(), event.getEntity(), EntityDamageEvent.DamageCause.FIRE, 0d); - if (! this.canDamagerHurtDamagee(sub, false)) { + if (!this.canDamagerHurtDamagee(sub, false)) { event.setCancelled(true); } } @@ -343,12 +343,12 @@ public class FactionsEntityListener implements Listener { break; } } - if (! badjuju) { + if (!badjuju) { return; } ProjectileSource thrower = event.getPotion().getShooter(); - if (! (thrower instanceof Entity)) { + if (!(thrower instanceof Entity)) { return; } @@ -364,14 +364,14 @@ public class FactionsEntityListener implements Listener { // scan through affected entities to make sure they're all valid targets for (LivingEntity target : event.getAffectedEntities()) { EntityDamageByEntityEvent sub = new EntityDamageByEntityEvent((Entity) thrower, target, EntityDamageEvent.DamageCause.CUSTOM, 0); - if (! this.canDamagerHurtDamagee(sub, true)) { + if (!this.canDamagerHurtDamagee(sub, true)) { event.setIntensity(target, 0.0); // affected entity list doesn't accept modification (so no iter.remove()), but this works } } } public boolean isPlayerInSafeZone(Entity damagee) { - if (! (damagee instanceof Player)) { + if (!(damagee instanceof Player)) { return false; } return Board.getInstance().getFactionAt(new FLocation(damagee.getLocation())).isSafeZone(); @@ -385,7 +385,7 @@ public class FactionsEntityListener implements Listener { Entity damager = sub.getDamager(); Entity damagee = sub.getEntity(); - if (! (damagee instanceof Player)) { + if (!(damagee instanceof Player)) { return true; } @@ -402,7 +402,7 @@ public class FactionsEntityListener implements Listener { if (damager instanceof Projectile) { Projectile projectile = (Projectile) damager; - if (! (projectile.getShooter() instanceof Entity)) { + if (!(projectile.getShooter() instanceof Entity)) { return true; } @@ -423,10 +423,10 @@ public class FactionsEntityListener implements Listener { } return false; } - return ! defLocFaction.noMonstersInTerritory(); + return !defLocFaction.noMonstersInTerritory(); } - if (! (damager instanceof Player)) { + if (!(damager instanceof Player)) { return true; } @@ -508,7 +508,7 @@ public class FactionsEntityListener implements Listener { } // Players without faction may be hurt anywhere - if (! defender.hasFaction()) { + if (!defender.hasFaction()) { return true; } @@ -567,7 +567,7 @@ public class FactionsEntityListener implements Listener { } // We are interested in blocking targeting for certain mobs: - if (! Conf.safeZoneNerfedCreatureTypes.contains(MiscUtil.creatureTypeFromEntity(event.getEntity()))) { + if (!Conf.safeZoneNerfedCreatureTypes.contains(MiscUtil.creatureTypeFromEntity(event.getEntity()))) { return; } @@ -590,7 +590,7 @@ public class FactionsEntityListener implements Listener { boolean online = faction.hasPlayersOnline(); - if ((faction.isWilderness() && ! Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName()) && (Conf.wildernessBlockCreepers || Conf.wildernessBlockFireballs || Conf.wildernessBlockTNT)) || + if ((faction.isWilderness() && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName()) && (Conf.wildernessBlockCreepers || Conf.wildernessBlockFireballs || Conf.wildernessBlockTNT)) || (faction.isNormal() && (online ? (Conf.territoryBlockCreepers || Conf.territoryBlockFireballs || Conf.territoryBlockTNT) : (Conf.territoryBlockCreepersWhenOffline || Conf.territoryBlockFireballsWhenOffline || Conf.territoryBlockTNTWhenOffline))) || (faction.isWarZone() && (Conf.warZoneBlockCreepers || Conf.warZoneBlockFireballs || Conf.warZoneBlockTNT)) || faction.isSafeZone()) { @@ -599,23 +599,23 @@ public class FactionsEntityListener implements Listener { } } - if (! (event instanceof HangingBreakByEntityEvent)) { + if (!(event instanceof HangingBreakByEntityEvent)) { return; } Entity breaker = ((HangingBreakByEntityEvent) event).getRemover(); - if (! (breaker instanceof Player)) { + if (!(breaker instanceof Player)) { return; } - if (! FactionsBlockListener.playerCanBuildDestroyBlock((Player) breaker, event.getEntity().getLocation(), "remove paintings", false)) { + if (!FactionsBlockListener.playerCanBuildDestroyBlock((Player) breaker, event.getEntity().getLocation(), "remove paintings", false)) { event.setCancelled(true); } } @EventHandler (priority = EventPriority.NORMAL, ignoreCancelled = true) public void onPaintingPlace(HangingPlaceEvent event) { - if (! FactionsBlockListener.playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "place paintings", false)) { + if (!FactionsBlockListener.playerCanBuildDestroyBlock(event.getPlayer(), event.getBlock().getLocation(), "place paintings", false)) { event.setCancelled(true); // Fix: update player's inventory to avoid items glitches event.getPlayer().updateInventory(); @@ -627,7 +627,7 @@ public class FactionsEntityListener implements Listener { Entity entity = event.getEntity(); // for now, only interested in Enderman and Wither boss tomfoolery - if (! (entity instanceof Enderman) && ! (entity instanceof Wither)) { + if (!(entity instanceof Enderman) && !(entity instanceof Wither)) { return; } @@ -640,7 +640,7 @@ public class FactionsEntityListener implements Listener { } else if (entity instanceof Wither) { Faction faction = Board.getInstance().getFactionAt(new FLocation(loc)); // it's a bit crude just using fireball protection, but I'd rather not add in a whole new set of xxxBlockWitherExplosion or whatever - if ((faction.isWilderness() && Conf.wildernessBlockFireballs && ! Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) || + if ((faction.isWilderness() && Conf.wildernessBlockFireballs && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName())) || (faction.isNormal() && (faction.hasPlayersOnline() ? Conf.territoryBlockFireballs : Conf.territoryBlockFireballsWhenOffline)) || (faction.isWarZone() && Conf.warZoneBlockFireballs) || faction.isSafeZone()) { @@ -651,7 +651,7 @@ public class FactionsEntityListener implements Listener { @EventHandler public void onTravel(PlayerPortalEvent event) { - if (! SavageFactions.plugin.getConfig().getBoolean("portals.limit", false)) { + if (!SavageFactions.plugin.getConfig().getBoolean("portals.limit", false)) { return; // Don't do anything if they don't want us to. } @@ -663,7 +663,7 @@ public class FactionsEntityListener implements Listener { Faction faction = Board.getInstance().getFactionAt(loc); if (faction.isWilderness()) { return; // We don't care about wilderness. - } else if (! faction.isNormal() && ! event.getPlayer().isOp()) { + } else if (!faction.isNormal() && !event.getPlayer().isOp()) { // Don't let non ops make portals in safezone or warzone. event.setCancelled(true); return; @@ -671,7 +671,7 @@ public class FactionsEntityListener implements Listener { FPlayer fp = FPlayers.getInstance().getByPlayer(event.getPlayer()); String mininumRelation = SavageFactions.plugin.getConfig().getString("portals.minimum-relation", "MEMBER"); // Defaults to Neutral if typed wrong. - if (! fp.getFaction().getRelationTo(faction).isAtLeast(Relation.fromString(mininumRelation))) { + if (!fp.getFaction().getRelationTo(faction).isAtLeast(Relation.fromString(mininumRelation))) { event.setCancelled(true); } } @@ -728,7 +728,7 @@ public class FactionsEntityListener implements Listener { Player player = event.getPlayer(); Entity entity = event.getRightClicked(); - if (! FactionsBlockListener.playerCanBuildDestroyBlock(player, entity.getLocation(), "use item frames", false)) { + if (!FactionsBlockListener.playerCanBuildDestroyBlock(player, entity.getLocation(), "use item frames", false)) { event.setCancelled(true); } } @@ -743,7 +743,7 @@ public class FactionsEntityListener implements Listener { return; } - if (! FactionsBlockListener.playerCanBuildDestroyBlock(event.getPlayer(), entity.getLocation(), "use armor stands", false)) { + if (!FactionsBlockListener.playerCanBuildDestroyBlock(event.getPlayer(), entity.getLocation(), "use armor stands", false)) { event.setCancelled(true); } } diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsExploitListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsExploitListener.java index b2703e4c..5173bce9 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsExploitListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsExploitListener.java @@ -20,7 +20,7 @@ public class FactionsExploitListener implements Listener { @EventHandler (priority = EventPriority.NORMAL, ignoreCancelled = true) public void obsidianGenerator(BlockFromToEvent event) { - if (! Conf.handleExploitObsidianGenerators) { + if (!Conf.handleExploitObsidianGenerators) { return; } @@ -35,7 +35,7 @@ public class FactionsExploitListener implements Listener { @EventHandler (priority = EventPriority.NORMAL, ignoreCancelled = true) public void enderPearlTeleport(PlayerTeleportEvent event) { - if (! Conf.handleExploitEnderPearlClipping) { + if (!Conf.handleExploitEnderPearlClipping) { return; } if (event.getCause() != PlayerTeleportEvent.TeleportCause.ENDER_PEARL) { diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java index d4f7e4fc..3137b33d 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -85,8 +85,8 @@ public class FactionsPlayerListener implements Listener { Relation rel = myFaction.getRelationTo(otherFaction); // Also cancel if player doesn't have ownership rights for this claim - if (Conf.ownedAreasEnabled && myFaction == otherFaction && ! myFaction.playerHasOwnershipRights(me, loc)) { - if (! justCheck) { + if (Conf.ownedAreasEnabled && myFaction == otherFaction && !myFaction.playerHasOwnershipRights(me, loc)) { + if (!justCheck) { me.msg("You can't use that in this territory, it is owned by: " + otherFaction.getOwnerListString(loc)); } return false; @@ -96,41 +96,41 @@ public class FactionsPlayerListener implements Listener { } if (otherFaction.hasPlayersOnline()) { - if (! Conf.territoryDenyUseageMaterials.contains(material)) { + if (!Conf.territoryDenyUseageMaterials.contains(material)) { return true; // Item isn't one we're preventing for online factions. } } else { - if (! Conf.territoryDenyUseageMaterialsWhenOffline.contains(material)) { + if (!Conf.territoryDenyUseageMaterialsWhenOffline.contains(material)) { return true; // Item isn't one we're preventing for offline factions. } } if (otherFaction.isWilderness()) { - if (! Conf.wildernessDenyUseage || Conf.worldsNoWildernessProtection.contains(location.getWorld().getName())) { + if (!Conf.wildernessDenyUseage || Conf.worldsNoWildernessProtection.contains(location.getWorld().getName())) { return true; // This is not faction territory. Use whatever you like here. } - if (! justCheck) { + if (!justCheck) { me.msg(TL.PLAYER_USE_WILDERNESS, TextUtil.getMaterialName(material)); } return false; } else if (otherFaction.isSafeZone()) { - if (! Conf.safeZoneDenyUseage || Permission.MANAGE_SAFE_ZONE.has(player)) { + if (!Conf.safeZoneDenyUseage || Permission.MANAGE_SAFE_ZONE.has(player)) { return true; } - if (! justCheck) { + if (!justCheck) { me.msg(TL.PLAYER_USE_SAFEZONE, TextUtil.getMaterialName(material)); } return false; } else if (otherFaction.isWarZone()) { - if (! Conf.warZoneDenyUseage || Permission.MANAGE_WAR_ZONE.has(player)) { + if (!Conf.warZoneDenyUseage || Permission.MANAGE_WAR_ZONE.has(player)) { return true; } - if (! justCheck) { + if (!justCheck) { me.msg(TL.PLAYER_USE_WARZONE, TextUtil.getMaterialName(material)); } @@ -139,7 +139,7 @@ public class FactionsPlayerListener implements Listener { // Cancel if we are not in our own territory if (rel.confDenyUseage()) { - if (! justCheck) { + if (!justCheck) { me.msg(TL.PLAYER_USE_TERRITORY, TextUtil.getMaterialName(material), otherFaction.getTag(myFaction)); } @@ -149,9 +149,9 @@ public class FactionsPlayerListener implements Listener { Access access = otherFaction.getAccess(me, PermissableAction.ITEM); if (access != null && access != Access.UNDEFINED) { // TODO: Update this once new access values are added other than just allow / deny. - if ((myFaction.getOwnerListString(loc) != null && ! myFaction.getOwnerListString(loc).isEmpty() && myFaction.getOwnerListString(loc).contains(player.getName()))) { + if ((myFaction.getOwnerListString(loc) != null && !myFaction.getOwnerListString(loc).isEmpty() && myFaction.getOwnerListString(loc).contains(player.getName()))) { return true; - } else if (myFaction.getOwnerListString(loc) != null && ! myFaction.getOwnerListString(loc).isEmpty() && ! myFaction.getOwnerListString(loc).contains(player.getName())) { + } else if (myFaction.getOwnerListString(loc) != null && !myFaction.getOwnerListString(loc).isEmpty() && !myFaction.getOwnerListString(loc).contains(player.getName())) { me.msg("You can't use items in this territory, it is owned by: " + myFaction.getOwnerListString(loc)); return false; } else if (access == Access.DENY) { @@ -182,7 +182,7 @@ public class FactionsPlayerListener implements Listener { // no door/chest/whatever protection in wilderness, war zones, or safe zones - if (! otherFaction.isNormal()) { + if (!otherFaction.isNormal()) { return true; } @@ -190,7 +190,7 @@ public class FactionsPlayerListener implements Listener { return true; } - if (! rel.isMember() || ! otherFaction.playerHasOwnershipRights(me, loc) && player.getItemInHand().getType() != null) { + if (!rel.isMember() || !otherFaction.playerHasOwnershipRights(me, loc) && player.getItemInHand().getType() != null) { if (player.getItemInHand().getType().toString().toUpperCase().contains("DOOR")) { return false; @@ -284,11 +284,11 @@ public class FactionsPlayerListener implements Listener { // We only care about some material types. if (otherFaction.hasPlayersOnline()) { - if (! Conf.territoryProtectedMaterials.contains(material)) { + if (!Conf.territoryProtectedMaterials.contains(material)) { return true; } } else { - if (! Conf.territoryProtectedMaterialsWhenOffline.contains(material)) { + if (!Conf.territoryProtectedMaterialsWhenOffline.contains(material)) { return true; } } @@ -309,7 +309,7 @@ public class FactionsPlayerListener implements Listener { if (doTerritoryEnemyProtectedCheck) { // You may use any block unless it is another faction's territory... if (rel.isNeutral() || (rel.isEnemy() && Conf.territoryEnemyProtectMaterials) || (rel.isAlly() && Conf.territoryAllyProtectMaterials) || (rel.isTruce() && Conf.territoryTruceProtectMaterials)) { - if (! justCheck) { + if (!justCheck) { me.msg(TL.PLAYER_USE_TERRITORY, (material == SavageFactions.plugin.SOIL ? "trample " : "use ") + TextUtil.getMaterialName(material), otherFaction.getTag(myFaction)); } return false; @@ -319,9 +319,9 @@ public class FactionsPlayerListener implements Listener { if (access != Access.ALLOW && me.getRole() != Role.LEADER) { // TODO: Update this once new access values are added other than just allow / deny. - if ((myFaction.getOwnerListString(loc) != null && ! myFaction.getOwnerListString(loc).isEmpty() && myFaction.getOwnerListString(loc).contains(player.getName()))) { + if ((myFaction.getOwnerListString(loc) != null && !myFaction.getOwnerListString(loc).isEmpty() && myFaction.getOwnerListString(loc).contains(player.getName()))) { return true; - } else if (myFaction.getOwnerListString(loc) != null && ! myFaction.getOwnerListString(loc).isEmpty() && ! myFaction.getOwnerListString(loc).contains(player.getName())) { + } else if (myFaction.getOwnerListString(loc) != null && !myFaction.getOwnerListString(loc).isEmpty() && !myFaction.getOwnerListString(loc).contains(player.getName())) { me.msg("You can't " + action + " in this territory, it is owned by: " + myFaction.getOwnerListString(loc)); return false; } else if (access == Access.DENY) { @@ -350,8 +350,8 @@ public class FactionsPlayerListener implements Listener { } if (me.hasFaction() && - ! me.isAdminBypassing() && - ! Conf.permanentFactionMemberDenyCommands.isEmpty() && + !me.isAdminBypassing() && + !Conf.permanentFactionMemberDenyCommands.isEmpty() && me.getFaction().isPermanent() && isCommandInList(fullCmd, shortCmd, Conf.permanentFactionMemberDenyCommands.iterator())) { me.msg(TL.PLAYER_COMMAND_PERMANENT, fullCmd); @@ -359,28 +359,28 @@ public class FactionsPlayerListener implements Listener { } Faction at = Board.getInstance().getFactionAt(new FLocation(player.getLocation())); - if (at.isWilderness() && ! Conf.wildernessDenyCommands.isEmpty() && ! me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.wildernessDenyCommands.iterator())) { + if (at.isWilderness() && !Conf.wildernessDenyCommands.isEmpty() && !me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.wildernessDenyCommands.iterator())) { me.msg(TL.PLAYER_COMMAND_WILDERNESS, fullCmd); return true; } Relation rel = at.getRelationTo(me); - if (at.isNormal() && rel.isAlly() && ! Conf.territoryAllyDenyCommands.isEmpty() && ! me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.territoryAllyDenyCommands.iterator())) { + if (at.isNormal() && rel.isAlly() && !Conf.territoryAllyDenyCommands.isEmpty() && !me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.territoryAllyDenyCommands.iterator())) { me.msg(TL.PLAYER_COMMAND_ALLY, fullCmd); return false; } - if (at.isNormal() && rel.isNeutral() && ! Conf.territoryNeutralDenyCommands.isEmpty() && ! me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.territoryNeutralDenyCommands.iterator())) { + if (at.isNormal() && rel.isNeutral() && !Conf.territoryNeutralDenyCommands.isEmpty() && !me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.territoryNeutralDenyCommands.iterator())) { me.msg(TL.PLAYER_COMMAND_NEUTRAL, fullCmd); return true; } - if (at.isNormal() && rel.isEnemy() && ! Conf.territoryEnemyDenyCommands.isEmpty() && ! me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.territoryEnemyDenyCommands.iterator())) { + if (at.isNormal() && rel.isEnemy() && !Conf.territoryEnemyDenyCommands.isEmpty() && !me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.territoryEnemyDenyCommands.iterator())) { me.msg(TL.PLAYER_COMMAND_ENEMY, fullCmd); return true; } - if (at.isWarZone() && ! Conf.warzoneDenyCommands.isEmpty() && ! me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.warzoneDenyCommands.iterator())) { + if (at.isWarZone() && !Conf.warzoneDenyCommands.isEmpty() && !me.isAdminBypassing() && isCommandInList(fullCmd, shortCmd, Conf.warzoneDenyCommands.iterator())) { me.msg(TL.PLAYER_COMMAND_WARZONE, fullCmd); return true; } @@ -440,7 +440,7 @@ public class FactionsPlayerListener implements Listener { } Faction myFaction = me.getFaction(); - if (! myFaction.isWilderness()) { + if (!myFaction.isWilderness()) { for (FPlayer other : myFaction.getFPlayersWhereOnline(true)) { if (other != me && other.isMonitoringJoins()) { other.msg(TL.FACTION_LOGIN, me.getName()); @@ -459,19 +459,19 @@ public class FactionsPlayerListener implements Listener { }, 180L); - if (me.isSpyingChat() && ! player.hasPermission(Permission.CHATSPY.node)) { + if (me.isSpyingChat() && !player.hasPermission(Permission.CHATSPY.node)) { me.setSpyingChat(false); SavageFactions.plugin.log(Level.INFO, "Found %s spying chat without permission on login. Disabled their chat spying.", player.getName()); } - if (me.isAdminBypassing() && ! player.hasPermission(Permission.BYPASS.node)) { + if (me.isAdminBypassing() && !player.hasPermission(Permission.BYPASS.node)) { me.setIsAdminBypassing(false); SavageFactions.plugin.log(Level.INFO, "Found %s on admin Bypass without permission on login. Disabled it for them.", player.getName()); } // If they have the permission, don't let them autoleave. Bad inverted setter :\ - me.setAutoLeave(! player.hasPermission(Permission.AUTO_LEAVE_BYPASS.node)); + me.setAutoLeave(!player.hasPermission(Permission.AUTO_LEAVE_BYPASS.node)); me.setTakeFallDamage(true); } @@ -507,11 +507,11 @@ public class FactionsPlayerListener implements Listener { } Faction myFaction = me.getFaction(); - if (! myFaction.isWilderness()) { + if (!myFaction.isWilderness()) { myFaction.memberLoggedOff(); } - if (! myFaction.isWilderness()) { + if (!myFaction.isWilderness()) { for (FPlayer player : myFaction.getFPlayersWhereOnline(true)) { if (player != me && player.isMonitoringJoins()) { player.msg(TL.FACTION_LOGOUT, me.getName()); @@ -558,12 +558,12 @@ public class FactionsPlayerListener implements Listener { public void onInspect(PlayerInteractEvent e) { if (e.getAction().name().contains("BLOCK")) { FPlayer fplayer = FPlayers.getInstance().getByPlayer(e.getPlayer()); - if (! fplayer.isInspectMode()) { + if (!fplayer.isInspectMode()) { return; } e.setCancelled(true); - if (! fplayer.isAdminBypassing()) { - if (! fplayer.hasFaction()) { + if (!fplayer.isAdminBypassing()) { + if (!fplayer.hasFaction()) { fplayer.setInspectMode(false); fplayer.msg(TL.COMMAND_INSPECT_DISABLED_NOFAC); return; @@ -664,8 +664,8 @@ public class FactionsPlayerListener implements Listener { title = parseAllPlaceholders(title, factionTo, player); String subTitle = SavageFactions.plugin.getConfig().getString("Title.Format.Subtitle").replace("{Description}", factionTo.getDescription()).replace("{Faction}", factionTo.getColorTo(me) + factionTo.getTag()); subTitle = parseAllPlaceholders(subTitle, factionTo, player); - if (! SavageFactions.plugin.mc17) { - if (! SavageFactions.plugin.mc18) { + if (!SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc18) { me.getPlayer().sendTitle(SavageFactions.plugin.color(title), SavageFactions.plugin.color(subTitle), SavageFactions.plugin.getConfig().getInt("Title.Options.FadeInTime"), SavageFactions.plugin.getConfig().getInt("Title.Options.ShowTime"), SavageFactions.plugin.getConfig().getInt("Title.Options.FadeOutTime")); @@ -678,13 +678,13 @@ public class FactionsPlayerListener implements Listener { } - if (! SavageFactions.plugin.factionsFlight) { + if (!SavageFactions.plugin.factionsFlight) { return; } // enable fly :) - if (me.hasFaction() && ! me.isFlying()) { + if (me.hasFaction() && !me.isFlying()) { if (factionTo == me.getFaction()) { enableFly(me); } @@ -696,7 +696,7 @@ public class FactionsPlayerListener implements Listener { (relationTo == Relation.ENEMY && me.canflyinEnemy()) || (relationTo == Relation.ALLY && me.canflyinAlly()) || (relationTo == Relation.TRUCE && me.canflyinTruce()) || - (relationTo == Relation.NEUTRAL && me.canflyinNeutral() && ! isSystemFaction(factionTo))) { + (relationTo == Relation.NEUTRAL && me.canflyinNeutral() && !isSystemFaction(factionTo))) { enableFly(me); } @@ -718,15 +718,15 @@ public class FactionsPlayerListener implements Listener { String ownersTo = myFaction.getOwnerListString(to); if (changedFaction) { me.sendFactionHereMessage(factionFrom); - if (Conf.ownedAreasEnabled && Conf.ownedMessageOnBorder && myFaction == factionTo && ! ownersTo.isEmpty()) { + if (Conf.ownedAreasEnabled && Conf.ownedMessageOnBorder && myFaction == factionTo && !ownersTo.isEmpty()) { me.sendMessage(TL.GENERIC_OWNERS.format(ownersTo)); } - } else if (Conf.ownedAreasEnabled && Conf.ownedMessageInsideTerritory && myFaction == factionTo && ! myFaction.isWilderness()) { + } else if (Conf.ownedAreasEnabled && Conf.ownedMessageInsideTerritory && myFaction == factionTo && !myFaction.isWilderness()) { String ownersFrom = myFaction.getOwnerListString(from); - if (Conf.ownedMessageByChunk || ! ownersFrom.equals(ownersTo)) { - if (! ownersTo.isEmpty()) { + if (Conf.ownedMessageByChunk || !ownersFrom.equals(ownersTo)) { + if (!ownersTo.isEmpty()) { me.sendMessage(TL.GENERIC_OWNERS.format(ownersTo)); - } else if (! TL.GENERIC_PUBLICLAND.toString().isEmpty()) { + } else if (!TL.GENERIC_PUBLICLAND.toString().isEmpty()) { me.sendMessage(TL.GENERIC_PUBLICLAND.toString()); } } @@ -736,19 +736,19 @@ public class FactionsPlayerListener implements Listener { if (me.getAutoClaimFor() != null) { me.attemptClaim(me.getAutoClaimFor(), event.getTo(), true); } else if (me.isAutoSafeClaimEnabled()) { - if (! Permission.MANAGE_SAFE_ZONE.has(player)) { + if (!Permission.MANAGE_SAFE_ZONE.has(player)) { me.setIsAutoSafeClaimEnabled(false); } else { - if (! Board.getInstance().getFactionAt(to).isSafeZone()) { + if (!Board.getInstance().getFactionAt(to).isSafeZone()) { Board.getInstance().setFactionAt(Factions.getInstance().getSafeZone(), to); me.msg(TL.PLAYER_SAFEAUTO); } } } else if (me.isAutoWarClaimEnabled()) { - if (! Permission.MANAGE_WAR_ZONE.has(player)) { + if (!Permission.MANAGE_WAR_ZONE.has(player)) { me.setIsAutoWarClaimEnabled(false); } else { - if (! Board.getInstance().getFactionAt(to).isWarZone()) { + if (!Board.getInstance().getFactionAt(to).isWarZone()) { Board.getInstance().setFactionAt(Factions.getInstance().getWarZone(), to); me.msg(TL.PLAYER_WARAUTO); } @@ -798,7 +798,7 @@ public class FactionsPlayerListener implements Listener { return; // clicked in air, apparently } - if (! canPlayerUseBlock(player, block, false)) { + if (!canPlayerUseBlock(player, block, false)) { event.setCancelled(true); if (Conf.handleExploitInteractionSpam) { String name = player.getName(); @@ -821,7 +821,7 @@ public class FactionsPlayerListener implements Listener { return; // only interested on right-clicks for below } - if (! playerCanUseItemHere(player, block.getLocation(), event.getMaterial(), false)) { + if (!playerCanUseItemHere(player, block.getLocation(), event.getMaterial(), false)) { event.setCancelled(true); } } @@ -836,7 +836,7 @@ public class FactionsPlayerListener implements Listener { if (Conf.homesEnabled && Conf.homesTeleportToOnDeath && home != null && - (Conf.homesRespawnFromNoPowerLossWorlds || ! Conf.worldsNoPowerLoss.contains(event.getPlayer().getWorld().getName()))) { + (Conf.homesRespawnFromNoPowerLossWorlds || !Conf.worldsNoPowerLoss.contains(event.getPlayer().getWorld().getName()))) { event.setRespawnLocation(home); } } @@ -848,7 +848,7 @@ public class FactionsPlayerListener implements Listener { Block block = event.getBlockClicked(); Player player = event.getPlayer(); - if (! playerCanUseItemHere(player, block.getLocation(), event.getBucket(), false)) { + if (!playerCanUseItemHere(player, block.getLocation(), event.getBucket(), false)) { event.setCancelled(true); } } @@ -858,7 +858,7 @@ public class FactionsPlayerListener implements Listener { Block block = event.getBlockClicked(); Player player = event.getPlayer(); - if (! playerCanUseItemHere(player, block.getLocation(), event.getBucket(), false)) { + if (!playerCanUseItemHere(player, block.getLocation(), event.getBucket(), false)) { event.setCancelled(true); } } diff --git a/src/main/java/com/massivecraft/factions/scoreboards/BufferedObjective.java b/src/main/java/com/massivecraft/factions/scoreboards/BufferedObjective.java index 853b3009..d21d3898 100644 --- a/src/main/java/com/massivecraft/factions/scoreboards/BufferedObjective.java +++ b/src/main/java/com/massivecraft/factions/scoreboards/BufferedObjective.java @@ -62,7 +62,7 @@ public class BufferedObjective { } public void setTitle(String title) { - if (this.title == null || ! this.title.equals(title)) { + if (this.title == null || !this.title.equals(title)) { this.title = title; requiresUpdate = true; } @@ -88,7 +88,7 @@ public class BufferedObjective { } content = ChatColor.translateAlternateColorCodes('&', content); - if (contents.get(lineNumber) == null || ! contents.get(lineNumber).equals(content)) { + if (contents.get(lineNumber) == null || !contents.get(lineNumber).equals(content)) { contents.put(lineNumber, content); requiresUpdate = true; } @@ -102,7 +102,7 @@ public class BufferedObjective { } public void flip() { - if (! requiresUpdate) { + if (!requiresUpdate) { return; } requiresUpdate = false; diff --git a/src/main/java/com/massivecraft/factions/scoreboards/FScoreboard.java b/src/main/java/com/massivecraft/factions/scoreboards/FScoreboard.java index 4be4f3ae..91b2c1e4 100644 --- a/src/main/java/com/massivecraft/factions/scoreboards/FScoreboard.java +++ b/src/main/java/com/massivecraft/factions/scoreboards/FScoreboard.java @@ -79,7 +79,7 @@ public class FScoreboard { } public void setSidebarVisibility(boolean visible) { - if (! isSupportedByServer()) { + if (!isSupportedByServer()) { return; } @@ -87,7 +87,7 @@ public class FScoreboard { } public void setDefaultSidebar(final FSidebarProvider provider, int updateInterval) { - if (! isSupportedByServer()) { + if (!isSupportedByServer()) { return; } @@ -113,7 +113,7 @@ public class FScoreboard { } public void setTemporarySidebar(final FSidebarProvider provider) { - if (! isSupportedByServer()) { + if (!isSupportedByServer()) { return; } diff --git a/src/main/java/com/massivecraft/factions/scoreboards/FTeamWrapper.java b/src/main/java/com/massivecraft/factions/scoreboards/FTeamWrapper.java index 8d0ba910..82a39c6d 100644 --- a/src/main/java/com/massivecraft/factions/scoreboards/FTeamWrapper.java +++ b/src/main/java/com/massivecraft/factions/scoreboards/FTeamWrapper.java @@ -30,7 +30,7 @@ public class FTeamWrapper { } public static void applyUpdatesLater(final Faction faction) { - if (! FScoreboard.isSupportedByServer()) { + if (!FScoreboard.isSupportedByServer()) { return; } @@ -38,7 +38,7 @@ public class FTeamWrapper { return; } - if (! SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) { + if (!SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) { return; } @@ -55,7 +55,7 @@ public class FTeamWrapper { } public static void applyUpdates(Faction faction) { - if (! FScoreboard.isSupportedByServer()) { + if (!FScoreboard.isSupportedByServer()) { return; } @@ -63,7 +63,7 @@ public class FTeamWrapper { return; } - if (! SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) { + if (!SavageFactions.plugin.getConfig().getBoolean("scoreboard.default-prefixes", false)) { return; } @@ -88,14 +88,14 @@ public class FTeamWrapper { } for (OfflinePlayer player : wrapper.getPlayers()) { - if (! player.isOnline() || ! factionMembers.contains(FPlayers.getInstance().getByOfflinePlayer(player))) { + if (!player.isOnline() || !factionMembers.contains(FPlayers.getInstance().getByOfflinePlayer(player))) { // Player is offline or no longer in faction wrapper.removePlayer(player); } } for (FPlayer fmember : factionMembers) { - if (! fmember.isOnline()) { + if (!fmember.isOnline()) { continue; } @@ -107,11 +107,11 @@ public class FTeamWrapper { } public static void updatePrefixes(Faction faction) { - if (! FScoreboard.isSupportedByServer()) { + if (!FScoreboard.isSupportedByServer()) { return; } - if (! wrappers.containsKey(faction)) { + if (!wrappers.containsKey(faction)) { applyUpdates(faction); } else { wrappers.get(faction).updatePrefixes(); @@ -119,7 +119,7 @@ public class FTeamWrapper { } protected static void track(FScoreboard fboard) { - if (! FScoreboard.isSupportedByServer()) { + if (!FScoreboard.isSupportedByServer()) { return; } tracking.add(fboard); @@ -129,7 +129,7 @@ public class FTeamWrapper { } protected static void untrack(FScoreboard fboard) { - if (! FScoreboard.isSupportedByServer()) { + if (!FScoreboard.isSupportedByServer()) { return; } tracking.remove(fboard); @@ -174,7 +174,7 @@ public class FTeamWrapper { } prefix = prefix.replace("{relationcolor}", faction.getRelationTo(fplayer).getColor().toString()); prefix = prefix.replace("{faction}", faction.getTag().substring(0, Math.min("{faction}".length() + 16 - prefix.length(), faction.getTag().length()))); - if (team.getPrefix() == null || ! team.getPrefix().equals(prefix)) { + if (team.getPrefix() == null || !team.getPrefix().equals(prefix)) { team.setPrefix(prefix); } } diff --git a/src/main/java/com/massivecraft/factions/struct/Role.java b/src/main/java/com/massivecraft/factions/struct/Role.java index c5ddf1fb..a493dfd5 100644 --- a/src/main/java/com/massivecraft/factions/struct/Role.java +++ b/src/main/java/com/massivecraft/factions/struct/Role.java @@ -135,7 +135,7 @@ public enum Role implements Permissable { itemMeta.setDisplayName(displayName); itemMeta.setLore(lore); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { itemMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES); } diff --git a/src/main/java/com/massivecraft/factions/util/AutoLeaveProcessTask.java b/src/main/java/com/massivecraft/factions/util/AutoLeaveProcessTask.java index 1a9ebed4..79684116 100644 --- a/src/main/java/com/massivecraft/factions/util/AutoLeaveProcessTask.java +++ b/src/main/java/com/massivecraft/factions/util/AutoLeaveProcessTask.java @@ -29,7 +29,7 @@ public class AutoLeaveProcessTask extends BukkitRunnable { return; } - if (! readyToGo) { + if (!readyToGo) { return; } // this is set so it only does one iteration at a time, no matter how frequently the timer fires @@ -49,7 +49,7 @@ public class AutoLeaveProcessTask extends BukkitRunnable { FPlayer fplayer = iterator.next(); // Check if they should be exempt from this. - if (! fplayer.willAutoLeave()) { + if (!fplayer.willAutoLeave()) { SavageFactions.plugin.debug(Level.INFO, fplayer.getName() + " was going to be auto-removed but was set not to."); continue; } diff --git a/src/main/java/com/massivecraft/factions/util/AutoLeaveTask.java b/src/main/java/com/massivecraft/factions/util/AutoLeaveTask.java index 66b6d5c5..a13ca1d3 100644 --- a/src/main/java/com/massivecraft/factions/util/AutoLeaveTask.java +++ b/src/main/java/com/massivecraft/factions/util/AutoLeaveTask.java @@ -13,7 +13,7 @@ public class AutoLeaveTask implements Runnable { } public synchronized void run() { - if (task != null && ! task.isFinished()) { + if (task != null && !task.isFinished()) { return; } diff --git a/src/main/java/com/massivecraft/factions/util/EnumTypeAdapter.java b/src/main/java/com/massivecraft/factions/util/EnumTypeAdapter.java index 8c65bc89..796fe5e5 100644 --- a/src/main/java/com/massivecraft/factions/util/EnumTypeAdapter.java +++ b/src/main/java/com/massivecraft/factions/util/EnumTypeAdapter.java @@ -40,10 +40,10 @@ public final class EnumTypeAdapter> extends TypeAdapter { @SuppressWarnings ({"rawtypes", "unchecked"}) public TypeAdapter create(Gson gson, TypeToken typeToken) { Class rawType = typeToken.getRawType(); - if (! Enum.class.isAssignableFrom(rawType) || rawType == Enum.class) { + if (!Enum.class.isAssignableFrom(rawType) || rawType == Enum.class) { return null; } - if (! rawType.isEnum()) { + if (!rawType.isEnum()) { rawType = rawType.getSuperclass(); // handle anonymous subclasses } return (TypeAdapter) new EnumTypeAdapter(rawType); diff --git a/src/main/java/com/massivecraft/factions/util/MapFLocToStringSetTypeAdapter.java b/src/main/java/com/massivecraft/factions/util/MapFLocToStringSetTypeAdapter.java index 7d506591..e1d6b60b 100644 --- a/src/main/java/com/massivecraft/factions/util/MapFLocToStringSetTypeAdapter.java +++ b/src/main/java/com/massivecraft/factions/util/MapFLocToStringSetTypeAdapter.java @@ -86,7 +86,7 @@ public class MapFLocToStringSetTypeAdapter implements JsonDeserializer(Arrays.asList("0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z")); public static EntityType creatureTypeFromEntity(Entity entity) { - if (! (entity instanceof Creature)) { + if (!(entity instanceof Creature)) { return null; } @@ -76,7 +76,7 @@ public class MiscUtil { } for (char c : str.toCharArray()) { - if (! substanceChars.contains(String.valueOf(c))) { + if (!substanceChars.contains(String.valueOf(c))) { errors.add(SavageFactions.plugin.txt.parse(TL.GENERIC_FACTIONTAG_ALPHANUMERIC.toString(), c)); } } diff --git a/src/main/java/com/massivecraft/factions/util/Particles/ParticleEffect.java b/src/main/java/com/massivecraft/factions/util/Particles/ParticleEffect.java index fbeffb63..bd442ba3 100644 --- a/src/main/java/com/massivecraft/factions/util/Particles/ParticleEffect.java +++ b/src/main/java/com/massivecraft/factions/util/Particles/ParticleEffect.java @@ -422,7 +422,7 @@ public enum ParticleEffect { */ public static ParticleEffect fromName(String name) { for (Entry entry : NAME_MAP.entrySet()) { - if (! entry.getKey().equalsIgnoreCase(name)) { + if (!entry.getKey().equalsIgnoreCase(name)) { continue; } return entry.getValue(); @@ -467,7 +467,7 @@ public enum ParticleEffect { String world = location.getWorld().getName(); for (Player player : players) { Location playerLocation = player.getLocation(); - if (! world.equals(playerLocation.getWorld().getName()) || playerLocation.distanceSquared(location) < 65536) { + if (!world.equals(playerLocation.getWorld().getName()) || playerLocation.distanceSquared(location) < 65536) { continue; } return true; @@ -562,13 +562,13 @@ public enum ParticleEffect { * @see ParticlePacket#sendTo(Location, double) */ public void display(float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, double range) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { - if (! isSupported()) { + if (!isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } if (hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect requires additional data"); } - if (hasProperty(ParticleProperty.REQUIRES_WATER) && ! isWater(center)) { + if (hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { throw new IllegalArgumentException("There is no water at the center location"); } new ParticlePacket(this, offsetX, offsetY, offsetZ, speed, amount, range > 256, null).sendTo(center, range); @@ -591,13 +591,13 @@ public enum ParticleEffect { * @see ParticlePacket#sendTo(Location, List) */ public void display(float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, List players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { - if (! isSupported()) { + if (!isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } if (hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect requires additional data"); } - if (hasProperty(ParticleProperty.REQUIRES_WATER) && ! isWater(center)) { + if (hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { throw new IllegalArgumentException("There is no water at the center location"); } new ParticlePacket(this, offsetX, offsetY, offsetZ, speed, amount, isLongDistance(center, players), null).sendTo(center, players); @@ -636,16 +636,16 @@ public enum ParticleEffect { * @see ParticlePacket#sendTo(Location, double) */ public void display(Vector direction, float speed, Location center, double range) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { - if (! isSupported()) { + if (!isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } if (hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect requires additional data"); } - if (! hasProperty(ParticleProperty.DIRECTIONAL)) { + if (!hasProperty(ParticleProperty.DIRECTIONAL)) { throw new IllegalArgumentException("This particle effect is not directional"); } - if (hasProperty(ParticleProperty.REQUIRES_WATER) && ! isWater(center)) { + if (hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { throw new IllegalArgumentException("There is no water at the center location"); } new ParticlePacket(this, direction, speed, range > 256, null).sendTo(center, range); @@ -665,16 +665,16 @@ public enum ParticleEffect { * @see ParticlePacket#sendTo(Location, List) */ public void display(Vector direction, float speed, Location center, List players) throws ParticleVersionException, ParticleDataException, IllegalArgumentException { - if (! isSupported()) { + if (!isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } if (hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect requires additional data"); } - if (! hasProperty(ParticleProperty.DIRECTIONAL)) { + if (!hasProperty(ParticleProperty.DIRECTIONAL)) { throw new IllegalArgumentException("This particle effect is not directional"); } - if (hasProperty(ParticleProperty.REQUIRES_WATER) && ! isWater(center)) { + if (hasProperty(ParticleProperty.REQUIRES_WATER) && !isWater(center)) { throw new IllegalArgumentException("There is no water at the center location"); } new ParticlePacket(this, direction, speed, isLongDistance(center, players), null).sendTo(center, players); @@ -708,13 +708,13 @@ public enum ParticleEffect { * @see ParticlePacket#sendTo(Location, double) */ public void display(ParticleColor color, Location center, double range) throws ParticleVersionException, ParticleColorException { - if (! isSupported()) { + if (!isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (! hasProperty(ParticleProperty.COLORABLE)) { + if (!hasProperty(ParticleProperty.COLORABLE)) { throw new ParticleColorException("This particle effect is not colorable"); } - if (! isColorCorrect(this, color)) { + if (!isColorCorrect(this, color)) { throw new ParticleColorException("The particle color type is incorrect"); } new ParticlePacket(this, color, range > 256).sendTo(center, range); @@ -732,13 +732,13 @@ public enum ParticleEffect { * @see ParticlePacket#sendTo(Location, List) */ public void display(ParticleColor color, Location center, List players) throws ParticleVersionException, ParticleColorException { - if (! isSupported()) { + if (!isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (! hasProperty(ParticleProperty.COLORABLE)) { + if (!hasProperty(ParticleProperty.COLORABLE)) { throw new ParticleColorException("This particle effect is not colorable"); } - if (! isColorCorrect(this, color)) { + if (!isColorCorrect(this, color)) { throw new ParticleColorException("The particle color type is incorrect"); } new ParticlePacket(this, color, isLongDistance(center, players)).sendTo(center, players); @@ -775,13 +775,13 @@ public enum ParticleEffect { * @see ParticlePacket#sendTo(Location, double) */ public void display(ParticleData data, float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, double range) throws ParticleVersionException, ParticleDataException { - if (! isSupported()) { + if (!isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (! hasProperty(ParticleProperty.REQUIRES_DATA)) { + if (!hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect does not require additional data"); } - if (! isDataCorrect(this, data)) { + if (!isDataCorrect(this, data)) { throw new ParticleDataException("The particle data type is incorrect"); } new ParticlePacket(this, offsetX, offsetY, offsetZ, speed, amount, range > 256, data).sendTo(center, range); @@ -804,13 +804,13 @@ public enum ParticleEffect { * @see ParticlePacket#sendTo(Location, List) */ public void display(ParticleData data, float offsetX, float offsetY, float offsetZ, float speed, int amount, Location center, List players) throws ParticleVersionException, ParticleDataException { - if (! isSupported()) { + if (!isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (! hasProperty(ParticleProperty.REQUIRES_DATA)) { + if (!hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect does not require additional data"); } - if (! isDataCorrect(this, data)) { + if (!isDataCorrect(this, data)) { throw new ParticleDataException("The particle data type is incorrect"); } new ParticlePacket(this, offsetX, offsetY, offsetZ, speed, amount, isLongDistance(center, players), data).sendTo(center, players); @@ -849,13 +849,13 @@ public enum ParticleEffect { * @see ParticlePacket#sendTo(Location, double) */ public void display(ParticleData data, Vector direction, float speed, Location center, double range) throws ParticleVersionException, ParticleDataException { - if (! isSupported()) { + if (!isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (! hasProperty(ParticleProperty.REQUIRES_DATA)) { + if (!hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect does not require additional data"); } - if (! isDataCorrect(this, data)) { + if (!isDataCorrect(this, data)) { throw new ParticleDataException("The particle data type is incorrect"); } new ParticlePacket(this, direction, speed, range > 256, data).sendTo(center, range); @@ -875,13 +875,13 @@ public enum ParticleEffect { * @see ParticlePacket#sendTo(Location, List) */ public void display(ParticleData data, Vector direction, float speed, Location center, List players) throws ParticleVersionException, ParticleDataException { - if (! isSupported()) { + if (!isSupported()) { throw new ParticleVersionException("This particle effect is not supported by your server version"); } - if (! hasProperty(ParticleProperty.REQUIRES_DATA)) { + if (!hasProperty(ParticleProperty.REQUIRES_DATA)) { throw new ParticleDataException("This particle effect does not require additional data"); } - if (! isDataCorrect(this, data)) { + if (!isDataCorrect(this, data)) { throw new ParticleDataException("The particle data type is incorrect"); } new ParticlePacket(this, direction, speed, isLongDistance(center, players), data).sendTo(center, players); @@ -1033,7 +1033,7 @@ public enum ParticleEffect { */ public BlockData(Material material, byte data) throws IllegalArgumentException { super(material, data); - if (! material.isBlock()) { + if (!material.isBlock()) { throw new IllegalArgumentException("The material is not a block"); } } @@ -1425,7 +1425,7 @@ public enum ParticleEffect { * @return The version number */ public static int getVersion() { - if (! initialized) { + if (!initialized) { initialize(); } return version; @@ -1530,7 +1530,7 @@ public enum ParticleEffect { String worldName = center.getWorld().getName(); double squared = range * range; for (Player player : Bukkit.getOnlinePlayers()) { - if (! player.getWorld().getName().equals(worldName) || player.getLocation().distanceSquared(center) > squared) { + if (!player.getWorld().getName().equals(worldName) || player.getLocation().distanceSquared(center) > squared) { continue; } sendTo(center, player); diff --git a/src/main/java/com/massivecraft/factions/util/Particles/ReflectionUtils.java b/src/main/java/com/massivecraft/factions/util/Particles/ReflectionUtils.java index 108c5323..4758b937 100644 --- a/src/main/java/com/massivecraft/factions/util/Particles/ReflectionUtils.java +++ b/src/main/java/com/massivecraft/factions/util/Particles/ReflectionUtils.java @@ -44,7 +44,7 @@ public final class ReflectionUtils { public static Constructor getConstructor(Class clazz, Class... parameterTypes) throws NoSuchMethodException { Class[] primitiveTypes = DataType.getPrimitive(parameterTypes); for (Constructor constructor : clazz.getConstructors()) { - if (! DataType.compare(DataType.getPrimitive(constructor.getParameterTypes()), primitiveTypes)) { + if (!DataType.compare(DataType.getPrimitive(constructor.getParameterTypes()), primitiveTypes)) { continue; } return constructor; @@ -118,7 +118,7 @@ public final class ReflectionUtils { public static Method getMethod(Class clazz, String methodName, Class... parameterTypes) throws NoSuchMethodException { Class[] primitiveTypes = DataType.getPrimitive(parameterTypes); for (Method method : clazz.getMethods()) { - if (! method.getName().equals(methodName) || ! DataType.compare(DataType.getPrimitive(method.getParameterTypes()), primitiveTypes)) { + if (!method.getName().equals(methodName) || !DataType.compare(DataType.getPrimitive(method.getParameterTypes()), primitiveTypes)) { continue; } return method; diff --git a/src/main/java/com/massivecraft/factions/util/RelationUtil.java b/src/main/java/com/massivecraft/factions/util/RelationUtil.java index ab1b1ba5..7b3412c0 100644 --- a/src/main/java/com/massivecraft/factions/util/RelationUtil.java +++ b/src/main/java/com/massivecraft/factions/util/RelationUtil.java @@ -65,7 +65,7 @@ public class RelationUtil { return Relation.NEUTRAL; // ERROR } - if (! fthat.isNormal() || ! fme.isNormal()) { + if (!fthat.isNormal() || !fme.isNormal()) { return Relation.NEUTRAL; } @@ -73,7 +73,7 @@ public class RelationUtil { return Relation.MEMBER; } - if (! ignorePeaceful && (fme.isPeaceful() || fthat.isPeaceful())) { + if (!ignorePeaceful && (fme.isPeaceful() || fthat.isPeaceful())) { return Relation.NEUTRAL; } diff --git a/src/main/java/com/massivecraft/factions/util/SpiralTask.java b/src/main/java/com/massivecraft/factions/util/SpiralTask.java index a3580df7..b5a9d40a 100644 --- a/src/main/java/com/massivecraft/factions/util/SpiralTask.java +++ b/src/main/java/com/massivecraft/factions/util/SpiralTask.java @@ -110,7 +110,7 @@ public abstract class SpiralTask implements Runnable { } public final void run() { - if (! this.valid() || ! readyToGo) { + if (!this.valid() || !readyToGo) { return; } @@ -118,7 +118,7 @@ public abstract class SpiralTask implements Runnable { readyToGo = false; // make sure we're still inside the specified radius - if (! this.insideRadius()) { + if (!this.insideRadius()) { return; } @@ -128,13 +128,13 @@ public abstract class SpiralTask implements Runnable { // keep going until the task has been running for 20ms or more, then stop to take a breather while (now() < loopStartTime + 20) { // run the primary task on the current X/Z coordinates - if (! this.work()) { + if (!this.work()) { this.finish(); return; } // move on to next chunk in spiral - if (! this.moveToNext()) { + if (!this.moveToNext()) { return; } } @@ -145,7 +145,7 @@ public abstract class SpiralTask implements Runnable { // step through chunks in spiral pattern from center; returns false if we're done, otherwise returns true public final boolean moveToNext() { - if (! this.valid()) { + if (!this.valid()) { return false; } @@ -154,7 +154,7 @@ public abstract class SpiralTask implements Runnable { current++; // if we're outside the radius, we're done - if (! this.insideRadius()) { + if (!this.insideRadius()) { return false; } } else { // one leg/side of the spiral down... @@ -179,7 +179,7 @@ public abstract class SpiralTask implements Runnable { public final boolean insideRadius() { boolean inside = current < limit; - if (! inside) { + if (!inside) { this.finish(); } return inside; @@ -193,7 +193,7 @@ public abstract class SpiralTask implements Runnable { // we're done, whether finished or cancelled public final void stop() { - if (! this.valid()) { + if (!this.valid()) { return; } diff --git a/src/main/java/com/massivecraft/factions/util/WarpGUI.java b/src/main/java/com/massivecraft/factions/util/WarpGUI.java index 31e635b2..abfe6ffc 100644 --- a/src/main/java/com/massivecraft/factions/util/WarpGUI.java +++ b/src/main/java/com/massivecraft/factions/util/WarpGUI.java @@ -95,7 +95,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI { // All clear lets TP them or ask for password String warp = warpSlots.get(slot); - if (! fme.getFaction().hasWarpPassword(warp)) { + if (!fme.getFaction().hasWarpPassword(warp)) { if (transact(fme)) { doWarmup(warp); } @@ -129,13 +129,13 @@ public class WarpGUI implements InventoryHolder, FactionGUI { } private boolean transact(FPlayer player) { - if (! SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing()) { + if (!SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) || player.isAdminBypassing()) { return true; } double cost = SavageFactions.plugin.getConfig().getDouble("warp-cost.warp", 5); - if (! Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.isAdminBypassing()) { + if (!Econ.shouldBeUsed() || this.fme == null || cost == 0.0 || fme.isAdminBypassing()) { return true; } @@ -183,7 +183,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI { string = ChatColor.translateAlternateColorCodes('&', string); string = string.replace("{warp}", warp); string = string.replace("{warp-protected}", faction.hasWarpPassword(warp) ? "Enabled" : "Disabled"); - string = string.replace("{warp-cost}", ! SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) ? "Disabled" : Integer.toString(SavageFactions.plugin.getConfig().getInt("warp-cost.warp", 5))); + string = string.replace("{warp-cost}", !SavageFactions.plugin.getConfig().getBoolean("warp-cost.enabled", false) ? "Disabled" : Integer.toString(SavageFactions.plugin.getConfig().getInt("warp-cost.warp", 5))); return string; } @@ -243,7 +243,7 @@ public class WarpGUI implements InventoryHolder, FactionGUI { ItemMeta itemMeta = itemStack.getItemMeta(); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); } diff --git a/src/main/java/com/massivecraft/factions/zcore/MCommand.java b/src/main/java/com/massivecraft/factions/zcore/MCommand.java index 3a778cb1..32f8999e 100644 --- a/src/main/java/com/massivecraft/factions/zcore/MCommand.java +++ b/src/main/java/com/massivecraft/factions/zcore/MCommand.java @@ -113,11 +113,11 @@ public abstract class MCommand { } } - if (! validCall(this.sender, this.args)) { + if (!validCall(this.sender, this.args)) { return; } - if (! this.isEnabled()) { + if (!this.isEnabled()) { return; } @@ -153,7 +153,7 @@ public abstract class MCommand { } public boolean validSenderType(CommandSender sender, boolean informSenderIfNot) { - if (this.senderMustBePlayer && ! (sender instanceof Player)) { + if (this.senderMustBePlayer && !(sender instanceof Player)) { if (informSenderIfNot) { msg(TL.GENERIC_PLAYERONLY); } diff --git a/src/main/java/com/massivecraft/factions/zcore/MPlugin.java b/src/main/java/com/massivecraft/factions/zcore/MPlugin.java index 8dbdec51..ba0355f3 100644 --- a/src/main/java/com/massivecraft/factions/zcore/MPlugin.java +++ b/src/main/java/com/massivecraft/factions/zcore/MPlugin.java @@ -84,7 +84,7 @@ public abstract class MPlugin extends JavaPlugin { // reference command will be used to prevent "unknown command" console messages try { Map> refCmd = this.getDescription().getCommands(); - if (refCmd != null && ! refCmd.isEmpty()) { + if (refCmd != null && !refCmd.isEmpty()) { this.refCommand = (String) (refCmd.keySet().toArray()[0]); } } catch (ClassCastException ex) { @@ -114,7 +114,7 @@ public abstract class MPlugin extends JavaPlugin { File lang = new File(getDataFolder(), "lang.yml"); OutputStream out = null; InputStream defLangStream = this.getResource("lang.yml"); - if (! lang.exists()) { + if (!lang.exists()) { try { getDataFolder().mkdir(); lang.createNewFile(); @@ -259,7 +259,7 @@ public abstract class MPlugin extends JavaPlugin { } for (final MCommand command : this.getBaseCommands()) { - if (noSlash && ! command.allowNoSlashAccess) { + if (noSlash && !command.allowNoSlashAccess) { continue; } diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java b/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java index 1f203a16..936ae133 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java +++ b/src/main/java/com/massivecraft/factions/zcore/fperms/PermissableAction.java @@ -120,7 +120,7 @@ public enum PermissableAction { // If under the 1.13 version we will use the colorable option. - if (! SavageFactions.plugin.mc113) { + if (!SavageFactions.plugin.mc113) { DyeColor dyeColor = null; try { @@ -140,7 +140,7 @@ public enum PermissableAction { lore.add(replacePlaceholders(loreLine, fme, permissable)); } - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); } diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java index c63fd550..bfe97a44 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java +++ b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableActionGUI.java @@ -92,7 +92,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI { if (disabled) { break; } - if (! usedDummySlots.isEmpty()) { + if (!usedDummySlots.isEmpty()) { int slot = usedDummySlots.get(0); actionSlots.put(slot, action); } else { @@ -126,7 +126,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI { } return; } - if (! actionSlots.containsKey(slot)) { + if (!actionSlots.containsKey(slot)) { return; } @@ -194,7 +194,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI { } backButtonMeta.setLore(lore); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { backButtonMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); } @@ -228,7 +228,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI { } ItemMeta meta = dummyItem.getItemMeta(); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); } @@ -283,7 +283,7 @@ public class PermissableActionGUI implements InventoryHolder, FactionGUI { } itemMeta.setLore(lore); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); } diff --git a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java index d6b4f076..c780e02e 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java +++ b/src/main/java/com/massivecraft/factions/zcore/fperms/gui/PermissableRelationGUI.java @@ -85,7 +85,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI { @Override public void onClick(int slot, ClickType clickType) { - if (! relationSlots.containsKey(slot)) { + if (!relationSlots.containsKey(slot)) { return; } @@ -142,7 +142,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI { } ItemMeta meta = dummyItem.getItemMeta(); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { meta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); } @@ -196,7 +196,7 @@ public class PermissableRelationGUI implements InventoryHolder, FactionGUI { } itemMeta.setLore(lore); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_ATTRIBUTES); } diff --git a/src/main/java/com/massivecraft/factions/zcore/fupgrades/FUpgradesGUI.java b/src/main/java/com/massivecraft/factions/zcore/fupgrades/FUpgradesGUI.java index 7102b8b7..ebf50fc8 100644 --- a/src/main/java/com/massivecraft/factions/zcore/fupgrades/FUpgradesGUI.java +++ b/src/main/java/com/massivecraft/factions/zcore/fupgrades/FUpgradesGUI.java @@ -114,7 +114,7 @@ public class FUpgradesGUI implements Listener { } if (spawnerLevel == 2) { int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-3"); - if (! hasMoney(fme, cost)) { + if (!hasMoney(fme, cost)) { return; } takeMoney(fme, cost); @@ -123,7 +123,7 @@ public class FUpgradesGUI implements Listener { } if (spawnerLevel == 1) { int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-2"); - if (! hasMoney(fme, cost)) { + if (!hasMoney(fme, cost)) { return; } takeMoney(fme, cost); @@ -132,7 +132,7 @@ public class FUpgradesGUI implements Listener { } if (spawnerLevel == 0) { int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Spawners.Cost.level-1"); - if (! hasMoney(fme, cost)) { + if (!hasMoney(fme, cost)) { return; } takeMoney(fme, cost); @@ -147,7 +147,7 @@ public class FUpgradesGUI implements Listener { } if (expLevel == 2) { int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-3"); - if (! hasMoney(fme, cost)) { + if (!hasMoney(fme, cost)) { return; } takeMoney(fme, cost); @@ -156,7 +156,7 @@ public class FUpgradesGUI implements Listener { } if (expLevel == 1) { int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-2"); - if (! hasMoney(fme, cost)) { + if (!hasMoney(fme, cost)) { return; } takeMoney(fme, cost); @@ -165,7 +165,7 @@ public class FUpgradesGUI implements Listener { } if (expLevel == 0) { int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.EXP.Cost.level-1"); - if (! hasMoney(fme, cost)) { + if (!hasMoney(fme, cost)) { return; } takeMoney(fme, cost); @@ -180,7 +180,7 @@ public class FUpgradesGUI implements Listener { } if (chestLevel == 2) { int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-3"); - if (! hasMoney(fme, cost)) { + if (!hasMoney(fme, cost)) { return; } takeMoney(fme, cost); @@ -190,7 +190,7 @@ public class FUpgradesGUI implements Listener { } if (chestLevel == 1) { int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-2"); - if (! hasMoney(fme, cost)) { + if (!hasMoney(fme, cost)) { return; } takeMoney(fme, cost); @@ -200,7 +200,7 @@ public class FUpgradesGUI implements Listener { } if (chestLevel == 0) { int cost = SavageFactions.plugin.getConfig().getInt("fupgrades.MainMenu.Chest.Cost.level-1"); - if (! hasMoney(fme, cost)) { + if (!hasMoney(fme, cost)) { return; } takeMoney(fme, cost); @@ -254,7 +254,7 @@ public class FUpgradesGUI implements Listener { ItemStack expItem = SavageFactions.plugin.createItem(expMaterial, expAmt, expData, expName, expLore); if (expLevel >= 1) { ItemMeta itemMeta = expItem.getItemMeta(); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS); } itemMeta.addEnchant(Enchantment.DURABILITY, 3, true); @@ -294,7 +294,7 @@ public class FUpgradesGUI implements Listener { cropItem.getItemMeta().setLore(cropLore); if (cropLevel >= 1) { ItemMeta itemMeta = cropItem.getItemMeta(); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS); } itemMeta.addEnchant(Enchantment.DURABILITY, 3, true); @@ -309,7 +309,7 @@ public class FUpgradesGUI implements Listener { spawnerItem.getItemMeta().setLore(spawnerLore); if (spawnerLevel >= 1) { ItemMeta itemMeta = spawnerItem.getItemMeta(); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS); } itemMeta.addEnchant(Enchantment.DURABILITY, 3, true); @@ -337,7 +337,7 @@ public class FUpgradesGUI implements Listener { if (chestlevel >= 1) { ItemMeta itemMeta = chestItem.getItemMeta(); - if (! SavageFactions.plugin.mc17) { + if (!SavageFactions.plugin.mc17) { itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS); } itemMeta.addEnchant(Enchantment.DURABILITY, 3, true); diff --git a/src/main/java/com/massivecraft/factions/zcore/nbtapi/NBTFile.java b/src/main/java/com/massivecraft/factions/zcore/nbtapi/NBTFile.java index bf92af73..cfcda445 100644 --- a/src/main/java/com/massivecraft/factions/zcore/nbtapi/NBTFile.java +++ b/src/main/java/com/massivecraft/factions/zcore/nbtapi/NBTFile.java @@ -23,7 +23,7 @@ public class NBTFile extends NBTCompound { } public void save() throws IOException { - if (! file.exists()) { + if (!file.exists()) { file.getParentFile().mkdirs(); file.createNewFile(); } diff --git a/src/main/java/com/massivecraft/factions/zcore/nbtapi/NBTList.java b/src/main/java/com/massivecraft/factions/zcore/nbtapi/NBTList.java index 161bc900..f5608a36 100644 --- a/src/main/java/com/massivecraft/factions/zcore/nbtapi/NBTList.java +++ b/src/main/java/com/massivecraft/factions/zcore/nbtapi/NBTList.java @@ -16,7 +16,7 @@ public class NBTList { listName = name; this.type = type; this.listObject = list; - if (! (type == NBTType.NBTTagString || type == NBTType.NBTTagCompound)) { + if (!(type == NBTType.NBTTagString || type == NBTType.NBTTagCompound)) { System.err.println("List types != String/Compound are currently not implemented!"); } } diff --git a/src/main/java/com/massivecraft/factions/zcore/nbtapi/NBTReflectionUtil.java b/src/main/java/com/massivecraft/factions/zcore/nbtapi/NBTReflectionUtil.java index cf57b218..80fc42e9 100644 --- a/src/main/java/com/massivecraft/factions/zcore/nbtapi/NBTReflectionUtil.java +++ b/src/main/java/com/massivecraft/factions/zcore/nbtapi/NBTReflectionUtil.java @@ -28,7 +28,7 @@ public class NBTReflectionUtil { Class clazz = Class.forName("org.bukkit.craftbukkit." + version + ".inventory.CraftItemStack"); return clazz; } catch (Exception ex) { - System.out.println("Error in ItemNBTAPI! (Outdated plugin?)"); + System.out.println("Error in ItemNBTAPI!(Outdated plugin?)"); ex.printStackTrace(); return null; } @@ -40,7 +40,7 @@ public class NBTReflectionUtil { Class clazz = Class.forName("org.bukkit.craftbukkit." + version + ".entity.CraftEntity"); return clazz; } catch (Exception ex) { - System.out.println("Error in ItemNBTAPI! (Outdated plugin?)"); + System.out.println("Error in ItemNBTAPI!(Outdated plugin?)"); ex.printStackTrace(); return null; } @@ -52,7 +52,7 @@ public class NBTReflectionUtil { Class clazz = Class.forName("net.minecraft.server." + version + ".NBTBase"); return clazz; } catch (Exception ex) { - System.out.println("Error in ItemNBTAPI! (Outdated plugin?)"); + System.out.println("Error in ItemNBTAPI!(Outdated plugin?)"); ex.printStackTrace(); return null; } @@ -64,7 +64,7 @@ public class NBTReflectionUtil { Class clazz = Class.forName("net.minecraft.server." + version + ".NBTTagString"); return clazz; } catch (Exception ex) { - System.out.println("Error in ItemNBTAPI! (Outdated plugin?)"); + System.out.println("Error in ItemNBTAPI!(Outdated plugin?)"); ex.printStackTrace(); return null; } @@ -76,7 +76,7 @@ public class NBTReflectionUtil { Class clazz = Class.forName("net.minecraft.server." + version + ".ItemStack"); return clazz; } catch (Exception ex) { - System.out.println("Error in ItemNBTAPI! (Outdated plugin?)"); + System.out.println("Error in ItemNBTAPI!(Outdated plugin?)"); ex.printStackTrace(); return null; } @@ -88,7 +88,7 @@ public class NBTReflectionUtil { Class clazz = Class.forName("net.minecraft.server." + version + ".NBTTagCompound"); return clazz; } catch (Exception ex) { - System.out.println("Error in ItemNBTAPI! (Outdated plugin?)"); + System.out.println("Error in ItemNBTAPI!(Outdated plugin?)"); ex.printStackTrace(); return null; } @@ -100,7 +100,7 @@ public class NBTReflectionUtil { Class clazz = Class.forName("net.minecraft.server." + version + ".NBTCompressedStreamTools"); return clazz; } catch (Exception ex) { - System.out.println("Error in ItemNBTAPI! (Outdated plugin?)"); + System.out.println("Error in ItemNBTAPI!(Outdated plugin?)"); ex.printStackTrace(); return null; } @@ -112,7 +112,7 @@ public class NBTReflectionUtil { Class c = Class.forName("net.minecraft.server." + version + ".MojangsonParser"); return c; } catch (Exception ex) { - System.out.println("Error in ItemNBTAPI! (Outdated plugin?)"); + System.out.println("Error in ItemNBTAPI!(Outdated plugin?)"); ex.printStackTrace(); return null; } @@ -124,7 +124,7 @@ public class NBTReflectionUtil { Class clazz = Class.forName("net.minecraft.server." + version + ".TileEntity"); return clazz; } catch (Exception ex) { - System.out.println("Error in ItemNBTAPI! (Outdated plugin?)"); + System.out.println("Error in ItemNBTAPI!(Outdated plugin?)"); ex.printStackTrace(); return null; } @@ -136,7 +136,7 @@ public class NBTReflectionUtil { Class clazz = Class.forName("org.bukkit.craftbukkit." + version + ".CraftWorld"); return clazz; } catch (Exception ex) { - System.out.println("Error in ItemNBTAPI! (Outdated plugin?)"); + System.out.println("Error in ItemNBTAPI!(Outdated plugin?)"); ex.printStackTrace(); return null; } @@ -149,7 +149,7 @@ public class NBTReflectionUtil { Class c = Class.forName("net.minecraft.server." + version + ".NBTTagCompound"); return c.newInstance(); } catch (Exception ex) { - System.out.println("Error in ItemNBTAPI! (Outdated plugin?)"); + System.out.println("Error in ItemNBTAPI!(Outdated plugin?)"); ex.printStackTrace(); return null; } @@ -162,7 +162,7 @@ public class NBTReflectionUtil { Class clazz = Class.forName("net.minecraft.server." + version + ".BlockPosition"); return clazz.getConstructor(int.class, int.class, int.class).newInstance(x, y, z); } catch (Exception ex) { - System.out.println("Error in ItemNBTAPI! (Outdated plugin?)"); + System.out.println("Error in ItemNBTAPI!(Outdated plugin?)"); ex.printStackTrace(); return null; } @@ -397,7 +397,7 @@ public class NBTReflectionUtil { if (nbttag == null) { nbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(nbttag, comp); Method method; try { @@ -425,7 +425,7 @@ public class NBTReflectionUtil { structure.add(comp.getName()); comp = comp.getParent(); } - while (! structure.isEmpty()) { + while (!structure.isEmpty()) { nbttag = getSubNBTTagCompound(nbttag, structure.pop()); if (nbttag == null) { return null; @@ -439,7 +439,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -460,7 +460,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -477,7 +477,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -494,7 +494,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -515,7 +515,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -532,7 +532,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -553,7 +553,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -571,7 +571,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -592,7 +592,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -609,7 +609,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -630,7 +630,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -647,7 +647,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -668,7 +668,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -685,7 +685,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -706,7 +706,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -723,7 +723,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -744,7 +744,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -761,7 +761,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -782,7 +782,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -799,7 +799,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -816,7 +816,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return 0; + if (!valideCompound(comp)) return 0; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -837,7 +837,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -854,7 +854,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -875,7 +875,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) { + if (!valideCompound(comp)) { new Throwable("InvalideCompound").printStackTrace(); return; } @@ -895,7 +895,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -908,7 +908,7 @@ public class NBTReflectionUtil { } public static void setObject(NBTCompound comp, String key, Object value) { - if (! MinecraftVersion.hasGsonSupport()) return; + if (!MinecraftVersion.hasGsonSupport()) return; try { String json = GsonWrapper.getString(value); setString(comp, key, json); @@ -918,7 +918,7 @@ public class NBTReflectionUtil { } public static T getObject(NBTCompound comp, String key, Class type) { - if (! MinecraftVersion.hasGsonSupport()) return null; + if (!MinecraftVersion.hasGsonSupport()) return null; String json = getString(comp, key); if (json == null) { return null; @@ -931,7 +931,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return; + if (!valideCompound(comp)) return; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -948,7 +948,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { @@ -966,7 +966,7 @@ public class NBTReflectionUtil { if (rootnbttag == null) { rootnbttag = getNewNBTTag(); } - if (! valideCompound(comp)) return null; + if (!valideCompound(comp)) return null; Object workingtag = gettoCompount(rootnbttag, comp); Method method; try { diff --git a/src/main/java/com/massivecraft/factions/zcore/nbtapi/utils/MinecraftVersion.java b/src/main/java/com/massivecraft/factions/zcore/nbtapi/utils/MinecraftVersion.java index 41b92a39..ace9713f 100644 --- a/src/main/java/com/massivecraft/factions/zcore/nbtapi/utils/MinecraftVersion.java +++ b/src/main/java/com/massivecraft/factions/zcore/nbtapi/utils/MinecraftVersion.java @@ -26,7 +26,7 @@ public enum MinecraftVersion { return version; } final String ver = Bukkit.getServer().getClass().getPackage().getName().replace(".", ",").split(",")[3]; - System.out.println("[NBTAPI] Found Spigot: " + ver + "! Trying to find NMS support"); + System.out.println("[NBTAPI] Found Spigot: " + ver + "!Trying to find NMS support"); try { version = MinecraftVersion.valueOf(ver.replace("v", "MC")); } catch (IllegalArgumentException ex) { @@ -35,7 +35,7 @@ public enum MinecraftVersion { if (version != Unknown) { System.out.println("[NBTAPI] NMS support '" + version.name() + "' loaded!"); } else { - System.out.println("[NBTAPI] Wasn't able to find NMS Support! Some functions will not work!"); + System.out.println("[NBTAPI] Wasn't able to find NMS Support!Some functions will not work!"); } return version; } diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java index 7de9818b..42d44952 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryBoard.java @@ -26,7 +26,7 @@ public abstract class MemoryBoard extends Board { // Get and Set //----------------------------------------------// public String getIdAt(FLocation flocation) { - if (! flocationIds.containsKey(flocation)) { + if (!flocationIds.containsKey(flocation)) { return "0"; } @@ -157,7 +157,7 @@ public abstract class MemoryBoard extends Board { Iterator> iter = flocationIds.entrySet().iterator(); while (iter.hasNext()) { Entry entry = iter.next(); - if (! Factions.getInstance().isValidFactionId(entry.getValue())) { + if (!Factions.getInstance().isValidFactionId(entry.getValue())) { SavageFactions.plugin.log("Board cleaner removed " + entry.getValue() + " from " + entry.getKey()); iter.remove(); } @@ -253,7 +253,7 @@ public abstract class MemoryBoard extends Board { (Conf.showNeutralFactionsOnMap && relation.equals(Relation.NEUTRAL)) || (Conf.showEnemyFactionsOnMap && relation.equals(Relation.ENEMY)) || (Conf.showTrucesFactionsOnMap && relation.equals(Relation.TRUCE))) { - if (! fList.containsKey(factionHere.getTag())) { + if (!fList.containsKey(factionHere.getTag())) { fList.put(factionHere.getTag(), Conf.mapKeyChrs[Math.min(chrIdx++, Conf.mapKeyChrs.length - 1)]); } char tag = fList.get(factionHere.getTag()); @@ -293,7 +293,7 @@ public abstract class MemoryBoard extends Board { List ret = new ArrayList<>(); List show = SavageFactions.plugin.getConfig().getStringList("map"); - if (! faction.isNormal()) { + if (!faction.isNormal()) { String tag = faction.getTag(to); // send header and that's all String header = show.get(0); @@ -326,7 +326,7 @@ public abstract class MemoryBoard extends Board { 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(); diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java index d1d114c9..923ea2f7 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayer.java @@ -103,7 +103,7 @@ public abstract class MemoryFPlayer implements FPlayer { this.deaths = 0; this.mapHeight = Conf.mapHeight; - if (! Conf.newPlayerStartingFactionID.equals("0") && Factions.getInstance().isValidFactionId(Conf.newPlayerStartingFactionID)) { + if (!Conf.newPlayerStartingFactionID.equals("0") && Factions.getInstance().isValidFactionId(Conf.newPlayerStartingFactionID)) { this.factionId = Conf.newPlayerStartingFactionID; } } @@ -170,7 +170,7 @@ public abstract class MemoryFPlayer implements FPlayer { } public boolean hasFaction() { - return ! factionId.equals("0"); + return !factionId.equals("0"); } public void setMonitorJoins(boolean monitor) { @@ -269,7 +269,7 @@ public abstract class MemoryFPlayer implements FPlayer { } public ChatMode getChatMode() { - if (this.factionId.equals("0") || ! Conf.factionOnlyChat) { + if (this.factionId.equals("0") || !Conf.factionOnlyChat) { this.chatMode = ChatMode.PUBLIC; } return chatMode; @@ -353,7 +353,7 @@ public abstract class MemoryFPlayer implements FPlayer { // Base: public boolean hasLoginPvpDisabled() { - if (! loginPvpDisabled) { + if (!loginPvpDisabled) { return false; } if (this.lastLoginTime + (Conf.noPVPDamageToOthersForXSecondsAfterLogin * 1000) < System.currentTimeMillis()) { @@ -542,7 +542,7 @@ public abstract class MemoryFPlayer implements FPlayer { public void updatePower() { if (this.isOffline()) { losePowerFromBeingOffline(); - if (! Conf.powerRegenOffline) { + if (!Conf.powerRegenOffline) { return; } } else if (hasFaction() && getFaction().isPowerFrozen()) { @@ -630,7 +630,7 @@ public abstract class MemoryFPlayer implements FPlayer { * @return true if should show, otherwise false. */ public boolean showInfoBoard(Faction toShow) { - return showScoreboard && ! toShow.isWarZone() && ! toShow.isWilderness() && ! toShow.isSafeZone() && SavageFactions.plugin.getConfig().contains("scoreboard.finfo") && SavageFactions.plugin.getConfig().getBoolean("scoreboard.finfo-enabled", false) && FScoreboard.get(this) != null; + return showScoreboard && !toShow.isWarZone() && !toShow.isWilderness() && !toShow.isSafeZone() && SavageFactions.plugin.getConfig().contains("scoreboard.finfo") && SavageFactions.plugin.getConfig().getBoolean("scoreboard.finfo-enabled", false) && FScoreboard.get(this) != null; } @Override @@ -645,7 +645,7 @@ public abstract class MemoryFPlayer implements FPlayer { public void leave(boolean makePay) { Faction myFaction = this.getFaction(); - makePay = makePay && Econ.shouldBeUsed() && ! this.isAdminBypassing(); + makePay = makePay && Econ.shouldBeUsed() && !this.isAdminBypassing(); if (myFaction == null) { resetFactionData(); @@ -654,18 +654,18 @@ public abstract class MemoryFPlayer implements FPlayer { boolean perm = myFaction.isPermanent(); - if (! perm && this.getRole() == Role.LEADER && myFaction.getFPlayers().size() > 1) { + if (!perm && this.getRole() == Role.LEADER && myFaction.getFPlayers().size() > 1) { msg(TL.LEAVE_PASSADMIN); return; } - if (! Conf.canLeaveWithNegativePower && this.getPower() < 0) { + if (!Conf.canLeaveWithNegativePower && this.getPower() < 0) { msg(TL.LEAVE_NEGATIVEPOWER); return; } // if economy is enabled and they're not on the bypass list, make sure they can pay - if (makePay && ! Econ.hasAtLeast(this, Conf.econCostLeave, TL.LEAVE_TOLEAVE.toString())) { + if (makePay && !Econ.hasAtLeast(this, Conf.econCostLeave, TL.LEAVE_TOLEAVE.toString())) { return; } @@ -676,7 +676,7 @@ public abstract class MemoryFPlayer implements FPlayer { } // then make 'em pay (if applicable) - if (makePay && ! Econ.modifyMoney(this, - Conf.econCostLeave, TL.LEAVE_TOLEAVE.toString(), TL.LEAVE_FORLEAVE.toString())) { + if (makePay && !Econ.modifyMoney(this, -Conf.econCostLeave, TL.LEAVE_TOLEAVE.toString(), TL.LEAVE_FORLEAVE.toString())) { return; } @@ -701,7 +701,7 @@ public abstract class MemoryFPlayer implements FPlayer { myFaction.removeAnnouncements(this); this.resetFactionData(); - if (myFaction.isNormal() && ! perm && myFaction.getFPlayers().isEmpty()) { + if (myFaction.isNormal() && !perm && myFaction.getFPlayers().isEmpty()) { // Remove this faction for (FPlayer fplayer : FPlayers.getInstance().getOnlinePlayers()) { fplayer.msg(TL.LEAVE_DISBANDED, myFaction.describeTo(fplayer, true)); @@ -715,7 +715,7 @@ public abstract class MemoryFPlayer implements FPlayer { } public boolean canClaimForFaction(Faction forFaction) { - return this.isAdminBypassing() || ! forFaction.isWilderness() && (forFaction == this.getFaction() && this.getRole().isAtLeast(Role.MODERATOR)) || (forFaction.isSafeZone() && Permission.MANAGE_SAFE_ZONE.has(getPlayer())) || (forFaction.isWarZone() && Permission.MANAGE_WAR_ZONE.has(getPlayer())); + return this.isAdminBypassing() || !forFaction.isWilderness() && (forFaction == this.getFaction() && this.getRole().isAtLeast(Role.MODERATOR)) || (forFaction.isSafeZone() && Permission.MANAGE_SAFE_ZONE.has(getPlayer())) || (forFaction.isWarZone() && Permission.MANAGE_WAR_ZONE.has(getPlayer())); } public boolean canClaimForFactionAtLocation(Faction forFaction, Location location, boolean notifyFailure) { @@ -763,7 +763,7 @@ public abstract class MemoryFPlayer implements FPlayer { error = SavageFactions.plugin.txt.parse(TL.CLAIM_LIMIT.toString()); } else if (currentFaction.getRelationTo(forFaction) == Relation.ALLY) { error = SavageFactions.plugin.txt.parse(TL.CLAIM_ALLY.toString()); - } else if (Conf.claimsMustBeConnected && ! this.isAdminBypassing() && myFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && ! Board.getInstance().isConnectedLocation(flocation, myFaction) && (! Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction || ! currentFaction.isNormal())) { + } else if (Conf.claimsMustBeConnected && !this.isAdminBypassing() && myFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !Board.getInstance().isConnectedLocation(flocation, myFaction) && (!Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction || !currentFaction.isNormal())) { if (Conf.claimsCanBeUnconnectedIfOwnedByOtherFaction) { error = SavageFactions.plugin.txt.parse(TL.CLAIM_CONTIGIOUS.toString()); } else { @@ -782,13 +782,13 @@ public abstract class MemoryFPlayer implements FPlayer { error = SavageFactions.plugin.txt.parse(TL.CLAIM_PEACEFUL.toString(), currentFaction.getTag(this)); } else if (currentFaction.isPeaceful()) { error = SavageFactions.plugin.txt.parse(TL.CLAIM_PEACEFULTARGET.toString(), currentFaction.getTag(this)); - } else if (! currentFaction.hasLandInflation()) { + } else if (!currentFaction.hasLandInflation()) { // TODO more messages WARN current faction most importantly error = SavageFactions.plugin.txt.parse(TL.CLAIM_THISISSPARTA.toString(), currentFaction.getTag(this)); - } else if (currentFaction.hasLandInflation() && ! SavageFactions.plugin.getConfig().getBoolean("hcf.allow-overclaim", true)) { + } else if (currentFaction.hasLandInflation() && !SavageFactions.plugin.getConfig().getBoolean("hcf.allow-overclaim", true)) { // deny over claim when it normally would be allowed. error = SavageFactions.plugin.txt.parse(TL.CLAIM_OVERCLAIM_DISABLED.toString()); - } else if (! Board.getInstance().isBorderLocation(flocation)) { + } else if (!Board.getInstance().isBorderLocation(flocation)) { error = SavageFactions.plugin.txt.parse(TL.CLAIM_BORDER.toString()); } } @@ -831,7 +831,7 @@ public abstract class MemoryFPlayer implements FPlayer { } public boolean isOffline() { - return ! isOnline(); + return !isOnline(); } public boolean isFlying() { @@ -849,9 +849,9 @@ public abstract class MemoryFPlayer implements FPlayer { player.setFlying(fly); } - if (! damage) { + if (!damage) { msg(TL.COMMAND_FLY_CHANGE, fly ? "enabled" : "disabled"); - if (! fly) { + if (!fly) { sendMessage(TL.COMMAND_FLY_COOLDOWN.toString().replace("{amount}", SavageFactions.plugin.getConfig().getInt("fly-falldamage-cooldown", 3) + "")); } @@ -860,7 +860,7 @@ public abstract class MemoryFPlayer implements FPlayer { } // If leaving fly mode, don't let them take fall damage for x seconds. - if (! fly) { + if (!fly) { int cooldown = SavageFactions.plugin.getConfig().getInt("fly-falldamage-cooldown", 3); CmdFly.flyMap.remove(player.getName()); @@ -953,7 +953,7 @@ public abstract class MemoryFPlayer implements FPlayer { public void sendFancyMessage(FancyMessage message) { Player player = getPlayer(); - if (player == null || ! player.isOnGround()) { + if (player == null || !player.isOnGround()) { return; } @@ -1053,7 +1053,7 @@ public abstract class MemoryFPlayer implements FPlayer { if (efplayer == null) { continue; } - if (efplayer != null && this.getRelationTo(efplayer).equals(Relation.ENEMY) && ! efplayer.isStealthEnabled()) { + if (efplayer != null && this.getRelationTo(efplayer).equals(Relation.ENEMY) && !efplayer.isStealthEnabled()) { setFlying(false); msg(TL.COMMAND_FLY_ENEMY_NEAR); Bukkit.getServer().getPluginManager().callEvent(new FPlayerStoppedFlying(this)); @@ -1125,21 +1125,21 @@ public abstract class MemoryFPlayer implements FPlayer { int ownedLand = forFaction.getLandRounded(); - if (! this.canClaimForFactionAtLocation(forFaction, flocation, notifyFailure)) { + if (!this.canClaimForFactionAtLocation(forFaction, flocation, notifyFailure)) { return false; } // if economy is enabled and they're not on the bypass list, make sure they can pay - boolean mustPay = Econ.shouldBeUsed() && ! this.isAdminBypassing() && ! forFaction.isSafeZone() && ! forFaction.isWarZone(); + boolean mustPay = Econ.shouldBeUsed() && !this.isAdminBypassing() && !forFaction.isSafeZone() && !forFaction.isWarZone(); double cost = 0.0; EconomyParticipator payee = null; if (mustPay) { cost = Econ.calculateClaimCost(ownedLand, currentFaction.isNormal()); - if (Conf.econClaimUnconnectedFee != 0.0 && forFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && ! Board.getInstance().isConnectedLocation(flocation, forFaction)) { + if (Conf.econClaimUnconnectedFee != 0.0 && forFaction.getLandRoundedInWorld(flocation.getWorldName()) > 0 && !Board.getInstance().isConnectedLocation(flocation, forFaction)) { cost += Conf.econClaimUnconnectedFee; } @@ -1149,7 +1149,7 @@ public abstract class MemoryFPlayer implements FPlayer { payee = this; } - if (! Econ.hasAtLeast(payee, cost, TL.CLAIM_TOCLAIM.toString())) { + if (!Econ.hasAtLeast(payee, cost, TL.CLAIM_TOCLAIM.toString())) { return false; } } @@ -1161,7 +1161,7 @@ public abstract class MemoryFPlayer implements FPlayer { } // then make 'em pay (if applicable) - if (mustPay && ! Econ.modifyMoney(payee, - cost, TL.CLAIM_TOCLAIM.toString(), TL.CLAIM_FORCLAIM.toString())) { + if (mustPay && !Econ.modifyMoney(payee, -cost, TL.CLAIM_TOCLAIM.toString(), TL.CLAIM_FORCLAIM.toString())) { return false; } diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayers.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayers.java index 8f1adeb3..b120e028 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayers.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFPlayers.java @@ -16,7 +16,7 @@ public abstract class MemoryFPlayers extends FPlayers { public void clean() { for (FPlayer fplayer : this.fPlayers.values()) { - if (! Factions.getInstance().isValidFactionId(fplayer.getFactionId())) { + if (!Factions.getInstance().isValidFactionId(fplayer.getFactionId())) { SavageFactions.plugin.log("Reset faction data (invalid faction:" + fplayer.getFactionId() + ") for player " + fplayer.getName()); fplayer.resetFactionData(false); } diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java index 9113eea0..bf937442 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFaction.java @@ -125,7 +125,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { } public void sendUnreadAnnouncements(FPlayer fPlayer) { - if (! announcements.containsKey(fPlayer.getId())) { + if (!announcements.containsKey(fPlayer.getId())) { return; } fPlayer.msg(TL.FACTIONS_ANNOUNCEMENT_TOP); @@ -262,7 +262,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { SavageFactions.plugin.log("The faction " + this.getTag() + " (" + this.getId() + ") was disbanded by " + (disbanderIsConsole ? "console command" : fdisbander.getName()) + "."); } - if (Econ.shouldBeUsed() && ! disbanderIsConsole) { + if (Econ.shouldBeUsed() && !disbanderIsConsole) { //Give all the faction's money to the disbander double amount = Econ.getBalance(this.getAccountId()); Econ.transferMoney(fdisbander, this, fdisbander, amount, false); @@ -435,11 +435,11 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { } public boolean noExplosionsInTerritory() { - return this.peaceful && ! peacefulExplosionsEnabled; + return this.peaceful && !peacefulExplosionsEnabled; } public boolean isPermanent() { - return permanent || ! this.isNormal(); + return permanent || !this.isNormal(); } public void setPermanent(boolean isPermanent) { @@ -512,7 +512,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { } public void confirmValidHome() { - if (! Conf.homesMustBeInClaimedTerritory || this.home == null || (this.home.getLocation() != null && Board.getInstance().getFactionAt(new FLocation(this.home.getLocation())) == this)) { + if (!Conf.homesMustBeInClaimedTerritory || this.home == null || (this.home.getLocation() != null && Board.getInstance().getFactionAt(new FLocation(this.home.getLocation())) == this)) { return; } @@ -524,7 +524,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { String aid = "faction-" + this.getId(); // We need to override the default money given to players. - if (! Econ.hasAccount(aid)) { + if (!Econ.hasAccount(aid)) { Econ.setBalance(aid, 0); } @@ -696,7 +696,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { // ------------------------------- public boolean isNormal() { - return ! (this.isWilderness() || this.isSafeZone() || this.isWarZone()); + return !(this.isWilderness() || this.isSafeZone() || this.isWarZone()); } public boolean isNone() { @@ -845,11 +845,11 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { } public boolean addFPlayer(FPlayer fplayer) { - return ! this.isPlayerFreeType() && fplayers.add(fplayer); + return !this.isPlayerFreeType() && fplayers.add(fplayer); } public boolean removeFPlayer(FPlayer fplayer) { - return ! this.isPlayerFreeType() && fplayers.remove(fplayer); + return !this.isPlayerFreeType() && fplayers.remove(fplayer); } public int getSize() { @@ -864,7 +864,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { public Set getFPlayersWhereOnline(boolean online) { Set ret = new HashSet<>(); - if (! this.isNormal()) { + if (!this.isNormal()) { return ret; } @@ -879,7 +879,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { public Set getFPlayersWhereOnline(boolean online, FPlayer viewer) { Set ret = new HashSet<>(); - if (! this.isNormal()) { + if (!this.isNormal()) { return ret; } @@ -895,7 +895,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { ret.add(viewed); // If we want offline, just add them. // Prob a better way to do this but idk. - } else if (! online) { + } else if (!online) { ret.add(viewed); } } @@ -905,7 +905,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { } public FPlayer getFPlayerAdmin() { - if (! this.isNormal()) { + if (!this.isNormal()) { return null; } @@ -919,7 +919,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { public ArrayList getFPlayersWhereRole(Role role) { ArrayList ret = new ArrayList<>(); - if (! this.isNormal()) { + if (!this.isNormal()) { return ret; } @@ -977,7 +977,7 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { // used when current leader is about to be removed from the faction; // promotes new leader, or disbands faction if no other members left public void promoteNewLeader() { - if (! this.isNormal()) { + if (!this.isNormal()) { return; } if (this.isPermanent() && Conf.permanentFactionsDisableLeaderPromotion) { @@ -1096,12 +1096,12 @@ public abstract class MemoryFaction implements Faction, EconomyParticipator { } public boolean doesLocationHaveOwnersSet(FLocation loc) { - if (claimOwnership.isEmpty() || ! claimOwnership.containsKey(loc)) { + if (claimOwnership.isEmpty() || !claimOwnership.containsKey(loc)) { return false; } Set ownerData = claimOwnership.get(loc); - return ownerData != null && ! ownerData.isEmpty(); + return ownerData != null && !ownerData.isEmpty(); } public boolean isPlayerInOwnerList(FPlayer player, FLocation loc) { diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFactions.java b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFactions.java index ac832f91..76d1caee 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFactions.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/MemoryFactions.java @@ -18,33 +18,33 @@ public abstract class MemoryFactions extends Factions { public void load() { // Make sure the default neutral faction exists - if (! factions.containsKey("0")) { + if (!factions.containsKey("0")) { Faction faction = generateFactionObject("0"); factions.put("0", faction); faction.setTag(TL.WILDERNESS.toString()); faction.setDescription(TL.WILDERNESS_DESCRIPTION.toString()); } else { Faction faction = factions.get("0"); - if (! faction.getTag().equalsIgnoreCase(TL.WILDERNESS.toString())) { + if (!faction.getTag().equalsIgnoreCase(TL.WILDERNESS.toString())) { faction.setTag(TL.WILDERNESS.toString()); } - if (! faction.getDescription().equalsIgnoreCase(TL.WILDERNESS_DESCRIPTION.toString())) { + if (!faction.getDescription().equalsIgnoreCase(TL.WILDERNESS_DESCRIPTION.toString())) { faction.setDescription(TL.WILDERNESS_DESCRIPTION.toString()); } } // Make sure the safe zone faction exists - if (! factions.containsKey("-1")) { + if (!factions.containsKey("-1")) { Faction faction = generateFactionObject("-1"); factions.put("-1", faction); faction.setTag(TL.SAFEZONE.toString()); faction.setDescription(TL.SAFEZONE_DESCRIPTION.toString()); } else { Faction faction = factions.get("-1"); - if (! faction.getTag().equalsIgnoreCase(TL.SAFEZONE.toString())) { + if (!faction.getTag().equalsIgnoreCase(TL.SAFEZONE.toString())) { faction.setTag(TL.SAFEZONE.toString()); } - if (! faction.getDescription().equalsIgnoreCase(TL.SAFEZONE_DESCRIPTION.toString())) { + if (!faction.getDescription().equalsIgnoreCase(TL.SAFEZONE_DESCRIPTION.toString())) { faction.setDescription(TL.SAFEZONE_DESCRIPTION.toString()); } // if SafeZone has old pre-1.6.0 name, rename it to remove troublesome " " @@ -54,17 +54,17 @@ public abstract class MemoryFactions extends Factions { } // Make sure the war zone faction exists - if (! factions.containsKey("-2")) { + if (!factions.containsKey("-2")) { Faction faction = generateFactionObject("-2"); factions.put("-2", faction); faction.setTag(TL.WARZONE.toString()); faction.setDescription(TL.WARZONE_DESCRIPTION.toString()); } else { Faction faction = factions.get("-2"); - if (! faction.getTag().equalsIgnoreCase(TL.WARZONE.toString())) { + if (!faction.getTag().equalsIgnoreCase(TL.WARZONE.toString())) { faction.setTag(TL.WARZONE.toString()); } - if (! faction.getDescription().equalsIgnoreCase(TL.WARZONE_DESCRIPTION.toString())) { + if (!faction.getDescription().equalsIgnoreCase(TL.WARZONE_DESCRIPTION.toString())) { faction.setDescription(TL.WARZONE_DESCRIPTION.toString()); } // if WarZone has old pre-1.6.0 name, rename it to remove troublesome " " @@ -101,7 +101,7 @@ public abstract class MemoryFactions extends Factions { if (candidate.length() < minlength) { continue; } - if (! candidate.toLowerCase().startsWith(start)) { + if (!candidate.toLowerCase().startsWith(start)) { continue; } diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/SaveTask.java b/src/main/java/com/massivecraft/factions/zcore/persist/SaveTask.java index 4ed33d05..232c9d21 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/SaveTask.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/SaveTask.java @@ -16,7 +16,7 @@ public class SaveTask implements Runnable { } public void run() { - if (! p.getAutoSave() || running) { + if (!p.getAutoSave() || running) { return; } running = true; diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/json/FactionsJSON.java b/src/main/java/com/massivecraft/factions/zcore/persist/json/FactionsJSON.java index de25f9c0..2ee4d2da 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/json/FactionsJSON.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/json/FactionsJSON.java @@ -11,13 +11,13 @@ import java.util.logging.Logger; public class FactionsJSON { public static void convertTo() { - if (! (Factions.getInstance() instanceof MemoryFactions)) { + if (!(Factions.getInstance() instanceof MemoryFactions)) { return; } - if (! (FPlayers.getInstance() instanceof MemoryFPlayers)) { + if (!(FPlayers.getInstance() instanceof MemoryFPlayers)) { return; } - if (! (Board.getInstance() instanceof MemoryBoard)) { + if (!(Board.getInstance() instanceof MemoryBoard)) { return; } new BukkitRunnable() { diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONBoard.java b/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONBoard.java index 94c06f96..d2b447ac 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONBoard.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONBoard.java @@ -32,7 +32,7 @@ public class JSONBoard extends MemoryBoard { worldName = entry.getKey().getWorldName(); coords = entry.getKey().getCoordString(); id = entry.getValue(); - if (! worldCoordIds.containsKey(worldName)) { + if (!worldCoordIds.containsKey(worldName)) { worldCoordIds.put(worldName, new TreeMap()); } @@ -73,7 +73,7 @@ public class JSONBoard extends MemoryBoard { public boolean load() { SavageFactions.plugin.log("Loading board from disk"); - if (! file.exists()) { + if (!file.exists()) { SavageFactions.plugin.log("No board to load from disk. Creating new file."); forceSave(); return true; diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFPlayers.java b/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFPlayers.java index 199301e3..c6c843ad 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFPlayers.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFPlayers.java @@ -79,7 +79,7 @@ public class JSONFPlayers extends MemoryFPlayers { } private Map loadCore() { - if (! this.file.exists()) { + if (!this.file.exists()) { return new HashMap<>(); } @@ -96,7 +96,7 @@ public class JSONFPlayers extends MemoryFPlayers { String key = entry.getKey(); entry.getValue().setId(key); if (doesKeyNeedMigration(key)) { - if (! isKeyInvalid(key)) { + if (!isKeyInvalid(key)) { list.add(key); } else { invalidList.add(key); @@ -126,7 +126,7 @@ public class JSONFPlayers extends MemoryFPlayers { Map response = fetcher.call(); for (String s : list) { // Are we missing any responses? - if (! response.containsKey(s)) { + if (!response.containsKey(s)) { // They don't have a UUID so they should just be removed invalidList.add(s); } @@ -168,7 +168,7 @@ public class JSONFPlayers extends MemoryFPlayers { } private boolean doesKeyNeedMigration(String key) { - if (! key.matches("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")) { + if (!key.matches("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")) { // Not a valid UUID.. // Valid playername, we'll mark this as one for conversion // to UUID @@ -178,7 +178,7 @@ public class JSONFPlayers extends MemoryFPlayers { } private boolean isKeyInvalid(String key) { - return ! key.matches("[a-zA-Z0-9_]{2,16}"); + return !key.matches("[a-zA-Z0-9_]{2,16}"); } @Override diff --git a/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFactions.java b/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFactions.java index 3ad80eb5..89ecac94 100644 --- a/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFactions.java +++ b/src/main/java/com/massivecraft/factions/zcore/persist/json/JSONFactions.java @@ -72,7 +72,7 @@ public class JSONFactions extends MemoryFactions { } private Map loadCore() { - if (! this.file.exists()) { + if (!this.file.exists()) { return new HashMap<>(); } @@ -180,7 +180,7 @@ public class JSONFactions extends MemoryFactions { private Set whichKeysNeedMigration(Set keys) { HashSet list = new HashSet<>(); for (String value : keys) { - if (! value.matches("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")) { + if (!value.matches("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")) { // Not a valid UUID.. if (value.matches("[a-zA-Z0-9_]{2,16}")) { // Valid playername, we'll mark this as one for conversion @@ -197,14 +197,14 @@ public class JSONFactions extends MemoryFactions { // -------------------------------------------- // public String getNextId() { - while (! isIdFree(this.nextId)) { + while (!isIdFree(this.nextId)) { this.nextId += 1; } return Integer.toString(this.nextId); } public boolean isIdFree(String id) { - return ! this.factions.containsKey(id); + return !this.factions.containsKey(id); } public boolean isIdFree(int id) { diff --git a/src/main/java/com/massivecraft/factions/zcore/util/PermUtil.java b/src/main/java/com/massivecraft/factions/zcore/util/PermUtil.java index fb68659d..6f243299 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/PermUtil.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/PermUtil.java @@ -51,7 +51,7 @@ public class PermUtil { return false; } - if (! (me instanceof Player)) { + if (!(me instanceof Player)) { return me.hasPermission(perm); } diff --git a/src/main/java/com/massivecraft/factions/zcore/util/Persist.java b/src/main/java/com/massivecraft/factions/zcore/util/Persist.java index 9b597db0..7a56bcaa 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/Persist.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/Persist.java @@ -64,7 +64,7 @@ public class Persist { } public T loadOrSaveDefault(T def, Class clazz, File file) { - if (! file.exists()) { + if (!file.exists()) { p.log("Creating default: " + file); this.save(def, file); return def; diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TL.java b/src/main/java/com/massivecraft/factions/zcore/util/TL.java index 2e1c8d0c..d186d280 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TL.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TL.java @@ -531,8 +531,8 @@ public enum TL { COMMAND_POWERBOOST_BOOSTLOG("%1$s has set the power bonus/penalty for %2$s to %3$d."), COMMAND_POWERBOOST_DESCRIPTION("Apply permanent power bonus/penalty to specified player or faction"), - COMMAND_RELATIONS_ALLTHENOPE("&c&l[!]&7 &cNope! You can't."), - COMMAND_RELATIONS_MORENOPE("&c&l[!]&7 &cNope! &7You can't declare a relation to &cyourself"), + COMMAND_RELATIONS_ALLTHENOPE("&c&l[!]&7 &cNope!You can't."), + COMMAND_RELATIONS_MORENOPE("&c&l[!]&7 &cNope!&7You can't declare a relation to &cyourself"), COMMAND_RELATIONS_ALREADYINRELATIONSHIP("&c&l[!]&7 You &calready&7 have that relation wish set with&c %1$s."), COMMAND_RELATIONS_TOMARRY("to change a relation wish"), COMMAND_RELATIONS_FORMARRY("for changing a relation wish"), @@ -774,7 +774,7 @@ public enum TL { CLAIM_MEMBERS("Factions must have at least %s members to claim land."), CLAIM_SAFEZONE("You can not claim a Safe Zone."), CLAIM_WARZONE("You can not claim a War Zone."), - CLAIM_POWER("You can't claim more land! You need more power!"), + CLAIM_POWER("You can't claim more land!You need more power!"), CLAIM_LIMIT("Limit reached. You can't claim more land!"), CLAIM_ALLY("You can't claim the land of your allies."), CLAIM_CONTIGIOUS("You can only claim additional land which is connected to your first claim or controlled by another faction!"), diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TagReplacer.java b/src/main/java/com/massivecraft/factions/zcore/util/TagReplacer.java index 38d5a45d..cd8ea89c 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TagReplacer.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TagReplacer.java @@ -164,7 +164,7 @@ public enum TagReplacer { case PLAYER_NAME: return fp.getName(); case FACTION: - return ! fac.isWilderness() ? fac.getTag(fp) : TL.GENERIC_FACTIONLESS.toString(); + return !fac.isWilderness() ? fac.getTag(fp) : TL.GENERIC_FACTIONLESS.toString(); case LAST_SEEN: String humanized = DurationFormatUtils.formatDurationWords(System.currentTimeMillis() - fp.getLastLoginTime(), true, true) + TL.COMMAND_STATUS_AGOSUFFIX; return fp.isOnline() ? ChatColor.GREEN + TL.COMMAND_STATUS_ONLINE.toString() : (System.currentTimeMillis() - fp.getLastLoginTime() < 432000000 ? ChatColor.YELLOW + humanized : ChatColor.RED + humanized); diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TagUtil.java b/src/main/java/com/massivecraft/factions/zcore/util/TagUtil.java index d103d734..531a2f8e 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TagUtil.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TagUtil.java @@ -200,7 +200,7 @@ public class TagUtil { FancyMessage currentOnline = SavageFactions.plugin.txt.parseFancy(prefix); boolean firstOnline = true; for (FPlayer p : MiscUtil.rankOrder(target.getFPlayersWhereOnline(true, fme))) { - if (fme.getPlayer() != null && ! fme.getPlayer().canSee(p.getPlayer())) { + if (fme.getPlayer() != null && !fme.getPlayer().canSee(p.getPlayer())) { continue; // skip } String name = p.getNameAndTitle(); @@ -220,7 +220,7 @@ public class TagUtil { for (FPlayer p : MiscUtil.rankOrder(target.getFPlayers())) { String name = p.getNameAndTitle(); // Also make sure to add players that are online BUT can't be seen. - if (! p.isOnline() || (fme.getPlayer() != null && p.isOnline() && ! fme.getPlayer().canSee(p.getPlayer()))) { + if (!p.isOnline() || (fme.getPlayer() != null && p.isOnline() && !fme.getPlayer().canSee(p.getPlayer()))) { currentOffline.then(firstOffline ? name : ", " + name); currentOffline.tooltip(tipPlayer(p)).color(fme.getColorTo(p)); firstOffline = false; diff --git a/src/main/java/com/massivecraft/factions/zcore/util/TextUtil.java b/src/main/java/com/massivecraft/factions/zcore/util/TextUtil.java index fbf11cf2..0b6f569b 100644 --- a/src/main/java/com/massivecraft/factions/zcore/util/TextUtil.java +++ b/src/main/java/com/massivecraft/factions/zcore/util/TextUtil.java @@ -159,7 +159,7 @@ public class TextUtil { if (candidate.length() < minlength) { continue; } - if (! candidate.toLowerCase().startsWith(start)) { + if (!candidate.toLowerCase().startsWith(start)) { continue; }