Avoids loading chunks when preparing the island level calc

https://github.com/BentoBoxWorld/Level/issues/68
This commit is contained in:
tastybento 2019-07-25 21:04:36 -07:00
parent 4fe46bd1a9
commit da83f66f8c

View File

@ -204,8 +204,7 @@ public class CalcIslandLevel {
Set<Pair<Integer, Integer>> chunkSnapshot = new HashSet<>(); Set<Pair<Integer, Integer>> chunkSnapshot = new HashSet<>();
for (int x = island.getMinProtectedX(); x < (island.getMinProtectedX() + island.getProtectionRange() * 2 + 16); x += 16) { for (int x = island.getMinProtectedX(); x < (island.getMinProtectedX() + island.getProtectionRange() * 2 + 16); x += 16) {
for (int z = island.getMinProtectedZ(); z < (island.getMinProtectedZ() + island.getProtectionRange() * 2 + 16); z += 16) { for (int z = island.getMinProtectedZ(); z < (island.getMinProtectedZ() + island.getProtectionRange() * 2 + 16); z += 16) {
Pair<Integer, Integer> pair = new Pair<>(world.getBlockAt(x, 0, z).getChunk().getX(), world.getBlockAt(x, 0, z).getChunk().getZ()); chunkSnapshot.add(new Pair<>(x >> 4, z >> 4));
chunkSnapshot.add(pair);
} }
} }
return chunkSnapshot; return chunkSnapshot;