9
0
mirror of https://github.com/Auxilor/EcoSkills.git synced 2026-01-01 21:36:34 +00:00

Fixed number format bug

This commit is contained in:
Auxilor
2021-08-24 23:21:23 +01:00
parent 357b852408
commit 816fe02aef

View File

@@ -15,7 +15,6 @@ import org.bukkit.OfflinePlayer
import org.bukkit.entity.Player
import org.bukkit.persistence.PersistentDataType
import java.util.*
import kotlin.collections.HashMap
object PlayerHelper {
@@ -66,7 +65,7 @@ private fun Player.cacheSkillExperienceMultiplier(): Double {
for (permissionAttachmentInfo in this.effectivePermissions) {
val permission = permissionAttachmentInfo.permission
if (permission.startsWith(prefix)) {
return (permission.substring(permission.lastIndexOf(".") + 1).toDouble() / 100) + 1
return (permission.substring(permission.lastIndexOf(".") + 1).toDoubleOrNull() ?: 100.0 / 100) + 1
}
}