Package com.sk89q.worldedit.blocks
Class BaseItem
java.lang.Object
com.sk89q.worldedit.blocks.BaseItem
- All Implemented Interfaces:
NbtValued
- Direct Known Subclasses:
BaseItemStack
Represents an item, without an amount value. See
BaseItemStack
for an instance with stack amount information.
This class may be removed in the future.
-
Constructor Summary
ConstructorDescriptionConstruct the object.BaseItem
(ItemType itemType, CompoundTag nbtData) Deprecated.BaseItem
(ItemType itemType, LazyReference<org.enginehub.linbus.tree.LinCompoundTag> tag) Construct the object. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.LazyReference
<org.enginehub.linbus.tree.LinCompoundTag> Get the object's NBT data (tile entity data).getType()
Get the type of item.void
setNbtReference
(LazyReference<org.enginehub.linbus.tree.LinCompoundTag> nbtData) Set the object's NBT data (tile entity data).void
Set the type of the item.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.sk89q.worldedit.world.NbtValued
getNbt, getNbtData, hasNbtData, setNbt, setNbtData
-
Constructor Details
-
BaseItem
Construct the object.- Parameters:
itemType
- Type of the item
-
BaseItem
Deprecated.Construct the object.- Parameters:
itemType
- Type of the itemnbtData
- NBT Compound tag
-
BaseItem
public BaseItem(ItemType itemType, @Nullable LazyReference<org.enginehub.linbus.tree.LinCompoundTag> tag) Construct the object.- Parameters:
itemType
- Type of the itemtag
- NBT Compound tag
-
-
Method Details
-
getType
Get the type of item.- Returns:
- the type
-
setType
Set the type of the item.- Parameters:
itemType
- The type to set
-
getNativeItem
Deprecated. -
getNbtReference
Description copied from interface:NbtValued
Get the object's NBT data (tile entity data).This only needs to be used if you don't want to immediately resolve the data. Otherwise, you probably want
NbtValued.getNbt()
.- Specified by:
getNbtReference
in interfaceNbtValued
- Returns:
- compound tag, or null
-
setNbtReference
public void setNbtReference(@Nullable LazyReference<org.enginehub.linbus.tree.LinCompoundTag> nbtData) Description copied from interface:NbtValued
Set the object's NBT data (tile entity data).- Specified by:
setNbtReference
in interfaceNbtValued
- Parameters:
nbtData
- NBT data, or null if no data
-
toString
-