diff --git a/Spigot-Server-Patches/Fix-Per-World-Difficulty-Remembering-Difficulty.patch b/Spigot-Server-Patches/Fix-Per-World-Difficulty-Remembering-Difficulty.patch index 9869a5675d..21f973cc38 100644 --- a/Spigot-Server-Patches/Fix-Per-World-Difficulty-Remembering-Difficulty.patch +++ b/Spigot-Server-Patches/Fix-Per-World-Difficulty-Remembering-Difficulty.patch @@ -47,15 +47,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 } - public void a(EnumDifficulty enumdifficulty, boolean flag) { -+ // Paper start - fix per world difficulty -+ public void a(WorldServer world, EnumDifficulty enumdifficulty, boolean flag) { -+ WorldDataServer worldData = world.worldDataServer; - if (flag || !this.saveData.isDifficultyLocked()) { - this.saveData.setDifficulty(this.saveData.isHardcore() ? EnumDifficulty.HARD : enumdifficulty); +- if (flag || !this.saveData.isDifficultyLocked()) { +- this.saveData.setDifficulty(this.saveData.isHardcore() ? EnumDifficulty.HARD : enumdifficulty); - this.updateSpawnFlags(); - this.getPlayerList().getPlayers().forEach(this::b); -+ world.setSpawnFlags(worldData.getDifficulty() != EnumDifficulty.PEACEFUL && ((DedicatedServer)this).propertyManager.getProperties().spawnMonsters, this.getSpawnAnimals()); -+ //this.getPlayerList().getPlayers().forEach(this::b); ++ // Paper start - fix per world difficulty ++ public void setWorldDifficulty(WorldServer world, EnumDifficulty enumdifficulty, boolean forcefullySet) { this.a(world, enumdifficulty, forcefullySet); } ++ public void a(WorldServer world, EnumDifficulty enumdifficulty, boolean flag) { ++ WorldDataServer worldData = world.worldDataServer; ++ if (flag || !worldData.isDifficultyLocked()) { ++ worldData.setDifficulty(worldData.isHardcore() ? EnumDifficulty.HARD : enumdifficulty); ++ world.setSpawnFlags(worldData.getDifficulty() != EnumDifficulty.PEACEFUL && ((DedicatedServer) this).propertyManager.getProperties().spawnMonsters, this.getSpawnAnimals()); ++ //this.getPlayerList().getPlayers().forEach(this::b); // Commented: WorldDataServer#setDifficulty handles updating players' difficulties + // Paper end } }