mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-17 10:24:23 +01:00
Fix food component not being updated correctly
This commit is contained in:
parent
c8dc41a68e
commit
e44347e8ed
1 changed files with 2 additions and 0 deletions
|
@ -58,6 +58,8 @@ abstract class MixinItem implements ItemDuck {
|
|||
|
||||
@Inject(method = "use", at = @At("HEAD"), cancellable = true)
|
||||
private void use(World world, PlayerEntity user, Hand hand, CallbackInfoReturnable<TypedActionResult<ItemStack>> info) {
|
||||
// ensure the food component is updated before attempting to use
|
||||
getToxic(user.getStackInHand(hand), user);
|
||||
TypedActionResult<ItemStack> result = FoodPoisoningStatusEffect.apply(this, user, hand);
|
||||
if (result.getResult() != ActionResult.PASS) {
|
||||
info.setReturnValue(result);
|
||||
|
|
Loading…
Reference in a new issue