From b428975efe7ffd694861194c898d7dfdcf230302 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 6 Mar 2024 11:12:18 +0100 Subject: add comments about item.name vs item.itemName --- src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main/java/at/hannibal2') 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() } -- cgit