Fixed code smells

This commit is contained in:
Florian CUNY 2019-01-20 09:46:00 +01:00
parent 5cbbbabcbf
commit 113335e60a
2 changed files with 3 additions and 6 deletions

View File

@ -58,12 +58,10 @@ public class CleanSuperFlatListener extends FlagListener {
task = Bukkit.getScheduler().runTaskTimer(plugin, () -> { task = Bukkit.getScheduler().runTaskTimer(plugin, () -> {
if (!chunkQ.isEmpty()) { if (!chunkQ.isEmpty()) {
Pair<Integer, Integer> chunkXZ = chunkQ.poll(); Pair<Integer, Integer> chunkXZ = chunkQ.poll();
world.regenerateChunk(chunkXZ.x, chunkXZ.z); world.regenerateChunk(chunkXZ.x, chunkXZ.z); // NOSONAR - the deprecation doesn't the cause any issues to us
plugin.logWarning(chunkQ.size() + " Regenerating superflat chunk " + world.getName() + " " + chunkXZ.x + ", " + chunkXZ.z); plugin.logWarning(chunkQ.size() + " Regenerating superflat chunk " + world.getName() + " " + chunkXZ.x + ", " + chunkXZ.z);
} }
}, 0L, 1L); }, 0L, 1L);
} }
} }
} }

View File

@ -206,8 +206,7 @@ public class IslandWorldManager {
/** /**
* Get the overworld based on friendly name. * Get the overworld based on friendly name.
* *
* @param friendlyName * @param friendlyName friendly name of world
* - friendly name of world
* @return overworld, or null if it does not exist * @return overworld, or null if it does not exist
* @since 1.1 * @since 1.1
*/ */
@ -215,7 +214,7 @@ public class IslandWorldManager {
public World getOverWorld(@NonNull String friendlyName) { public World getOverWorld(@NonNull String friendlyName) {
return gameModes.values().stream().distinct() return gameModes.values().stream().distinct()
.filter(gm -> gm.getWorldSettings().getFriendlyName().equalsIgnoreCase(friendlyName)) .filter(gm -> gm.getWorldSettings().getFriendlyName().equalsIgnoreCase(friendlyName))
.map(gm -> gm.getOverWorld()).findFirst().orElse(null); .map(GameModeAddon::getOverWorld).findFirst().orElse(null);
} }
/** /**