Reformatted Code

This commit is contained in:
ProSavage
2018-11-06 23:38:43 -06:00
parent cd09e77b42
commit b1b9bd1b73
156 changed files with 1589 additions and 1593 deletions

View File

@@ -44,6 +44,7 @@ public class EngineDynmap {
public DynmapAPI dynmapApi;
public MarkerAPI markerApi;
public MarkerSet markerset;
private EngineDynmap() {
}
@@ -103,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;
@@ -117,7 +118,7 @@ public class EngineDynmap {
}
// Shedule non thread safe sync at the end!
Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
Bukkit.getScheduler().scheduleSyncRepeatingTask(SavageFactions.plugin, new Runnable() {
@Override
public void run() {
@@ -125,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;
}
@@ -170,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;
}
@@ -322,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;
}
@@ -406,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
@@ -419,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
@@ -432,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
@@ -445,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
@@ -570,7 +571,7 @@ public class EngineDynmap {
// Thread Safe / Asynchronous: Yes
public Map<String, Set<String>> createPlayersets() {
if (!Conf.dynmapVisibilityByFaction) {
if (! Conf.dynmapVisibilityByFaction) {
return null;
}
@@ -599,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;
}
@@ -669,7 +670,7 @@ public class EngineDynmap {
FPlayer playersLeaderObject = faction.getFPlayerAdmin();
String playersLeader = getHtmlPlayerName(playersLeaderObject);
ArrayList<FPlayer> playersAdminsList = faction.getFPlayersWhereRole(Role.LEADER);
ArrayList<FPlayer> playersAdminsList = faction.getFPlayersWhereRole(Role.LEADER);
String playersAdminsCount = String.valueOf(playersAdminsList.size());
String playersAdmins = getHtmlPlayerString(playersAdminsList);
@@ -713,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
@@ -743,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];