diff options
author | Thunderblade73 <85900443+Thunderblade73@users.noreply.github.com> | 2024-02-20 18:28:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 18:28:44 +0100 |
commit | 2d1a900fd40150cff686ea4f2c260d120140d653 (patch) | |
tree | cba51f2e6456e474cacbdc4cadbc138c3eea445f /src/main | |
parent | 5e83fa9cd9d53f6a7f9d702e77a0873db3487b8f (diff) | |
download | skyhanni-2d1a900fd40150cff686ea4f2c260d120140d653.tar.gz skyhanni-2d1a900fd40150cff686ea4f2c260d120140d653.tar.bz2 skyhanni-2d1a900fd40150cff686ea4f2c260d120140d653.zip |
Fixed gfs bazaar given wrong search value. #1032
Diffstat (limited to 'src/main')
3 files changed, 12 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt index 942114203..f5b8904a6 100644 --- a/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/api/GetFromSackAPI.kt @@ -18,7 +18,6 @@ import at.hannibal2.skyhanni.utils.NumberUtil.isInt import at.hannibal2.skyhanni.utils.PrimitiveItemStack import at.hannibal2.skyhanni.utils.PrimitiveItemStack.Companion.makePrimitiveStack import at.hannibal2.skyhanni.utils.SimpleTimeMark -import at.hannibal2.skyhanni.utils.StringUtils.firstLetterUppercase import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.repopatterns.RepoPattern import net.minecraft.inventory.Slot @@ -50,9 +49,9 @@ object GetFromSackAPI { fun getFromChatMessageSackItems( item: PrimitiveItemStack, - text: String = "§lCLICK HERE§r§e to grab §ax${item.amount} §9${item.name.asString()}§e from sacks!" + text: String = "§lCLICK HERE§r§e to grab §ax${item.amount} §9${item.itemName}§e from sacks!" ) = - ChatUtils.clickableChat(text, "${commands.first()} ${item.name.asString()} ${item.amount}") + ChatUtils.clickableChat(text, "${commands.first()} ${item.internalName.asString()} ${item.amount}") fun getFromSlotClickedSackItems(items: List<PrimitiveItemStack>, slotIndex: Int) = addToInventory(items, slotIndex) @@ -79,7 +78,7 @@ object GetFromSackAPI { if (!LorenzUtils.inSkyBlock) return if (queue.isNotEmpty() && lastTimeOfCommand.passedSince() >= minimumDelay) { val item = queue.poll() - LorenzUtils.sendCommandToServer("gfs ${item.name.asString()} ${item.amount}") + LorenzUtils.sendCommandToServer("gfs ${item.internalName.asString()} ${item.amount}") lastTimeOfCommand = ChatUtils.getTimeWhenNewlyQueuedMessageGetsExecuted() } } @@ -105,7 +104,7 @@ object GetFromSackAPI { event.toolTip.let { tip -> tip.add("") tip.add("§ePress right click to get from sack:") - tip.addAll(list.map { "§ex" + it.amount.toString() + " " + it.name.asString() }) + tip.addAll(list.map { "§ex" + it.amount.toString() + " " + it.internalName.asString() }) } } @@ -173,12 +172,12 @@ object GetFromSackAPI { fromSacksChatPattern.matchMatcher(message) { val diff = stack.amount - group("amount").toInt() if (diff <= 0) return - bazaarMessage(stack.name.asString().firstLetterUppercase(), diff, true) + bazaarMessage(stack.itemName, diff, true) lastItemStack = null return } missingChatPattern.matchMatcher(message) { - bazaarMessage(stack.name.asString().firstLetterUppercase(), stack.amount) + bazaarMessage(stack.itemName, stack.amount) lastItemStack = null return } diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt index d866ecc8d..4d5d54bae 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionXp.kt @@ -107,7 +107,7 @@ class MinionXp { it.value.getLore().isNotEmpty() && (!isMinion || it.key in listOf(21..26, 30..35, 39..44).flatten()) }.forEach { (_, itemStack) -> val item = toPrimitiveItemStack(itemStack) - val name = item.name + val name = item.internalName val xp = xpInfoMap[name] ?: return@forEach // TODO add wisdom and temporary skill exp (Events) to calculation diff --git a/src/main/java/at/hannibal2/skyhanni/utils/PrimitiveItemStack.kt b/src/main/java/at/hannibal2/skyhanni/utils/PrimitiveItemStack.kt index ad7b864b1..fd684950f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/PrimitiveItemStack.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/PrimitiveItemStack.kt @@ -1,10 +1,13 @@ package at.hannibal2.skyhanni.utils +import at.hannibal2.skyhanni.utils.ItemUtils.itemName import at.hannibal2.skyhanni.utils.NEUItems.getItemStack -data class PrimitiveItemStack(val name: NEUInternalName, val amount: Int) { +data class PrimitiveItemStack(val internalName: NEUInternalName, val amount: Int) { - fun createItem() = name.getItemStack().apply { stackSize = amount } + fun createItem() = internalName.getItemStack().apply { stackSize = amount } + + val itemName by lazy { internalName.itemName } companion object { |