Archiviert
13
0
Dieses Repository wurde am 2024-12-25 archiviert. Du kannst Dateien ansehen und es klonen, aber nicht pushen oder Issues/Pull-Requests öffnen.
Paper-Old/CraftBukkit-Patches/0155-Add-getFloat-method-to-configs.patch

48 Zeilen
1.8 KiB
Diff

2014-06-22 22:37:12 +02:00
From 4ab2112e922501a5ea9f47ab927c97c8787b0cb7 Mon Sep 17 00:00:00 2001
From: Zach Brown <Zbob750@live.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 5818cab..5ddd593 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -120,6 +120,14 @@ 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 f9f8c05..c340fb3 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -52,6 +52,14 @@ 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 );
--
1.9.1