--- a/net/minecraft/server/commands/DifficultyCommand.java
+++ b/net/minecraft/server/commands/DifficultyCommand.java
@@ -5,42 +5,51 @@
 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) -> {
-        return Component.translatable("commands.difficulty.failure", difficulty);
+
+    private static final DynamicCommandExceptionType ERROR_ALREADY_DIFFICULT = new DynamicCommandExceptionType((object) -> {
+        return Component.translatable("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) -> {
-                return 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) -> {
-            return source.hasPermission(2);
-        }).executes((context) -> {
-            Difficulty difficulty = context.getSource().getLevel().getDifficulty();
-            context.getSource().sendSuccess(() -> {
-                return Component.translatable("commands.difficulty.query", difficulty.getDisplayName());
+        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 difficulty.getId();
+            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);
+            minecraftserver.setDifficulty(worldServer, difficulty, true); // Paper - don't skip other difficulty-changing logic (fix upstream's fix)
             source.sendSuccess(() -> {
                 return Component.translatable("commands.difficulty.success", difficulty.getDisplayName());
             }, true);
