aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/rift
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/rift')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt4
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt9
3 files changed, 11 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt
index d15eeb3be..3a37cc435 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/RiftAPI.kt
@@ -6,6 +6,7 @@ import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.NEUInternalName
+import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import net.minecraft.item.ItemStack
object RiftAPI {
@@ -16,6 +17,8 @@ object RiftAPI {
// internal name -> motes
var motesPrice = emptyMap<NEUInternalName, Double>()
+ val farmingTool by lazy { "FARMING_WAND".asInternalName() }
+
fun ItemStack.motesNpcPrice(): Double? {
val baseMotes = motesPrice[getInternalName()] ?: return null
val burgerStacks = config.motes.burgerStacks
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt
index 61f7b55a6..ded7de44c 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/area/wyldwoods/RiftOdonata.kt
@@ -9,6 +9,7 @@ import at.hannibal2.skyhanni.utils.EntityUtils.hasSkullTexture
import at.hannibal2.skyhanni.utils.InventoryUtils
import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName
import at.hannibal2.skyhanni.utils.LorenzUtils.toChromaColor
+import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName
import net.minecraft.entity.item.EntityArmorStand
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
@@ -17,6 +18,7 @@ class RiftOdonata {
private var hasBottleInHand = false
val odonataSkullTexture =
"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOWZkODA2ZGVmZGZkZjU5YjFmMjYwOWM4ZWUzNjQ2NjZkZTY2MTI3YTYyMzQxNWI1NDMwYzkzNThjNjAxZWY3YyJ9fX0="
+ private val emptyBottle by lazy { "EMPTY_ODONATA_BOTTLE".asInternalName() }
@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
@@ -31,7 +33,7 @@ class RiftOdonata {
}
private fun checkHand() {
- hasBottleInHand = InventoryUtils.getItemInHand()?.getInternalName()?.equals("EMPTY_ODONATA_BOTTLE") ?: false
+ hasBottleInHand = InventoryUtils.getItemInHand()?.getInternalName() == emptyBottle
}
private fun findOdonatas() {
diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt
index 06ec9cd97..fe7cb2a73 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/rift/everywhere/motes/ShowMotesNpcSellPrice.kt
@@ -14,7 +14,8 @@ import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils.addAsSingletonList
import at.hannibal2.skyhanni.utils.LorenzUtils.addSelector
import at.hannibal2.skyhanni.utils.LorenzUtils.chat
-import at.hannibal2.skyhanni.utils.NEUItems
+import at.hannibal2.skyhanni.utils.NEUInternalName
+import at.hannibal2.skyhanni.utils.NEUItems.getItemStack
import at.hannibal2.skyhanni.utils.NumberUtil
import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators
import at.hannibal2.skyhanni.utils.RenderUtils.highlight
@@ -29,7 +30,7 @@ class ShowMotesNpcSellPrice {
private val config get() = RiftAPI.config.motes
private var display = emptyList<List<Any>>()
private val pattern = ".*(?:§\\w)+You have (?:§\\w)+(?<amount>\\d) Grubber Stacks.*".toPattern()
- private val itemMap = mutableMapOf<String, Pair<MutableList<Int>, Double>>()
+ private val itemMap = mutableMapOf<NEUInternalName, Pair<MutableList<Int>, Double>>()
private var inInventory = false
private val slotList = mutableListOf<Int>()
@@ -108,7 +109,7 @@ class ShowMotesNpcSellPrice {
itemMap.clear()
for ((index, stack) in stacks) {
val itemValue = stack.motesNpcPrice() ?: continue
- val internalName = stack.getInternalName().asString()
+ val internalName = stack.getInternalName()
if (itemMap.contains(internalName)) {
val (oldIndex, oldValue) = itemMap[internalName] ?: return
oldIndex.add(index)
@@ -143,7 +144,7 @@ class ShowMotesNpcSellPrice {
newDisplay.add(buildList {
val (index, value) = pair
add(" §7- ")
- val stack = NEUItems.getItemStack(internalName)
+ val stack = internalName.getItemStack()
add(stack)
val price = value.formatPrice()
val valuePer = stack.motesNpcPrice() ?: continue