Fixed EntityTame event firing too many times.

This commit is contained in:
EvilSeph 2011-06-17 23:06:20 -04:00
parent d48e9c22f5
commit 68695fb9d6

View File

@ -419,18 +419,12 @@ public class EntityWolf extends EntityAnimal {
}
public void d(boolean flag) {
// CraftBukkit start
EntityTameEvent event = CraftEventFactory.callEntityTameEvent(this, null);
byte b0 = this.datawatcher.a(16);
if (!event.isCancelled()) {
// CraftBukkit end
byte b0 = this.datawatcher.a(16);
if (flag) {
this.datawatcher.b(16, Byte.valueOf((byte) (b0 | 4)));
} else {
this.datawatcher.b(16, Byte.valueOf((byte) (b0 & -5)));
}
if (flag) {
this.datawatcher.b(16, Byte.valueOf((byte) (b0 | 4)));
} else {
this.datawatcher.b(16, Byte.valueOf((byte) (b0 & -5)));
}
}
}