Code Enhancements...

This commit is contained in:
Driftay
2019-07-03 23:24:32 -04:00
parent 2937e05fda
commit 9d40fec03b
23 changed files with 55 additions and 98 deletions

View File

@@ -40,9 +40,7 @@ public class MapFLocToStringSetTypeAdapter implements JsonDeserializer<Map<FLoca
nameSet = new HashSet<>();
iter = entry2.getValue().getAsJsonArray().iterator();
while (iter.hasNext()) {
nameSet.add(iter.next().getAsString());
}
while (iter.hasNext()) nameSet.add(iter.next().getAsString());
locationMap.put(new FLocation(worldName, x, z), nameSet);
}

View File

@@ -16,11 +16,7 @@ public class VisualizeUtil {
}
public static Set<Location> getPlayerLocations(UUID uuid) {
Set<Location> ret = playerLocations.get(uuid);
if (ret == null) {
ret = new HashSet<>();
playerLocations.put(uuid, ret);
}
Set<Location> ret = playerLocations.computeIfAbsent(uuid, k -> new HashSet<>());
return ret;
}