From 7af5834501f31e123ca5ab49f7a34170ead40565 Mon Sep 17 00:00:00 2001 From: ishland Date: Sun, 10 Dec 2023 10:39:52 +0800 Subject: [PATCH] fix: skip chunk sent check for optimized entity tracking Fixes #52 --- .../MixinThreadedAnvilChunkStorageEntityTracker.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/ishland/vmp/mixins/playerwatching/optimize_nearby_entity_tracking_lookups/MixinThreadedAnvilChunkStorageEntityTracker.java b/src/main/java/com/ishland/vmp/mixins/playerwatching/optimize_nearby_entity_tracking_lookups/MixinThreadedAnvilChunkStorageEntityTracker.java index d6aec7f..ab7f1e0 100644 --- a/src/main/java/com/ishland/vmp/mixins/playerwatching/optimize_nearby_entity_tracking_lookups/MixinThreadedAnvilChunkStorageEntityTracker.java +++ b/src/main/java/com/ishland/vmp/mixins/playerwatching/optimize_nearby_entity_tracking_lookups/MixinThreadedAnvilChunkStorageEntityTracker.java @@ -18,6 +18,7 @@ import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import java.util.List; @@ -106,4 +107,9 @@ private void beforeStartTracking(ServerPlayerEntity player, CallbackInfo ci) { } } + @Redirect(method = "updateTrackedStatus(Lnet/minecraft/server/network/ServerPlayerEntity;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/world/ThreadedAnvilChunkStorage;isTracked(Lnet/minecraft/server/network/ServerPlayerEntity;II)Z")) + private boolean assumeAlwaysTracked(ThreadedAnvilChunkStorage instance, ServerPlayerEntity player, int chunkX, int chunkZ) { + return true; + } + }