public static int getItemCount(CompoundTag tag) {
        return tag.contains(TAG_ITEM_COUNT) ? tag.getInt(TAG_ITEM_COUNT) : tag.getList(TAG_ITEMS, 10).size(); //TODO remove legacy support
    }
Simple extension of default vanilla Inventory class that allows for proper saving and loading
to a CompoundNBT. Default implementation does not load items back into their original slots.
<p>
Use {@link BaseContainer#save} and {@link BaseContainer#load} instead of Inventory#createTag and Inventory#fromTag
core/src/main/java/mrtjp/projectred/core/inventory/BaseContainer.java