testserver/patches/server/0335-Add-option-to-disable-...

34 lines
1.8 KiB
Diff
Raw Normal View History

2021-06-11 12:02:28 +00:00
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
2022-03-11 20:13:46 +00:00
index b59eb179c188382d13c342ff78bc76c30ade8335..9bc6dc4e6159aa0ccad3cd7bdb331a852c5978ae 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
2022-03-11 20:13:46 +00:00
@@ -452,5 +452,10 @@ public class PaperWorldConfig {
2021-11-24 05:44:21 +00:00
private void disableRelativeProjectileVelocity() {
disableRelativeProjectileVelocity = getBoolean("game-mechanics.disable-relative-projectile-velocity", false);
2021-06-11 12:02:28 +00:00
}
+
+ public boolean disablePillagerPatrols = false;
+ private void pillagerSettings() {
+ disablePillagerPatrols = getBoolean("game-mechanics.disable-pillager-patrols", disablePillagerPatrols);
+ }
}
2021-06-13 19:29:58 +00:00
2021-06-11 12:02:28 +00:00
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java
2022-03-01 05:43:03 +00:00
index 38bdce99b6be6e0dfc3dcd975af3faa8dbe42f7e..d5a701b2d684bbe18f985adb6bd62e9218d3a0a6 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java
2022-03-01 05:43:03 +00:00
@@ -24,6 +24,7 @@ public class PatrolSpawner implements CustomSpawner {
2021-06-11 12:02:28 +00:00
@Override
public int tick(ServerLevel world, boolean spawnMonsters, boolean spawnAnimals) {
+ if (world.paperConfig.disablePillagerPatrols) return 0; // Paper
if (!spawnMonsters) {
return 0;
} else if (!world.getGameRules().getBoolean(GameRules.RULE_DO_PATROL_SPAWNING)) {