geforkt von Mirrors/Paper
45 Zeilen
1.9 KiB
Diff
45 Zeilen
1.9 KiB
Diff
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||
|
From: Zach Brown <1254957+zachbr@users.noreply.github.com>
|
||
|
Date: Mon, 19 May 2014 21:08:44 -0500
|
||
|
Subject: [PATCH] Add getFloat method to configs
|
||
|
|
||
|
|
||
|
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
|
||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||
|
--- a/src/main/java/org/spigotmc/SpigotConfig.java
|
||
|
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
|
||
|
@@ -0,0 +0,0 @@ public class SpigotConfig
|
||
|
return config.getBoolean( path, config.getBoolean( path ) );
|
||
|
}
|
||
|
|
||
|
+ // PaperSpigot start - Add getFloat
|
||
|
+ private static float getFloat(String path, float def)
|
||
|
+ {
|
||
|
+ config.addDefault( path, def );
|
||
|
+ return config.getFloat( path, config.getFloat( path ) );
|
||
|
+ }
|
||
|
+ // PaperSpigot end
|
||
|
+
|
||
|
private static int getInt(String path, int def)
|
||
|
{
|
||
|
config.addDefault( path, def );
|
||
|
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||
|
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||
|
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
|
||
|
@@ -0,0 +0,0 @@ public class SpigotWorldConfig
|
||
|
return config.getDouble( "world-settings." + worldName + "." + path, config.getDouble( "world-settings.default." + path ) );
|
||
|
}
|
||
|
|
||
|
+ // PaperSpigot start - Add getFloat
|
||
|
+ 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 ) );
|
||
|
+ }
|
||
|
+ // PaperSpigot end
|
||
|
+
|
||
|
private int getInt(String path, int def)
|
||
|
{
|
||
|
config.addDefault( "world-settings.default." + path, def );
|
||
|
--
|