aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSpottedleaf <[email protected]>2023-06-16 10:24:51 -0700
committerSpottedleaf <[email protected]>2023-06-16 10:25:26 -0700
commitf5551380b3279bf51752e8617e384a594ac1a2f5 (patch)
tree04086e90c830ffa7db53d4a81232d0d05fb50a32
parent3f237e869a5a862e310af9cfaf401a4dab6d9c0b (diff)
downloadPaper-f5551380b3279bf51752e8617e384a594ac1a2f5.tar.gz
Paper-f5551380b3279bf51752e8617e384a594ac1a2f5.zip
Make sure to post process chunks before they are sent to players
Some TEs need to be post processed after generation to be sent properly (chests)
-rw-r--r--patches/server/0019-Rewrite-chunk-system.patch14
1 files changed, 11 insertions, 3 deletions
diff --git a/patches/server/0019-Rewrite-chunk-system.patch b/patches/server/0019-Rewrite-chunk-system.patch
index 57a4ce05e7..e18ca0e67c 100644
--- a/patches/server/0019-Rewrite-chunk-system.patch
+++ b/patches/server/0019-Rewrite-chunk-system.patch
@@ -2310,10 +2310,10 @@ index 95eac2e12a16938d81ab512b00e90c5234b42834..8f7bf1f0400aeab8b7801d113d244d07
private ChunkSystem() {
diff --git a/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java b/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java
new file mode 100644
-index 0000000000000000000000000000000000000000..a495d692841c1a6056ca82519ee9b9c66f1ff5cd
+index 0000000000000000000000000000000000000000..924539d4ac50c70178ba220424ffacd6ff277c8b
--- /dev/null
+++ b/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java
-@@ -0,0 +1,1418 @@
+@@ -0,0 +1,1426 @@
+package io.papermc.paper.chunk.system;
+
+import ca.spottedleaf.concurrentutil.collection.SRSWLinkedQueue;
@@ -3170,6 +3170,14 @@ index 0000000000000000000000000000000000000000..a495d692841c1a6056ca82519ee9b9c6
+ // the target chunk may not be owned by this region, but this should be resolved in the future
+ break;
+ }
++ if (!chunk.isPostProcessingDone) {
++ // not yet post-processed, need to do this so that tile entities can properly be sent to clients
++ chunk.postProcessGeneration();
++ // check if there was any recursive action
++ if (this.removed || this.sendQueue.isEmpty() || this.sendQueue.firstLong() != pendingSend) {
++ return;
++ } // else: good to dequeue and send, fall through
++ }
+ this.sendQueue.dequeueLong();
+
+ this.sendChunk(pendingSendX, pendingSendZ);
@@ -22765,7 +22773,7 @@ index 73f61f2b0c0aeefabb7b7bba7ca37914751dcc42..4a3593f24fc844a6a8b1b6c28ad2dc9c
// Spigot start
private final org.bukkit.World.Spigot spigot = new org.bukkit.World.Spigot()
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
-index 6812237223f8b31e19476cf320192214994c032c..d67a7f9534c3dc43310a26e8e9073c6442a2edef 100644
+index ef25bfa8c9341104df5cc150eefada52c5353efa..07934c6b9fc1412a404c8c1fdb704cf8adccfb08 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -187,6 +187,48 @@ public class CraftPlayer extends CraftHumanEntity implements Player {