aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/server/commands/DifficultyCommand.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/server/commands/DifficultyCommand.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/server/commands/DifficultyCommand.java.patch23
1 files changed, 23 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/server/commands/DifficultyCommand.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/server/commands/DifficultyCommand.java.patch
new file mode 100644
index 0000000000..9781bb1783
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/server/commands/DifficultyCommand.java.patch
@@ -0,0 +1,23 @@
+--- a/net/minecraft/server/commands/DifficultyCommand.java
++++ b/net/minecraft/server/commands/DifficultyCommand.java
+@@ -43,14 +42,15 @@
+ }));
+ }
+
+- public static int setDifficulty(CommandSourceStack commandsourcestack, Difficulty difficulty) throws CommandSyntaxException {
+- MinecraftServer minecraftserver = commandsourcestack.getServer();
++ public static int setDifficulty(CommandSourceStack source, Difficulty difficulty) throws CommandSyntaxException {
++ MinecraftServer minecraftserver = source.getServer();
++ net.minecraft.server.level.ServerLevel worldServer = source.getLevel(); // CraftBukkit
+
+- if (minecraftserver.getWorldData().getDifficulty() == difficulty) {
++ if (worldServer.getDifficulty() == difficulty) { // CraftBukkit
+ throw DifficultyCommand.ERROR_ALREADY_DIFFICULT.create(difficulty.getKey());
+ } else {
+- minecraftserver.setDifficulty(difficulty, true);
+- commandsourcestack.sendSuccess(() -> {
++ worldServer.serverLevelData.setDifficulty(difficulty); // CraftBukkit
++ source.sendSuccess(() -> {
+ return Component.translatable("commands.difficulty.success", difficulty.getDisplayName());
+ }, true);
+ return 0;