Merge pull request #45 from dkim19375/master

Use PaperLib's isChunkGenerated to prevent loading chunks already generated
This commit is contained in:
PryPurity 2022-05-05 06:55:43 -05:00 committed by GitHub
commit cff0b659c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package com.wimbli.WorldBorder;
import io.papermc.lib.PaperLib;
import org.bukkit.World;
import org.bukkit.entity.Player;
@ -103,7 +104,10 @@ public class WorldFileData {
CoordXZ region = new CoordXZ(CoordXZ.chunkToRegion(x), CoordXZ.chunkToRegion(z));
List<Boolean> regionChunks = this.getRegionData(region);
// Bukkit.getLogger().info("x: "+x+" z: "+z+" offset: "+coordToRegionOffset(x, z));
return regionChunks.get(coordToRegionOffset(x, z));
if (regionChunks.get(coordToRegionOffset(x, z))) {
return true;
}
return PaperLib.isChunkGenerated(world, x, z);
}
// Find out if the chunk at the given coordinates has been fully generated.