Fixed shooting star resetting on server shutdown

This commit is contained in:
Player Name
2025-02-13 11:30:02 +00:00
committed by Ryan
parent 62a7dd4324
commit 618d39d73c
5 changed files with 64 additions and 35 deletions
+6 -6
View File
@@ -113,18 +113,18 @@ class ServerStore : PersistWorld {
}
@JvmStatic
fun JSONObject.getString(key: String): String {
return this[key] as? String ?: "nothing"
fun JSONObject.getString(key: String, default: String = "nothing"): String {
return this[key] as? String ?: default
}
@JvmStatic
fun JSONObject.getLong(key: String): Long {
return this[key] as? Long ?: 0L
fun JSONObject.getLong(key: String, default: Long = 0L): Long {
return this[key] as? Long ?: default
}
@JvmStatic
fun JSONObject.getBoolean(key: String): Boolean {
return this[key] as? Boolean ?: false
fun JSONObject.getBoolean(key: String, default: Boolean = false): Boolean {
return this[key] as? Boolean ?: default
}
fun List<Int>.toJSONArray(): JSONArray{