summaryrefslogtreecommitdiffstats
path: root/nms-patches/PathfinderGoalBreed.patch
blob: 1965fd02dec8be13f41d3890ea1bc2f865709911 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--- ../work/decompile-8eb82bde//net/minecraft/server/PathfinderGoalBreed.java	2014-11-28 11:22:56.098823159 +0000
+++ src/main/java/net/minecraft/server/PathfinderGoalBreed.java	2014-11-28 11:01:54.000000000 +0000
@@ -70,6 +70,11 @@
         EntityAgeable entityageable = this.d.createChild(this.e);
 
         if (entityageable != null) {
+            // CraftBukkit start - set persistence for tame animals
+            if (entityageable instanceof EntityTameableAnimal && ((EntityTameableAnimal) entityageable).isTamed()) {
+                entityageable.persistent = true;
+            }
+            // CraftBukkit end
             EntityHuman entityhuman = this.d.co();
 
             if (entityhuman == null && this.e.co() != null) {
@@ -89,7 +94,7 @@
             this.e.cq();
             entityageable.setAgeRaw(-24000);
             entityageable.setPositionRotation(this.d.locX, this.d.locY, this.d.locZ, 0.0F, 0.0F);
-            this.a.addEntity(entityageable);
+            this.a.addEntity(entityageable, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason
             Random random = this.d.bb();
 
             for (int i = 0; i < 7; ++i) {