From 0c313d2c988e6d2a39560db1733beb993f0f4f39 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 24 Feb 2024 18:48:52 +0100 Subject: Fixed Garden plot edit mode copies stack size. --- .../hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt index db5cec5a5..b1ae273fa 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/inventory/GardenPlotIcon.kt @@ -23,6 +23,8 @@ object GardenPlotIcon { private val plotList get() = GardenAPI.storage?.plotIcon?.plotList private var inInventory = false private var copyStack: ItemStack? = null + + // TODO replace with enum private var editMode = 0 // 0 = off, 1 = on, 2 = reset private var lastClickedSlotId = -1 private var originalStack = mutableMapOf() @@ -103,7 +105,9 @@ object GardenPlotIcon { if (editMode != 0) { if (event.slotId in 54..89) { event.isCanceled = true - copyStack = event.slot.stack ?: return + copyStack = event.slot.stack?.copy()?.also { + it.stackSize = 1 + } ?: return // TODO different format, not bold or show not in chat at all. ChatUtils.chat("§6§lClick an item in the desk menu to replace it with that item!") return -- cgit