diff options
author | GJ <gjmcferrin@gmail.com> | 2013-12-16 22:30:13 -0500 |
---|---|---|
committer | Nate Mortensen <nate.richard.mortensen@gmail.com> | 2014-01-30 21:47:44 -0700 |
commit | 7f2289945663c89f20bcc8bfde1124af42620a7c (patch) | |
tree | 73d24c1f736d8cfb13d3acc5bc3b53b73c8e4863 /src/main/java/net/minecraft | |
parent | e962b1bc095dda028182f59c6e9a2897ef2cd72f (diff) | |
download | craftbukkit-7f2289945663c89f20bcc8bfde1124af42620a7c.tar craftbukkit-7f2289945663c89f20bcc8bfde1124af42620a7c.tar.gz craftbukkit-7f2289945663c89f20bcc8bfde1124af42620a7c.tar.lz craftbukkit-7f2289945663c89f20bcc8bfde1124af42620a7c.tar.xz craftbukkit-7f2289945663c89f20bcc8bfde1124af42620a7c.zip |
[Bleeding] Re-add EntityShootBowEvent lost in e93a3eb3b4c5234e3e3936bc697d566a42d3b30e. Fixes BUKKIT-4214
In the 1.2 update for CraftBukkit, a missed diff resulted in Skeletons no longer firing an EntityShootBowEvent when they shoot an arrow.
Diffstat (limited to 'src/main/java/net/minecraft')
-rw-r--r-- | src/main/java/net/minecraft/server/EntitySkeleton.java | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntitySkeleton.java b/src/main/java/net/minecraft/server/EntitySkeleton.java index 11ba41a1..da5fd8f9 100644 --- a/src/main/java/net/minecraft/server/EntitySkeleton.java +++ b/src/main/java/net/minecraft/server/EntitySkeleton.java @@ -243,8 +243,20 @@ public class EntitySkeleton extends EntityMonster implements IRangedEntity { entityarrow.setOnFire(100); } + // CraftBukkit start + org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.be(), entityarrow, 0.8F); + if (event.isCancelled()) { + event.getProjectile().remove(); + return; + } + + if (event.getProjectile() == entityarrow.getBukkitEntity()) { + world.addEntity(entityarrow); + } + // CraftBukkit end + this.makeSound("random.bow", 1.0F, 1.0F / (this.aI().nextFloat() * 0.4F + 0.8F)); - this.world.addEntity(entityarrow); + // this.world.addEntity(entityarrow); // CraftBukkit - moved up } public int getSkeletonType() { |