Dirty fix for empty itemstack. Closes #1255
This commit is contained in:
parent
27bfa618db
commit
8a1d9c78eb
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue