Paper/Spigot-Server-Patches/0054-Don-t-create-a-chunk-just-to-unload-it.patch

28 lines
1.1 KiB
Diff
Raw Normal View History

2016-03-31 02:50:23 +02:00
From 4523f4c601e523971012b1a5b50c40704f74fdc6 Mon Sep 17 00:00:00 2001
2015-11-16 02:46:34 +01:00
From: Aikar <aikar@aikar.co>
2016-03-01 00:09:49 +01:00
Date: Wed, 2 Mar 2016 23:55:20 -0600
2015-11-16 02:46:34 +01:00
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 83e3003..3f2d83a 100644
2015-11-16 02:46:34 +01:00
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
2016-03-12 03:13:31 +01:00
@@ -205,7 +205,12 @@ public class CraftWorld implements World {
2015-11-16 02:46:34 +01:00
return false;
}
2016-03-01 00:09:49 +01:00
- net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkAt(x, z);
+ // Paper start - Don't create a chunk just to unload it
+ net.minecraft.server.Chunk chunk = world.getChunkProviderServer().getChunkIfLoaded(x, z);
2015-11-16 02:46:34 +01:00
+ if (chunk == null) {
+ return false;
+ }
2016-03-01 00:09:49 +01:00
+ // Paper end
2015-11-16 02:46:34 +01:00
if (chunk.mustSave) { // If chunk had previously been queued to save, must do save to avoid loss of that data
save = true;
}
--
2016-03-31 02:50:23 +02:00
2.8.0
2015-11-16 02:46:34 +01:00