From 4de304b9eb82090fec44b377c3ff0560d87ad666 Mon Sep 17 00:00:00 2001 From: Phillipp Glanz Date: Fri, 16 Jun 2023 13:02:43 +0200 Subject: [PATCH] Don't enforce icanhasbukkit default if alias block exists (#9334) --- ...anhasbukkit-default-if-alias-block-e.patch | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 patches/server/Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch diff --git a/patches/server/Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch b/patches/server/Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch new file mode 100644 index 0000000000..a39ca1fa55 --- /dev/null +++ b/patches/server/Don-t-enforce-icanhasbukkit-default-if-alias-block-e.patch @@ -0,0 +1,23 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: TheMeinerLP +Date: Tue, 13 Jun 2023 16:10:59 +0200 +Subject: [PATCH] Don't enforce icanhasbukkit default if alias block exists + + +diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java ++++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +@@ -0,0 +0,0 @@ public final class CraftServer implements Server { + } + this.commandsConfiguration = YamlConfiguration.loadConfiguration(this.getCommandsConfigFile()); + this.commandsConfiguration.options().copyDefaults(true); +- this.commandsConfiguration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/commands.yml"), Charsets.UTF_8))); ++ // Paper start - don't enforce icanhasbukkit default if alias block exists ++ final YamlConfiguration commandsDefaults = YamlConfiguration.loadConfiguration(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("configurations/commands.yml"), Charsets.UTF_8)); ++ if (this.commandsConfiguration.contains("aliases")) commandsDefaults.set("aliases", null); ++ this.commandsConfiguration.setDefaults(commandsDefaults); ++ // Paper stop - dont enforce icanhasbukkit default if alias block exists + this.saveCommandsConfig(); + + // Migrate aliases from old file and add previously implicit $1- to pass all arguments