2015-05-25 18:37:24 +08:00
|
|
|
--- a/net/minecraft/server/PathfinderGoalBreed.java
|
|
|
|
+++ b/net/minecraft/server/PathfinderGoalBreed.java
|
2016-03-01 05:32:46 +08:00
|
|
|
@@ -69,6 +69,11 @@
|
|
|
|
EntityAgeable entityageable = this.animal.createChild(this.partner);
|
2014-11-26 05:32:16 +08:00
|
|
|
|
|
|
|
if (entityageable != null) {
|
|
|
|
+ // CraftBukkit start - set persistence for tame animals
|
|
|
|
+ if (entityageable instanceof EntityTameableAnimal && ((EntityTameableAnimal) entityageable).isTamed()) {
|
|
|
|
+ entityageable.persistent = true;
|
|
|
|
+ }
|
|
|
|
+ // CraftBukkit end
|
2016-03-01 05:32:46 +08:00
|
|
|
EntityHuman entityhuman = this.animal.getBreedCause();
|
2014-11-26 05:32:16 +08:00
|
|
|
|
2016-03-01 05:32:46 +08:00
|
|
|
if (entityhuman == null && this.partner.getBreedCause() != null) {
|
|
|
|
@@ -88,7 +93,7 @@
|
|
|
|
this.partner.resetLove();
|
2014-11-26 05:32:16 +08:00
|
|
|
entityageable.setAgeRaw(-24000);
|
2016-03-01 05:32:46 +08:00
|
|
|
entityageable.setPositionRotation(this.animal.locX, this.animal.locY, this.animal.locZ, 0.0F, 0.0F);
|
2014-11-26 05:32:16 +08:00
|
|
|
- this.a.addEntity(entityageable);
|
|
|
|
+ this.a.addEntity(entityageable, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.BREEDING); // CraftBukkit - added SpawnReason
|
2016-03-01 05:32:46 +08:00
|
|
|
Random random = this.animal.getRandom();
|
2014-11-26 05:32:16 +08:00
|
|
|
|
|
|
|
for (int i = 0; i < 7; ++i) {
|