Skip to content

Commit

Permalink
fix: Fix UseItemInputEvent cancellation being applied on next use only
Browse files Browse the repository at this point in the history
  • Loading branch information
BlayTheNinth committed Jun 29, 2024
1 parent 93d2aec commit 8a6e9e5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Screen modifyScreen(Screen screen) {
return event.getNewScreen() != null ? event.getNewScreen() : screen;
}

@Inject(method = "startUseItem()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;getItemInHand(Lnet/minecraft/world/InteractionHand;)Lnet/minecraft/world/item/ItemStack;"), cancellable = true)
@Inject(method = "startUseItem()V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;getItemInHand(Lnet/minecraft/world/InteractionHand;)Lnet/minecraft/world/item/ItemStack;", shift = At.Shift.AFTER), cancellable = true)
public void startUseItem(CallbackInfo callbackInfo) {
final var event = balmCurrentUseEvent.get();
if (event != null && event.isCanceled()) {
Expand Down

0 comments on commit 8a6e9e5

Please sign in to comment.