Class AstralItemGroup

java.lang.Object
net.minecraft.item.ItemGroup
dev.jaxydog.astral.content.item.group.AstralItemGroup
All Implemented Interfaces:
Registered, Registered.Common, AstralItemGroup
Direct Known Subclasses:
AstralCycledItemGroup

public class AstralItemGroup extends net.minecraft.item.ItemGroup implements Registered.Common
An extension of an ItemGroup that provides commonly used functionality.

This type is automatically registered.

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
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
     
    AstralItemGroup(String path, net.minecraft.item.ItemGroup.Row row, int column, net.minecraft.item.ItemGroup.Type type, net.minecraft.text.Text displayName, Supplier<net.minecraft.item.ItemStack> iconSupplier, net.minecraft.item.ItemGroup.EntryCollector entryCollector)
    Creates a new item group.
    protected
    AstralItemGroup(String path, net.minecraft.item.ItemGroup group, net.minecraft.item.ItemGroup.EntryCollector entryCollector)
    Creates a new item group from a given source.
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull AstralItemGroup.Builder
    Returns a new builder for an AstralItemGroup.
    net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup>
    Returns this item group's associated registry key.
    Returns this value's associated registry identifier path.
    void
    Registers this value on both the client and server environments.

    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.utility.injected.AstralItemGroup

    astral$getIcon

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

    getRegistryId
  • Constructor Details

    • AstralItemGroup

      public AstralItemGroup(String path, net.minecraft.item.ItemGroup.Row row, int column, net.minecraft.item.ItemGroup.Type type, net.minecraft.text.Text displayName, Supplier<net.minecraft.item.ItemStack> iconSupplier, net.minecraft.item.ItemGroup.EntryCollector entryCollector)
      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.
      iconSupplier - The item group's preferred icon.
      entryCollector - The item group's entry collector.
      Since:
      2.0.0
    • AstralItemGroup

      protected AstralItemGroup(String path, net.minecraft.item.ItemGroup group, net.minecraft.item.ItemGroup.EntryCollector entryCollector)
      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.
      Since:
      2.0.0
  • Method Details

    • builder

      @Contract("_ -> new") @NotNull public static @NotNull AstralItemGroup.Builder builder(String path)
      Returns a new builder for an AstralItemGroup.
      Parameters:
      path - The identifier path.
      Returns:
      A new builder.
      Since:
      2.0.0
    • getRegistryKey

      public net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup> getRegistryKey()
      Returns this item group's associated registry key.

      If the item group has not been registered, this method will throw a run-time exception.

      Returns:
      The associated registry key.
      Since:
      2.0.0
    • getRegistryPath

      public String getRegistryPath()
      Description copied from interface: Registered
      Returns this value's associated registry identifier path.

      This is by default used to determine the Identifier provided by Registered.getRegistryId(). For example, returning "my_item" will cause the associated identifier to be astral:my_item.

      Specified by:
      getRegistryPath in interface Registered
      Returns:
      An identifier path.
    • registerCommon

      public void registerCommon()
      Description copied from interface: Registered.Common
      Registers this value on both the client and server environments.

      The contained code will run for both environments. If you only want one or the other, see its sister interfaces.

      Specified by:
      registerCommon in interface Registered.Common
      See Also: