Interface PreviewContext.Builder
- Enclosing interface:
PreviewContext
public static interface PreviewContext.Builder
A builder for creating
PreviewContext instances.- Since:
- 4.1.0
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds thePreviewContextinstance.withOwner(net.minecraft.world.entity.player.Player owner) Sets the owning player of the item stack.withRegistryLookup(net.minecraft.core.HolderLookup.Provider registryLookup) Sets the registry lookup to use for deserialization of the item stack.
-
Method Details
-
withOwner
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
Builds thePreviewContextinstance.- Returns:
- a new
PreviewContextinstance. - Since:
- 4.1.0
-