diff options
author | EdGruberman <ed@rjump.com> | 2013-03-28 09:09:19 -0700 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-28 21:14:48 -0500 |
commit | 377be0a79ed8a49ecac6fdfd8221fbe33d653150 (patch) | |
tree | 17bf400e33c54ff6ac747a00d667b551640c6d5a /src/main/java | |
parent | adbee6049e68f7df26ff3314da72141f63c3188d (diff) | |
download | craftbukkit-377be0a79ed8a49ecac6fdfd8221fbe33d653150.tar craftbukkit-377be0a79ed8a49ecac6fdfd8221fbe33d653150.tar.gz craftbukkit-377be0a79ed8a49ecac6fdfd8221fbe33d653150.tar.lz craftbukkit-377be0a79ed8a49ecac6fdfd8221fbe33d653150.tar.xz craftbukkit-377be0a79ed8a49ecac6fdfd8221fbe33d653150.zip |
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.
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityPotion.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPotion.java b/src/main/java/net/minecraft/server/EntityPotion.java index a189e1de..be9e339c 100644 --- a/src/main/java/net/minecraft/server/EntityPotion.java +++ b/src/main/java/net/minecraft/server/EntityPotion.java @@ -64,7 +64,7 @@ public class EntityPotion extends EntityProjectile { if (!this.world.isStatic) { 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); 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); - 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()) { if (!(victim instanceof CraftLivingEntity)) { continue; |