mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-20 03:44: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)
|
@Inject(method = "use", at = @At("HEAD"), cancellable = true)
|
||||||
private void use(World world, PlayerEntity user, Hand hand, CallbackInfoReturnable<TypedActionResult<ItemStack>> info) {
|
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);
|
TypedActionResult<ItemStack> result = FoodPoisoningStatusEffect.apply(this, user, hand);
|
||||||
if (result.getResult() != ActionResult.PASS) {
|
if (result.getResult() != ActionResult.PASS) {
|
||||||
info.setReturnValue(result);
|
info.setReturnValue(result);
|
||||||
|
|
Loading…
Reference in a new issue