2023-06-16 13:02:43 +02:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: TheMeinerLP <p.glanz@madfix.me>
|
|
|
|
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
|
2023-12-05 18:20:55 +01:00
|
|
|
index 7376d3acb27edd7209916e9e9df4ce9b9514e50c..4d2443f40dc2e1b38b7c80e7b5f9ca7a4f84c107 100644
|
2023-06-16 13:02:43 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
2023-11-11 21:25:45 +01:00
|
|
|
@@ -361,7 +361,11 @@ public final class CraftServer implements Server {
|
2023-06-16 13:02:43 +02:00
|
|
|
}
|
|
|
|
this.commandsConfiguration = YamlConfiguration.loadConfiguration(this.getCommandsConfigFile());
|
|
|
|
this.commandsConfiguration.options().copyDefaults(true);
|
2023-10-27 01:34:58 +02:00
|
|
|
- this.commandsConfiguration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("configurations/commands.yml"), Charsets.UTF_8)));
|
2023-06-16 13:02:43 +02:00
|
|
|
+ // Paper start - don't enforce icanhasbukkit default if alias block exists
|
2023-10-27 01:34:58 +02:00
|
|
|
+ final YamlConfiguration commandsDefaults = YamlConfiguration.loadConfiguration(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream("configurations/commands.yml"), Charsets.UTF_8));
|
2023-06-16 13:02:43 +02:00
|
|
|
+ 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
|