Implemented the proper interaction for low-alchemy option on the Explorer's Ring

Implemented a generic item selection ContentAPI method
Added ContentAPI method for running CS2 scripts
Added development command for running CS2 scripts
This commit is contained in:
Ceikry
2023-05-16 12:08:32 +00:00
committed by Ryan
parent a04191b11e
commit 767117f54e
8 changed files with 152 additions and 26 deletions
+3 -3
View File
@@ -101,14 +101,14 @@ class ServerStore : PersistWorld {
}
@JvmStatic
fun JSONObject.getInt(key: String): Int {
fun JSONObject.getInt(key: String, default: Int = 0): Int {
return when(val value = this[key]){
is Long -> value.toInt()
is Double -> value.toInt()
is Float -> value.toInt()
is Int -> value
is Nothing -> 0
else -> 0
is Nothing -> default
else -> default
}
}