Upstream - Don't overwrite invalid config files
This commit is contained in:
2
Bukkit
2
Bukkit
Submodule Bukkit updated: 0f9d880f80...3c30a21f8e
Submodule CraftBukkit updated: bc6d8b3353...4556a872ec
@@ -1,6 +1,6 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
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
|
Subject: [PATCH] PaperSpigot config files
|
||||||
|
|
||||||
|
|
||||||
@@ -87,6 +87,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+import net.minecraft.server.MinecraftServer;
|
+import net.minecraft.server.MinecraftServer;
|
||||||
+import org.bukkit.Bukkit;
|
+import org.bukkit.Bukkit;
|
||||||
+import org.bukkit.command.Command;
|
+import org.bukkit.command.Command;
|
||||||
|
+import org.bukkit.configuration.InvalidConfigurationException;
|
||||||
+import org.bukkit.configuration.file.YamlConfiguration;
|
+import org.bukkit.configuration.file.YamlConfiguration;
|
||||||
+
|
+
|
||||||
+public class PaperSpigotConfig
|
+public class PaperSpigotConfig
|
||||||
@@ -109,7 +110,17 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+
|
+
|
||||||
+ public static void init()
|
+ 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().header( HEADER );
|
||||||
+ config.options().copyDefaults( true );
|
+ config.options().copyDefaults( true );
|
||||||
+
|
+
|
||||||
@@ -142,7 +153,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ method.invoke( instance );
|
+ method.invoke( instance );
|
||||||
+ } catch ( InvocationTargetException ex )
|
+ } catch ( InvocationTargetException ex )
|
||||||
+ {
|
+ {
|
||||||
+ Throwables.propagate( ex.getCause() );
|
+ throw Throwables.propagate( ex.getCause() );
|
||||||
+ } catch ( Exception ex )
|
+ } catch ( Exception ex )
|
||||||
+ {
|
+ {
|
||||||
+ Bukkit.getLogger().log( Level.SEVERE, "Error invoking " + method, ex );
|
+ Bukkit.getLogger().log( Level.SEVERE, "Error invoking " + method, ex );
|
||||||
@@ -195,7 +206,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ return config.getString( path, config.getString( path ) );
|
+ 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
|
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
|
||||||
new file mode 100644
|
new file mode 100644
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||||
@@ -279,5 +289,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
|
+ return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
\ No newline at end of file
|
|
||||||
--
|
--
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
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
|
Subject: [PATCH] Allow undead horse types to be leashed
|
||||||
|
|
||||||
|
|
||||||
@@ -40,8 +40,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
config.addDefault( "world-settings.default." + path, def );
|
config.addDefault( "world-settings.default." + path, def );
|
||||||
return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
|
return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
|
||||||
}
|
}
|
||||||
-}
|
|
||||||
\ No newline at end of file
|
|
||||||
+
|
+
|
||||||
+ public static boolean allowUndeadHorseLeashing;
|
+ public static boolean allowUndeadHorseLeashing;
|
||||||
+ private void allowUndeadHorseLeashing()
|
+ private void allowUndeadHorseLeashing()
|
||||||
@@ -49,5 +47,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true );
|
+ allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true );
|
||||||
+ log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing );
|
+ log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing );
|
||||||
+ }
|
+ }
|
||||||
+}
|
}
|
||||||
--
|
--
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||||
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
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
|
Subject: [PATCH] Ability to disable asynccatcher
|
||||||
|
|
||||||
|
|
||||||
@@ -12,8 +12,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
config.addDefault( path, def );
|
config.addDefault( path, def );
|
||||||
return config.getString( path, config.getString( path ) );
|
return config.getString( path, config.getString( path ) );
|
||||||
}
|
}
|
||||||
-}
|
|
||||||
\ No newline at end of file
|
|
||||||
+
|
+
|
||||||
+ public static boolean asyncCatcherFeature;
|
+ public static boolean asyncCatcherFeature;
|
||||||
+ private static void 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" );
|
+ 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
|
diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/spigotmc/AsyncCatcher.java
|
--- a/src/main/java/org/spigotmc/AsyncCatcher.java
|
||||||
|
|||||||
Reference in New Issue
Block a user