--- a/net/minecraft/server/commands/DifficultyCommand.java
+++ b/net/minecraft/server/commands/DifficultyCommand.java
@@ -5,37 +5,54 @@
 import com.mojang.brigadier.exceptions.CommandSyntaxException;
 import com.mojang.brigadier.exceptions.DynamicCommandExceptionType;
 import net.minecraft.commands.CommandSourceStack;
-import net.minecraft.commands.Commands;
 import net.minecraft.network.chat.Component;
 import net.minecraft.server.MinecraftServer;
 import net.minecraft.world.Difficulty;
 
 public class DifficultyCommand {
-    private static final DynamicCommandExceptionType ERROR_ALREADY_DIFFICULT = new DynamicCommandExceptionType(
-        difficulty -> Component.translatableEscape("commands.difficulty.failure", difficulty)
-    );
+
+    private static final DynamicCommandExceptionType ERROR_ALREADY_DIFFICULT = new DynamicCommandExceptionType((object) -> {
+        return Component.translatableEscape("commands.difficulty.failure", object);
+    });
+
+    public DifficultyCommand() {}
 
     public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
-        LiteralArgumentBuilder<CommandSourceStack> literalArgumentBuilder = Commands.literal("difficulty");
+        LiteralArgumentBuilder<CommandSourceStack> literalargumentbuilder = net.minecraft.commands.Commands.literal("difficulty");
+        Difficulty[] aenumdifficulty = Difficulty.values();
+        int i = aenumdifficulty.length;
 
-        for (Difficulty difficulty : Difficulty.values()) {
-            literalArgumentBuilder.then(Commands.literal(difficulty.getKey()).executes(context -> setDifficulty(context.getSource(), difficulty)));
+        for (int j = 0; j < i; ++j) {
+            Difficulty enumdifficulty = aenumdifficulty[j];
+
+            literalargumentbuilder.then(net.minecraft.commands.Commands.literal(enumdifficulty.getKey()).executes((commandcontext) -> {
+                return DifficultyCommand.setDifficulty((CommandSourceStack) commandcontext.getSource(), enumdifficulty);
+            }));
         }
 
-        dispatcher.register(literalArgumentBuilder.requires(source -> source.hasPermission(2)).executes(context -> {
-            Difficulty difficultyx = context.getSource().getLevel().getDifficulty();
-            context.getSource().sendSuccess(() -> Component.translatable("commands.difficulty.query", difficultyx.getDisplayName()), false);
-            return difficultyx.getId();
+        dispatcher.register((LiteralArgumentBuilder) ((LiteralArgumentBuilder) literalargumentbuilder.requires((commandlistenerwrapper) -> {
+            return commandlistenerwrapper.hasPermission(2);
+        })).executes((commandcontext) -> {
+            Difficulty enumdifficulty1 = ((CommandSourceStack) commandcontext.getSource()).getLevel().getDifficulty();
+
+            ((CommandSourceStack) commandcontext.getSource()).sendSuccess(() -> {
+                return Component.translatable("commands.difficulty.query", enumdifficulty1.getDisplayName());
+            }, false);
+            return enumdifficulty1.getId();
         }));
     }
 
     public static int setDifficulty(CommandSourceStack source, Difficulty difficulty) throws CommandSyntaxException {
-        MinecraftServer minecraftServer = source.getServer();
-        if (minecraftServer.getWorldData().getDifficulty() == difficulty) {
-            throw ERROR_ALREADY_DIFFICULT.create(difficulty.getKey());
+        MinecraftServer minecraftserver = source.getServer();
+        net.minecraft.server.level.ServerLevel worldServer = source.getLevel(); // CraftBukkit
+
+        if (worldServer.getDifficulty() == difficulty) { // CraftBukkit
+            throw DifficultyCommand.ERROR_ALREADY_DIFFICULT.create(difficulty.getKey());
         } else {
-            minecraftServer.setDifficulty(difficulty, true);
-            source.sendSuccess(() -> Component.translatable("commands.difficulty.success", difficulty.getDisplayName()), true);
+            minecraftserver.setDifficulty(worldServer, difficulty, true); // Paper - per level difficulty; don't skip other difficulty-changing logic (fix upstream's fix)
+            source.sendSuccess(() -> {
+                return Component.translatable("commands.difficulty.success", difficulty.getDisplayName());
+            }, true);
             return 0;
         }
     }
