public interface ItemStackSnapshot extends ImmutableDataHolder<ItemStackSnapshot>, Translatable
ItemStack
as an
ImmutableDataHolder
to represent all of the data associated with
the ItemStack
of which the snapshot was created from. Being that
it is a snapshot, a snapshot cannot be modified, but modifications will
result in a new instance of the ItemStackSnapshot
.Modifier and Type | Field and Description |
---|---|
static ItemStackSnapshot |
NONE |
Modifier and Type | Method and Description |
---|---|
GameDictionary.Entry |
createGameDictionaryEntry()
Creates a
GameDictionary.Entry that
compares stacks to this ItemStackSnapshot . |
ItemStack |
createStack()
Creates a new
ItemStack with all the data currently available
on this ItemStackSnapshot . |
default int |
getCount()
Deprecated.
Use
getQuantity() |
int |
getQuantity()
Gets the quantity of items in this the
ItemStack this
ItemStackSnapshot is representing. |
ItemType |
getType()
Gets the
ItemType of this ItemStackSnapshot . |
boolean |
isEmpty()
Returns true if
getQuantity() is zero and therefore this
ItemStackSnapshot is empty. |
getManipulators
getContentVersion, toContainer
getApplicableProperties, getProperty
get, getContainers, getOrCreate, merge, merge, supports, transform, with, with, with, with, without
copy, get, getKeys, getOrElse, getOrNull, getValue, getValues, require, supports, supports
getTranslation
static final ItemStackSnapshot NONE
ItemType getType()
@Deprecated default int getCount()
getQuantity()
ItemStack
this
ItemStackSnapshot
is representing.int getQuantity()
ItemStack
this
ItemStackSnapshot
is representing.boolean isEmpty()
getQuantity()
is zero and therefore this
ItemStackSnapshot is empty.ItemStack createStack()
ItemStack
with all the data currently available
on this ItemStackSnapshot
.GameDictionary.Entry createGameDictionaryEntry()
GameDictionary.Entry
that
compares stacks to this ItemStackSnapshot
. Note that not all
data stored in this ItemStackSnapshot
may be stored in the
returned entry.GameDictionary.Entry
based on this
ItemStackSnapshot