3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00
Paper/nms-patches/PathfinderGoalTame.patch

13 Zeilen
810 B
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/PathfinderGoalTame.java
+++ b/net/minecraft/server/PathfinderGoalTame.java
2016-02-29 22:32:46 +01:00
@@ -51,7 +51,8 @@
int i = this.entity.getTemper();
int j = this.entity.getMaxDomestication();
2016-02-29 22:32:46 +01:00
- if (j > 0 && this.entity.getRandom().nextInt(j) < i) {
+ // CraftBukkit - fire EntityTameEvent
2016-02-29 22:32:46 +01:00
+ 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.g((EntityHuman) entity);
this.entity.world.broadcastEntityEffect(this.entity, (byte) 7);
return;