1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-16 18:31:53 +01:00

Upstream - Don't overwrite invalid config files

This commit is contained in:
Zach Brown 2014-07-12 19:38:57 -05:00
parent 209b9e7259
commit 52f7f753f9
5 changed files with 20 additions and 15 deletions

2
Bukkit

@ -1 +1 @@
Subproject commit 0f9d880f80f374a2e6a88a6bd5ec196a67673ba4
Subproject commit 3c30a21f8e53dc81ff2ae877466adfcc6e7c137b

@ -1 +1 @@
Subproject commit bc6d8b3353b3ff83d39de840246b25542c71d386
Subproject commit 4556a872ece2a4f3d896b2d7ffea47e26b1b850f

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Tue, 8 Jul 2014 21:08:51 -0500
Date: Sat, 12 Jul 2014 19:32:01 -0500
Subject: [PATCH] PaperSpigot config files
@ -87,6 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+import net.minecraft.server.MinecraftServer;
+import org.bukkit.Bukkit;
+import org.bukkit.command.Command;
+import org.bukkit.configuration.InvalidConfigurationException;
+import org.bukkit.configuration.file.YamlConfiguration;
+
+public class PaperSpigotConfig
@ -109,7 +110,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ public static void init()
+ {
+ config = YamlConfiguration.loadConfiguration( CONFIG_FILE );
+ config = new YamlConfiguration();
+ try
+ {
+ config.load ( CONFIG_FILE );
+ } catch ( IOException ex )
+ {
+ } catch ( InvalidConfigurationException ex )
+ {
+ Bukkit.getLogger().log( Level.SEVERE, "Could not load paper.yml, please correct your syntax errors", ex );
+ throw Throwables.propagate( ex );
+ }
+ config.options().header( HEADER );
+ config.options().copyDefaults( true );
+
@ -142,7 +153,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ method.invoke( instance );
+ } catch ( InvocationTargetException ex )
+ {
+ Throwables.propagate( ex.getCause() );
+ throw Throwables.propagate( ex.getCause() );
+ } catch ( Exception ex )
+ {
+ Bukkit.getLogger().log( Level.SEVERE, "Error invoking " + method, ex );
@ -195,7 +206,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return config.getString( path, config.getString( path ) );
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
new file mode 100644
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
@ -279,5 +289,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
+ }
+}
\ No newline at end of file
--

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Wed, 2 Jul 2014 22:33:09 -0500
Date: Sat, 12 Jul 2014 19:36:18 -0500
Subject: [PATCH] Allow undead horse types to be leashed
@ -40,8 +40,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
config.addDefault( "world-settings.default." + path, def );
return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
}
-}
\ No newline at end of file
+
+ public static boolean allowUndeadHorseLeashing;
+ private void allowUndeadHorseLeashing()
@ -49,5 +47,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true );
+ log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing );
+ }
+}
}
--

View file

@ -1,6 +1,6 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
Date: Wed, 2 Jul 2014 22:34:04 -0500
Date: Sat, 12 Jul 2014 19:37:16 -0500
Subject: [PATCH] Ability to disable asynccatcher
@ -12,8 +12,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
config.addDefault( path, def );
return config.getString( path, config.getString( path ) );
}
-}
\ No newline at end of file
+
+ public static boolean asyncCatcherFeature;
+ private static void asyncCatcherFeature()
@ -23,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this might be bad depending on your plugins" );
+ }
+ }
+}
}
diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/spigotmc/AsyncCatcher.java