Package org.moddingx.libx.creativetab
Class CreativeTabX
java.lang.Object
org.moddingx.libx.creativetab.CreativeTabX
Class to register and populate a creative tab. You should subclass it and create an instance in your
mods' constructor.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
CreativeTabX
(ModX mod) protected
CreativeTabX
(ModX mod, String name) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
Adds the items to the tab.protected void
Adds all items from the current mod into the tab.protected void
addModItems
(CreativeTabX.TabContext ctx, Comparator<net.minecraft.world.item.Item> order) Adds all items from the current mod into the tab using a custom order.protected void
addModItems
(CreativeTabX.TabContext ctx, Comparator<net.minecraft.world.item.Item> order, Predicate<net.minecraft.world.item.Item> items) Adds all items from the current mod, that match a predicate into the tab using a custom order.protected void
addModItems
(CreativeTabX.TabContext ctx, Predicate<net.minecraft.world.item.Item> items) Adds all items from the current mod, that match a predicate into the tab.protected void
addModItemStacks
(CreativeTabX.TabContext ctx, Comparator<net.minecraft.world.item.Item> order, Function<net.minecraft.world.item.Item, Stream<net.minecraft.world.item.ItemStack>> stacks) Generates a stream ofitem stacks
for each item from the current mod and adds the stacks to the tab using a custom order.protected void
addModItemStacks
(CreativeTabX.TabContext ctx, Function<net.minecraft.world.item.Item, Stream<net.minecraft.world.item.ItemStack>> stacks) Generates a stream ofitem stacks
for each item from the current mod and adds the stacks to the tab.protected void
buildTab
(net.minecraft.world.item.CreativeModeTab.Builder builder) Sets some basic creative tab information.net.minecraft.world.item.CreativeModeTab
tab()
Gets the creative tab.
-
Field Details
-
mod
-
id
protected final net.minecraft.resources.ResourceLocation id
-
-
Constructor Details
-
CreativeTabX
-
CreativeTabX
-
-
Method Details
-
tab
public net.minecraft.world.item.CreativeModeTab tab()Gets the creative tab.- Throws:
IllegalArgumentException
- if the tab has not yet been created.
-
buildTab
protected void buildTab(net.minecraft.world.item.CreativeModeTab.Builder builder) Sets some basic creative tab information. This is not for tab contents. The default implementation just sets the tab title. -
addItems
Adds the items to the tab. -
addModItems
Adds all items from the current mod into the tab. -
addModItems
protected void addModItems(CreativeTabX.TabContext ctx, Comparator<net.minecraft.world.item.Item> order) Adds all items from the current mod into the tab using a custom order. -
addModItems
protected void addModItems(CreativeTabX.TabContext ctx, Predicate<net.minecraft.world.item.Item> items) Adds all items from the current mod, that match a predicate into the tab. -
addModItems
protected void addModItems(CreativeTabX.TabContext ctx, Comparator<net.minecraft.world.item.Item> order, Predicate<net.minecraft.world.item.Item> items) Adds all items from the current mod, that match a predicate into the tab using a custom order. -
addModItemStacks
protected void addModItemStacks(CreativeTabX.TabContext ctx, Function<net.minecraft.world.item.Item, Stream<net.minecraft.world.item.ItemStack>> stacks) Generates a stream ofitem stacks
for each item from the current mod and adds the stacks to the tab. -
addModItemStacks
protected void addModItemStacks(CreativeTabX.TabContext ctx, Comparator<net.minecraft.world.item.Item> order, Function<net.minecraft.world.item.Item, Stream<net.minecraft.world.item.ItemStack>> stacks) Generates a stream ofitem stacks
for each item from the current mod and adds the stacks to the tab using a custom order.
-