Commits
Doc authored and md_5 committed 62d976242c2
1 + | --- a/net/minecraft/server/commands/CommandDifficulty.java |
2 + | +++ b/net/minecraft/server/commands/CommandDifficulty.java |
3 + | |
4 + | |
5 + | public static int setDifficulty(CommandListenerWrapper commandlistenerwrapper, EnumDifficulty enumdifficulty) throws CommandSyntaxException { |
6 + | MinecraftServer minecraftserver = commandlistenerwrapper.getServer(); |
7 + | + net.minecraft.server.level.WorldServer worldServer = commandlistenerwrapper.getLevel(); // CraftBukkit |
8 + | |
9 + | - if (minecraftserver.getWorldData().getDifficulty() == enumdifficulty) { |
10 + | + if (worldServer.getDifficulty() == enumdifficulty) { // CraftBukkit |
11 + | throw CommandDifficulty.ERROR_ALREADY_DIFFICULT.create(enumdifficulty.getKey()); |
12 + | } else { |
13 + | - minecraftserver.setDifficulty(enumdifficulty, true); |
14 + | + worldServer.serverLevelData.setDifficulty(enumdifficulty); // CraftBukkit |
15 + | commandlistenerwrapper.sendSuccess(new ChatMessage("commands.difficulty.success", new Object[]{enumdifficulty.getDisplayName()}), true); |
16 + | return 0; |
17 + | } |