Fix crash with null fluid stack (#193)

* fix crash with null fluid stack

* change minimum stack size in bookmarks

Co-authored-by: Serghei Borovetchi <sborovetchi@estatim.com>
This commit is contained in:
slprimeandSerghei Borovetchi authored and GitHub committed 2022-01-07 09:06:05 -08:00
1 parent 2d18dcf42b
commit 144a37cebb
3 files changed
+20 -15

No files matched your search

@@ -14,9 +14,15 @@ public class DefaultStackStringifyHandler implements IStackStringifyHandler
public NBTTagCompound convertItemStackToNBT(ItemStack stack, boolean saveStackSize)
{
final String strId = Item.itemRegistry.getNameForObject(stack.getItem());
if (strId == null) {
return null;
}
final NBTTagCompound nbTag = new NBTTagCompound();
nbTag.setString("strId", Item.itemRegistry.getNameForObject(stack.getItem()));
nbTag.setInteger("Count", saveStackSize? stack.stackSize: 1);
nbTag.setString("strId", strId);
nbTag.setInteger("Count", Math.max(saveStackSize? stack.stackSize: 1, 1));
nbTag.setShort("Damage", (short)stack.getItemDamage());
if (stack.hasTagCompound()) {