mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-01-13 20:11:30 +01:00
This commit is contained in:
parent
72470984b8
commit
6e9d5a4d05
@ -167,13 +167,13 @@ public abstract class MixinClientPlayerInteractionManager {
|
|||||||
return ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(VersionEnum.r1_17);
|
return ProtocolHack.getTargetVersion().isNewerThanOrEqualTo(VersionEnum.r1_17);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "interactItem", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/packet/Packet;)V", ordinal = 0, shift = At.Shift.BEFORE))
|
@Inject(method = "interactItem", at = @At("HEAD"))
|
||||||
public void injectInteractItem(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
|
public void trackLastUsedItem(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
|
||||||
ViaFabricPlusHandItemProvider.lastUsedItem = player.getStackInHand(hand).copy();
|
ViaFabricPlusHandItemProvider.lastUsedItem = player.getStackInHand(hand).copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject(method = "interactBlock", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;sendSequencedPacket(Lnet/minecraft/client/world/ClientWorld;Lnet/minecraft/client/network/SequencedPacketCreator;)V", shift = At.Shift.BEFORE))
|
@Inject(method = "interactBlock", at = @At("HEAD"))
|
||||||
public void injectInteractBlock(ClientPlayerEntity player, Hand hand, BlockHitResult hitResult, CallbackInfoReturnable<ActionResult> cir) {
|
public void trackLastUsedBlock(ClientPlayerEntity player, Hand hand, BlockHitResult hitResult, CallbackInfoReturnable<ActionResult> cir) {
|
||||||
ViaFabricPlusHandItemProvider.lastUsedItem = player.getStackInHand(hand).copy();
|
ViaFabricPlusHandItemProvider.lastUsedItem = player.getStackInHand(hand).copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user