Files
Purpur/patches/server/0073-Configurable-villager-breeding.patch
Ben Kerllenevich 3f2e212cda 100/310
2023-06-08 17:58:43 -04:00

40 lines
2.3 KiB
Diff

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/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index d2fcf2121ff9765fed268b2984a865329d27a17a..8144e3c60bc586bd48677a1d1af3b20f1a1fa337 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -755,7 +755,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 25fd73c046f62848cbe016f5f9dfce2d2b2a03c6..6c9a5b5696b042d5e9358fc5261b8965bdfaf01f 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1201,6 +1201,7 @@ public class PurpurWorldConfig {
public double villagerMaxHealth = 20.0D;
public boolean villagerFollowEmeraldBlock = false;
public boolean villagerCanBeLeashed = false;
+ public boolean villagerCanBreed = true;
private void villagerSettings() {
if (PurpurConfig.version < 10) {
double oldValue = getDouble("mobs.villager.attributes.max-health", villagerMaxHealth);
@@ -1210,6 +1211,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 double vindicatorMaxHealth = 24.0D;