diff options
author | t00thpick1 <t00thpick1dirko@gmail.com> | 2013-12-20 17:36:09 -0500 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-12-20 23:37:56 -0600 |
commit | 9bc3b7df2448ed2d3601e113a673e70599a24152 (patch) | |
tree | b24e7e40505b16a9b3960f9451575fb4c2d46a80 /src/main/java/net | |
parent | 624603cd41aabb3a40e4b74dbc089e78401d81f6 (diff) | |
download | craftbukkit-9bc3b7df2448ed2d3601e113a673e70599a24152.tar craftbukkit-9bc3b7df2448ed2d3601e113a673e70599a24152.tar.gz craftbukkit-9bc3b7df2448ed2d3601e113a673e70599a24152.tar.lz craftbukkit-9bc3b7df2448ed2d3601e113a673e70599a24152.tar.xz craftbukkit-9bc3b7df2448ed2d3601e113a673e70599a24152.zip |
[Bleeding] Call event when reflecting fireballs. Adds BUKKIT-5214
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityFireball.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/java/net/minecraft/server/EntityFireball.java b/src/main/java/net/minecraft/server/EntityFireball.java index 6915c374..82da554b 100644 --- a/src/main/java/net/minecraft/server/EntityFireball.java +++ b/src/main/java/net/minecraft/server/EntityFireball.java @@ -2,6 +2,8 @@ package net.minecraft.server; import java.util.List; +import org.bukkit.event.entity.EntityDamageByEntityEvent; // CraftBukkit + public abstract class EntityFireball extends Entity { private int e = -1; @@ -231,6 +233,16 @@ public abstract class EntityFireball extends Entity { } else { this.Q(); if (damagesource.getEntity() != null) { + // CraftBukkit start + EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(damagesource.getEntity().getBukkitEntity(), this.getBukkitEntity(), org.bukkit.event.entity.EntityDamageEvent.DamageCause.ENTITY_ATTACK, f); + + world.getServer().getPluginManager().callEvent(event); + + if (event.isCancelled()) { + return false; + } + // CraftBukkit end + Vec3D vec3d = damagesource.getEntity().ag(); if (vec3d != null) { |