Fix another mistake in previous commits causing server crash

This commit is contained in:
md_5 2023-06-12 21:02:46 +10:00
parent b10ea735ca
commit 63b46678a5
No known key found for this signature in database
GPG Key ID: E8E901AC7C617C11

View File

@ -1611,8 +1611,7 @@ public class CraftEventFactory {
PotionEffect bukkitOldEffect = (oldEffect == null) ? null : CraftPotionUtil.toBukkit(oldEffect); PotionEffect bukkitOldEffect = (oldEffect == null) ? null : CraftPotionUtil.toBukkit(oldEffect);
PotionEffect bukkitNewEffect = (newEffect == null) ? null : CraftPotionUtil.toBukkit(newEffect); PotionEffect bukkitNewEffect = (newEffect == null) ? null : CraftPotionUtil.toBukkit(newEffect);
Preconditions.checkState(bukkitOldEffect != null, "Old and new potion is null"); Preconditions.checkState(bukkitOldEffect != null || bukkitNewEffect != null, "Old and new potion effect are both null");
Preconditions.checkState(bukkitNewEffect != null, "New potion effect is null");
EntityPotionEffectEvent event = new EntityPotionEffectEvent((LivingEntity) entity.getBukkitEntity(), bukkitOldEffect, bukkitNewEffect, cause, action, willOverride); EntityPotionEffectEvent event = new EntityPotionEffectEvent((LivingEntity) entity.getBukkitEntity(), bukkitOldEffect, bukkitNewEffect, cause, action, willOverride);
Bukkit.getPluginManager().callEvent(event); Bukkit.getPluginManager().callEvent(event);