Archiviert
13
0

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.
Dieser Commit ist enthalten in:
Byteflux 2015-08-04 17:57:17 -07:00
Ursprung 80e87de54f
Commit bde7f6bbbd
2 geänderte Dateien mit 12 neuen und 12 gelöschten Zeilen

Datei anzeigen

@ -1,4 +1,4 @@
From a47bb6f79e5625beba2876cb3f3d72dba15add9e Mon Sep 17 00:00:00 2001 From 173dc14f7675fadf49fe31bc7e790ec5369c046a Mon Sep 17 00:00:00 2001
From: Zach Brown <zach.brown@destroystokyo.com> From: Zach Brown <zach.brown@destroystokyo.com>
Date: Thu, 28 May 2015 00:08:15 -0500 Date: Thu, 28 May 2015 00:08:15 -0500
Subject: [PATCH] PaperSpigot config files Subject: [PATCH] PaperSpigot config files
@ -88,7 +88,7 @@ index 337aa29..c936219 100644
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java diff --git a/src/main/java/org/github/paperspigot/PaperSpigotConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
new file mode 100644 new file mode 100644
index 0000000..a2fabf5 index 0000000..006ca37
--- /dev/null --- /dev/null
+++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotConfig.java
@@ -0,0 +1,141 @@ @@ -0,0 +1,141 @@
@ -211,8 +211,8 @@ index 0000000..a2fabf5
+ +
+ private static float getFloat(String path, float def) + private static float getFloat(String path, float def)
+ { + {
+ config.addDefault( path, def ); + // TODO: Figure out why getFloat() always returns the default value.
+ return config.getFloat( path, config.getFloat( path ) ); + return (float) getDouble( path, (double) def );
+ } + }
+ +
+ private static int getInt(String path, int def) + private static int getInt(String path, int def)
@ -235,7 +235,7 @@ index 0000000..a2fabf5
+} +}
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 0000000..f3bc3aa index 0000000..146324a
--- /dev/null --- /dev/null
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +1,77 @@ @@ -0,0 +1,77 @@
@ -300,8 +300,8 @@ index 0000000..f3bc3aa
+ +
+ private float getFloat(String path, float def) + private float getFloat(String path, float def)
+ { + {
+ config.addDefault( "world-settings.default." + path, def ); + // TODO: Figure out why getFloat() always returns the default value.
+ return config.getFloat( "world-settings." + worldName + "." + path, config.getFloat( "world-settings.default." + path ) ); + return (float) getDouble( path, (double) def );
+ } + }
+ +
+ private <T> List getList(String path, T def) + private <T> List getList(String path, T def)
@ -317,5 +317,5 @@ index 0000000..f3bc3aa
+ } + }
+} +}
-- --
2.5.0 2.4.6.windows.1

Datei anzeigen

@ -1,4 +1,4 @@
From e794a7dc6ebf8ad1bec934760beea280bb11935a Mon Sep 17 00:00:00 2001 From 410ae1f136e532793a05d6508ab7c8629c660185 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net> From: Byteflux <byte@byteflux.net>
Date: Tue, 4 Aug 2015 17:45:00 -0700 Date: Tue, 4 Aug 2015 17:45:00 -0700
Subject: [PATCH] Configurable TNT explosion volume Subject: [PATCH] Configurable TNT explosion volume
@ -21,18 +21,18 @@ index 6617899..2763e74 100644
this.world.addParticle(EnumParticle.EXPLOSION_HUGE, this.posX, this.posY, this.posZ, 1.0D, 0.0D, 0.0D, new int[0]); this.world.addParticle(EnumParticle.EXPLOSION_HUGE, this.posX, this.posY, this.posZ, 1.0D, 0.0D, 0.0D, new int[0]);
} else { } else {
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
index bd1b363..ebfa991 100644 index 84cdb12..d16c9fe 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java --- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java +++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -402,4 +402,10 @@ public class PaperSpigotWorldConfig @@ -402,4 +402,10 @@ public class PaperSpigotWorldConfig
{ {
containerUpdateTickRate = getInt("container-update-tick-rate", 1); containerUpdateTickRate = getInt( "container-update-tick-rate", 1 );
} }
+ +
+ public float tntExplosionVolume; + public float tntExplosionVolume;
+ private void tntExplosionVolume() + private void tntExplosionVolume()
+ { + {
+ tntExplosionVolume = getFloat("tnt-explosion-volume", 4.0F); + tntExplosionVolume = getFloat( "tnt-explosion-volume", 4.0F );
+ } + }
} }
-- --