From c94f56f0ac430f84dae6bd38063d563ff58175ff Mon Sep 17 00:00:00 2001 From: Gabriel Tofvesson Date: Thu, 20 May 2021 00:52:26 +0200 Subject: [PATCH] Add stack count check for throwable replacement --- src/dev/w1zzrd/invtweaks/listener/StackReplaceListener.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dev/w1zzrd/invtweaks/listener/StackReplaceListener.java b/src/dev/w1zzrd/invtweaks/listener/StackReplaceListener.java index c316ca6..19b0510 100644 --- a/src/dev/w1zzrd/invtweaks/listener/StackReplaceListener.java +++ b/src/dev/w1zzrd/invtweaks/listener/StackReplaceListener.java @@ -73,7 +73,8 @@ public class StackReplaceListener implements Listener { slot = EquipmentSlot.OFF_HAND; else return; - if (findAndMoveSimilarStack(stack, slot, inventory, CompareFunc.defaultFunc())) + if (inventory.getItem(slot).getAmount() == 1 && + findAndMoveSimilarStack(stack, slot, inventory, CompareFunc.defaultFunc())) logger.fine(LOG_PLUGIN_NAME + " Moved snowball into empty hand for player " + thrower.getName()); } }