Upstream - Don't overwrite invalid config files

This commit is contained in:
Zach Brown 2014-07-12 19:38:57 -05:00
parent 604d0e801d
commit 489e293d69
6 changed files with 33 additions and 28 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 e633546d50c886637b5e1e64c33a7b1a01226542 Mon Sep 17 00:00:00 2001
From 825c40af0eb3a4e106ef598ccc590b5be5de9806 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Tue, 8 Jul 2014 21:08:51 -0500
Date: Sat, 12 Jul 2014 19:32:01 -0500
Subject: [PATCH] PaperSpigot config files
@ -68,10 +68,10 @@ index 79d4d99..b6de6e9 100644
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
new file mode 100644
index 0000000..5d309da
index 0000000..e296da2
--- /dev/null
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
@@ -0,0 +1,123 @@
@@ -0,0 +1,134 @@
+package org.github.paperspigot;
+
+import com.google.common.base.Throwables;
@ -87,6 +87,7 @@ index 0000000..5d309da
+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 0000000..5d309da
+
+ 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 0000000..5d309da
+ 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,10 +206,9 @@ index 0000000..5d309da
+ 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 0000000..95298f3
index 0000000..f3bc3aa
--- /dev/null
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +1,77 @@
@ -279,7 +289,6 @@ index 0000000..95298f3
+ return config.getString( "world-settings." + worldName + "." + path, config.getString( "world-settings.default." + path ) );
+ }
+}
\ No newline at end of file
--
1.9.1

View file

@ -1,11 +1,11 @@
From 621472f2b2e720d3167f64288f1d8a5c293d85eb Mon Sep 17 00:00:00 2001
From 393ee89fabd9b0576d7e3d63305b064fd28ec2bb Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.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
diff --git a/src/main/java/net/minecraft/server/EntityHorse.java b/src/main/java/net/minecraft/server/EntityHorse.java
index 76bde8c..dee187c 100644
index e9f6236..5b17bcb 100644
--- a/src/main/java/net/minecraft/server/EntityHorse.java
+++ b/src/main/java/net/minecraft/server/EntityHorse.java
@@ -5,6 +5,8 @@ import java.util.List;
@ -33,15 +33,13 @@ index 76bde8c..dee187c 100644
protected void o(float f) {
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index 95298f3..1eb5e47 100644
index f3bc3aa..1eb5e47 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -74,4 +74,11 @@ public class PaperSpigotWorldConfig
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,7 +47,7 @@ index 95298f3..1eb5e47 100644
+ allowUndeadHorseLeashing = getBoolean( "allow-undead-horse-leashing", true );
+ log( "Allow undead horse types to be leashed: " + allowUndeadHorseLeashing );
+ }
+}
}
--
1.9.1

View file

@ -1,19 +1,17 @@
From 8893f8d37c41a94efb574440d782b37507bb35a0 Mon Sep 17 00:00:00 2001
From d9c63faf92eabb4f87c62b38be6c4829bc670908 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.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
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
index 5d309da..3131c30 100644
index e296da2..f7dc787 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
@@ -120,4 +120,13 @@ public class PaperSpigotConfig
@@ -131,4 +131,13 @@ public class PaperSpigotConfig
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 5d309da..3131c30 100644
+ 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 4b3aa85..c4312db 100644
--- a/src/main/java/org/spigotmc/AsyncCatcher.java

View file

@ -1,4 +1,4 @@
From 42e3c45e2ab734d4d22081e4f19dc594d7a7d621 Mon Sep 17 00:00:00 2001
From 0bb13c80b9f334ae95fcaf0cd66aaef7143c884c Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.com>
Date: Fri, 11 Jul 2014 08:17:00 -0500
Subject: [PATCH] Toggle for player interact limiter
@ -27,10 +27,10 @@ index 4f7da33..1657c7c 100644
} else
{
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
index 3131c30..092b3d8 100644
index f7dc787..ec800c3 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
@@ -129,4 +129,10 @@ public class PaperSpigotConfig
@@ -140,4 +140,10 @@ public class PaperSpigotConfig
Bukkit.getLogger().log( Level.INFO, "Disabling async plugin bad ju-ju catcher, this might be bad depending on your plugins" );
}
}