diff options
author | Christopher White <[email protected]> | 2018-08-22 18:13:03 -0700 |
---|---|---|
committer | Daniel Ennis <[email protected]> | 2018-08-22 21:13:03 -0400 |
commit | 6c32ee4a5ccc139401593fd76cd587f71690cd67 (patch) | |
tree | 3e842bdc67d9715cc6d06d01c796512f31aad69e /Spigot-Server-Patches | |
parent | 1218b4aae6724d4a825dcf1ace8afbd29b0a8493 (diff) | |
download | Paper-6c32ee4a5ccc139401593fd76cd587f71690cd67.tar.gz Paper-6c32ee4a5ccc139401593fd76cd587f71690cd67.zip |
Add isChunkGenerated API (#1363)
Resolves #1329
Diffstat (limited to 'Spigot-Server-Patches')
-rw-r--r-- | Spigot-Server-Patches/0356-isChunkGenerated-API.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0356-isChunkGenerated-API.patch b/Spigot-Server-Patches/0356-isChunkGenerated-API.patch new file mode 100644 index 0000000000..2fd75c25a3 --- /dev/null +++ b/Spigot-Server-Patches/0356-isChunkGenerated-API.patch @@ -0,0 +1,44 @@ +From 2f16be2d68ab57aac9b4568aa113b15f6b0d6af2 Mon Sep 17 00:00:00 2001 +From: cswhite2000 <[email protected]> +Date: Tue, 21 Aug 2018 19:44:10 -0700 +Subject: [PATCH] isChunkGenerated API + +Resolves #1329 + +diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java +index 0eba3df5..ad548590 100644 +--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java ++++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java +@@ -85,6 +85,12 @@ public class ChunkProviderServer implements IChunkProvider { + + } + ++ // Paper start ++ public boolean isChunkGenerated(int x, int z) { ++ return this.chunks.containsKey(ChunkCoordIntPair.asLong(x, z)) || this.chunkLoader.chunkExists(x, z); ++ } ++ // Paper end ++ + @Nullable + public Chunk getLoadedChunkAt(int i, int j) { + long k = ChunkCoordIntPair.a(i, j); +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +index 567e9acb..afb141c6 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +@@ -630,6 +630,12 @@ public class CraftWorld implements World { + return getChunkAt(location.getBlockX() >> 4, location.getBlockZ() >> 4); + } + ++ // Paper start ++ public boolean isChunkGenerated(int x, int z) { ++ return this.getHandle().getChunkProviderServer().isChunkGenerated(x, z); ++ } ++ // Paper end ++ + public ChunkGenerator getGenerator() { + return generator; + } +-- +2.18.0 + |