Skip to content

Commit

Permalink
Use MixinExtras for MixinClientPlayerInteractionManager#redirectPlaye…
Browse files Browse the repository at this point in the history
…rPosPacket
  • Loading branch information
FlorianMichael committed Feb 6, 2024
1 parent ecd38de commit de6db35
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,9 @@ private PlayerActionC2SPacket trackPlayerAction(PlayerActionC2SPacket.Action act
return new PlayerActionC2SPacket(action, pos, direction);
}

@Redirect(method = "interactItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;)V", ordinal = 0))
private void redirectPlayerPosPacket(ClientPlayNetworkHandler instance, Packet<?> packet) {
if (ProtocolHack.getTargetVersion().isNewerThan(VersionEnum.r1_16_4tor1_16_5)) {
instance.sendPacket(packet);
}
@WrapWithCondition(method = "interactItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;)V", ordinal = 0))
private boolean redirectPlayerPosPacket(ClientPlayNetworkHandler instance, Packet<?> packet) {
return ProtocolHack.getTargetVersion().isNewerThan(VersionEnum.r1_16_4tor1_16_5);
}

@ModifyVariable(method = "clickSlot", at = @At(value = "STORE"), ordinal = 0)
Expand Down

0 comments on commit de6db35

Please sign in to comment.