Paper/Spigot-Server-Patches/0393-Add-option-to-disable-pillager-patrols.patch
Aikar b6925c36af
Remove no longer needed undead horse leash patch
This is now default vanilla behavior

Fixes #3644
2020-06-28 04:35:41 -04:00

33 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Wed, 9 Oct 2019 21:46:15 -0500
Subject: [PATCH] Add option to disable pillager patrols
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index fde31f324b3578c65a7d064c466b80ee46b65e03..c51a149fd9cd7f2d250f07a4ca0e7ce8c9b91383 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -572,4 +572,9 @@ public class PaperWorldConfig {
private void generatorSettings() {
generateFlatBedrock = getBoolean("generator-settings.flat-bedrock", false);
}
+
+ public boolean disablePillagerPatrols = false;
+ private void pillagerSettings() {
+ disablePillagerPatrols = getBoolean("game-mechanics.disable-pillager-patrols", disablePillagerPatrols);
+ }
}
diff --git a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java
index e108f14b36b5459503e02146f8c11e5223d6bd61..b1fea06d29a0c98136496d6eff81e6959cb73672 100644
--- a/src/main/java/net/minecraft/server/MobSpawnerPatrol.java
+++ b/src/main/java/net/minecraft/server/MobSpawnerPatrol.java
@@ -10,6 +10,7 @@ public class MobSpawnerPatrol implements MobSpawner {
@Override
public int a(WorldServer worldserver, boolean flag, boolean flag1) {
+ if (worldserver.paperConfig.disablePillagerPatrols) return 0; // Paper
if (!flag) {
return 0;
} else if (!worldserver.getGameRules().getBoolean(GameRules.DO_PATROL_SPAWNING)) {