Paper/nms-patches/PathfinderGoalMakeLove.patch

24 lines
996 B
Diff
Raw Normal View History

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/PathfinderGoalMakeLove.java
+++ b/net/minecraft/server/PathfinderGoalMakeLove.java
2016-06-19 07:00:39 +02:00
@@ -80,6 +80,11 @@
private void i() {
2018-12-13 01:00:00 +01:00
EntityVillager entityvillager = this.a.createChild(this.b);
2016-06-19 07:00:39 +02:00
+ // CraftBukkit start - call EntityBreedEvent
2018-07-15 02:00:00 +02:00
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityBreedEvent(entityvillager, this.a, this.b, null, null, 0).isCancelled()) {
2016-06-19 07:00:39 +02:00
+ return;
+ }
+ // CraftBukkit end
this.b.setAgeRaw(6000);
2018-07-15 02:00:00 +02:00
this.a.setAgeRaw(6000);
2016-06-19 07:00:39 +02:00
@@ -87,7 +92,7 @@
2018-07-15 02:00:00 +02:00
this.a.v(false);
entityvillager.setAgeRaw(-24000);
2018-07-15 02:00:00 +02:00
entityvillager.setPositionRotation(this.a.locX, this.a.locY, this.a.locZ, 0.0F, 0.0F);
- this.c.addEntity(entityvillager);
+ this.c.addEntity(entityvillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason
this.c.broadcastEntityEffect(entityvillager, (byte) 12);
}
}