diff options
author | Linnea Gräf <nea@nea.moe> | 2024-02-21 22:22:14 +0100 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-02-21 22:22:14 +0100 |
commit | 619652c75b2dda06550cc8c89d0b0d5b70d3ba6f (patch) | |
tree | c8640ae6fd0e9e62fe780ab291d5377c1f6c3db9 /src/main/kotlin/moe/nea/ledger | |
parent | 640456c11d91ef1815c57ade5773a9d917ebcb71 (diff) | |
download | LocalTransactionLedger-619652c75b2dda06550cc8c89d0b0d5b70d3ba6f.tar.gz LocalTransactionLedger-619652c75b2dda06550cc8c89d0b0d5b70d3ba6f.tar.bz2 LocalTransactionLedger-619652c75b2dda06550cc8c89d0b0d5b70d3ba6f.zip |
Add support for co op bazaar orders
Diffstat (limited to 'src/main/kotlin/moe/nea/ledger')
-rw-r--r-- | src/main/kotlin/moe/nea/ledger/ItemIdProvider.kt | 4 |
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 |