Interface ColorRegistry


@NonExtendable @Environment(CLIENT) public interface ColorRegistry
Provides a way to register custom color keys and categories to allow user-customization through the mod's config.
Since:
3.2.0
  • Method Details

    • category

      @Nonnull ColorRegistry.Category category(net.minecraft.resources.Identifier categoryId)
      Access to a category, the returned instance will only be registered if at least one color key is registered to it.

      In the GUI, the category will be represented by a sub-list in the 'Colors' category of the config screen. The name of the category is obtained by localizing the string shulkerboxtooltip.colors.MOD_ID.CATEGORY_ID, Where MOD_ID is the namespace of categoryId, and CATEGORY_ID is the path of categoryId.

      Parameters:
      categoryId - The unique identifier of the category.
      Returns:
      The category.
      Since:
      3.2.0
    • defaultCategory

      @Nonnull ColorRegistry.Category defaultCategory()
      Access to the default category.

      In the GUI, the keys belonging the default category will appear at the root of the 'Colors' category, before other color category sub-lists.

      Returns:
      The default category instance.
      Since:
      3.2.0
    • categories

      @Nonnull Map<net.minecraft.resources.Identifier,ColorRegistry.Category> categories()
      Access to all the registered categories.
      Returns:
      An immutable view over the existing categories.
      Since:
      3.2.0