3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00
Paper/nms-patches/PathfinderGoalBreed.patch

24 Zeilen
1.1 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/PathfinderGoalBreed.java
+++ b/net/minecraft/server/PathfinderGoalBreed.java
@@ -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
2015-02-26 23:41:06 +01:00
EntityHuman entityhuman = this.d.cq();
2015-02-26 23:41:06 +01:00
if (entityhuman == null && this.e.cq() != null) {
@@ -89,7 +94,7 @@
2015-02-26 23:41:06 +01:00
this.e.cs();
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
2015-02-26 23:41:06 +01:00
Random random = this.d.bc();
for (int i = 0; i < 7; ++i) {