Interface ColorRegistry.Category

Enclosing interface:
ColorRegistry

public static interface ColorRegistry.Category
A color category.
Since:
3.2.0
  • Method Details

    • key

      @Nullable ColorKey key(String colorId)
      Gets a color key registered to this category with the given id, or null if not found.
      Parameters:
      colorId - The identifier of the color.
      Returns:
      The ColorKey instance linked to the given id, or null if not found.
      Since:
      3.2.0
    • keyUnlocalizedName

      @Nullable String keyUnlocalizedName(ColorKey key)
      Gets the localization key of the given color key.
      Parameters:
      key - The color key.
      Returns:
      The unlocalized name of the given color key.
      Since:
      3.2.0
    • register

      default ColorRegistry.Category register(ColorKey key, String colorId)
      Registers a color key.

      The GUI name of the color key is obtained by localizing the string shulkerboxtooltip.colors.MOD_ID.CATEGORY_ID.KEY_ID, Where MOD_ID is the namespace of the category's ID, CATEGORY_ID is the path of the category's ID, and KEY_ID is the colorId parameter.

      Parameters:
      key - The color key to register.
      colorId - The name of this color key.
      Returns:
      This category instance to allow chaining.
      Since:
      3.2.0
    • register

      ColorRegistry.Category register(ColorKey key, String colorId, @Nullable String unlocalizedName)
      Registers a color key.

      The GUI name of the color key is obtained by localizing the string unlocalizedName, or when the parameter is null, shulkerboxtooltip.colors.MOD_ID.CATEGORY_ID.KEY_ID, Where MOD_ID is the namespace of the category's ID, CATEGORY_ID is the path of the category's ID, and KEY_ID is the colorId parameter.

      Parameters:
      key - The color key to register.
      colorId - The name of this color key.
      unlocalizedName - The unlocalized name of the key, pass null to use the default name.
      Returns:
      This category instance to allow chaining.
      Since:
      3.2.0
    • keys

      Access the all the color keys registered to this category.
      Returns:
      An immutable view over the existing keys in this category.
      Since:
      3.2.0