mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-29 11:23:52 -07:00
Merge branch 'master' into pre/1.13
This commit is contained in:
42
Spigot-Server-Patches/isChunkGenerated-API.patch
Normal file
42
Spigot-Server-Patches/isChunkGenerated-API.patch
Normal file
@@ -0,0 +1,42 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
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
|
||||
index 0e0c7b1ab..cb4a2a0b9 100644
|
||||
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
||||
@@ -0,0 +0,0 @@ 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 aa0b1f5fa..9a78fa687 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -0,0 +0,0 @@ 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;
|
||||
}
|
||||
--
|
Reference in New Issue
Block a user