fix potions

This commit is contained in:
Sen 2025-05-31 20:09:23 +02:00
parent 821a46b720
commit 669fc77eab
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
2 changed files with 8 additions and 2 deletions

View file

@ -48,6 +48,9 @@ public class EntityMage extends EntityNPC
{ {
for (PotionEffect potioneffect : list) for (PotionEffect potioneffect : list)
{ {
if(potioneffect.getPotion().isInstant())
potioneffect.getPotion().onImpact(null, null, this, potioneffect.getAmplifier(), 1.0);
else
this.addEffect(new PotionEffect(potioneffect)); this.addEffect(new PotionEffect(potioneffect));
} }
} }

View file

@ -104,6 +104,9 @@ public class ItemPotion extends Item
{ {
for (PotionEffect potioneffect : list) for (PotionEffect potioneffect : list)
{ {
if(potioneffect.getPotion().isInstant())
potioneffect.getPotion().onImpact(null, null, playerIn, potioneffect.getAmplifier(), 1.0);
else
playerIn.addEffect(new PotionEffect(potioneffect)); playerIn.addEffect(new PotionEffect(potioneffect));
} }
} }