Interface DisplayInfo.Builder

All Superinterfaces:
AbstractBuilder<DisplayInfo>, Builder<DisplayInfo,DisplayInfo.Builder>, CopyableBuilder<DisplayInfo,DisplayInfo.Builder>, ResettableBuilder<DisplayInfo,DisplayInfo.Builder>
Enclosing interface:
DisplayInfo

public static interface DisplayInfo.Builder extends Builder<DisplayInfo,DisplayInfo.Builder>, CopyableBuilder<DisplayInfo,DisplayInfo.Builder>
A builder to create DisplayInfos.
  • Method Details

    • type

      default DisplayInfo.Builder type(Supplier<? extends AdvancementType> advancementType)
      Sets the AdvancementType. Defaults to AdvancementTypes.TASK.
      Parameters:
      advancementType - The advancement type
      Returns:
      This builder, for chaining
    • type

      DisplayInfo.Builder type(AdvancementType advancementType)
      Sets the AdvancementType. Defaults to AdvancementTypes.TASK.
      Parameters:
      advancementType - The advancement type
      Returns:
      This builder, for chaining
    • description

      DisplayInfo.Builder description(Component description)
      Sets the description. Defaults to Component.empty().
      Parameters:
      description - The description
      Returns:
      This builder, for chaining
    • title

      Sets the title.
      Parameters:
      title - The title
      Returns:
      This builder, for chaining
    • icon

      default DisplayInfo.Builder icon(Supplier<? extends ItemType> itemType)
      Sets the icon of the advancement with the specified ItemType.
      Parameters:
      itemType - The item type
      Returns:
      This builder, for chaining
    • icon

      default DisplayInfo.Builder icon(ItemType itemType)
      Sets the icon of the advancement with the specified ItemType.
      Parameters:
      itemType - The item type
      Returns:
      This builder, for chaining
    • icon

      Sets the icon of the advancement with the specified ItemStackLike.
      Parameters:
      itemStack - The item stack snapshot
      Returns:
      This builder, for chaining
    • showToast

      DisplayInfo.Builder showToast(boolean showToast)
      Sets whether a toast should be shown. This is the notification that will be displayed in the top right corner.

      Defaults to true.

      Parameters:
      showToast - Whether a toast should be shown
      Returns:
      This builder, for chaining
    • announceToChat

      DisplayInfo.Builder announceToChat(boolean announceToChat)
      Sets whether a notification should be shown in the global chat.

      Defaults to true.

      Parameters:
      announceToChat - Whether a notification should be shown in the chat
      Returns:
      This builder, for chaining
    • hidden

      DisplayInfo.Builder hidden(boolean hidden)
      Sets whether the Advancement should be hidden.

      Hidden advancements will only appear in the tree once they are unlocked. The lines that connect them to other advancements are still present.

      Parameters:
      hidden - Is hidden
      Returns:
      This builder, for chaining
    • build

      DisplayInfo build()
      Builds the DisplayInfo.
      Specified by:
      build in interface AbstractBuilder<DisplayInfo>
      Returns:
      The display info