public class BaseItem extends java.lang.Object implements NbtValued
BaseItemStack
for an instance with stack amount information.
This class may be removed in the future.
Constructor and Description |
---|
BaseItem(ItemType itemType)
Construct the object.
|
BaseItem(ItemType itemType,
CompoundTag nbtData)
Deprecated.
|
BaseItem(ItemType itemType,
LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> tag)
Construct the object.
|
Modifier and Type | Method and Description |
---|---|
LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> |
getNbtReference()
Get the object's NBT data (tile entity data).
|
ItemType |
getType()
Get the type of item.
|
void |
setNbtReference(LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> nbtData)
Set the object's NBT data (tile entity data).
|
void |
setType(ItemType itemType)
Set the type of the item.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getNbt, getNbtData, hasNbtData, setNbt, setNbtData
public BaseItem(ItemType itemType)
itemType
- Type of the item@Deprecated public BaseItem(ItemType itemType, @Nullable CompoundTag nbtData)
itemType
- Type of the itemnbtData
- NBT Compound tagpublic BaseItem(ItemType itemType, @Nullable LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> tag)
itemType
- Type of the itemtag
- NBT Compound tagpublic ItemType getType()
public void setType(ItemType itemType)
itemType
- The type to set@Nullable public LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> getNbtReference()
NbtValued
This only needs to be used if you don't want to immediately resolve the data.
Otherwise, you probably want NbtValued.getNbt()
.
getNbtReference
in interface NbtValued
public void setNbtReference(@Nullable LazyReference<com.sk89q.worldedit.util.nbt.CompoundBinaryTag> nbtData)
NbtValued
setNbtReference
in interface NbtValued
nbtData
- NBT data, or null if no datapublic java.lang.String toString()
toString
in class java.lang.Object