Class PaperItemBody

java.lang.Object
io.github.projectunified.unidialog.paper.body.PaperItemBody
All Implemented Interfaces:
ItemBody<org.bukkit.inventory.ItemStack,PaperTextBody,PaperItemBody>, PaperDialogBody

public class PaperItemBody extends Object implements ItemBody<org.bukkit.inventory.ItemStack,PaperTextBody,PaperItemBody>, PaperDialogBody
  • Constructor Details

    • PaperItemBody

      public PaperItemBody(Function<String,net.kyori.adventure.text.Component> componentDeserializer)
  • Method Details

    • item

      public PaperItemBody item(org.bukkit.inventory.ItemStack item)
      Description copied from interface: ItemBody
      Set the item for the body
      Specified by:
      item in interface ItemBody<org.bukkit.inventory.ItemStack,PaperTextBody,PaperItemBody>
      Parameters:
      item - the item to set
      Returns:
      the instance of the item body for method chaining
    • description

      public PaperItemBody description(@Nullable @Nullable Consumer<PaperTextBody> descriptionBuilder)
      Description copied from interface: ItemBody
      Set the description for the body
      Specified by:
      description in interface ItemBody<org.bukkit.inventory.ItemStack,PaperTextBody,PaperItemBody>
      Parameters:
      descriptionBuilder - a consumer to build the description
      Returns:
      the instance of the item body for method chaining
    • showDecorations

      public PaperItemBody showDecorations(boolean showDecorations)
      Description copied from interface: ItemBody
      Set the option to show decorations in the body
      Specified by:
      showDecorations in interface ItemBody<org.bukkit.inventory.ItemStack,PaperTextBody,PaperItemBody>
      Parameters:
      showDecorations - whether to show decorations
      Returns:
      the instance of the item body for method chaining
    • showTooltip

      public PaperItemBody showTooltip(boolean showTooltip)
      Description copied from interface: ItemBody
      Set the option to show a tooltip in the body
      Specified by:
      showTooltip in interface ItemBody<org.bukkit.inventory.ItemStack,PaperTextBody,PaperItemBody>
      Parameters:
      showTooltip - whether to show a tooltip
      Returns:
      the instance of the item body for method chaining
    • width

      public PaperItemBody width(int width)
      Description copied from interface: ItemBody
      Set the width of the item body
      Specified by:
      width in interface ItemBody<org.bukkit.inventory.ItemStack,PaperTextBody,PaperItemBody>
      Parameters:
      width - the width to set
      Returns:
      the instance of the item body for method chaining
    • height

      public PaperItemBody height(int height)
      Description copied from interface: ItemBody
      Set the height of the item body
      Specified by:
      height in interface ItemBody<org.bukkit.inventory.ItemStack,PaperTextBody,PaperItemBody>
      Parameters:
      height - the height to set
      Returns:
      the instance of the item body for method chaining
    • getDialogBody

      public io.papermc.paper.registry.data.dialog.body.DialogBody getDialogBody()
      Specified by:
      getDialogBody in interface PaperDialogBody