Skip to content

Commit

Permalink
changed a few .toString to .asString to fix stuff (hannibal002#678)
Browse files Browse the repository at this point in the history
changed a few .toString to .asString to fix stuff hannibal002#678
  • Loading branch information
CalMWolfs authored Nov 2, 2023
1 parent 379b7ee commit 3b2b937
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ package at.hannibal2.skyhanni.features.fishing
import at.hannibal2.skyhanni.utils.InventoryUtils

object FishingAPI {
fun hasFishingRodInHand() = InventoryUtils.itemInHandId.toString().contains("ROD")
}
fun hasFishingRodInHand() = InventoryUtils.itemInHandId.asString().contains("ROD")
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList
import at.hannibal2.skyhanni.utils.NEUInternalName
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import at.hannibal2.skyhanni.utils.RenderUtils.renderString
import at.hannibal2.skyhanni.utils.RenderUtils.renderStringsAndItems
import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments
Expand Down Expand Up @@ -174,10 +173,10 @@ class FarmingFortuneDisplay {
return 0.0
}
return if (internalName.startsWith("THEORETICAL_HOE")) {
listOf(10.0, 25.0, 50.0)[internalName.toString().last().digitToInt() - 1]
} else when (internalName) {
"FUNGI_CUTTER".asInternalName() -> 30.0
"COCO_CHOPPER".asInternalName() -> 20.0
listOf(10.0, 25.0, 50.0)[internalName.asString().last().digitToInt() - 1]
} else when (internalName.asString()) {
"FUNGI_CUTTER" -> 30.0
"COCO_CHOPPER" -> 20.0
else -> 0.0
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ enum class VisitorReward(private val rawInternalName: String) {

private val internalName by lazy { rawInternalName.asInternalName() }
val itemStack by lazy { internalName.getItemStack() }
val displayName by lazy { itemStack.nameWithEnchantment ?: internalName.toString() }
val displayName by lazy { itemStack.nameWithEnchantment ?: internalName.asString() }

companion object {
fun getByInternalName(internalName: NEUInternalName) = entries.firstOrNull { it.internalName == internalName }
}
}
}

0 comments on commit 3b2b937

Please sign in to comment.