Fixed spacing in code around ! operator.

This commit is contained in:
ProSavage
2018-11-07 10:14:42 -06:00
parent 7f1785e152
commit 84f1d354eb
119 changed files with 619 additions and 619 deletions

View File

@@ -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("<h>%s<i> lacks permission to control <h>%s's<i> 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("<h>%s<b> can't afford to transfer <h>%s<b> to %s<b>.", 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("<h>%s<i> can't afford <h>%s<i> %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("<h>%s<i> gained <h>%s<i> %s.", You, moneyString(delta), forDoingThis);
}
return true;
} else {
// transfer to account failed
if (forDoingThis != null && ! forDoingThis.isEmpty()) {
if (forDoingThis != null && !forDoingThis.isEmpty()) {
ep.msg("<h>%s<i> would have gained <h>%s<i> %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("<h>%s<i> lost <h>%s<i> %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("<h>%s<i> can't afford <h>%s<i> %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;
}

View File

@@ -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;
}

View File

@@ -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();
}

View File

@@ -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<String, TempAreaMarker> areas = createAreas();
final Map<String, Set<String>> 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<String, TempAreaMarker> 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<String, Set<String>> 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<String> visible = Conf.dynmapVisibleFactions;
Set<String> 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<int[]> 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];

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -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);
}