diff options
author | Andrew Ardill <andrew.ardill@gmail.com> | 2011-11-29 18:10:05 +1100 |
---|---|---|
committer | Andrew Ardill <andrew.ardill@gmail.com> | 2011-11-29 18:20:21 +1100 |
commit | 3da00ee41adf0ecfc31d5c330c281a8d5fe8a7b1 (patch) | |
tree | f9fff4196425ff33ceccd6c29a79df97ce253c91 /src/main/java/net/minecraft/server/EntityHuman.java | |
parent | 0c88f05c0da5e5f4a4dbd9be3ccbe2482e7b2f79 (diff) | |
download | craftbukkit-3da00ee41adf0ecfc31d5c330c281a8d5fe8a7b1.tar craftbukkit-3da00ee41adf0ecfc31d5c330c281a8d5fe8a7b1.tar.gz craftbukkit-3da00ee41adf0ecfc31d5c330c281a8d5fe8a7b1.tar.lz craftbukkit-3da00ee41adf0ecfc31d5c330c281a8d5fe8a7b1.tar.xz craftbukkit-3da00ee41adf0ecfc31d5c330c281a8d5fe8a7b1.zip |
Implementation of reworked EntityCombustEvents
Also includes some extra comments, and a refactoring of the
PaintingBreakByEntity event that is raised when lighting strikes a painting.
Diffstat (limited to 'src/main/java/net/minecraft/server/EntityHuman.java')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityHuman.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java index 0688632d..4c127148 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -8,6 +8,7 @@ import org.bukkit.craftbukkit.entity.CraftItem; import org.bukkit.craftbukkit.TrigMath; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; +import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityTargetEvent; @@ -838,7 +839,12 @@ public abstract class EntityHuman extends EntityLiving { int l = EnchantmentManager.c(this.inventory, (EntityLiving) entity); if (l > 0) { - entity.j(l * 4); + // CraftBukkit start - raise a combust event when somebody hits with a fire enchanted item + EntityCombustByEntityEvent combustEvent = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), l*4); + if (!combustEvent.isCancelled()) { + entity.j(combustEvent.getDuration()); + } + // CraftBukkit end } } |