From 45ca6f0af92f6326154f0d2f859cd20efa24a783 Mon Sep 17 00:00:00 2001 From: ishland Date: Mon, 14 Oct 2024 19:21:01 +0800 Subject: [PATCH] fix: properly broadcast changes in notickvd chunks --- .../c2me/notickvd/mixin/MixinServerChunkManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/c2me-notickvd/src/main/java/com/ishland/c2me/notickvd/mixin/MixinServerChunkManager.java b/c2me-notickvd/src/main/java/com/ishland/c2me/notickvd/mixin/MixinServerChunkManager.java index 81992e8eb..aeddcad2f 100644 --- a/c2me-notickvd/src/main/java/com/ishland/c2me/notickvd/mixin/MixinServerChunkManager.java +++ b/c2me-notickvd/src/main/java/com/ishland/c2me/notickvd/mixin/MixinServerChunkManager.java @@ -1,6 +1,5 @@ package com.ishland.c2me.notickvd.mixin; -import com.ishland.c2me.base.common.theinterface.IFastChunkHolder; import com.ishland.c2me.base.common.util.FilteringIterable; import com.ishland.c2me.notickvd.common.IChunkTicketManager; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; @@ -30,4 +29,9 @@ private Iterable redirectIterateEntities(ServerWorld serverWorld, Operat return new FilteringIterable<>(op.call(serverWorld), entity -> !noTickOnlyChunks.contains(entity.getChunkPos().toLong())); } + @Redirect(method = "broadcastUpdates", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ChunkHolder;getWorldChunk()Lnet/minecraft/world/chunk/WorldChunk;")) + private WorldChunk broadcastBorderChunks(ChunkHolder instance) { + return instance.getAccessibleFuture().getNow(ChunkHolder.UNLOADED_WORLD_CHUNK).orElse(null); + } + }