aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/utils
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-09 14:21:22 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-08-09 14:21:22 +0200
commit5607930d95e526c529dac318d8e958b7b4de052b (patch)
tree9c9202b00937fc72a064c8a7d8e50ebef3a4766e /src/main/java/at/hannibal2/skyhanni/utils
parent14e306e77902fdbf3564121f069028dd5f55fef8 (diff)
downloadskyhanni-5607930d95e526c529dac318d8e958b7b4de052b.tar.gz
skyhanni-5607930d95e526c529dac318d8e958b7b4de052b.tar.bz2
skyhanni-5607930d95e526c529dac318d8e958b7b4de052b.zip
Using NEUInternalName in more classes
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt13
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt10
2 files changed, 9 insertions, 14 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
index 314275fa8..8fe41bfb2 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt
@@ -176,15 +176,10 @@ object ItemUtils {
}
val ItemStack.nameWithEnchantment: String?
- get() {
- val name = name
- name?.let {
- if (name.endsWith("Enchanted Book")) {
- return getLore()[0]
- }
- }
-
- return name
+ get() = name?.let {
+ if (it.endsWith("Enchanted Book")) {
+ getLore()[0]
+ } else it
}
fun isSkyBlockMenuItem(stack: ItemStack?): Boolean = stack?.getInternalName_old() == "SKYBLOCK_MENU"
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
index 6aa6fa28c..f55277e0a 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/NEUItems.kt
@@ -151,16 +151,15 @@ object NEUItems {
manager.auctionManager.transformHypixelBazaarToNEUItemId(hypixelId).asInternalName()
fun NEUInternalName.getPrice(useSellingPrice: Boolean = false): Double {
- val string = asString()
- if (string == "WISP_POTION") {
+ if (equals("WISP_POTION")) {
return 20_000.0
}
- val result = manager.auctionManager.getBazaarOrBin(string, useSellingPrice)
+ val result = manager.auctionManager.getBazaarOrBin(asString(), useSellingPrice)
if (result == -1.0) {
- if (string == "JACK_O_LANTERN") {
+ if (equals("JACK_O_LANTERN")) {
return getPrice("PUMPKIN", useSellingPrice) + 1
}
- if (string == "GOLDEN_CARROT") {
+ if (equals("GOLDEN_CARROT")) {
// 6.8 for some players
return 7.0 // NPC price
}
@@ -177,6 +176,7 @@ object NEUItems {
fun getItemStackOrNull(internalName: String) = internalName.asInternalName().getItemStackOrNull()
+ // TODO remove
fun getItemStack(internalName: String, definite: Boolean = false): ItemStack =
internalName.asInternalName().getItemStack(definite)