Skip to content

Commit

Permalink
Fix stacks having empty nbts upon deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt authored Mar 5, 2024
1 parent 246b2a5 commit c553460
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.refinedmods.refinedstorage.network;

import com.refinedmods.refinedstorage.network.craftingmonitor.CraftingMonitorCancelMessage;
import com.refinedmods.refinedstorage.network.craftingmonitor.CraftingMonitorCancelMessage;
import com.refinedmods.refinedstorage.network.craftingmonitor.CraftingMonitorUpdateMessage;
import com.refinedmods.refinedstorage.network.craftingmonitor.WirelessCraftingMonitorSettingsUpdateMessage;
import com.refinedmods.refinedstorage.network.disk.StorageDiskSizeRequestMessage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ public static ItemStack deserializeStackFromNbt(CompoundTag tag) {
return AttachmentInternals.reconstructItemStack(
BuiltInRegistries.ITEM.get(new ResourceLocation(tag.getString(NBT_ITEM_ID))),
tag.getInt(NBT_ITEM_QUANTITY),
tag.getCompound(NBT_ITEM_NBT)
tag.contains(NBT_ITEM_NBT) ? tag.getCompound(NBT_ITEM_NBT) : null
);
}
}

0 comments on commit c553460

Please sign in to comment.