Add stack count check for throwable replacement

This commit is contained in:
Gabriel Tofvesson 2021-05-20 00:52:26 +02:00
parent f0c89e897b
commit c94f56f0ac

View File

@ -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());
}
}