Interface PreviewContext.Builder

Enclosing interface:
PreviewContext

public static interface PreviewContext.Builder
A builder for creating PreviewContext instances.
Since:
4.1.0
  • Method Details

    • withOwner

      PreviewContext.Builder withOwner(@Nullable net.minecraft.world.entity.player.Player owner)
      Sets the owning player of the item stack.
      Parameters:
      owner - The owner of the item stack, may be null.
      Returns:
      this builder instance for chaining.
      Since:
      4.1.0
    • withRegistryLookup

      PreviewContext.Builder withRegistryLookup(@Nullable net.minecraft.core.HolderLookup.Provider registryLookup)
      Sets the registry lookup to use for deserialization of the item stack.

      Defaults to the owner's registry if not set.

      Parameters:
      registryLookup - The registry lookup for the item stack, may be null.
      Returns:
      this builder instance for chaining.
      Since:
      4.1.0
    • build

      @Nonnull PreviewContext build()
      Builds the PreviewContext instance.
      Returns:
      a new PreviewContext instance.
      Since:
      4.1.0