Print name of busted server config files

This commit is contained in:
Shane Freeder 2021-01-05 11:21:03 +00:00
parent 05af2837cd
commit 66d3e62281

View file

@ -600,7 +600,7 @@ index 18f510c2be4f6630c25b3f404234f3843ece817b..a314ed0106cbf4359dd1920bb4b3c609
+ // Paper end + // Paper end
} }
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 6d1012cc652780189a5d849125abe09b27b88422..49649e70ee8bfb3dacd63a88a180f0f329f308c0 100644 index 6d1012cc652780189a5d849125abe09b27b88422..d8c8bf2466be362b424fde611fe42b73fea42ef9 100644
--- a/src/main/java/net/minecraft/server/Main.java --- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java +++ b/src/main/java/net/minecraft/server/Main.java
@@ -64,6 +64,12 @@ public class Main { @@ -64,6 +64,12 @@ public class Main {
@ -616,15 +616,19 @@ index 6d1012cc652780189a5d849125abe09b27b88422..49649e70ee8bfb3dacd63a88a180f0f3
java.nio.file.Path java_nio_file_path1 = Paths.get("eula.txt"); java.nio.file.Path java_nio_file_path1 = Paths.get("eula.txt");
EULA eula = new EULA(java_nio_file_path1); EULA eula = new EULA(java_nio_file_path1);
@@ -205,6 +211,16 @@ public class Main { @@ -205,6 +211,20 @@ public class Main {
} }
+ // Paper start - load config files + // Paper start - load config files
+ private static org.bukkit.configuration.file.YamlConfiguration loadConfigFile(File configFile) throws java.io.IOException, org.bukkit.configuration.InvalidConfigurationException { + private static org.bukkit.configuration.file.YamlConfiguration loadConfigFile(File configFile) throws Exception {
+ org.bukkit.configuration.file.YamlConfiguration config = new org.bukkit.configuration.file.YamlConfiguration(); + org.bukkit.configuration.file.YamlConfiguration config = new org.bukkit.configuration.file.YamlConfiguration();
+ if (configFile.exists()) { + if (configFile.exists()) {
+ try {
+ config.load(configFile); + config.load(configFile);
+ } catch (Exception ex) {
+ throw new Exception("Failed to load configuration file: " + configFile.getName(), ex);
+ }
+ } + }
+ return config; + return config;
+ } + }