Class AstralCycledItemGroup
java.lang.Object
net.minecraft.item.ItemGroup
dev.jaxydog.astral.content.item.group.AstralItemGroup
dev.jaxydog.astral.content.item.group.AstralCycledItemGroup
- All Implemented Interfaces:
Registered,Registered.Common,AstralItemGroup
An extension of an
AstralItemGroup that provides a cycling icon.
If you do not need more than one icon, it's recommended to use AstralItemGroup instead.
- Since:
- 2.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilds and constructs an instance of a newAstralItemGroup.Nested classes/interfaces inherited from class net.minecraft.item.ItemGroup
net.minecraft.item.ItemGroup.DisplayContext, net.minecraft.item.ItemGroup.Entries, net.minecraft.item.ItemGroup.EntryCollector, net.minecraft.item.ItemGroup.Row, net.minecraft.item.ItemGroup.StackVisibility, net.minecraft.item.ItemGroup.TypeNested classes/interfaces inherited from interface dev.jaxydog.astral.register.Registered
Registered.All, Registered.Client, Registered.Common, Registered.Generated, Registered.Server -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final intA duration in ticks that determines the cycle speed of the icons.A list containing all valid icons for this item group. -
Constructor Summary
ConstructorsModifierConstructorDescriptionAstralCycledItemGroup(String path, net.minecraft.item.ItemGroup.Row row, int column, net.minecraft.item.ItemGroup.Type type, net.minecraft.text.Text displayName, net.minecraft.item.ItemGroup.EntryCollector entryCollector, List<Supplier<net.minecraft.item.ItemStack>> icons, int cycleInterval) Creates a new item group.protectedAstralCycledItemGroup(String path, net.minecraft.item.ItemGroup group, net.minecraft.item.ItemGroup.EntryCollector entryCollector, List<Supplier<net.minecraft.item.ItemStack>> icons, int cycleInterval) Creates a new item group from a given source. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.item.ItemStackastral$getIcon(float delta) Returns the item group's icon, computed using the provided delta.static @NotNull AstralCycledItemGroup.BuilderReturns a new builder for aAstralCycledItemGroup.Methods inherited from class dev.jaxydog.astral.content.item.group.AstralItemGroup
getRegistryKey, getRegistryPath, registerCommonMethods inherited from class net.minecraft.item.ItemGroup
contains, create, getColumn, getDisplayName, getDisplayStacks, getIcon, getRow, getSearchTabStacks, getTexture, getType, hasScrollbar, hasStacks, isSpecial, reloadSearchProvider, setSearchProviderReloader, shouldDisplay, shouldRenderName, updateEntriesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.jaxydog.astral.register.Registered
getRegistryId
-
Field Details
-
iconSuppliers
A list containing all valid icons for this item group.- Since:
- 2.0.0
-
cycleInterval
protected final int cycleIntervalA duration in ticks that determines the cycle speed of the icons.- Since:
- 2.0.0
-
-
Constructor Details
-
AstralCycledItemGroup
public AstralCycledItemGroup(String path, net.minecraft.item.ItemGroup.Row row, int column, net.minecraft.item.ItemGroup.Type type, net.minecraft.text.Text displayName, net.minecraft.item.ItemGroup.EntryCollector entryCollector, List<Supplier<net.minecraft.item.ItemStack>> icons, int cycleInterval) Creates a new item group.In most cases, you will want to instead use this class' builder.
- Parameters:
path- The item group's identifier path.row- The item group's row.column- The item group's column.type- The item group's type.displayName- The item group's display name.entryCollector- The item group's entry collector.icons- The item group's preferred icons.cycleInterval- The duration in ticks that determines the length of stay for one icon.- Since:
- 2.0.0
-
AstralCycledItemGroup
protected AstralCycledItemGroup(String path, net.minecraft.item.ItemGroup group, net.minecraft.item.ItemGroup.EntryCollector entryCollector, List<Supplier<net.minecraft.item.ItemStack>> icons, int cycleInterval) Creates a new item group from a given source.In most cases, you will want to instead use this class' builder.
- Parameters:
path- The item group's identifier path.group- The source item group.entryCollector- The item group's entry collector.icons- The item group's preferred icons.cycleInterval- The duration in ticks that determines the length of stay for one icon.- Since:
- 2.0.0
-
-
Method Details
-
builder
@Contract("_ -> new") @NotNull public static @NotNull AstralCycledItemGroup.Builder builder(String path) Returns a new builder for aAstralCycledItemGroup.- Parameters:
path- The identifier path.- Returns:
- A new builder.
- Since:
- 2.0.0
-
astral$getIcon
public net.minecraft.item.ItemStack astral$getIcon(float delta) Description copied from interface:AstralItemGroupReturns the item group's icon, computed using the provided delta.- Parameters:
delta- The time passed since the last update.- Returns:
- An item stack.
-