mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Fix World#refreshChunk not working for chunks in no-tick range
The chunk would not be marked as ticking in this case, so retrieving the ticking chunk would not work.
This commit is contained in:
parent
90da9124c5
commit
0ee53db50a
1 changed files with 28 additions and 0 deletions
|
@ -2082,6 +2082,34 @@ diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/jav
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||||
|
@@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||||
|
ChunkHolder playerChunk = this.world.getChunkSource().chunkMap.getVisibleChunkIfPresent(ChunkPos.asLong(x, z));
|
||||||
|
if (playerChunk == null) return false;
|
||||||
|
|
||||||
|
- playerChunk.getTickingChunkFuture().thenAccept(either -> {
|
||||||
|
- either.left().ifPresent(chunk -> {
|
||||||
|
+ // Paper start - rewrite player chunk loader
|
||||||
|
+ net.minecraft.world.level.chunk.LevelChunk chunk = playerChunk.getSendingChunk();
|
||||||
|
+ if (chunk == null) {
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ // Paper end - rewrite player chunk loader
|
||||||
|
List<ServerPlayer> playersInRange = playerChunk.playerProvider.getPlayers(playerChunk.getPos(), false);
|
||||||
|
- if (playersInRange.isEmpty()) return;
|
||||||
|
+ if (playersInRange.isEmpty()) return true; // Paper - rewrite player chunk loader
|
||||||
|
|
||||||
|
// Paper start - Anti-Xray - Bypass
|
||||||
|
Map<Object, ClientboundLevelChunkWithLightPacket> refreshPackets = new HashMap<>();
|
||||||
|
@@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||||
|
}));
|
||||||
|
// Paper end
|
||||||
|
}
|
||||||
|
- });
|
||||||
|
- });
|
||||||
|
+ // Paper - rewrite player chunk loader
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
@@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
@@ -0,0 +0,0 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||||
// Spigot start
|
// Spigot start
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue