From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: William Blake Galbreath 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 b230c79a830375a1d3b9262620f51039c30102ce..50f6eb50a20773bab78e96e9c4cbac79a5893310 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -478,5 +478,10 @@ public class PaperWorldConfig { private void disableRelativeProjectileVelocity() { disableRelativeProjectileVelocity = getBoolean("game-mechanics.disable-relative-projectile-velocity", false); } + + public boolean disablePillagerPatrols = false; + private void pillagerSettings() { + disablePillagerPatrols = getBoolean("game-mechanics.disable-pillager-patrols", disablePillagerPatrols); + } } diff --git a/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java index 65d9211b812995869e58900a2873583658122312..96765f740eb5704c977be7c037ecf81fbc1c7a92 100644 --- a/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java +++ b/src/main/java/net/minecraft/world/level/levelgen/PatrolSpawner.java @@ -25,6 +25,7 @@ public class PatrolSpawner implements CustomSpawner { @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)) {