mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 19:46:21 +01:00
Fixed the fix of the EntityTame event.
This commit is contained in:
parent
a5dd42adb9
commit
0b92a51ba7
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user