mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Don't create a chunk just to unload it
This commit is contained in:
parent
68c983d7cd
commit
c0fa6b8d12
1 changed files with 25 additions and 0 deletions
|
@ -0,0 +1,25 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Sun, 15 Nov 2015 19:46:07 -0600
|
||||
Subject: [PATCH] Don't create a chunk just to unload it
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 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 false;
|
||||
}
|
||||
|
||||
- net.minecraft.server.Chunk chunk = world.chunkProviderServer.getOrCreateChunk(x, z);
|
||||
+ net.minecraft.server.Chunk chunk = world.chunkProviderServer.getChunkIfLoaded(x, z);
|
||||
+ // PaperSpigot start - Don't create a chunk just to unload it
|
||||
+ if (chunk == null) {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // PaperSpigot end
|
||||
if (chunk.mustSave) { // If chunk had previously been queued to save, must do save to avoid loss of that data
|
||||
save = true;
|
||||
}
|
||||
--
|
Loading…
Reference in a new issue