From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: draycia Date: Tue, 31 Mar 2020 23:48:55 -0700 Subject: [PATCH] Configurable villager breeding diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java index cb8ea90c03bcd5ad81d9478abcd556838143850e..ab3497bd22beffaf7a66bdd502b9e1bfc6478881 100644 --- a/src/main/java/net/minecraft/world/entity/npc/Villager.java +++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java @@ -775,7 +775,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler @Override public boolean canBreed() { - return this.foodLevel + this.countFoodPointsInInventory() >= 12 && !this.isSleeping() && this.getAge() == 0; + return this.level.purpurConfig.villagerCanBreed && this.foodLevel + this.countFoodPointsInInventory() >= 12 && !this.isSleeping() && this.getAge() == 0; // Purpur } private boolean hungry() { diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java index e05c07533300c567a9083e28e1f4c81b9381010d..cf2904fabe3389ef72d1b4901961192a2b1d3072 100644 --- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java +++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java @@ -1609,6 +1609,7 @@ public class PurpurWorldConfig { public double villagerMaxHealth = 20.0D; public boolean villagerFollowEmeraldBlock = false; public boolean villagerCanBeLeashed = false; + public boolean villagerCanBreed = true; private void villagerSettings() { villagerRidable = getBoolean("mobs.villager.ridable", villagerRidable); villagerRidableInWater = getBoolean("mobs.villager.ridable-in-water", villagerRidableInWater); @@ -1621,6 +1622,7 @@ public class PurpurWorldConfig { villagerMaxHealth = getDouble("mobs.villager.attributes.max_health", villagerMaxHealth); villagerFollowEmeraldBlock = getBoolean("mobs.villager.follow-emerald-blocks", villagerFollowEmeraldBlock); villagerCanBeLeashed = getBoolean("mobs.villager.can-be-leashed", villagerCanBeLeashed); + villagerCanBreed = getBoolean("mobs.villager.can-breed", villagerCanBreed); } public boolean vindicatorRidable = false;