2018-08-26 02:41:32 +00:00
|
|
|
From f503290e3d8ddca727fd3adab58eaf77e759bf62 Mon Sep 17 00:00:00 2001
|
2018-08-23 01:13:03 +00:00
|
|
|
From: cswhite2000 <18whitechristop@gmail.com>
|
|
|
|
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
|
2018-08-24 15:57:11 +00:00
|
|
|
index 0e0c7b1ab..cb4a2a0b9 100644
|
2018-08-23 01:13:03 +00:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
2018-08-24 15:57:11 +00:00
|
|
|
@@ -74,6 +74,12 @@ public class ChunkProviderServer implements IChunkProvider {
|
2018-08-23 01:13:03 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
+ // 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
|
2018-08-24 15:57:11 +00:00
|
|
|
index aa0b1f5fa..9a78fa687 100644
|
2018-08-23 01:13:03 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2018-08-24 15:57:11 +00:00
|
|
|
@@ -612,6 +612,12 @@ public class CraftWorld implements World {
|
2018-08-23 01:13:03 +00:00
|
|
|
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
|
|
|
|
|