mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-05 06:32:17 -07:00
net.minecraft.server.commands
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
--- a/net/minecraft/server/commands/DifficultyCommand.java
|
||||
+++ b/net/minecraft/server/commands/DifficultyCommand.java
|
||||
@@ -31,10 +_,11 @@
|
||||
|
||||
public static int setDifficulty(CommandSourceStack source, Difficulty difficulty) throws CommandSyntaxException {
|
||||
MinecraftServer server = source.getServer();
|
||||
- if (server.getWorldData().getDifficulty() == difficulty) {
|
||||
+ net.minecraft.server.level.ServerLevel serverLevel = source.getLevel(); // CraftBukkit
|
||||
+ if (serverLevel.getDifficulty() == difficulty) { // CraftBukkit
|
||||
throw ERROR_ALREADY_DIFFICULT.create(difficulty.getKey());
|
||||
} else {
|
||||
- server.setDifficulty(difficulty, true);
|
||||
+ server.setDifficulty(serverLevel, difficulty, true); // Paper - per level difficulty; don't skip other difficulty-changing logic (fix upstream's fix)
|
||||
source.sendSuccess(() -> Component.translatable("commands.difficulty.success", difficulty.getDisplayName()), true);
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user