diff options
author | sk89q <the.sk89q@gmail.com> | 2011-01-20 00:49:35 -0800 |
---|---|---|
committer | sk89q <the.sk89q@gmail.com> | 2011-01-20 02:10:32 -0800 |
commit | 62624a079932adbe3e75a3bc2a120d6377a9a0e3 (patch) | |
tree | 59730c2eb014e981e0a62631e3e417fc7c301478 /src/main/java/net | |
parent | 62344b57f2b43e4f52d6989a5c2d3f9e05e15550 (diff) | |
download | craftbukkit-62624a079932adbe3e75a3bc2a120d6377a9a0e3.tar craftbukkit-62624a079932adbe3e75a3bc2a120d6377a9a0e3.tar.gz craftbukkit-62624a079932adbe3e75a3bc2a120d6377a9a0e3.tar.lz craftbukkit-62624a079932adbe3e75a3bc2a120d6377a9a0e3.tar.xz craftbukkit-62624a079932adbe3e75a3bc2a120d6377a9a0e3.zip |
Added suffocation damage as an event.
Diffstat (limited to 'src/main/java/net')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityLiving.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java index 24daad60..fb0debdd 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -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; |