Fix #2590 baubles disappearing

This commit is contained in:
Vincent Lee committed 2018-04-09 10:28:47 -05:00
1 parent e3e4522339
commit 34afbd45ab
1 file changed
+4
@@ -103,6 +103,10 @@ public abstract class ItemBauble extends ItemMod implements IBauble, ICosmeticAt
if(baubles.isItemValidForSlot(i, toEquip, player)) {
ItemStack stackInSlot = baubles.getStackInSlot(i);
if(stackInSlot.isEmpty() || ((IBauble) stackInSlot.getItem()).canUnequip(stackInSlot, player)) {
// If toEquip and stackInSlot are stacks with equal value but not identity, ItemStackHandler.setStackInSlot actually does nothing >.>
// Prevent it from trying to be overly smart by going through empty first
baubles.setStackInSlot(i, ItemStack.EMPTY);
baubles.setStackInSlot(i, toEquip);
((IBauble) toEquip.getItem()).onEquipped(toEquip, player);