Interface ShopLayoutHandler.OpenEvent

Enclosing interface:
ShopLayoutHandler

public static interface ShopLayoutHandler.OpenEvent
Used to pass information to ShopLayoutHandler.build(OpenEvent)
  • Method Summary

    Modifier and Type
    Method
    Description
    Builds a GUIItem that can be used to set the item inside the GUI
    default GUIItem
    Builds a GUIItem that can be used to set the page inside the GUI.
    Also resets the current data back to null once pressed
    build(ShopPage page, Object data)
    Builds a GUIItem that can be used to set the page inside the GUI
    Builds a GUIItem that will flush any info about the info on click.
    This behavior is similar to as if the player is closing and reopening the shop
    Builds a GUIItem that can be used to set the page inside the villager GUI
    The default value is null
    <T> T
    getData(T def)
    Returns data that can be used during the session
    Returns the title that has been configured by the player.
    That title shall be used when creating the GUI
    Returns the layout that has been opened
    @Nullable ShopPage
    The currently open page
    Can be null when there's no page open
    List<? extends ShopItem>
    All items that should be displayed to the player
    The available pages with which the handler has to work with
    The collections and EVERYTHING in the collection has been cloned,
    meaning the handler can do anything with it that he wants
    Returns the player that opened it
    Returns the already loaded and ready to use player properties instance of the player
    void
    Will reopen the current GUI
    void
    setOpenPage(@Nullable ShopPage page)
    Sets the new open page.
    Won't reopen the GUI when set
  • Method Details

    • getLayout

      ShopLayout getLayout()
      Returns the layout that has been opened
      Returns:
      The layout
    • getPlayer

      Player getPlayer()
      Returns the player that opened it
      Returns:
      The player
    • getPlayerProperties

      PlayerProperties getPlayerProperties()
      Returns the already loaded and ready to use player properties instance of the player
      Returns:
      The PlayerProperties instance of the given player
    • getDefaultGUITitle

      String getDefaultGUITitle()
      Returns the title that has been configured by the player.
      That title shall be used when creating the GUI
      Returns:
      The title that shall be used in the GUI
    • getPages

      List<ShopPage> getPages()
      The available pages with which the handler has to work with
      The collections and EVERYTHING in the collection has been cloned,
      meaning the handler can do anything with it that he wants
      Returns:
      The available pages
    • getOpenPage

      @Nullable @Nullable ShopPage getOpenPage()
      The currently open page
      Can be null when there's no page open
      Returns:
      The currently open page
    • setOpenPage

      void setOpenPage(@Nullable @Nullable ShopPage page)
      Sets the new open page.
      Won't reopen the GUI when set
      Parameters:
      page - The new open page, can be null
    • getPageItems

      List<? extends ShopItem> getPageItems()
      All items that should be displayed to the player
      Returns:
      all items that will be displayed
    • getData

      Object getData()
      The default value is null
      Returns:
      Data that can be passed around
    • getData

      <T> T getData(T def)
      Returns data that can be used during the session
      Type Parameters:
      T - (Unsafe operation:) Automatically casts the intern data object to the given generic
      Parameters:
      def - The default value which will be taken if none is set
      Returns:
      Data that can be passed around
    • refresh

      void refresh()
      Will reopen the current GUI
    • build

      GUIItem build(ShopItem item)
      Builds a GUIItem that can be used to set the item inside the GUI
      Parameters:
      item - The item that shall be displayed
      Returns:
      The item that shall be placed inside the GUI
    • build

      default GUIItem build(ShopPage page)
      Builds a GUIItem that can be used to set the page inside the GUI.
      Also resets the current data back to null once pressed
      Parameters:
      page - The page that shall be displayed
      Returns:
      The item that shall be placed inside the GUI
    • build

      GUIItem build(ShopPage page, Object data)
      Builds a GUIItem that can be used to set the page inside the GUI
      Parameters:
      page - The page that shall be displayed
      data - The new data that will be taken after pressing on the page
      Returns:
      The item that shall be placed inside the GUI
    • buildOffer

      VillagerOffer buildOffer(ShopItem item)
      Builds a GUIItem that can be used to set the page inside the villager GUI
      Parameters:
      item - The item that shall be displayed
      Returns:
      The item that shall be placed inside the GUI
    • buildHome

      GUIItem buildHome(ItemStack is)
      Builds a GUIItem that will flush any info about the info on click.
      This behavior is similar to as if the player is closing and reopening the shop
      Parameters:
      is - The item that shall be presented as the button
      Returns:
      The item that shall be placed inside the GUI