mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-12-25 17:18:04 +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);
|
||||
}
|
||||
|
||||
@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))
|
||||
public void injectInteractItem(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
|
||||
@Inject(method = "interactItem", at = @At("HEAD"))
|
||||
public void trackLastUsedItem(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
|
||||
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))
|
||||
public void injectInteractBlock(ClientPlayerEntity player, Hand hand, BlockHitResult hitResult, CallbackInfoReturnable<ActionResult> cir) {
|
||||
@Inject(method = "interactBlock", at = @At("HEAD"))
|
||||
public void trackLastUsedBlock(ClientPlayerEntity player, Hand hand, BlockHitResult hitResult, CallbackInfoReturnable<ActionResult> cir) {
|
||||
ViaFabricPlusHandItemProvider.lastUsedItem = player.getStackInHand(hand).copy();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user