From 60eb216b2bb090705a553a725581817ff435eb7f Mon Sep 17 00:00:00 2001 From: Fabrizio La Rosa Date: Mon, 22 Jun 2020 05:48:58 +0200 Subject: [PATCH] Optimized Island async scan --- .../com/songoda/skyblock/levelling/rework/IslandScan.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/songoda/skyblock/levelling/rework/IslandScan.java b/src/main/java/com/songoda/skyblock/levelling/rework/IslandScan.java index 8d21eeb7..a961c942 100644 --- a/src/main/java/com/songoda/skyblock/levelling/rework/IslandScan.java +++ b/src/main/java/com/songoda/skyblock/levelling/rework/IslandScan.java @@ -186,11 +186,11 @@ public final class IslandScan extends BukkitRunnable { chunks.getChunksToScan(island, world, paper); if(paper){ - List positions = new LinkedList<>(); + List positions = new LinkedList<>(); for(CompletableFuture chunk : chunks.asyncPositions){ - positions.add(chunk.join()); - snapshots.put(skyblock.getWorldManager().getWorld(world), positions.stream().map(org.bukkit.Chunk::getChunkSnapshot).collect(Collectors.toList())); + positions.add(chunk.join().getChunkSnapshot()); } + snapshots.put(skyblock.getWorldManager().getWorld(world), positions); } else { snapshots.put(skyblock.getWorldManager().getWorld(world), chunks.syncPositions.stream().map(org.bukkit.Chunk::getChunkSnapshot).collect(Collectors.toList())); }