From 619652c75b2dda06550cc8c89d0b0d5b70d3ba6f Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Wed, 21 Feb 2024 22:22:14 +0100 Subject: Add support for co op bazaar orders --- src/main/kotlin/moe/nea/ledger/ItemIdProvider.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit