File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/main/java/com/fix3dll/skyblockaddons/features/backpacks Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 3636import net .minecraft .world .inventory .ChestMenu ;
3737import net .minecraft .world .inventory .Slot ;
3838import net .minecraft .world .item .ItemStack ;
39+ import net .minecraft .world .item .Items ;
3940import net .minecraft .world .item .component .CustomData ;
4041import net .minecraft .world .item .component .ItemLore ;
4142import net .minecraft .world .level .block .Blocks ;
@@ -66,6 +67,7 @@ public class ContainerPreviewManager {
6667 private static final ResourceLocation CHEST_GUI_TEXTURE = SkyblockAddons .resourceLocation ("containerpreview.png" );
6768 private static final Pattern BACKPACK_STORAGE_PATTERN = Pattern .compile ("Backpack Slot (?<slot>\\ d+)" );
6869 private static final Pattern ENDERCHEST_STORAGE_PATTERN = Pattern .compile ("Ender Chest Page (?<page>\\ d+)" );
70+ private static final ItemStack EMPTY_SLOT_ITEM = Items .AIR .getDefaultInstance ();
6971
7072 /**
7173 * The container preview to render
@@ -232,9 +234,11 @@ public static List<ItemStack> decompressItems(byte[] bytes) {
232234 }
233235
234236 items .add (i , modernItem );
237+ } else if (itemTag .isEmpty ()) {
238+ items .add (i , EMPTY_SLOT_ITEM );
235239 } else {
236240 Optional <ItemStack > itemStack = ItemUtils .parseTag (itemTag );
237- items .add (i , itemStack .orElse (ItemStack . EMPTY ));
241+ items .add (i , itemStack .orElse (EMPTY_SLOT_ITEM ));
238242 }
239243 }
240244 } catch (Exception ex ) {
You can’t perform that action at this time.
0 commit comments