Class PlaceholderMimicItem.Group

java.lang.Object
dev.jaxydog.astral.register.RegisteredMap<net.minecraft.item.Item,PlaceholderMimicItem>
dev.jaxydog.astral.content.item.custom.PlaceholderMimicItem.Group
All Implemented Interfaces:
Registered, Registered.All, Registered.Client, Registered.Common, Registered.Generated, Registered.Server
Enclosing class:
PlaceholderMimicItem

public static class PlaceholderMimicItem.Group extends RegisteredMap<net.minecraft.item.Item,PlaceholderMimicItem>
A group of mimicking placeholder items.

This is most useful for bulk declaration, for example when defining armor items or dye items.

Since:
1.4.0
  • Constructor Details

    • Group

      public Group(String path, net.minecraft.item.Item.Settings settings, @Nullable @Nullable Supplier<net.minecraft.registry.RegistryKey<net.minecraft.item.ItemGroup>> preferredGroup, net.minecraft.item.Item... items)
      Creates a new group of mimicking items.

      If the #preferredGroup supplier is null, the items will not be added to any item groups.

      Parameters:
      path - The item's base identifier path.
      settings - The item's settings.
      preferredGroup - The item's preferred item group.
      items - The items to be mimicked.
      Since:
      2.0.0
    • Group

      public Group(String path, net.minecraft.item.Item.Settings settings, net.minecraft.item.Item... items)
      Creates a new group of mimicking items.

      The items will be added to the default item group.

      Parameters:
      path - The item's base identifier path.
      settings - The item's settings.
      items - The items to be mimicked.
      Since:
      1.4.0
  • Method Details

    • compareKeys

      protected int compareKeys(@NotNull @NotNull net.minecraft.item.Item a, @NotNull @NotNull net.minecraft.item.Item b)
      Description copied from class: RegisteredMap
      Compares the provided keys to determine their registration order.

      If left is lesser than right, a negative value should be returned. If left is greater than right, a positive value should be returned. Otherwise, if both are equal, 0 should be returned.

      For a simple example, assuming <K> is of type Integer, the value can be determined by evaluating right - left for a simple natural ordering.

      Specified by:
      compareKeys in class RegisteredMap<net.minecraft.item.Item,PlaceholderMimicItem>
      Parameters:
      a - The left key.
      b - The right key.
      Returns:
      The result as defined in the method documentation.
    • getPath

      protected String getPath(@NotNull @NotNull net.minecraft.item.Item key)
      Description copied from class: RegisteredMap
      Returns an identifier path based off of the given key.
      Specified by:
      getPath in class RegisteredMap<net.minecraft.item.Item,PlaceholderMimicItem>
      Parameters:
      key - The value's key.
      Returns:
      A valid identifier path.
    • keys

      public Set<net.minecraft.item.Item> keys()
      Description copied from class: RegisteredMap
      Returns the set of all expected keys.

      The values within this set are fed into the computation callback to generate the values stored within this map.

      Specified by:
      keys in class RegisteredMap<net.minecraft.item.Item,PlaceholderMimicItem>
      Returns:
      A set containing all expected keys.