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

public class AstralCycledItemGroup extends 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 Classes
    Modifier and Type
    Class
    Description
    static class 
    Builds and constructs an instance of a new AstralItemGroup.

    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.Type

    Nested classes/interfaces inherited from interface dev.jaxydog.astral.register.Registered

    Registered.All, Registered.Client, Registered.Common, Registered.Generated, Registered.Server
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final int
    A duration in ticks that determines the cycle speed of the icons.
    protected final List<Supplier<net.minecraft.item.ItemStack>>
    A list containing all valid icons for this item group.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    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.
    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.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.item.ItemStack
    astral$getIcon(float delta)
    Returns the item group's icon, computed using the provided delta.
    Returns a new builder for a AstralCycledItemGroup.

    Methods inherited from class dev.jaxydog.astral.content.item.group.AstralItemGroup

    getRegistryKey, getRegistryPath, registerCommon

    Methods inherited from class net.minecraft.item.ItemGroup

    contains, create, getColumn, getDisplayName, getDisplayStacks, getIcon, getRow, getSearchTabStacks, getTexture, getType, hasScrollbar, hasStacks, isSpecial, reloadSearchProvider, setSearchProviderReloader, shouldDisplay, shouldRenderName, updateEntries

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface dev.jaxydog.astral.register.Registered

    getRegistryId
  • Field Details

    • iconSuppliers

      protected final List<Supplier<net.minecraft.item.ItemStack>> iconSuppliers
      A list containing all valid icons for this item group.
      Since:
      2.0.0
    • cycleInterval

      protected final int cycleInterval
      A 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 a AstralCycledItemGroup.
      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: AstralItemGroup
      Returns the item group's icon, computed using the provided delta.
      Parameters:
      delta - The time passed since the last update.
      Returns:
      An item stack.