Skip to content

Commit

Permalink
Fix #49
Browse files Browse the repository at this point in the history
  • Loading branch information
senseiwells committed Aug 19, 2024
1 parent 38ea67a commit 8b6a07b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package me.senseiwells.replay.mixin.compat.carpet;

import carpet.patches.EntityPlayerMPFake;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import net.minecraft.server.level.ChunkMap;
import net.minecraft.server.level.ServerPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(ChunkMap.class)
public class ChunkMapMixin {
@ModifyExpressionValue(
method = "isChunkTracked",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/network/PlayerChunkSender;isPending(J)Z"
)
)
private boolean isChunkPending(boolean original, ServerPlayer player) {
return original && !(player instanceof EntityPlayerMPFake);
}
}
1 change: 1 addition & 0 deletions src/main/resources/serverreplay.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"common.ChunkMapMixin",
"common.MinecraftServerMixin",
"common.ServerLevelMixin",
"compat.carpet.ChunkMapMixin",
"compat.carpet.EntityPlayerMPFakeMixin",
"compat.carpet.NetHandlerPlayServerFakeMixin",
"compat.syncmatica.SyncmaticaPacketPayloadMixin",
Expand Down

0 comments on commit 8b6a07b

Please sign in to comment.