2019-04-06 05:08:45 +02:00
|
|
|
From 8484a08f0e21ca3e231e2c2fa45de1ebeddc7f80 Mon Sep 17 00:00:00 2001
|
2018-09-29 07:22:21 +02:00
|
|
|
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
|
2019-04-06 05:08:45 +02:00
|
|
|
index 0d51c1baeb..46804203fe 100644
|
2018-09-29 07:22:21 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/Chunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/Chunk.java
|
2019-04-06 05:08:45 +02:00
|
|
|
@@ -1190,7 +1190,7 @@ public class Chunk implements IChunkAccess {
|
2018-09-29 07:22:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isReady() {
|
|
|
|
- return this.C.a(ChunkStatus.POSTPROCESSED);
|
|
|
|
+ return true; // Paper - Always send chunks
|
|
|
|
}
|
|
|
|
|
|
|
|
public boolean v() {
|
2019-04-06 05:08:45 +02:00
|
|
|
@@ -1428,6 +1428,13 @@ public class Chunk implements IChunkAccess {
|
2018-10-02 15:06:52 +02:00
|
|
|
this.h.clear();
|
2018-09-29 07:22:21 +02:00
|
|
|
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
|
2019-04-06 05:08:45 +02:00
|
|
|
index e4cf8548d3..ac5d158093 100644
|
2018-09-29 07:22:21 +02:00
|
|
|
--- a/src/main/java/net/minecraft/server/PlayerChunk.java
|
|
|
|
+++ b/src/main/java/net/minecraft/server/PlayerChunk.java
|
2019-01-01 04:15:55 +01:00
|
|
|
@@ -20,7 +20,7 @@ public class PlayerChunk {
|
2018-09-29 07:22:21 +02:00
|
|
|
private int dirtyCount;
|
|
|
|
private int h;
|
|
|
|
private long i;
|
|
|
|
- private boolean done;
|
|
|
|
+ boolean done; // Paper - package-private
|
2018-12-17 06:18:06 +01:00
|
|
|
boolean chunkExists; // Paper
|
|
|
|
// Paper start
|
|
|
|
PaperAsyncChunkProvider.CancellableChunkRequest chunkRequest;
|
2019-01-01 04:15:55 +01:00
|
|
|
@@ -147,6 +147,7 @@ public class PlayerChunk {
|
2018-09-29 07:22:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+ public boolean sendAll() { return b(); } // Paper - OBFHELPER
|
|
|
|
public boolean b() {
|
|
|
|
if (this.done) {
|
|
|
|
return true;
|
|
|
|
--
|
2019-03-20 01:28:15 +01:00
|
|
|
2.21.0
|
2018-09-29 07:22:21 +02:00
|
|
|
|