diff options
author | Wesley Wolfe <weswolf@aol.com> | 2012-03-20 02:07:13 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-20 03:24:57 -0400 |
commit | 68b98d4c8fab36d5b139b3a404069d5b99d56886 (patch) | |
tree | 82fc4b625f9906af11ca410171a69fca4d0a2e1c /src/main/java/net/minecraft/server | |
parent | 9055a20d71698922c891ac2ff802a8d7e63f78be (diff) | |
download | craftbukkit-68b98d4c8fab36d5b139b3a404069d5b99d56886.tar craftbukkit-68b98d4c8fab36d5b139b3a404069d5b99d56886.tar.gz craftbukkit-68b98d4c8fab36d5b139b3a404069d5b99d56886.tar.lz craftbukkit-68b98d4c8fab36d5b139b3a404069d5b99d56886.tar.xz craftbukkit-68b98d4c8fab36d5b139b3a404069d5b99d56886.zip |
[Bleeding] Implement ExpBottleEvent; Addresses BUKKIT-888
Diffstat (limited to 'src/main/java/net/minecraft/server')
-rw-r--r-- | src/main/java/net/minecraft/server/EntityThrownExpBottle.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java index 70b254e9..820b330e 100644 --- a/src/main/java/net/minecraft/server/EntityThrownExpBottle.java +++ b/src/main/java/net/minecraft/server/EntityThrownExpBottle.java @@ -28,9 +28,18 @@ public class EntityThrownExpBottle extends EntityProjectile { protected void a(MovingObjectPosition movingobjectposition) { if (!this.world.isStatic) { - this.world.triggerEffect(2002, (int) Math.round(this.locX), (int) Math.round(this.locY), (int) Math.round(this.locZ), 0); + // CraftBukkit moved after event + //this.world.triggerEffect(2002, (int) Math.round(this.locX), (int) Math.round(this.locY), (int) Math.round(this.locZ), 0); int i = 3 + this.world.random.nextInt(5) + this.world.random.nextInt(5); + // CraftBukkit start + org.bukkit.event.entity.ExpBottleEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callExpBottleEvent(this, i); + i = event.getExperience(); + if (event.getShowEffect()) { + this.world.triggerEffect(2002, (int) Math.round(this.locX), (int) Math.round(this.locY), (int) Math.round(this.locZ), 0); + } + // CraftBukkit end + while (i > 0) { int j = EntityExperienceOrb.getOrbValue(i); |