Dirty fix for empty itemstack. Closes #1255

This commit is contained in:
drcrazy 2017-09-19 15:11:00 +03:00
parent 27bfa618db
commit 8a1d9c78eb

View file

@ -141,7 +141,11 @@ public class TileTechStorageBase extends TileLegacyMachineBase
public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) { public NBTTagCompound writeToNBTWithoutCoords(NBTTagCompound tagCompound) {
if (!storedItem.isEmpty()) { if (!storedItem.isEmpty()) {
tagCompound.setTag("storedStack", storedItem.writeToNBT(new NBTTagCompound())); ItemStack temp = storedItem.copy();
if (storedItem.getCount() > storedItem.getMaxStackSize()){
temp.setCount(storedItem.getMaxStackSize());
}
tagCompound.setTag("storedStack", temp.writeToNBT(new NBTTagCompound()));
tagCompound.setInteger("storedQuantity", storedItem.getCount()); tagCompound.setInteger("storedQuantity", storedItem.getCount());
} else { } else {
tagCompound.setInteger("storedQuantity", 0); tagCompound.setInteger("storedQuantity", 0);