mirror of
https://github.com/YatopiaMC/Yatopia.git
synced 2024-06-28 15:44:59 +02:00
32 lines
2.2 KiB
Diff
32 lines
2.2 KiB
Diff
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||
|
From: Simon Gardling <titaniumtown@gmail.com>
|
||
|
Date: Wed, 21 Apr 2021 14:44:35 -0400
|
||
|
Subject: [PATCH] Multithreaded Entity Tracker fixup
|
||
|
|
||
|
|
||
|
diff --git a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
|
||
|
index 9097884f71d7986c8185a4b2b2a65b8c66fa7354..0b9ed4042612f5242e5b2d057b716170f22c78b1 100644
|
||
|
--- a/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
|
||
|
+++ b/src/main/java/net/minecraft/server/level/PlayerChunkMap.java
|
||
|
@@ -763,11 +763,6 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d {
|
||
|
return this.updatingChunks.getVisibleAsync(i);
|
||
|
// Tuinity end - Don't copy
|
||
|
}
|
||
|
- // Airplane start - since neither map can be updated during tracker tick, it's safe to allow direct retrieval here
|
||
|
- private PlayerChunk trackerGetVisibleChunk(long i) {
|
||
|
- return this.hasPendingVisibleUpdate ? this.pendingVisibleChunks.get(i) : ((ProtectedVisibleChunksMap) this.visibleChunks).safeGet(i);
|
||
|
- }
|
||
|
- // Airplane end
|
||
|
|
||
|
protected final IntSupplier getPrioritySupplier(long i) { return c(i); } // Paper - OBFHELPER
|
||
|
protected IntSupplier c(long i) {
|
||
|
@@ -2581,7 +2576,7 @@ Sections go from 0..16. Now whenever a section is not empty, it can potentially
|
||
|
|
||
|
if (!flag1) {
|
||
|
ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(this.tracker.chunkX, this.tracker.chunkZ);
|
||
|
- PlayerChunk playerchunk = PlayerChunkMap.this.trackerGetVisibleChunk(chunkcoordintpair.pair()); // Airplane
|
||
|
+ PlayerChunk playerchunk = PlayerChunkMap.this.getVisibleChunk(chunkcoordintpair.pair()); // Airplane
|
||
|
|
||
|
if (playerchunk != null && playerchunk.getSendingChunk() != null && PlayerChunkMap.this.playerChunkManager.isChunkSent(entityplayer, MathHelper.floor(this.tracker.locX()) >> 4, MathHelper.floor(this.tracker.locZ()) >> 4)) { // Paper - no-tick view distance // Tuinity - don't broadcast in chunks the player hasn't received
|
||
|
flag1 = PlayerChunkMap.b(chunkcoordintpair, entityplayer, false) <= PlayerChunkMap.this.viewDistance;
|