Fix another mistake in previous commits causing server crash

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot 2023-06-12 21:02:46 +10:00
parent b00fd47b85
commit b6271a3554

View File

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