PaperMC/nms-patches/PathfinderGoalTame.patch
2020-06-25 10:00:00 +10:00

12 lines
744 B
Diff

--- a/net/minecraft/server/PathfinderGoalTame.java
+++ b/net/minecraft/server/PathfinderGoalTame.java
@@ -57,7 +57,8 @@
int i = this.entity.getTemper();
int j = this.entity.getMaxDomestication();
- if (j > 0 && this.entity.getRandom().nextInt(j) < i) {
+ // CraftBukkit - fire EntityTameEvent
+ if (j > 0 && this.entity.getRandom().nextInt(j) < i && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this.entity, ((org.bukkit.craftbukkit.entity.CraftHumanEntity) this.entity.getBukkitEntity().getPassenger()).getHandle()).isCancelled()) {
this.entity.i((EntityHuman) entity);
return;
}