mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-08-31 22:30:15 +00:00
Call PotionSplashEvent even for no effects. Fixes BUKKIT-3618
When a splash potion has no applicable effects we currently do not call PotionSplashEvent. This means plugins are unable to make custom potions with reliable splash handling as they have to relicate the functionality themselves. With this commit we simply make the event fire regardless of the effects on the potion.
This commit is contained in:
parent
adbee6049e
commit
377be0a79e
1 changed files with 2 additions and 2 deletions
|
@ -64,7 +64,7 @@ public class EntityPotion extends EntityProjectile {
|
||||||
if (!this.world.isStatic) {
|
if (!this.world.isStatic) {
|
||||||
List list = Item.POTION.g(this.c);
|
List list = Item.POTION.g(this.c);
|
||||||
|
|
||||||
if (list != null && !list.isEmpty()) {
|
if (true || list != null && !list.isEmpty()) { // CraftBukkit - Call event even if no effects to apply
|
||||||
AxisAlignedBB axisalignedbb = this.boundingBox.grow(4.0D, 2.0D, 4.0D);
|
AxisAlignedBB axisalignedbb = this.boundingBox.grow(4.0D, 2.0D, 4.0D);
|
||||||
List list1 = this.world.a(EntityLiving.class, axisalignedbb);
|
List list1 = this.world.a(EntityLiving.class, axisalignedbb);
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public class EntityPotion extends EntityProjectile {
|
||||||
}
|
}
|
||||||
|
|
||||||
org.bukkit.event.entity.PotionSplashEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPotionSplashEvent(this, affected);
|
org.bukkit.event.entity.PotionSplashEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPotionSplashEvent(this, affected);
|
||||||
if (!event.isCancelled()) {
|
if (!event.isCancelled() && list != null && !list.isEmpty()) { // do not process effects if there are no effects to process
|
||||||
for (LivingEntity victim : event.getAffectedEntities()) {
|
for (LivingEntity victim : event.getAffectedEntities()) {
|
||||||
if (!(victim instanceof CraftLivingEntity)) {
|
if (!(victim instanceof CraftLivingEntity)) {
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Reference in a new issue