From 5b6b8beff84a9e56bbe3e60f5f4b1394c40b280a Mon Sep 17 00:00:00 2001 From: Byteflux Date: Tue, 4 Aug 2015 17:57:17 -0700 Subject: [PATCH] Temporarily use getDouble() internally for calls to getFloat() in Paper configs getFloat() seems to have an issue with reading modified values and always returns the default value instead. This needs further investigating, but for now making it use getDouble() internally appears to resolve the issue. --- .../Configurable-TNT-explosion-volume.patch | 4 ++-- Spigot-Server-Patches/PaperSpigot-config-files.patch | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Spigot-Server-Patches/Configurable-TNT-explosion-volume.patch b/Spigot-Server-Patches/Configurable-TNT-explosion-volume.patch index 0de227ffd3..4df7c1f629 100644 --- a/Spigot-Server-Patches/Configurable-TNT-explosion-volume.patch +++ b/Spigot-Server-Patches/Configurable-TNT-explosion-volume.patch @@ -26,13 +26,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 +++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java @@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig { - containerUpdateTickRate = getInt("container-update-tick-rate", 1); + containerUpdateTickRate = getInt( "container-update-tick-rate", 1 ); } + + public float tntExplosionVolume; + private void tntExplosionVolume() + { -+ tntExplosionVolume = getFloat("tnt-explosion-volume", 4.0F); ++ tntExplosionVolume = getFloat( "tnt-explosion-volume", 4.0F ); + } } -- \ No newline at end of file diff --git a/Spigot-Server-Patches/PaperSpigot-config-files.patch b/Spigot-Server-Patches/PaperSpigot-config-files.patch index 0520b4e720..9bef7d19ba 100644 --- a/Spigot-Server-Patches/PaperSpigot-config-files.patch +++ b/Spigot-Server-Patches/PaperSpigot-config-files.patch @@ -211,8 +211,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + private static float getFloat(String path, float def) + { -+ config.addDefault( path, def ); -+ return config.getFloat( path, config.getFloat( path ) ); ++ // TODO: Figure out why getFloat() always returns the default value. ++ return (float) getDouble( path, (double) def ); + } + + private static int getInt(String path, int def) @@ -300,8 +300,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + + private float getFloat(String path, float def) + { -+ config.addDefault( "world-settings.default." + path, def ); -+ return config.getFloat( "world-settings." + worldName + "." + path, config.getFloat( "world-settings.default." + path ) ); ++ // TODO: Figure out why getFloat() always returns the default value. ++ return (float) getDouble( path, (double) def ); + } + + private List getList(String path, T def)