Class GuideHistory

java.lang.Object
io.github.thebusybiscuit.slimefun4.core.guide.GuideHistory

public class GuideHistory extends Object
GuideHistory represents the browsing history of a Player through the SlimefunGuide.
Author:
TheBusyBiscuit
See Also:
  • Constructor Details

  • Method Details

    • clear

      public void clear()
      This method will clear this GuideHistory and remove all entries.
    • setMainMenuPage

      public void setMainMenuPage(int page)
      This method sets the page of the main menu of this GuideHistory
      Parameters:
      page - The current page of the main menu that should be stored
    • getMainMenuPage

      public int getMainMenuPage()
      This returns the current main menu page of this GuideHistory
      Returns:
      The main menu page of this GuideHistory
    • add

      public void add(@Nonnull ItemGroup itemGroup, int page)
      This method adds a ItemGroup to this GuideHistory. Should the ItemGroup already be the last element in this GuideHistory, then the entry will be overridden with the new page.
      Parameters:
      itemGroup - The ItemGroup that should be added to this GuideHistory
      page - The current page of the ItemGroup that should be stored
    • add

      public void add(@Nonnull org.bukkit.inventory.ItemStack item, int page)
      This method adds a ItemStack to this GuideHistory. Should the ItemStack already be the last element in this GuideHistory, then the entry will be overridden with the new page.
      Parameters:
      item - The ItemStack that should be added to this GuideHistory
      page - The current page of the recipes of this ItemStack
    • add

      public void add(@Nonnull SlimefunItem item)
      This method stores the given SlimefunItem in this GuideHistory.
      Parameters:
      item - The SlimefunItem that should be added to this GuideHistory
    • add

      public void add(@Nonnull String searchTerm)
      This method stores the given search term in this GuideHistory.
      Parameters:
      searchTerm - The term that the Player searched for
    • size

      public int size()
      This returns the amount of elements in this GuideHistory.
      Returns:
      The size of this GuideHistory
    • openLastEntry

      public void openLastEntry(@Nonnull SlimefunGuideImplementation guide)
      This method opens the last opened entry to the associated PlayerProfile of this GuideHistory.
      Parameters:
      guide - The SlimefunGuideImplementation to use
    • goBack

      public void goBack(@Nonnull SlimefunGuideImplementation guide)
      This method opens the previous entry to the associated PlayerProfile. More precisely, it will remove the last entry and open the second-last entry to the Player. It can be thought of as a "back" button. Since that is what this is used for.
      Parameters:
      guide - The SlimefunGuideImplementation to use