diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-24 17:09:58 +0100 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2023-12-24 17:09:58 +0100 |
commit | 283f55a2e11d131cfa5a2382253734002ebc4306 (patch) | |
tree | 17fcd436136ddc1348549620ca07877ec472c82d /src/main/java/at/hannibal2 | |
parent | fdb8fec242f5b87bbd464ed95708d72391fe6d9b (diff) | |
download | skyhanni-283f55a2e11d131cfa5a2382253734002ebc4306.tar.gz skyhanni-283f55a2e11d131cfa5a2382253734002ebc4306.tar.bz2 skyhanni-283f55a2e11d131cfa5a2382253734002ebc4306.zip |
Code cleanup
Diffstat (limited to 'src/main/java/at/hannibal2')
-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 |