Interface DataHolderBuilder<H extends DataHolder,B extends DataHolderBuilder<H,B>>

All Superinterfaces:
Buildable.Builder<H>, Builder<H,B>, CopyableBuilder<H,B>, ResettableBuilder<H,B>
All Known Subinterfaces:
BlockEntityArchetype.Builder, BlockSnapshot.Builder, BlockState.Builder, DataHolderBuilder.Immutable<H,B>, DataHolderBuilder.Mutable<H,B>, EntityArchetype.Builder, EntitySnapshot.Builder, FluidStack.Builder, FluidStackSnapshot.Builder, FluidState.Builder, ItemStack.Builder, SerializableDataHolderBuilder<H,B>, SerializableDataHolderBuilder.Immutable<H,B>, SerializableDataHolderBuilder.Mutable<H,B>, State.Builder<S,B>

public interface DataHolderBuilder<H extends DataHolder,B extends DataHolderBuilder<H,B>> extends Builder<H,B>, CopyableBuilder<H,B>
  • Method Details

    • add

      default B add(Value<?> value)
      Adds the given Value to the builder. The Value is copied when the DataHolder is created.
      Parameters:
      value - The value to add
      Returns:
      This builder, for chaining
    • add

      default B add(Iterable<? extends Value<?>> values)
      Adds all the Values to the builder. The Values are copied when the DataHolder is created.
      Parameters:
      values - The values to add
      Returns:
      This builder, for chaining
    • add

      default B add(DataManipulator manipulator)
      Adds all the Values from the DataManipulator to the builder. The Values are copied when the DataHolder is created.
      Parameters:
      manipulator - The manipulator to add
      Returns:
      This builder, for chaining
    • addFrom

      default B addFrom(DataHolder dataHolder)
      Adds all the Values from the DataHolder to the builder. The Values are copied when the DataHolder is created.
      Parameters:
      dataHolder - The data holder to add data from
      Returns:
      This builder, for chaining
    • add

      <V> B add(Key<? extends Value<V>> key, V value)
      Adds the given Key with the given value.
      Type Parameters:
      V - The type of the value
      Parameters:
      key - The key to assign the value with
      value - The value to assign with the key
      Returns:
      This builder, for chaining
    • add

      default <V> B add(Supplier<? extends Key<? extends Value<V>>> key, V value)
      Adds the given Key with the given value.
      Type Parameters:
      V - The type of the value
      Parameters:
      key - The key to assign the value with
      value - The value to assign with the key
      Returns:
      This builder, for chaining
    • from

      B from(H holder)
      Copies all known DataManipulators from the given DataHolder of type DataHolderBuilder. This is a defensive copy as DataManipulator is mutable.
      Specified by:
      from in interface CopyableBuilder<H extends DataHolder,B extends DataHolderBuilder<H,B>>
      Parameters:
      holder - The DataHolder to copy from
      Returns:
      This builder for chaining
    • reset

      B reset()
      Description copied from interface: Builder
      Resets this builder to a "default" state such that there is no remaining data to set. This is to be the presumed "default" state.
      Specified by:
      reset in interface Builder<H extends DataHolder,B extends DataHolderBuilder<H,B>>
      Specified by:
      reset in interface ResettableBuilder<H extends DataHolder,B extends DataHolderBuilder<H,B>>
      Returns:
      This builder, for chaining