CompactStorage

CompactStorage

11M Downloads

Stack splitting(by rmb) nullify reminder part of stack in chest and backups

alexeik opened this issue ยท 2 comments

commented

There seems to be an issue with stacks in a chest right clicking to split the stacks end up deleting one of the stacks this would be on a server aswell vanilla chests are not effected by this

I can confirm the same issue that "Wakingone94" faced. I did not notice what caused the issue, as he did, however I have noticed that literally half my stuff is missing when I dealt with the backpacks. Please fix this as soon as you can. :(

pasted from http://www.curse.com/mc-mods/minecraft/223703-compactstorage#t1:changes

commented

@OverRide
public ItemStack decrStackSize(int slot, int amount)
{
ItemStack stack = getStackInSlot(slot);
if(stack != null)
{
if(stack.stackSize <= amount)
{
setInventorySlotContents(slot, null);
}
else
{
ItemStack stack2 = stack.splitStack(amount);
}
}
return stack;
}

here
ItemStack itemStackRemoved;
if (itemStackInSlot.stackSize <= count) {
itemStackRemoved = itemStackInSlot;
setInventorySlotContents(slotIndex, null);
} else {
itemStackRemoved = itemStackInSlot.splitStack(count);
if (itemStackInSlot.stackSize == 0) {
setInventorySlotContents(slotIndex, null);
}
}
return itemStackRemoved;
must be smth like this

@OverRide
public ItemStack decrStackSize(int slot, int amount)
{
ItemStack stack = getStackInSlot(slot);
if(stack != null)
{
ItemStack itemStackRemoved;
if(stack.stackSize <= amount)
{
itemStackRemoved=stack;
setInventorySlotContents(slot, null);
}
else
{
itemStackRemoved = stack.splitStack(amount);
if (stack .stackSize == 0) {
setInventorySlotContents(slotIndex, null);
}
}

}
markDirty();
return itemStackRemoved;
}

commented

... It will be updated in the next version, this has been said on the Forum Page