From 7dc5d71367f7c1ed49f4dd1492bf0b80d4ea662c Mon Sep 17 00:00:00 2001 From: MeFisto94 Date: Mon, 26 Jul 2021 01:11:44 +0200 Subject: [PATCH] Move "use-display-name-in-quit-message" to settings namespace (#6257) --- patches/server/Add-tick-times-API-and-mspt-command.patch | 4 ++-- patches/server/Adventure.patch | 6 +++++- .../Default-loading-permissions.yml-before-plugins.patch | 4 ++-- patches/server/Paper-config-files.patch | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/patches/server/Add-tick-times-API-and-mspt-command.patch b/patches/server/Add-tick-times-API-and-mspt-command.patch index 7ec40a9845..4359e0818a 100644 --- a/patches/server/Add-tick-times-API-and-mspt-command.patch +++ b/patches/server/Add-tick-times-API-and-mspt-command.patch @@ -84,8 +84,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 commands.put("paper", new PaperCommand("paper")); + commands.put("mspt", new MSPTCommand("mspt")); - version = getInt("config-version", 20); - set("config-version", 20); + version = getInt("config-version", 21); + set("config-version", 21); diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/patches/server/Adventure.patch b/patches/server/Adventure.patch index 0e8a62c3e3..5bd24b5214 100644 --- a/patches/server/Adventure.patch +++ b/patches/server/Adventure.patch @@ -17,7 +17,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + public static boolean useDisplayNameInQuit = false; + private static void useDisplayNameInQuit() { -+ useDisplayNameInQuit = getBoolean("use-display-name-in-quit-message", useDisplayNameInQuit); ++ if (version < 21) { ++ boolean oldValue = getBoolean("use-display-name-in-quit-message", useDisplayNameInQuit); ++ set("settings.use-display-name-in-quit-message", oldValue); ++ } ++ useDisplayNameInQuit = getBoolean("settings.use-display-name-in-quit-message", useDisplayNameInQuit); + } } diff --git a/src/main/java/io/papermc/paper/adventure/AdventureComponent.java b/src/main/java/io/papermc/paper/adventure/AdventureComponent.java diff --git a/patches/server/Default-loading-permissions.yml-before-plugins.patch b/patches/server/Default-loading-permissions.yml-before-plugins.patch index f3384027ac..a77670b1a3 100644 --- a/patches/server/Default-loading-permissions.yml-before-plugins.patch +++ b/patches/server/Default-loading-permissions.yml-before-plugins.patch @@ -20,8 +20,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/com/destroystokyo/paper/PaperConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperConfig.java @@ -0,0 +0,0 @@ public class PaperConfig { - private static void useDisplayNameInQuit() { - useDisplayNameInQuit = getBoolean("use-display-name-in-quit-message", useDisplayNameInQuit); + } + useDisplayNameInQuit = getBoolean("settings.use-display-name-in-quit-message", useDisplayNameInQuit); } + + public static boolean loadPermsBeforePlugins = true; diff --git a/patches/server/Paper-config-files.patch b/patches/server/Paper-config-files.patch index b0fc53d805..c100da3b13 100644 --- a/patches/server/Paper-config-files.patch +++ b/patches/server/Paper-config-files.patch @@ -364,8 +364,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + commands = new HashMap(); + commands.put("paper", new PaperCommand("paper")); + -+ version = getInt("config-version", 20); -+ set("config-version", 20); ++ version = getInt("config-version", 21); ++ set("config-version", 21); + readConfig(PaperConfig.class, null); + } +