diff options
author | EvilSeph <evilseph@unaligned.org> | 2011-06-23 19:26:36 -0400 |
---|---|---|
committer | EvilSeph <evilseph@unaligned.org> | 2011-06-23 20:07:34 -0400 |
commit | 0b92a51ba70ea8112aee6a8fd735456994c03fd2 (patch) | |
tree | d0810d5cb40bcf953b9441b1c030ac706ddaf655 | |
parent | a5dd42adb952bdd9a948c95c2f518fd7e6fe5538 (diff) | |
download | craftbukkit-0b92a51ba70ea8112aee6a8fd735456994c03fd2.tar craftbukkit-0b92a51ba70ea8112aee6a8fd735456994c03fd2.tar.gz craftbukkit-0b92a51ba70ea8112aee6a8fd735456994c03fd2.tar.lz craftbukkit-0b92a51ba70ea8112aee6a8fd735456994c03fd2.tar.xz craftbukkit-0b92a51ba70ea8112aee6a8fd735456994c03fd2.zip |
Fixed the fix of the EntityTame event.
-rw-r--r-- | src/main/java/net/minecraft/server/EntityWolf.java | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/src/main/java/net/minecraft/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java index 8ef074f0..114b91de 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java @@ -374,23 +374,18 @@ public class EntityWolf extends EntityAnimal { } if (!this.world.isStatic) { - // CraftBukkit start - if (this.random.nextInt(3) == 0) { - EntityTameEvent event = CraftEventFactory.callEntityTameEvent(this, entityhuman); - - if (!event.isCancelled()) { - // CraftBukkit end - this.d(true); - this.a((PathEntity) null); - this.setSitting(true); - this.health = 20; - this.a(entityhuman.name); - this.a(true); - this.world.a(this, (byte) 7); - } else { - this.a(false); - this.world.a(this, (byte) 6); - } + // CraftBukkit - added event call and isCancelled check. + if (this.random.nextInt(3) == 0 && !CraftEventFactory.callEntityTameEvent(this, entityhuman).isCancelled()) { + this.d(true); + this.a((PathEntity) null); + this.setSitting(true); + this.health = 20; + this.a(entityhuman.name); + this.a(true); + this.world.a(this, (byte) 7); + } else { + this.a(false); + this.world.a(this, (byte) 6); } } |