Interface BlockType.Typed<B extends BlockData>

Type Parameters:
B - the generic type of the block data that represents the block type.
All Superinterfaces:
BlockType, Keyed, Translatable
Enclosing interface:
BlockType

public static interface BlockType.Typed<B extends BlockData> extends BlockType
Typed represents a subtype of BlockTypes that have a known block data type at compile time.
  • Method Details

    • getBlockDataClass

      @NotNull Class<B> getBlockDataClass()
      Gets the BlockData class of this BlockType
      Specified by:
      getBlockDataClass in interface BlockType
      Returns:
      the BlockData class of this BlockType
    • createBlockData

      @NotNull B createBlockData(@Nullable Consumer<? super B> consumer)
      Creates a new BlockData instance for this block type, with all properties initialized to unspecified defaults.
      Parameters:
      consumer - consumer to run on new instance before returning
      Returns:
      new data instance
    • createBlockData

      @NotNull B createBlockData()
      Creates a new BlockData instance for this block type, with all properties initialized to unspecified defaults.
      Specified by:
      createBlockData in interface BlockType
      Returns:
      new data instance
    • createBlockData

      @NotNull B createBlockData(@Nullable String data)
      Creates a new BlockData instance for this block type, with all properties initialized to unspecified defaults, except for those provided in data.
      Specified by:
      createBlockData in interface BlockType
      Parameters:
      data - data string
      Returns:
      new data instance
      Throws:
      IllegalArgumentException - if the specified data is not valid