summaryrefslogtreecommitdiffstats
path: root/nms-patches/PathfinderGoalTame.patch
blob: 8026e5b2b821436e722fa208938bfc907fd127cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
--- a/net/minecraft/server/PathfinderGoalTame.java
+++ b/net/minecraft/server/PathfinderGoalTame.java
@@ -51,7 +51,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.h((EntityHuman) entity);
                     return;
                 }