diff options
author | Luck <git@lucko.me> | 2022-02-06 20:59:27 +0000 |
---|---|---|
committer | Luck <git@lucko.me> | 2022-02-06 20:59:27 +0000 |
commit | 9639aefcb87770d9bf00e8caf4c10d33244e24e0 (patch) | |
tree | 69bd2a058a555fce6e286018016ff012522bca48 /spark-bukkit/src/main/java | |
parent | 25f46b649363d99f51b1b5262b5f7c0ce0c3251b (diff) | |
download | spark-9639aefcb87770d9bf00e8caf4c10d33244e24e0.tar.gz spark-9639aefcb87770d9bf00e8caf4c10d33244e24e0.tar.bz2 spark-9639aefcb87770d9bf00e8caf4c10d33244e24e0.zip |
Fix NumberFormatException in Bukkit config provider (#173)
Diffstat (limited to 'spark-bukkit/src/main/java')
-rw-r--r-- | spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java index e4750f9..492e610 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitServerConfigProvider.java @@ -84,7 +84,11 @@ public class BukkitServerConfigProvider extends AbstractServerConfigProvider<Buk if ("true".equals(value) || "false".equals(value)) { values.put(key, Boolean.parseBoolean(value)); } else if (value.matches("\\d+")) { - values.put(key, Integer.parseInt(value)); + try { + values.put(key, Long.parseLong(value)); + } catch (NumberFormatException e) { + values.put(key, value); + } } else { values.put(key, value); } |