aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-02-21 22:22:14 +0100
committerLinnea Gräf <nea@nea.moe>2024-02-21 22:22:14 +0100
commit619652c75b2dda06550cc8c89d0b0d5b70d3ba6f (patch)
treec8640ae6fd0e9e62fe780ab291d5377c1f6c3db9 /src
parent640456c11d91ef1815c57ade5773a9d917ebcb71 (diff)
downloadLocalTransactionLedger-619652c75b2dda06550cc8c89d0b0d5b70d3ba6f.tar.gz
LocalTransactionLedger-619652c75b2dda06550cc8c89d0b0d5b70d3ba6f.tar.bz2
LocalTransactionLedger-619652c75b2dda06550cc8c89d0b0d5b70d3ba6f.zip
Add support for co op bazaar orders
Diffstat (limited to 'src')
-rw-r--r--src/main/kotlin/moe/nea/ledger/ItemIdProvider.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/kotlin/moe/nea/ledger/ItemIdProvider.kt b/src/main/kotlin/moe/nea/ledger/ItemIdProvider.kt
index b1d953e..89570da 100644
--- a/src/main/kotlin/moe/nea/ledger/ItemIdProvider.kt
+++ b/src/main/kotlin/moe/nea/ledger/ItemIdProvider.kt
@@ -25,7 +25,8 @@ class ItemIdProvider {
fun saveInventoryIds(event: BeforeGuiAction) {
val chest = (event.gui as? GuiChest) ?: return
val slots = chest.inventorySlots as ContainerChest
- val isOrderMenu = slots.lowerChestInventory.name.unformattedString() == "Your Bazaar Orders"
+ val chestName = slots.lowerChestInventory.name.unformattedString()
+ val isOrderMenu = chestName == "Your Bazaar Orders" || chestName == "Co-op Bazar Orders"
slots.inventorySlots.forEach {
val stack = it.stack ?: return@forEach
val nbt = stack.tagCompound ?: NBTTagCompound()
@@ -33,6 +34,7 @@ class ItemIdProvider {
var name = display.getString("Name").unformattedString()
if (isOrderMenu)
name = name.removePrefix("BUY ").removePrefix("SELL ")
+ name = name.trim()
val id = stack.getInternalId()
if (id != null && name.isNotBlank()) {
knownNames[name] = id