mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-02 17:32:03 +01:00
f100b5d921
A recent commit has been made that caused patches to be out of order, rebuilding
39 lines
No EOL
1.7 KiB
Diff
39 lines
No EOL
1.7 KiB
Diff
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 0ca071b879..96d49b469a 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 {
|
|
private long lastQueuedSaves = 0L; // Paper
|
|
private long lastProcessedSaves = 0L; // Paper
|
|
private long lastSaveStatPrinted = System.currentTimeMillis();
|
|
+ public boolean isChunkGenerated(int x, int z) {
|
|
+ return this.chunks.containsKey(ChunkCoordIntPair.asLong(x, z)) || ((ChunkRegionLoader) this.chunkLoader).chunkExists(x, z);
|
|
+ }
|
|
// Paper end
|
|
public final Long2ObjectMap<Chunk> chunks = Long2ObjectMaps.synchronize(new ChunkMap(8192));
|
|
private Chunk lastChunk;
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
index ba2e768594..1ccf2a7609 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;
|
|
}
|
|
--
|