Interface IWithData<R>

Type Parameters:
R - the type of the object
All Known Subinterfaces:
Holder<T>, IHolderExtension<T>
All Known Implementing Classes:
DeferredBlock, DeferredBlockBuilder, DeferredEntityTypeBuilder, DeferredHolder, DeferredItem, DeferredItemBuilder, Holder.Direct, Holder.Reference, RegistrySetBuilder.LazyHolder

public interface IWithData<R>
Represents a registry object (usually a Holder) that has data maps.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T> T
    Returns the data of the given type that is attached to this object, or null if one isn't.
  • Method Details

    • getData

      @Nullable default <T> T getData(DataMapType<R,T> type)
      Returns the data of the given type that is attached to this object, or null if one isn't.
      Type Parameters:
      T - the type of the data
      Parameters:
      type - the data type
      Returns:
      the data of the given type that is attached to this object, or null if one isn't