From 4bead5b89821cbb929f54d47068c20ab52115051 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 16 May 2016 22:07:12 -0400 Subject: [PATCH] bump the default maxMobSpawns default to 250, and add support for unlimited Use -1 to represent vanilla/unlimited. Updated PaperWorldConfig to also update the individual worlds limit if it was set to the new default value. Should hopefully help #235 --- ...d-ability-to-configure-frosted_ice-properties.patch | 4 ++-- ...w-capping-number-of-attempts-at-spawning-mobs.patch | 10 +++++++++- Spigot-Server-Patches/Paper-config-files.patch | 7 +++++-- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch b/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch index aa522f882d..cceb2b7f7f 100644 --- a/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch +++ b/Spigot-Server-Patches/Add-ability-to-configure-frosted_ice-properties.patch @@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { - maxMobSpawnAttempts = getInt("max-mob-spawn-attempts", 50); - log( "Max Mob Spawn Attempts: " + maxMobSpawnAttempts); + } + } } + + public boolean frostedIceEnabled = true; diff --git a/Spigot-Server-Patches/Allow-capping-number-of-attempts-at-spawning-mobs.patch b/Spigot-Server-Patches/Allow-capping-number-of-attempts-at-spawning-mobs.patch index edbfc6921c..a46862afc2 100644 --- a/Spigot-Server-Patches/Allow-capping-number-of-attempts-at-spawning-mobs.patch +++ b/Spigot-Server-Patches/Allow-capping-number-of-attempts-at-spawning-mobs.patch @@ -20,8 +20,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + public int maxMobSpawnAttempts; + private void maxMobSpawnAttempts() { -+ maxMobSpawnAttempts = getInt("max-mob-spawn-attempts", 50); ++ maxMobSpawnAttempts = getInt("max-mob-spawn-attempts", 250); + log( "Max Mob Spawn Attempts: " + maxMobSpawnAttempts); ++ if (maxMobSpawnAttempts < 0) { ++ maxMobSpawnAttempts = Integer.MAX_VALUE; ++ } else { ++ if (maxMobSpawnAttempts < 250 && PaperConfig.version < 10) { ++ set("max-mob-spawn-attempts", 250); ++ maxMobSpawnAttempts = 250; ++ } ++ } + } } diff --git a/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java diff --git a/Spigot-Server-Patches/Paper-config-files.patch b/Spigot-Server-Patches/Paper-config-files.patch index 3c43718e0a..a3d4895a9b 100644 --- a/Spigot-Server-Patches/Paper-config-files.patch +++ b/Spigot-Server-Patches/Paper-config-files.patch @@ -66,8 +66,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + commands = new HashMap(); + -+ version = getInt("config-version", 9); -+ set("config-version", 9); ++ version = getInt("config-version", 10); ++ set("config-version", 10); + readConfig(PaperConfig.class, null); + } + @@ -217,6 +217,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + private void set(String path, Object val) { + config.set("world-settings.default." + path, val); ++ if (config.get("world-settings." + worldName + "." + path) != null) { ++ config.set("world-settings." + worldName + "." + path, val); ++ } + } + + private boolean getBoolean(String path, boolean def) {