mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-30 22:44:17 +01:00
Fixed multiworld difficulty.
World difficulty was incorrectly being set to 0 or 1 on reload depending on spawn-monsters instead of the difficulty server property.
This commit is contained in:
parent
7c5007c016
commit
11b388ff39
@ -372,6 +372,7 @@ public final class CraftServer implements Server {
|
|||||||
|
|
||||||
boolean animals = config.getBoolean("spawn-animals", console.spawnAnimals);
|
boolean animals = config.getBoolean("spawn-animals", console.spawnAnimals);
|
||||||
boolean monsters = config.getBoolean("spawn-monsters", console.worlds.get(0).difficulty > 0);
|
boolean monsters = config.getBoolean("spawn-monsters", console.worlds.get(0).difficulty > 0);
|
||||||
|
int difficulty = config.getInt("difficulty", console.worlds.get(0).difficulty);
|
||||||
|
|
||||||
console.onlineMode = config.getBoolean("online-mode", console.onlineMode);
|
console.onlineMode = config.getBoolean("online-mode", console.onlineMode);
|
||||||
console.spawnAnimals = config.getBoolean("spawn-animals", console.spawnAnimals);
|
console.spawnAnimals = config.getBoolean("spawn-animals", console.spawnAnimals);
|
||||||
@ -379,7 +380,7 @@ public final class CraftServer implements Server {
|
|||||||
console.allowFlight = config.getBoolean("allow-flight", console.allowFlight);
|
console.allowFlight = config.getBoolean("allow-flight", console.allowFlight);
|
||||||
|
|
||||||
for (WorldServer world : console.worlds) {
|
for (WorldServer world : console.worlds) {
|
||||||
world.difficulty = monsters ? 1 : 0;
|
world.difficulty = difficulty;
|
||||||
world.setSpawnFlags(monsters, animals);
|
world.setSpawnFlags(monsters, animals);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user