mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 05:32:18 -07:00
Small diff cleanups from patch updating
And remove a dumb log change in PacketEncoder
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
--- a/net/minecraft/server/commands/DifficultyCommand.java
|
||||
+++ b/net/minecraft/server/commands/DifficultyCommand.java
|
||||
@@ -31,10 +_,11 @@
|
||||
@@ -31,10 +_,10 @@
|
||||
|
||||
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
|
||||
+ if (source.getLevel().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)
|
||||
+ server.setDifficulty(source.getLevel(), 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