Yatopia/patches/server/0070-Multithreaded-Entity-Tracker-fixup.patch

32 lines
2.2 KiB
Diff
Raw Permalink Normal View History

Upstream (#469) * Updated Upstream and Sidestream(s) (Paper/Tuinity/Airplane/Purpur/Empirecraft) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: fbae9dbe0 [Auto] Updated Upstream (Bukkit/CraftBukkit) ac4a33aab [Auto] Updated Upstream (Bukkit) c1e07158b [Auto] Updated Upstream (Bukkit/CraftBukkit) 5e4b88e95 Fix dangling sout 23afda179 basic hostname validation 0fb8bdf0e Updated Upstream (Bukkit/CraftBukkit) (#5508) 88ab784da [Auto] Updated Upstream (CraftBukkit) ca7111d5f Fix PlayerItemConsumeEvent cancelling (fixes #4682) (#5383) 06fb560dc Add support for tab completing and highlighting console input from the Brigadier command tree (#5437) 0a9b89c7a Fix occasional light gen issues for neighbor blocks (#5500) a08be1ec7 [Auto] Updated Upstream (CraftBukkit) Tuinity Changes: 7d36676 Fix light source locking f1ec0c2 Add concurrency check to ProtoChunk light sources 159d146 Improvements to chunk loader system Airplane Changes: 3b3cde7 Correctly use DEAR values, fix config reloading dd60919 Updated Upstream (Tuinity) Purpur Changes: 5674cdc Updated Upstream (Paper) Empirecraft Changes: efda8c5b Updated Paper * Updated Upstream and Sidestream(s) (Paper/Tuinity) Upstream/An Sidestream has released updates that appears to apply and compile correctly This update has NOT been tested by YatopiaMC and as with ANY update, please do your own testing. Paper Changes: 39bf5b525 Update teams known as code owners Tuinity Changes: b12d0cc Replace ticket level propagator 42df8e1 Correctly handle recursion for chunkholder updates 73eb2a8 Do not copy visible chunks 8a4f3be Do not schedule poi task for each block write on chunk gen * Multithreaded Entity Tracker fixup
2021-04-21 23:26:49 +02:00
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;