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 Details

    • hasNbtData

      @Deprecated default boolean hasNbtData()
      Deprecated.
      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 @Nullable default CompoundTag getNbtData()
      Deprecated.
      Get the object's NBT data (tile entity data). The returned tag, if modified in any way, should be sent to setNbtData(CompoundTag) so that the instance knows of the changes. Making changes without calling setNbtData(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 default void setNbtData(@Nullable CompoundTag nbtData)
      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