From c73cb8115eae2b677702cbd79f95adfca8811a38 Mon Sep 17 00:00:00 2001
From: embeddedt <42941056+embeddedt@users.noreply.github.com>
Date: Wed, 5 Jul 2023 11:24:04 -0400
Subject: [PATCH] Fix mixin crash outside dev
---
.../mixin/bugfix/entity_load_deadlock/ChunkMapMixin.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/forge/src/main/java/org/embeddedt/modernfix/forge/mixin/bugfix/entity_load_deadlock/ChunkMapMixin.java b/forge/src/main/java/org/embeddedt/modernfix/forge/mixin/bugfix/entity_load_deadlock/ChunkMapMixin.java
index 550f08d5..11f1bf8d 100644
--- a/forge/src/main/java/org/embeddedt/modernfix/forge/mixin/bugfix/entity_load_deadlock/ChunkMapMixin.java
+++ b/forge/src/main/java/org/embeddedt/modernfix/forge/mixin/bugfix/entity_load_deadlock/ChunkMapMixin.java
@@ -32,8 +32,11 @@ public class ChunkMapMixin {
*
* A different patch is necessary for 1.17+, if the issue can be reproduced there, as entity loading
* works differently.
+ *
+ * Because of the method arguments being appended to this redirect handler, it will only target the lambda inside
+ * protoChunkToFullChunk.
*/
- @Redirect(method = "*(Lnet/minecraft/server/level/ChunkHolder;Lnet/minecraft/world/level/chunk/ChunkAccess;)Lnet/minecraft/world/level/chunk/ChunkAccess;", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/chunk/LevelChunk;getEntitySections()[Lnet/minecraft/util/ClassInstanceMultiMap;"))
+ @Redirect(method = "*", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/chunk/LevelChunk;getEntitySections()[Lnet/minecraft/util/ClassInstanceMultiMap;"))
private ClassInstanceMultiMap>[] getEntitySections(LevelChunk chunk, ChunkHolder holder, ChunkAccess access) {
((ILevelChunk)chunk).setEntityLoadHook(() -> {
List list = null;