Class CreativeModeTab.Builder
java.lang.Object
net.minecraft.world.item.CreativeModeTab.Builder
- Enclosing class:
CreativeModeTab
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate Identifierprivate booleanprivate final intprivate static final IdentifierNeo: holds the default background for tabs with a search barprivate Componentprivate static final CreativeModeTab.DisplayItemsGeneratorprivate booleanNeo: indicates whether this tab has a search barprivate intNeo: holds the text color of the tab titleprivate final CreativeModeTab.Rowprivate intNeo: holds the width of the search barprivate booleanprivate @Nullable IdentifierNeo: holds the scroller sprite to use in this tabprivate Function<CreativeModeTab.Builder, CreativeModeTab> Neo: holds the function to use for constructing the tabprivate final List<Identifier> Neo: holds the IDs of tabs which should appear after this tabprivate final List<Identifier> Neo: holds the IDs of tabs which should appear before this tabprivate CreativeModeTab.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbackgroundTexture(Identifier backgroundTexture) build()displayItems(Collection<? extends Holder<? extends ItemLike>> collection) Neo: helper to set this tab's contents to everything in the supplied Collection of Holders.displayItems(CreativeModeTab.DisplayItemsGenerator displayItemsGenerator) protected CreativeModeTab.Buildertype(CreativeModeTab.Type type) withLabelColor(int labelColor) Neo: set the color of the tab label.withScrollBarSpriteLocation(Identifier scrollBarSpriteLocation) Neo: set the location of the scroll bar background.Neo: give this tab a search bar.withSearchBar(int searchBarWidth) Neo: give this tab a search bar, with a specific width.withTabFactory(Function<CreativeModeTab.Builder, CreativeModeTab> tabFactory) Neo: define the function to use for constructing the final tabwithTabsAfter(Identifier... tabs) Neo: define tabs that should come after this tab.final CreativeModeTab.BuilderwithTabsAfter(ResourceKey<CreativeModeTab>... tabs) Neo: define tabs that should come after this tab.withTabsBefore(Identifier... tabs) Neo: define tabs that should come before this tab.final CreativeModeTab.BuilderwithTabsBefore(ResourceKey<CreativeModeTab>... tabs) Neo: define tabs that should come before this tab.
-
Field Details
-
EMPTY_GENERATOR
-
CREATIVE_ITEM_SEARCH_BACKGROUND
Neo: holds the default background for tabs with a search bar -
row
-
column
private final int column -
displayName
-
iconGenerator
-
displayItemsGenerator
-
canScroll
private boolean canScroll -
showTitle
private boolean showTitle -
alignedRight
private boolean alignedRight -
type
-
backgroundTexture
-
spriteScrollerLocation
Neo: holds the scroller sprite to use in this tab -
hasSearchBar
private boolean hasSearchBarNeo: indicates whether this tab has a search bar -
searchBarWidth
private int searchBarWidthNeo: holds the width of the search bar -
labelColor
private int labelColorNeo: holds the text color of the tab title -
tabFactory
Neo: holds the function to use for constructing the tab -
tabsBefore
Neo: holds the IDs of tabs which should appear before this tab -
tabsAfter
Neo: holds the IDs of tabs which should appear after this tab
-
-
Constructor Details
-
Builder
-
-
Method Details
-
title
-
icon
-
displayItems
public CreativeModeTab.Builder displayItems(CreativeModeTab.DisplayItemsGenerator displayItemsGenerator) -
alignedRight
-
hideTitle
-
noScrollBar
-
type
-
backgroundTexture
-
withSearchBar
Neo: give this tab a search bar.
Note that, if using a custom
background image, you will need to make sure that your image contains the input box and the scroll bar. -
withSearchBar
Neo: give this tab a search bar, with a specific width.- Parameters:
searchBarWidth- the width of the search bar
-
withScrollBarSpriteLocation
Neo: set the location of the scroll bar background. -
withLabelColor
Neo: set the color of the tab label. -
withTabFactory
public CreativeModeTab.Builder withTabFactory(Function<CreativeModeTab.Builder, CreativeModeTab> tabFactory) Neo: define the function to use for constructing the final tab -
withTabsBefore
Neo: define tabs that should come before this tab. This tab will be placed after thetabs. -
withTabsAfter
Neo: define tabs that should come after this tab. This tab will be placed before thetabs. -
withTabsBefore
@SafeVarargs public final CreativeModeTab.Builder withTabsBefore(ResourceKey<CreativeModeTab>... tabs) Neo: define tabs that should come before this tab. This tab will be placed after thetabs. -
withTabsAfter
@SafeVarargs public final CreativeModeTab.Builder withTabsAfter(ResourceKey<CreativeModeTab>... tabs) Neo: define tabs that should come after this tab. This tab will be placed before thetabs. -
displayItems
public CreativeModeTab.Builder displayItems(Collection<? extends Holder<? extends ItemLike>> collection) Neo: helper to set this tab's contents to everything in the supplied Collection of Holders.
Intended for use with
DeferredRegister.getEntries(), for Item or Block DeferredRegisters. Entries added through this method are filtered out ifItemLike.asItem()returnsItems.AIRor if disabled viaFeatureElement.isEnabled(FeatureFlagSet). Note that like the vanilla method this overrides any other calls for this tab todisplayItems(CreativeModeTab.DisplayItemsGenerator). -
build
-