From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: draycia <lonelyyordle@gmail.com>
Date: Tue, 31 Mar 2020 23:48:55 -0700
Subject: [PATCH] Configurable villager breeding


diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
index 8002c55497f772eadae3242cad06d529571e97bf..762f1acf435c6e7b6d695fc1b2120de0116f46da 100644
--- a/src/main/java/net/minecraft/server/EntityVillager.java
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
@@ -640,7 +640,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
 
     @Override
     public boolean canBreed() {
-        return this.bx + this.fv() >= 12 && this.getAge() == 0;
+        return world.purpurConfig.villagerCanBreed && this.bx + this.fv() >= 12 && this.getAge() == 0; // Purpur
     }
 
     private boolean fr() {
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index fd7eabb033d8900bfab28c3d4a06626f7c0c3ef3..a47962e2cc277a5c86b9cb5ab793e84286bd9af1 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -471,6 +471,7 @@ public class PurpurWorldConfig {
     public boolean villagerFollowEmeraldBlock = false;
     public int villagerSpawnIronGolemRadius = 0;
     public int villagerSpawnIronGolemLimit = 0;
+    public boolean villagerCanBreed = true;
     private void villagerSettings() {
         villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks);
         villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging);
@@ -479,6 +480,7 @@ public class PurpurWorldConfig {
         villagerFollowEmeraldBlock = getBoolean("mobs.villager.follow-emerald-blocks", villagerFollowEmeraldBlock);
         villagerSpawnIronGolemRadius = getInt("mobs.villager.spawn-iron-golem.radius", villagerSpawnIronGolemRadius);
         villagerSpawnIronGolemLimit = getInt("mobs.villager.spawn-iron-golem.limit", villagerSpawnIronGolemLimit);
+        villagerCanBreed = getBoolean("mobs.villager.can-breed", villagerCanBreed);
     }
 
     public boolean villagerTraderCanBeLeashed = false;
