diff --git a/patches/minecraft/net/minecraft/world/level/Level.java.patch b/patches/minecraft/net/minecraft/world/level/Level.java.patch index 0bab988397..bba40e9611 100644 --- a/patches/minecraft/net/minecraft/world/level/Level.java.patch +++ b/patches/minecraft/net/minecraft/world/level/Level.java.patch @@ -9,14 +9,6 @@ protected static final Logger f_46426_ = LogManager.getLogger(); public static final Codec> f_46427_ = ResourceLocation.f_135803_.xmap(ResourceKey.m_135797_(Registry.f_122819_), ResourceKey::m_135782_); public static final ResourceKey f_46428_ = ResourceKey.m_135785_(Registry.f_122819_, new ResourceLocation("overworld")); -@@ -82,6 +_,7 @@ - protected final List f_151512_ = Lists.newArrayList(); - private final List f_151503_ = Lists.newArrayList(); - private boolean f_151504_; -+ protected final java.util.Set f_46434_ = java.util.Collections.newSetFromMap(new java.util.IdentityHashMap<>()); // Forge: faster "contains" makes removal much more efficient - private final Thread f_46423_; - private final boolean f_46424_; - private int f_46425_; @@ -99,8 +_,14 @@ private final WorldBorder f_46447_; private final BiomeManager f_46420_; @@ -121,7 +113,7 @@ } }); CrashReportCategory.m_178950_(crashreportcategory, this, p_46587_, blockstate); -@@ -401,11 +_,28 @@ +@@ -401,10 +_,26 @@ (this.f_151504_ ? this.f_151503_ : this.f_151512_).add(p_151526_); } @@ -146,10 +138,8 @@ + this.freshBlockEntities.clear(); + } if (!this.f_151503_.isEmpty()) { -+ this.f_46434_.forEach(e -> e.onChunkUnloaded()); this.f_151512_.addAll(this.f_151503_); this.f_151503_.clear(); - } @@ -427,12 +_,15 @@ public void m_46653_(Consumer p_46654_, T p_46655_) { diff --git a/patches/minecraft/net/minecraft/world/level/chunk/LevelChunk.java.patch b/patches/minecraft/net/minecraft/world/level/chunk/LevelChunk.java.patch index 6bea36c49c..ec3c592b4f 100644 --- a/patches/minecraft/net/minecraft/world/level/chunk/LevelChunk.java.patch +++ b/patches/minecraft/net/minecraft/world/level/chunk/LevelChunk.java.patch @@ -95,7 +95,12 @@ }); } -@@ -763,6 +_,7 @@ +@@ -759,10 +_,12 @@ + } + + public void m_156368_() { ++ this.f_62779_.values().forEach(BlockEntity::onChunkUnloaded); + this.f_62779_.values().forEach(this::m_156400_); } public void m_156369_() {