From 63b46678a59597198ff11f4a92dc4450f9eb4dd2 Mon Sep 17 00:00:00 2001 From: md_5 Date: Mon, 12 Jun 2023 21:02:46 +1000 Subject: [PATCH] Fix another mistake in previous commits causing server crash --- .../java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 222a92eb8..18345c4bb 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -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);