summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorsk89q <the.sk89q@gmail.com>2011-01-30 01:26:45 -0800
committersk89q <the.sk89q@gmail.com>2011-01-30 01:26:45 -0800
commitd0cd8c6cc7d1aaf38934996e7e5d3e03272e4ff1 (patch)
treeec6b229ab54eefb71c59f593395920d7a13449b9 /src/main
parentd92376e10681bc358cceae0888a1adc57820048a (diff)
downloadcraftbukkit-d0cd8c6cc7d1aaf38934996e7e5d3e03272e4ff1.tar
craftbukkit-d0cd8c6cc7d1aaf38934996e7e5d3e03272e4ff1.tar.gz
craftbukkit-d0cd8c6cc7d1aaf38934996e7e5d3e03272e4ff1.tar.lz
craftbukkit-d0cd8c6cc7d1aaf38934996e7e5d3e03272e4ff1.tar.xz
craftbukkit-d0cd8c6cc7d1aaf38934996e7e5d3e03272e4ff1.zip
Fixed drowning damage event.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/net/minecraft/server/EntityLiving.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index dc8f4620..17d62bee 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -167,7 +167,19 @@ public abstract class EntityLiving extends Entity {
this.l.a("bubble", p + (double) f1, q + (double) f2, r + (double) f3, this.s, t, u);
}
- a(((Entity) (null)), 2);
+ // CraftBukkit start
+ CraftServer server = ((WorldServer) l).getServer();
+ org.bukkit.entity.Entity damagee = this.getBukkitEntity();
+ DamageCause damageType = EntityDamageEvent.DamageCause.DROWNING;
+ int damageDone = 2;
+
+ EntityDamageEvent ede = new EntityDamageEvent(damagee, damageType, damageDone);
+ server.getPluginManager().callEvent(ede);
+
+ if (!ede.isCancelled()){
+ a(((Entity) (null)), ede.getDamage());
+ }
+ // CraftBukkit end
}
Z = 0;
} else {