mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 20:50:41 +01:00
[Bleeding] Call event when reflecting fireballs. Adds BUKKIT-5214
This commit is contained in:
parent
624603cd41
commit
9bc3b7df24
1 changed files with 12 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue