Interface FabricCreativeInventoryScreen


public interface FabricCreativeInventoryScreen
Fabric provided extensions to CreativeInventoryScreen. This interface is automatically implemented on all creative inventory screens via Mixin and interface injection.
  • Method Details

    • switchToPage

      default boolean switchToPage(int page)
      Switches to the page with the given index if it exists.
      Parameters:
      page - the index of the page to switch to
      Returns:
      Returns true when the page was changed
    • switchToNextPage

      default boolean switchToNextPage()
      Switches to the next page if it exists.
      Returns:
      Returns true when the page was changed
    • switchToPreviousPage

      default boolean switchToPreviousPage()
      Switches to the previous page if it exists.
      Returns:
      Returns true when the page was changed
    • getCurrentPage

      default int getCurrentPage()
      Returns the index of the current page.
    • getPageCount

      default int getPageCount()
      Returns the total number of pages.
    • getItemGroupsOnPage

      default List<ItemGroup> getItemGroupsOnPage(int page)
      Returns an ordered list containing the item groups on the requested page.
    • getPage

      default int getPage(ItemGroup itemGroup)
      Returns the page index of the given item group.

      Item groups appearing on every page always return the current page index.

      Parameters:
      itemGroup - the item group to get the page index for
      Returns:
      the page index of the item group
    • hasAdditionalPages

      default boolean hasAdditionalPages()
      Returns whether there are additional pages to show on top of the default vanilla pages.
      Returns:
      true if there are additional pages
    • getSelectedItemGroup

      default ItemGroup getSelectedItemGroup()
      Returns the ItemGroup that is associated with the currently selected tab.
      Returns:
      the currently selected ItemGroup
    • setSelectedItemGroup

      default boolean setSelectedItemGroup(ItemGroup itemGroup)
      Sets the currently selected tab to the given ItemGroup.
      Parameters:
      itemGroup - the ItemGroup to select
      Returns:
      true if the tab was successfully selected