mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 07:48:53 +01:00
0976d52bbd
Upstream has released updates that appears to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Please note that this build includes changes to meet upstreams requirements for nullability annotations. While we aim for a level of accuracy, these might not be 100% correct, if there are any issues, please speak to us on discord, or open an issue on the tracker to discuss. Bukkit Changes: 9a6a1de3 Remove nullability annotations from enum constructors 3f0591ea SPIGOT-2540: Add nullability annotations to entire Bukkit API CraftBukkit Changes:8d8475fc
SPIGOT-4666: Force parameter in HumanEntity#sleep8b1588e2
Fix ExplosionPrimeEvent#setFire not working with EnderCrystals39a287b7
Don't ignore newlines in PlayerListHeader/Footer Spigot Changes: cf694d87 Add nullability annotations
66 lines
2.4 KiB
Diff
66 lines
2.4 KiB
Diff
From 18286af8e0396d079dd3aac05c304cd29cc68de1 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Sat, 29 Sep 2018 01:18:16 -0400
|
|
Subject: [PATCH] Fix Sending Chunks to Client
|
|
|
|
Vanilla has some screwy logic that doesn't send a chunk until
|
|
it has been post processed. This is an issue as post processing
|
|
doesn't occur until all neighbor chunks have been loaded.
|
|
|
|
This can reduce view distance while generating terrain, but also
|
|
cause bugs where chunks are never sent to the client.
|
|
|
|
This fix always sends chunks to the client, and simply updates
|
|
the client anytime post processing is triggered with the new chunk data.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java
|
|
index d848a97bd..2bcbf8902 100644
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
|
@@ -1189,7 +1189,7 @@ public class Chunk implements IChunkAccess {
|
|
}
|
|
|
|
public boolean isReady() {
|
|
- return this.C.a(ChunkStatus.POSTPROCESSED);
|
|
+ return true; // Paper - Always send chunks
|
|
}
|
|
|
|
public boolean v() {
|
|
@@ -1427,6 +1427,13 @@ public class Chunk implements IChunkAccess {
|
|
this.h.clear();
|
|
this.a(ChunkStatus.POSTPROCESSED);
|
|
this.m.a(this);
|
|
+ // Paper start - resend chunk after post process
|
|
+ PlayerChunk playerChunk = ((WorldServer) world).getPlayerChunkMap().getChunk(locX, locZ);
|
|
+ if (playerChunk != null) {
|
|
+ playerChunk.done = false;
|
|
+ playerChunk.sendAll();
|
|
+ }
|
|
+ // Paper end
|
|
}
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java
|
|
index e4cf8548d..ac5d15809 100644
|
|
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
|
|
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
|
|
@@ -20,7 +20,7 @@ public class PlayerChunk {
|
|
private int dirtyCount;
|
|
private int h;
|
|
private long i;
|
|
- private boolean done;
|
|
+ boolean done; // Paper - package-private
|
|
boolean chunkExists; // Paper
|
|
// Paper start
|
|
PaperAsyncChunkProvider.CancellableChunkRequest chunkRequest;
|
|
@@ -147,6 +147,7 @@ public class PlayerChunk {
|
|
}
|
|
}
|
|
|
|
+ public boolean sendAll() { return b(); } // Paper - OBFHELPER
|
|
public boolean b() {
|
|
if (this.done) {
|
|
return true;
|
|
--
|
|
2.21.0
|
|
|