aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-03-06 11:12:18 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2024-03-06 11:12:18 +0100
commitb428975efe7ffd694861194c898d7dfdcf230302 (patch)
tree2fa7f5961fcc813d173242f2fcf8f71bd7c00929
parent3ace352b8f5d8614ca9015f62a7182b4cca9cba0 (diff)
downloadskyhanni-b428975efe7ffd694861194c898d7dfdcf230302.tar.gz
skyhanni-b428975efe7ffd694861194c898d7dfdcf230302.tar.bz2
skyhanni-b428975efe7ffd694861194c898d7dfdcf230302.zip
add comments about item.name vs item.itemName
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
index 80939e492..30e8adcee 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
@@ -291,6 +291,7 @@ object ItemUtils {
private fun itemRarityLastCheck(data: CachedItemData) =
data.itemRarityLastCheck.asTimeMark().passedSince() > 10.seconds
+ // use when compaaring the name (e.g. regex), not for showing to the user
// extra method for shorter name and kotlin nullability logic
var ItemStack.name: String?
get() = this.displayName
@@ -365,11 +366,13 @@ object ItemUtils {
fun NEUInternalName.isRune(): Boolean = contains("_RUNE;")
+ // use when showing the item name to the user (in guis, chat message, etc), not for comparing
val ItemStack.itemName: String
get() = getInternalName().itemName
val ItemStack.itemNameWithoutColor: String get() = itemName.removeColor()
+ // use when showing the item name to the user (in guis, chat message, etc), not for comparing
val NEUInternalName.itemName: String
get() = itemNameCache.getOrPut(this) { grabItemName() }