diff options
author | gjmcferrin@gmail.com <gjmcferrin@gmail.com> | 2013-03-28 21:18:11 -0400 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2013-03-28 21:10:42 -0500 |
commit | adbee6049e68f7df26ff3314da72141f63c3188d (patch) | |
tree | b2a1896c5bfcf322e6e0cd6d6ff3a37a39a588af | |
parent | acd637d48b7550254956b8aa8a09f69980050b39 (diff) | |
download | craftbukkit-adbee6049e68f7df26ff3314da72141f63c3188d.tar craftbukkit-adbee6049e68f7df26ff3314da72141f63c3188d.tar.gz craftbukkit-adbee6049e68f7df26ff3314da72141f63c3188d.tar.lz craftbukkit-adbee6049e68f7df26ff3314da72141f63c3188d.tar.xz craftbukkit-adbee6049e68f7df26ff3314da72141f63c3188d.zip |
Call appropriate event for zombies igniting players. Adds BUKKIT-3915
-rw-r--r-- | src/main/java/net/minecraft/server/EntityZombie.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java index a7fe3094..b8a7c07e 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -2,7 +2,10 @@ package net.minecraft.server; import java.util.Calendar; -import org.bukkit.event.entity.EntityCombustEvent; // CraftBukkit +//CraftBukkit start +import org.bukkit.event.entity.EntityCombustByEntityEvent; +import org.bukkit.event.entity.EntityCombustEvent; +//CraftBukkit end public class EntityZombie extends EntityMonster { @@ -129,7 +132,14 @@ public class EntityZombie extends EntityMonster { boolean flag = super.m(entity); if (flag && this.bG() == null && this.isBurning() && this.random.nextFloat() < (float) this.world.difficulty * 0.3F) { - entity.setOnFire(2 * this.world.difficulty); + // CraftBukkit start + EntityCombustByEntityEvent event = new EntityCombustByEntityEvent(this.getBukkitEntity(), entity.getBukkitEntity(), 2 * this.world.difficulty); + this.world.getServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { + entity.setOnFire(event.getDuration()); + } + // CraftBukkit end } return flag; |