mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-17 06:48:23 +01:00
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
This commit is contained in:
parent
478f246490
commit
4bead5b898
3 changed files with 16 additions and 5 deletions
|
@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
|
||||||
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
@@ -0,0 +0,0 @@ public class PaperWorldConfig {
|
||||||
maxMobSpawnAttempts = getInt("max-mob-spawn-attempts", 50);
|
}
|
||||||
log( "Max Mob Spawn Attempts: " + maxMobSpawnAttempts);
|
}
|
||||||
}
|
}
|
||||||
+
|
+
|
||||||
+ public boolean frostedIceEnabled = true;
|
+ public boolean frostedIceEnabled = true;
|
||||||
|
|
|
@ -20,8 +20,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+
|
+
|
||||||
+ public int maxMobSpawnAttempts;
|
+ public int maxMobSpawnAttempts;
|
||||||
+ private void maxMobSpawnAttempts() {
|
+ private void maxMobSpawnAttempts() {
|
||||||
+ maxMobSpawnAttempts = getInt("max-mob-spawn-attempts", 50);
|
+ maxMobSpawnAttempts = getInt("max-mob-spawn-attempts", 250);
|
||||||
+ log( "Max Mob Spawn Attempts: " + maxMobSpawnAttempts);
|
+ 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/src/main/java/net/minecraft/server/SpawnerCreature.java b/src/main/java/net/minecraft/server/SpawnerCreature.java
|
||||||
|
|
|
@ -66,8 +66,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+
|
+
|
||||||
+ commands = new HashMap<String, Command>();
|
+ commands = new HashMap<String, Command>();
|
||||||
+
|
+
|
||||||
+ version = getInt("config-version", 9);
|
+ version = getInt("config-version", 10);
|
||||||
+ set("config-version", 9);
|
+ set("config-version", 10);
|
||||||
+ readConfig(PaperConfig.class, null);
|
+ readConfig(PaperConfig.class, null);
|
||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
|
@ -217,6 +217,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+
|
+
|
||||||
+ private void set(String path, Object val) {
|
+ private void set(String path, Object val) {
|
||||||
+ config.set("world-settings.default." + path, 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) {
|
+ private boolean getBoolean(String path, boolean def) {
|
||||||
|
|
Loading…
Reference in a new issue