Null check missing world

This commit is contained in:
fullwall 2021-10-30 15:53:49 +08:00
parent 840f32469b
commit 57adea419a

View File

@ -5,6 +5,7 @@ import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Location;
import org.bukkit.World;
public class ChunkCoord {
public final UUID worldUUID;
@ -45,7 +46,8 @@ public class ChunkCoord {
}
public Chunk getChunk() {
return Bukkit.getWorld(worldUUID).getChunkAt(x, z);
World world = Bukkit.getWorld(worldUUID);
return world != null ? world.getChunkAt(x, z) : null;
}
@Override