2016-05-13 07:34:37 +02:00
|
|
|
From 9df0a1beae6afe76606eb96db443a735faf77eba Mon Sep 17 00:00:00 2001
|
2016-05-12 07:55:53 +02:00
|
|
|
From: Aikar <aikar@aikar.co>
|
|
|
|
Date: Thu, 12 May 2016 01:55:17 -0400
|
2016-05-13 07:34:37 +02:00
|
|
|
Subject: [PATCH] Do not mark chunks as active for neighbor updates
|
2016-05-12 07:55:53 +02:00
|
|
|
|
2016-05-13 07:34:37 +02:00
|
|
|
Fixes chunk unload issues
|
2016-05-12 07:55:53 +02:00
|
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
2016-05-13 07:34:37 +02:00
|
|
|
index 8ee8e80..1bc001d 100644
|
2016-05-12 07:55:53 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java
|
2016-05-13 07:34:37 +02:00
|
|
|
@@ -197,7 +197,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
2016-05-12 07:55:53 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
- Chunk neighbor = this.getLoadedChunkAt(chunk.locX + x, chunk.locZ + z);
|
2016-05-13 07:34:37 +02:00
|
|
|
+ Chunk neighbor = MCUtil.getLoadedChunkWithoutMarkingActive(this, chunk.locX + x, chunk.locZ + z); // Paper
|
2016-05-12 07:55:53 +02:00
|
|
|
if (neighbor != null) {
|
|
|
|
neighbor.setNeighborLoaded(-x, -z);
|
|
|
|
chunk.setNeighborLoaded(x, z);
|
2016-05-13 07:34:37 +02:00
|
|
|
@@ -318,7 +318,7 @@ public class ChunkProviderServer implements IChunkProvider {
|
2016-05-12 07:55:53 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
- Chunk neighbor = this.chunks.get(ChunkCoordIntPair.a(chunk.locX + x, chunk.locZ + z));
|
2016-05-13 07:34:37 +02:00
|
|
|
+ Chunk neighbor = MCUtil.getLoadedChunkWithoutMarkingActive(this, chunk.locX + x, chunk.locZ + z); // Paper
|
2016-05-12 07:55:53 +02:00
|
|
|
if (neighbor != null) {
|
|
|
|
neighbor.setNeighborUnloaded(-x, -z);
|
|
|
|
chunk.setNeighborUnloaded(x, z);
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
2016-05-13 07:34:37 +02:00
|
|
|
index 1adfc03..b1a7435 100644
|
2016-05-12 07:55:53 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
|
|
|
@@ -241,7 +241,7 @@ public class CraftWorld implements World {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
- net.minecraft.server.Chunk neighbor = world.getChunkProviderServer().getLoadedChunkAt(chunk.locX + x, chunk.locZ + z);
|
2016-05-13 07:34:37 +02:00
|
|
|
+ net.minecraft.server.Chunk neighbor = net.minecraft.server.MCUtil.getLoadedChunkWithoutMarkingActive(world, chunk.locX + x, chunk.locZ + z); // Paper
|
2016-05-12 07:55:53 +02:00
|
|
|
if (neighbor != null) {
|
|
|
|
neighbor.setNeighborUnloaded(-xx, -zz);
|
|
|
|
chunk.setNeighborUnloaded(xx, zz);
|
|
|
|
@@ -328,7 +328,7 @@ public class CraftWorld implements World {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
- net.minecraft.server.Chunk neighbor = world.getChunkProviderServer().getLoadedChunkAt(chunk.locX + x, chunk.locZ + z);
|
2016-05-13 07:34:37 +02:00
|
|
|
+ net.minecraft.server.Chunk neighbor = net.minecraft.server.MCUtil.getLoadedChunkWithoutMarkingActive(world, chunk.locX + x, chunk.locZ + z); // Paper
|
2016-05-12 07:55:53 +02:00
|
|
|
if (neighbor != null) {
|
|
|
|
neighbor.setNeighborLoaded(-x, -z);
|
|
|
|
chunk.setNeighborLoaded(x, z);
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
|
2016-05-13 07:34:37 +02:00
|
|
|
index 7b61b14..7752b50 100644
|
2016-05-12 07:55:53 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOProvider.java
|
2016-05-13 07:34:37 +02:00
|
|
|
@@ -5,7 +5,6 @@ import net.minecraft.server.Chunk;
|
|
|
|
import net.minecraft.server.ChunkCoordIntPair;
|
|
|
|
import net.minecraft.server.ChunkRegionLoader;
|
|
|
|
import net.minecraft.server.NBTTagCompound;
|
|
|
|
-
|
|
|
|
import org.bukkit.Server;
|
|
|
|
import org.bukkit.craftbukkit.util.AsynchronousExecutor;
|
|
|
|
|
|
|
|
@@ -62,7 +61,7 @@ class ChunkIOProvider implements AsynchronousExecutor.CallBackProvider<QueuedChu
|
2016-05-12 07:55:53 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
- Chunk neighbor = queuedChunk.provider.getLoadedChunkAt(chunk.locX + x, chunk.locZ + z);
|
2016-05-13 07:34:37 +02:00
|
|
|
+ Chunk neighbor = net.minecraft.server.MCUtil.getLoadedChunkWithoutMarkingActive(queuedChunk.provider, chunk.locX + x, chunk.locZ + z); // Paper
|
2016-05-12 07:55:53 +02:00
|
|
|
if (neighbor != null) {
|
|
|
|
neighbor.setNeighborLoaded(-x, -z);
|
|
|
|
chunk.setNeighborLoaded(x, z);
|
|
|
|
--
|
|
|
|
2.8.2
|
|
|
|
|