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 Summary
Modifier and TypeMethodDescriptiondefault int
Returns the index of the current page.getItemGroupsOnPage
(int page) Returns an ordered list containing the item groups on the requested page.default int
Returns the page index of the given item group.default int
Returns the total number of pages.default ItemGroup
Returns theItemGroup
that is associated with the currently selected tab.default boolean
Returns whether there are additional pages to show on top of the default vanilla pages.default boolean
setSelectedItemGroup
(ItemGroup itemGroup) Sets the currently selected tab to the givenItemGroup
.default boolean
Switches to the next page if it exists.default boolean
switchToPage
(int page) Switches to the page with the given index if it exists.default boolean
Switches to the previous page if it exists.
-
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
Returns an ordered list containing the item groups on the requested page. -
getPage
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
Returns theItemGroup
that is associated with the currently selected tab.- Returns:
- the currently selected
ItemGroup
-
setSelectedItemGroup
Sets the currently selected tab to the givenItemGroup
.- Parameters:
itemGroup
- theItemGroup
to select- Returns:
- true if the tab was successfully selected
-