Class DynamicTitle.InteractionDynamicTitle

java.lang.Object
io.rhythmknights.coreapi.component.module.DynamicTitle.InteractionDynamicTitle
All Implemented Interfaces:
DynamicTitle
Enclosing interface:
DynamicTitle

public static class DynamicTitle.InteractionDynamicTitle extends Object implements DynamicTitle
Implementation for updating titles based on item interactions
  • Constructor Details

    • InteractionDynamicTitle

      public InteractionDynamicTitle(@NotNull @NotNull String baseTitle)
      Creates a dynamic title that updates on item interactions
      Parameters:
      baseTitle - Base title text
    • InteractionDynamicTitle

      public InteractionDynamicTitle(@NotNull @NotNull Function<DynamicTitle.InteractionState,net.kyori.adventure.text.Component> titleFunction, @NotNull @NotNull String baseTitle)
      Creates a dynamic title with custom formatting
      Parameters:
      titleFunction - Function to create title from interaction state
      baseTitle - Base title text
  • Method Details

    • getDynamicTitle

      @NotNull public @NotNull net.kyori.adventure.text.Component getDynamicTitle()
      Description copied from interface: DynamicTitle
      Get the current dynamic title based on modal state
      Specified by:
      getDynamicTitle in interface DynamicTitle
      Returns:
      Current component title
    • update

      @NotNull public @NotNull net.kyori.adventure.text.Component update(@NotNull @NotNull Object state)
      Description copied from interface: DynamicTitle
      Update the dynamic title with a new state object
      Specified by:
      update in interface DynamicTitle
      Parameters:
      state - Object containing state information for the update
      Returns:
      Updated component title
    • updateOnClick

      @NotNull public @NotNull net.kyori.adventure.text.Component updateOnClick(@Nullable @Nullable ModalItem item, int slot, @Nullable @Nullable org.bukkit.event.inventory.ClickType clickType, @Nullable @Nullable org.bukkit.event.inventory.InventoryAction action)
      Update on item click
      Parameters:
      item - The clicked item
      slot - The slot that was clicked
      clickType - The type of click
      action - The inventory action
      Returns:
      Updated component title
    • getBaseTitle

      public String getBaseTitle()
      Get the base title
      Returns:
      Base title text