diff options
author | EvilSeph <evilseph@gmail.com> | 2012-03-09 22:25:59 -0500 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-03-09 22:26:21 -0500 |
commit | fce3386aa072eeb52c335208959ce445c4aeb543 (patch) | |
tree | 5f0c50f947ae2fa6029d6ae5fcceafb9c7a6955b | |
parent | e625999f2452e7d944d73a883109ee2fa4e64d65 (diff) | |
download | craftbukkit-fce3386aa072eeb52c335208959ce445c4aeb543.tar craftbukkit-fce3386aa072eeb52c335208959ce445c4aeb543.tar.gz craftbukkit-fce3386aa072eeb52c335208959ce445c4aeb543.tar.lz craftbukkit-fce3386aa072eeb52c335208959ce445c4aeb543.tar.xz craftbukkit-fce3386aa072eeb52c335208959ce445c4aeb543.zip |
Added EntityTame event. Fixes BUKKIT-1109
-rw-r--r-- | src/main/java/net/minecraft/server/EntityOcelot.java | 3 | ||||
-rw-r--r-- | src/main/java/net/minecraft/server/EntityWolf.java | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/EntityOcelot.java b/src/main/java/net/minecraft/server/EntityOcelot.java index 0dce6fa0..fdddcdde 100644 --- a/src/main/java/net/minecraft/server/EntityOcelot.java +++ b/src/main/java/net/minecraft/server/EntityOcelot.java @@ -115,7 +115,8 @@ public class EntityOcelot extends EntityTameableAnimal { } if (!this.world.isStatic) { - if (this.random.nextInt(3) == 0) { + // CraftBukkit - added event call and isCancelled check. + if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { this.setTamed(true); this.setCatType(1 + this.world.random.nextInt(3)); this.setOwnerName(entityhuman.name); diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java index 8b81401e..5003668d 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java @@ -186,7 +186,8 @@ public class EntityWolf extends EntityTameableAnimal { } if (!this.world.isStatic) { - if (this.random.nextInt(3) == 0) { + // CraftBukkit - added event call and isCancelled check. + if (this.random.nextInt(3) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { this.setTamed(true); this.setPathEntity((PathEntity) null); this.b((EntityLiving) null); |