mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-22 11:56:21 +01:00
Change spectator action type in <= 1.21.1 block interacting
This commit is contained in:
parent
b37115fa33
commit
9f5f6e8421
@ -111,6 +111,15 @@ public abstract class MixinClientPlayerInteractionManager implements IClientPlay
|
|||||||
@Unique
|
@Unique
|
||||||
private final ClientPlayerInteractionManager1_18_2 viaFabricPlus$1_18_2InteractionManager = new ClientPlayerInteractionManager1_18_2();
|
private final ClientPlayerInteractionManager1_18_2 viaFabricPlus$1_18_2InteractionManager = new ClientPlayerInteractionManager1_18_2();
|
||||||
|
|
||||||
|
@Redirect(method = "interactBlockInternal", at = @At(value = "FIELD", target = "Lnet/minecraft/util/ActionResult;CONSUME:Lnet/minecraft/util/ActionResult$Success;"))
|
||||||
|
private ActionResult.Success changeSpectatorAction() {
|
||||||
|
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_12_1)) {
|
||||||
|
return ActionResult.SUCCESS;
|
||||||
|
} else {
|
||||||
|
return ActionResult.CONSUME;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Inject(method = "interactItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;syncSelectedSlot()V", shift = At.Shift.AFTER))
|
@Inject(method = "interactItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;syncSelectedSlot()V", shift = At.Shift.AFTER))
|
||||||
private void sendPlayerPosPacket(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
|
private void sendPlayerPosPacket(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
|
||||||
if (ProtocolTranslator.getTargetVersion().betweenInclusive(ProtocolVersion.v1_17, ProtocolVersion.v1_20_5)) {
|
if (ProtocolTranslator.getTargetVersion().betweenInclusive(ProtocolVersion.v1_17, ProtocolVersion.v1_20_5)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user