mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-22 23:58:02 -05:00
Resolve ClassCastException in UseItemCallback
Returns ActionResult, not TypedActionResult
This commit is contained in:
parent
3c664f3a9c
commit
25c8636270
1 changed files with 2 additions and 2 deletions
|
@ -99,7 +99,7 @@ public class MixinClientPlayerInteractionManager {
|
|||
}
|
||||
|
||||
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayNetworkHandler;sendPacket(Lnet/minecraft/network/Packet;)V", ordinal = 0), method = "interactItem", cancellable = true)
|
||||
public void interactItem(PlayerEntity player, World world, Hand hand, CallbackInfoReturnable<TypedActionResult<ItemStack>> info) {
|
||||
public void interactItem(PlayerEntity player, World world, Hand hand, CallbackInfoReturnable<ActionResult> info) {
|
||||
TypedActionResult<ItemStack> result = UseItemCallback.EVENT.invoker().interact(player, world, hand);
|
||||
|
||||
if (result.getResult() != ActionResult.PASS) {
|
||||
|
@ -107,7 +107,7 @@ public class MixinClientPlayerInteractionManager {
|
|||
this.networkHandler.sendPacket(new PlayerInteractItemC2SPacket(hand));
|
||||
}
|
||||
|
||||
info.setReturnValue(result);
|
||||
info.setReturnValue(result.getResult());
|
||||
info.cancel();
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue