diff options
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt index 5a5ad06f7..74672db97 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/combat/BestiaryData.kt @@ -30,7 +30,6 @@ import at.hannibal2.skyhanni.utils.renderables.Renderable import net.minecraft.item.ItemStack import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - object BestiaryData { private val config get() = SkyHanniMod.feature.combat.bestiary @@ -472,31 +471,17 @@ object BestiaryData { fun getNextLevel() = level.getNextLevel() } - private fun String.romanOrInt() = romanToDecimalIfNecessary().let { if (config.replaceRoman || it == 0) it.toString() else it.toRoman() } - fun Any.getNextLevel(): String { - return when (this) { - is Int -> { - (this + 1).toString().romanOrInt() - } - - is String -> { - if (this == "0") { - "I".romanOrInt() - } else { - val intValue = romanToDecimalIfNecessary() - (intValue + 1).toRoman().romanOrInt() - } - } - - else -> { - "Unsupported type: ${this::class.simpleName}" - } + private fun String.getNextLevel() = + if (this == "0") { + "I".romanOrInt() + } else { + val intValue = romanToDecimalIfNecessary() + (intValue + 1).toRoman().romanOrInt() } - } private fun isEnabled() = LorenzUtils.inSkyBlock && config.enabled |