From 5cc76afdcdb087f45fa4c8e8006c38d12d63fe63 Mon Sep 17 00:00:00 2001 From: 2No2Name <2No2Name@web.de> Date: Sat, 18 Jan 2025 00:49:07 +0100 Subject: [PATCH] Moonrise compatibility: Set require=0 for ChunkStatusTracker Inject https://github.com/Tuinity/Moonrise/pull/91 --- .../mixin/util/chunk_status_tracking/ChunkHolderMixin.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/net/caffeinemc/mods/lithium/mixin/util/chunk_status_tracking/ChunkHolderMixin.java b/common/src/main/java/net/caffeinemc/mods/lithium/mixin/util/chunk_status_tracking/ChunkHolderMixin.java index 191ff1214..2b05d8ee4 100644 --- a/common/src/main/java/net/caffeinemc/mods/lithium/mixin/util/chunk_status_tracking/ChunkHolderMixin.java +++ b/common/src/main/java/net/caffeinemc/mods/lithium/mixin/util/chunk_status_tracking/ChunkHolderMixin.java @@ -23,7 +23,10 @@ public ChunkHolderMixin(ChunkPos chunkPos) { @Inject( method = "updateFutures(Lnet/minecraft/server/level/ChunkMap;Ljava/util/concurrent/Executor;)V", locals = LocalCapture.CAPTURE_FAILHARD, - at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/FullChunkStatus;isOrAfter(Lnet/minecraft/server/level/FullChunkStatus;)Z", ordinal = 6) + at = @At(value = "INVOKE", target = "Lnet/minecraft/server/level/FullChunkStatus;isOrAfter(Lnet/minecraft/server/level/FullChunkStatus;)Z", ordinal = 6), + // See ca.spottledleaf.moonrise.compat.lithium.LithiumHooks and https://github.com/Tuinity/Moonrise/blob/c2cf9858998d9245cb2f548a4618b8772d054125/src/main/java/ca/spottedleaf/moonrise/mixin/chunk_system/ChunkHolderMixin.java#L401 + // Moonrise will call Lithium's ChunkStatusTracker methods directly, in turn we set require = 0, avoiding a conflict with their overwrite. + require = 0 ) private void trackUpdate(ChunkMap chunkMap, Executor executor, CallbackInfo ci, FullChunkStatus prevStatus, FullChunkStatus status) { ServerLevel serverLevel = chunkMap.level;