aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-12 10:16:04 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-10-12 10:16:04 +0200
commitb825b8e1d58348ba8ad853e4cc1c7ba672429bd3 (patch)
treeb98598cf9daa3ec977d3ada838e90ba09ca5f819 /src/main/java
parent7d6503b05de3a2db7af247c0cc32b341bf636a37 (diff)
downloadskyhanni-b825b8e1d58348ba8ad853e4cc1c7ba672429bd3.tar.gz
skyhanni-b825b8e1d58348ba8ad853e4cc1c7ba672429bd3.tar.bz2
skyhanni-b825b8e1d58348ba8ad853e4cc1c7ba672429bd3.zip
Fixed Hyper reforge/End Stone Geode detection.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt5
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt8
2 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt
index 93b84ec48..60a790297 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/misc/items/EstimatedItemValue.kt
@@ -289,7 +289,7 @@ object EstimatedItemValue {
}
private fun addReforgeStone(stack: ItemStack, list: MutableList<String>): Double {
- var rawReforgeName = stack.getReforgeName() ?: return 0.0
+ val rawReforgeName = stack.getReforgeName() ?: return 0.0
for ((rawInternalName, values) in Constants.REFORGESTONES.entrySet()) {
val stoneJson = values.asJsonObject
@@ -302,8 +302,7 @@ object EstimatedItemValue {
val reforgeCosts = stoneJson.get("reforgeCosts").asJsonObject
val applyCost = getReforgeStoneApplyCost(stack, reforgeCosts, internalName) ?: return 0.0
- val realReforgeName = if (reforgeName.equals("Warped")) "Hyper" else reforgeName
- list.add("§7Reforge: §9$realReforgeName")
+ list.add("§7Reforge: §9$reforgeName")
list.add(" §7Stone $reforgeStoneName §7(§6" + NumberUtil.format(reforgeStonePrice) + "§7)")
list.add(" §7Apply cost: (§6" + NumberUtil.format(applyCost) + "§7)")
return reforgeStonePrice + applyCost
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
index 0a3478236..4cc248ba3 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/SkyBlockItemModifierUtils.kt
@@ -7,6 +7,7 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getLore
import at.hannibal2.skyhanni.utils.ItemUtils.name
import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher
+import at.hannibal2.skyhanni.utils.StringUtils.removeColor
import com.google.gson.JsonObject
import net.minecraft.item.Item
import net.minecraft.item.ItemStack
@@ -145,7 +146,12 @@ object SkyBlockItemModifierUtils {
}
fun ItemStack.getReforgeName() = getAttributeString("modifier")?.let {
- if (it == "pitchin") "pitchin_koi" else it
+ when {
+ it == "pitchin" -> "pitchin_koi"
+ it == "warped" && name!!.removeColor().startsWith("Hyper ") -> "endstone_geode"
+
+ else -> it
+ }
}
fun ItemStack.isRecombobulated() = getAttributeBoolean("rarity_upgrades")