Class DataItem
java.lang.Object
com.viaversion.viaversion.api.minecraft.item.DataItem
- All Implemented Interfaces:
Item
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
amount()
Returns the item amount.copy()
Returns a copy of the item.short
data()
Returns the item data.Returns the data container for item data components.boolean
int
hashCode()
int
Returns the item identifier.void
setAmount
(int amount) Returns the item amount.void
setData
(short data) Sets the item data used in versions before 1.13.void
setIdentifier
(int identifier) Sets the item identifier.void
setTag
(@Nullable com.viaversion.nbt.tag.CompoundTag tag) Sets the item compound tag.@Nullable com.viaversion.nbt.tag.CompoundTag
tag()
Returns the item compound tag if present.toString()
-
Constructor Details
-
DataItem
public DataItem() -
DataItem
public DataItem(int identifier, byte amount, @Nullable com.viaversion.nbt.tag.CompoundTag tag) -
DataItem
public DataItem(int identifier, byte amount, short data, @Nullable com.viaversion.nbt.tag.CompoundTag tag)
-
-
Method Details
-
identifier
public int identifier()Description copied from interface:Item
Returns the item identifier.- Specified by:
identifier
in interfaceItem
- Returns:
- item identifier
-
setIdentifier
public void setIdentifier(int identifier) Description copied from interface:Item
Sets the item identifier.- Specified by:
setIdentifier
in interfaceItem
- Parameters:
identifier
- item identifier
-
amount
public int amount()Description copied from interface:Item
Returns the item amount. -
setAmount
public void setAmount(int amount) Description copied from interface:Item
Returns the item amount. -
data
public short data()Description copied from interface:Item
Returns the item data. Always 0 for 1.13+ items. -
setData
public void setData(short data) Description copied from interface:Item
Sets the item data used in versions before 1.13. -
tag
public @Nullable com.viaversion.nbt.tag.CompoundTag tag()Description copied from interface:Item
Returns the item compound tag if present. -
setTag
public void setTag(@Nullable com.viaversion.nbt.tag.CompoundTag tag) Description copied from interface:Item
Sets the item compound tag. -
dataContainer
Description copied from interface:Item
Returns the data container for item data components.- Specified by:
dataContainer
in interfaceItem
- Returns:
- the data container
-
copy
Description copied from interface:Item
Returns a copy of the item. -
equals
-
hashCode
public int hashCode() -
toString
-