Use MixinExtras for MixinClientPlayerInteractionManager#redirectPlayerPosPacket

This commit is contained in:
FlorianMichael 2024-02-06 22:06:45 +01:00
parent ecd38de782
commit de6db35397
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126

View File

@ -129,11 +129,9 @@ public abstract class MixinClientPlayerInteractionManager implements IClientPlay
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)