Package com.sk89q.worldedit.world
Interface NbtValued
- All Known Subinterfaces:
BlockStateHolder<B>
,TileEntityBlock
- All Known Implementing Classes:
AbstractExtentFilterBlock
,AbstractFilterBlock
,AbstractSingleFilterBlock
,ArrayFilterBlock
,BaseBlock
,BaseEntity
,BaseItem
,BaseItemStack
,BlanketBaseBlock
,BlockState
,CharFilterBlock
,ChunkFilterBlock
,ExtentFilterBlock
,FilterBlock
,FuzzyBlockState
,LazyBaseEntity
,MobSpawnerBlock
,SignBlock
,SingleFilterBlock
,SkullBlock
,VectorizedCharFilterBlock
public interface NbtValued
Indicates an object that contains extra data identified as an NBT structure.
This interface is used when saving and loading objects to a serialized
format, but may be used in other cases.
-
Method Summary
Modifier and TypeMethodDescriptiondefault org.enginehub.linbus.tree.LinCompoundTag
getNbt()
Get the object's NBT data (tile entity data).default CompoundTag
Deprecated.default LazyReference
<org.enginehub.linbus.tree.LinCompoundTag> Get the object's NBT data (tile entity data).default boolean
Deprecated.SeegetNbt()
default void
setNbt
(org.enginehub.linbus.tree.LinCompoundTag nbtData) Set the object's NBT data (tile entity data).default void
setNbtData
(CompoundTag nbtData) Deprecated.default void
setNbtReference
(LazyReference<org.enginehub.linbus.tree.LinCompoundTag> nbtData) Set the object's NBT data (tile entity data).
-
Method Details
-
hasNbtData
Deprecated.SeegetNbt()
Returns whether the block contains NBT data.getNbtData()
must not return null if this method returns true.- Returns:
- true if there is NBT data
-
getNbtData
Deprecated.SeegetNbt()
Get the object's NBT data (tile entity data). The returned tag, if modified in any way, should be sent tosetNbtData(CompoundTag)
so that the instance knows of the changes. Making changes without callingsetNbtData(CompoundTag)
could have unintended consequences.hasNbtData()
must return true if and only if method does not return null.- Returns:
- compound tag, or null
-
setNbtData
Deprecated.Set the object's NBT data (tile entity data).- Parameters:
nbtData
- NBT data, or null if no data
-
getNbtReference
@NonAbstractForCompatibility(delegateName="getNbtData", delegateParams={}) @Nullable default LazyReference<org.enginehub.linbus.tree.LinCompoundTag> getNbtReference()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
getNbt()
.- Returns:
- compound tag, or null
-
getNbt
@Nullable default org.enginehub.linbus.tree.LinCompoundTag getNbt()Get the object's NBT data (tile entity data).- Returns:
- compound tag, or null
-
setNbtReference
@NonAbstractForCompatibility(delegateName="setNbtData", delegateParams=CompoundTag.class) default void setNbtReference(@Nullable LazyReference<org.enginehub.linbus.tree.LinCompoundTag> nbtData) Set the object's NBT data (tile entity data).- Parameters:
nbtData
- NBT data, or null if no data
-
setNbt
default void setNbt(@Nullable org.enginehub.linbus.tree.LinCompoundTag nbtData) Set the object's NBT data (tile entity data).- Parameters:
nbtData
- NBT data, or null if no data
-
getNbt()