diff --git a/patches/server/Fix-potions-splash-events.patch b/patches/server/Fix-potions-splash-events.patch index d628a8090c..921726d63d 100644 --- a/patches/server/Fix-potions-splash-events.patch +++ b/patches/server/Fix-potions-splash-events.patch @@ -126,6 +126,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 Entity entity = this.getOwner(); @@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie + entityareaeffectcloud.setPotion(potion); + Iterator iterator = PotionUtils.getCustomEffects(stack).iterator(); + ++ boolean noEffects = potion.getEffects().isEmpty(); // Paper + while (iterator.hasNext()) { + MobEffectInstance mobeffect = (MobEffectInstance) iterator.next(); + + entityareaeffectcloud.addEffect(new MobEffectInstance(mobeffect)); ++ noEffects = false; // Paper + } + + CompoundTag nbttagcompound = stack.getTag(); +@@ -0,0 +0,0 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie + + // CraftBukkit start + org.bukkit.event.entity.LingeringPotionSplashEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callLingeringPotionSplashEvent(this, entityareaeffectcloud); +- if (!(event.isCancelled() || entityareaeffectcloud.isRemoved())) { ++ if (!(event.isCancelled() || entityareaeffectcloud.isRemoved() || (noEffects && entityareaeffectcloud.effects.isEmpty() && entityareaeffectcloud.getPotion().getEffects().isEmpty()))) { // Paper - don't spawn area effect cloud if the effects were empty and not changed during the event handling + this.level.addFreshEntity(entityareaeffectcloud); + } else { entityareaeffectcloud.discard(); } // CraftBukkit end