Files
Purpur/patches/server/0074-Configurable-villager-breeding.patch
2023-06-08 19:58:32 -07: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 e258d5b83e5cb517b9fe2e2818391f0666cacd84..26d7b7de2dc2b59224311bc9541a5f0f0f386277 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -779,7 +779,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 4f5f144127787b5deaca89f5fa97551c8caf4c28..da232210c18f9389dd51a30f4bf72b4e913513c2 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;