From 2015fe5f717ec3e0d0cf2d2ca6ae6d52b64c86a4 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Thu, 13 May 2021 22:36:24 -0500 Subject: [PATCH] Breedable parrots --- patches/server/0214-Breedable-parrots.patch | 55 +++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 patches/server/0214-Breedable-parrots.patch diff --git a/patches/server/0214-Breedable-parrots.patch b/patches/server/0214-Breedable-parrots.patch new file mode 100644 index 000000000..bd9412f18 --- /dev/null +++ b/patches/server/0214-Breedable-parrots.patch @@ -0,0 +1,55 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: BillyGalbreath +Date: Thu, 13 May 2021 22:17:50 -0500 +Subject: [PATCH] Breedable parrots + + +diff --git a/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java b/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java +index 2f51e80a02817f1e36c8fe9542809ab881263a16..f5007837f99c0f8cf941293c215516cd926fe999 100644 +--- a/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java ++++ b/src/main/java/net/minecraft/world/entity/animal/EntityParrot.java +@@ -44,6 +44,7 @@ import net.minecraft.world.entity.GroupDataEntity; + import net.minecraft.world.entity.ai.attributes.AttributeProvider; + import net.minecraft.world.entity.ai.attributes.GenericAttributes; + import net.minecraft.world.entity.ai.control.ControllerMoveFlying; ++import net.minecraft.world.entity.ai.goal.PathfinderGoalBreed; + import net.minecraft.world.entity.ai.goal.PathfinderGoalFloat; + import net.minecraft.world.entity.ai.goal.PathfinderGoalFollowEntity; + import net.minecraft.world.entity.ai.goal.PathfinderGoalFollowOwner; +@@ -205,6 +206,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + this.goalSelector.a(0, new PathfinderGoalFloat(this)); + this.goalSelector.a(0, new PathfinderGoalHasRider(this)); // Purpur + this.goalSelector.a(1, new PathfinderGoalPanic(this, 1.25D)); // Purpur ++ if (world.purpurConfig.parrotBreedable) this.goalSelector.addGoal(1, new PathfinderGoalBreed(this, 1.0D)); // Purpur + this.goalSelector.a(1, new PathfinderGoalLookAtPlayer(this, EntityHuman.class, 8.0F)); + this.goalSelector.a(2, new PathfinderGoalSit(this)); + this.goalSelector.a(2, new PathfinderGoalFollowOwner(this, 1.0D, 5.0F, 1.0F, true)); +@@ -353,7 +355,7 @@ public class EntityParrot extends EntityPerchable implements EntityBird { + + @Override + public boolean mate(EntityAnimal entityanimal) { +- return false; ++ return super.mate(entityanimal); // Purpur + } + + @Nullable +diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +index ffb8d505a723d61bd6311f4116524d9a99a27f62..db8b31972b38f907a53b4f63465c83d1f47f4dc3 100644 +--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java ++++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +@@ -1345,6 +1345,7 @@ public class PurpurWorldConfig { + public boolean parrotRidableInWater = false; + public double parrotMaxY = 256D; + public double parrotMaxHealth = 6.0D; ++ public boolean parrotBreedable = false; + private void parrotSettings() { + parrotRidable = getBoolean("mobs.parrot.ridable", parrotRidable); + parrotRidableInWater = getBoolean("mobs.parrot.ridable-in-water", parrotRidableInWater); +@@ -1355,6 +1356,7 @@ public class PurpurWorldConfig { + set("mobs.parrot.attributes.max_health", oldValue); + } + parrotMaxHealth = getDouble("mobs.parrot.attributes.max_health", parrotMaxHealth); ++ parrotBreedable = getBoolean("mobs.parrot.can-breed", parrotBreedable); + } + + public boolean phantomRidable = false;