Skip to content

Commit

Permalink
fix: properly broadcast changes in notickvd chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
ishland committed Oct 14, 2024
1 parent 24be581 commit 45ca6f0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -30,4 +29,9 @@ private Iterable<Entity> 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);
}

}

0 comments on commit 45ca6f0

Please sign in to comment.