mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 20:50:41 +01:00
Added suffocation damage as an event.
This commit is contained in:
parent
62344b57f2
commit
62624a0799
1 changed files with 11 additions and 1 deletions
|
@ -141,7 +141,17 @@ public abstract class EntityLiving extends Entity {
|
|||
}
|
||||
}
|
||||
if (B() && C()) {
|
||||
a(((Entity) (null)), 1);
|
||||
// CraftBukkit start
|
||||
CraftServer server = ((WorldServer) l).getServer();
|
||||
org.bukkit.entity.Entity victim = this.getBukkitEntity();
|
||||
DamageCause damageType = EntityDamageEvent.DamageCause.SUFFOCATION;
|
||||
EntityDamageEvent evt = new EntityDamageEvent(victim, damageType, 1);
|
||||
server.getPluginManager().callEvent(evt);
|
||||
|
||||
if (!evt.isCancelled()){
|
||||
a(((Entity) (null)), 1);
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
if (ae || this.l.z) {
|
||||
Z = 0;
|
||||
|
|
Loading…
Reference in a new issue