Interface FabricCreativeModeInventoryScreen
public interface FabricCreativeModeInventoryScreen
Fabric provided extensions to
CreativeModeInventoryScreen.
This interface is automatically implemented on all creative inventory screens via Mixin and interface injection.-
Method Summary
Modifier and TypeMethodDescriptiondefault intReturns the index of the current page.default intgetPage(net.minecraft.world.item.CreativeModeTab creativeModeTab) Returns the page index of the given creative mode tab.default intReturns the total number of pages.default net.minecraft.world.item.CreativeModeTabReturns theCreativeModeTabthat is associated with the currently selected tab.default List<net.minecraft.world.item.CreativeModeTab> getTabsOnPage(int page) Returns an ordered list containing the creative mode tabs on the requested page.default booleanReturns whether there are additional pages to show on top of the default vanilla pages.default booleansetSelectedTab(net.minecraft.world.item.CreativeModeTab creativeModeTab) Sets the currently selected tab to the givenCreativeModeTab.default booleanSwitches to the next page if it exists.default booleanswitchToPage(int page) Switches to the page with the given index if it exists.default booleanSwitches 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. -
getTabsOnPage
Returns an ordered list containing the creative mode tabs on the requested page. -
getPage
default int getPage(net.minecraft.world.item.CreativeModeTab creativeModeTab) Returns the page index of the given creative mode tab.Creative Mode Tabs appearing on every page always return the current page index.
- Parameters:
creativeModeTab- the creative mode tab to get the page index for- Returns:
- the page index of the creative mode tab
-
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
-
getSelectedTab
default net.minecraft.world.item.CreativeModeTab getSelectedTab()Returns theCreativeModeTabthat is associated with the currently selected tab.- Returns:
- the currently selected
CreativeModeTab
-
setSelectedTab
default boolean setSelectedTab(net.minecraft.world.item.CreativeModeTab creativeModeTab) Sets the currently selected tab to the givenCreativeModeTab.- Parameters:
creativeModeTab- theCreativeModeTabto select- Returns:
- true if the tab was successfully selected
-