From 4f9b37ba8f84686e2b385dfc1762caa8b4441ceb Mon Sep 17 00:00:00 2001 From: M2ke4U <79621885+MrHua269@users.noreply.github.com> Date: Wed, 29 Nov 2023 21:03:49 +0800 Subject: [PATCH] Fix threading issue in LevelTicks.java --- .../net/minecraft/world/ticks/LevelTicks.java.patch | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/patches/minecraft/net/minecraft/world/ticks/LevelTicks.java.patch b/patches/minecraft/net/minecraft/world/ticks/LevelTicks.java.patch index 4817dd6..1b226ae 100644 --- a/patches/minecraft/net/minecraft/world/ticks/LevelTicks.java.patch +++ b/patches/minecraft/net/minecraft/world/ticks/LevelTicks.java.patch @@ -52,7 +52,7 @@ public LevelTicks(LongPredicate p_193211_, Supplier p_193212_) { this.f_193200_ = p_193211_; -@@ -55,75 +_,100 @@ +@@ -55,75 +_,95 @@ } public void m_193231_(ChunkPos p_193232_, LevelChunkTicks p_193233_) { @@ -149,14 +149,9 @@ + this.m_193216_(p_193222_); + //profiler.incrementCounter("containersToTick", this.containersToTick.size()); // Purpur + this.m_193218_(p_193222_, p_193223_); -+ }finally { -+ this.accessLock.writeLock().unlock(); -+ } -+ this.accessLock.readLock().lock(); -+ try { + this.m_193278_(); + }finally { -+ this.accessLock.readLock().unlock(); ++ this.accessLock.writeLock().unlock(); + } }