geforkt von Mirrors/Paper
SPIGOT-4137: Fix World.regenerateChunk
By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
Ursprung
64f2fdae29
Commit
c3205e4e12
@ -57,16 +57,31 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +162,7 @@
|
@@ -147,10 +159,21 @@
|
||||||
|
return this.g.c();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // CraftBukkit start
|
||||||
public CompletableFuture<Chunk> generateChunk(int i, int j) {
|
public CompletableFuture<Chunk> generateChunk(int i, int j) {
|
||||||
|
+ return this.generateChunk(i, j, false);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ public CompletableFuture<Chunk> generateChunk(int i, int j, boolean force) {
|
||||||
this.g.b();
|
this.g.b();
|
||||||
this.g.a(new ChunkCoordIntPair(i, j));
|
- this.g.a(new ChunkCoordIntPair(i, j));
|
||||||
- CompletableFuture completablefuture = this.g.c();
|
- CompletableFuture completablefuture = this.g.c();
|
||||||
|
+
|
||||||
|
+ ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);
|
||||||
|
+ if (force) {
|
||||||
|
+ this.f.forcePolluteCache(chunkcoordintpair);
|
||||||
|
+ }
|
||||||
|
+ this.g.a(chunkcoordintpair);
|
||||||
|
+ // CraftBukkit end
|
||||||
+ CompletableFuture<ProtoChunk> completablefuture = this.g.c(); // CraftBukkit - decompile error
|
+ CompletableFuture<ProtoChunk> completablefuture = this.g.c(); // CraftBukkit - decompile error
|
||||||
|
|
||||||
return completablefuture.thenApply(this::a);
|
return completablefuture.thenApply(this::a);
|
||||||
}
|
}
|
||||||
@@ -268,10 +280,12 @@
|
@@ -268,10 +291,12 @@
|
||||||
Chunk chunk = (Chunk) this.chunks.get(olong);
|
Chunk chunk = (Chunk) this.chunks.get(olong);
|
||||||
|
|
||||||
if (chunk != null && chunk.d) {
|
if (chunk != null && chunk.d) {
|
||||||
@ -83,7 +98,7 @@
|
|||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -284,6 +298,40 @@
|
@@ -284,6 +309,40 @@
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
15
paper-server/nms-patches/ChunkTaskScheduler.patch
Normale Datei
15
paper-server/nms-patches/ChunkTaskScheduler.patch
Normale Datei
@ -0,0 +1,15 @@
|
|||||||
|
--- a/net/minecraft/server/ChunkTaskScheduler.java
|
||||||
|
+++ b/net/minecraft/server/ChunkTaskScheduler.java
|
||||||
|
@@ -39,6 +39,12 @@
|
||||||
|
this.f = iasynctaskhandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ // CraftBukkit start
|
||||||
|
+ public void forcePolluteCache(ChunkCoordIntPair chunkcoordintpair) {
|
||||||
|
+ this.g.put(chunkcoordintpair.a(), new Scheduler.a(chunkcoordintpair, new ProtoChunk(chunkcoordintpair, ChunkConverter.a), ChunkStatus.EMPTY));
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
+
|
||||||
|
protected Scheduler.a a(ChunkCoordIntPair chunkcoordintpair) {
|
||||||
|
return (Scheduler.a) this.g.computeIfAbsent(Long.valueOf(chunkcoordintpair.a()), (olong) -> {
|
||||||
|
ProtoChunk protochunk = this.a(chunkcoordintpair.x, chunkcoordintpair.z);
|
@ -218,17 +218,13 @@ public class CraftWorld implements World {
|
|||||||
|
|
||||||
net.minecraft.server.Chunk chunk = null;
|
net.minecraft.server.Chunk chunk = null;
|
||||||
|
|
||||||
chunk = Futures.getUnchecked(world.getChunkProviderServer().generateChunk(x, z));
|
chunk = Futures.getUnchecked(world.getChunkProviderServer().generateChunk(x, z, true));
|
||||||
PlayerChunk playerChunk = world.getPlayerChunkMap().getChunk(x, z);
|
PlayerChunk playerChunk = world.getPlayerChunkMap().getChunk(x, z);
|
||||||
if (playerChunk != null) {
|
if (playerChunk != null) {
|
||||||
playerChunk.chunk = chunk;
|
playerChunk.chunk = chunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
world.getChunkProviderServer().chunks.put(chunkKey, chunk);
|
|
||||||
|
|
||||||
chunk.addEntities();
|
|
||||||
|
|
||||||
refreshChunk(x, z);
|
refreshChunk(x, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren