Add WorldDifficultyChangeEvent (#12471)

This commit is contained in:
David
2025-07-26 23:38:16 +02:00
committed by GitHub
parent 57c13137e4
commit a57636189a
6 changed files with 96 additions and 9 deletions

View File

@@ -9,7 +9,7 @@
throw ERROR_ALREADY_DIFFICULT.create(difficulty.getKey());
} else {
- server.setDifficulty(difficulty, true);
+ server.setDifficulty(source.getLevel(), difficulty, true); // Paper - per level difficulty; don't skip other difficulty-changing logic (fix upstream's fix)
+ server.setDifficulty(source.getLevel(), difficulty, source, true); // Paper - per level difficulty; don't skip other difficulty-changing logic (fix upstream's fix); WorldDifficultyChangeEvent
source.sendSuccess(() -> Component.translatable("commands.difficulty.success", difficulty.getDisplayName()), true);
return 0;
}