mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-08 06:26:43 +01:00
Fixed crash when an entity other than the player tries to eat
This commit is contained in:
parent
afda7a6ef8
commit
64be265c04
1 changed files with 3 additions and 1 deletions
|
@ -24,7 +24,9 @@ public record Toxic (
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemStack finishUsing(ItemStack stack, World world, LivingEntity entity) {
|
public ItemStack finishUsing(ItemStack stack, World world, LivingEntity entity) {
|
||||||
ailment.get(entity).ifPresent(ailment -> ailment.effect().afflict((PlayerEntity)entity, stack));
|
if (entity instanceof PlayerEntity player) {
|
||||||
|
ailment.get(entity).ifPresent(ailment -> ailment.effect().afflict(player, stack));
|
||||||
|
}
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue