Class IconRegistry

java.lang.Object
net.pl3x.map.core.registry.Registry<@NotNull IconImage>
net.pl3x.map.core.registry.IconRegistry
All Implemented Interfaces:
Iterable<IconImage>

public class IconRegistry extends Registry<@NotNull IconImage>
  • Constructor Details

    • IconRegistry

      public IconRegistry()
  • Method Details

    • init

      public void init()
      Create a new image registry.
    • getDir

      @NotNull public @NotNull Path getDir()
      Get the directory where registered icon images are stored.
      Returns:
      icons directory
    • register

      @NotNull public @NotNull IconImage register(@NotNull @NotNull String id, @NotNull @NotNull IconImage image)
      Register a new image.

      Will return null if the image is already registered.

      Overrides:
      register in class Registry<@NotNull IconImage>
      Parameters:
      image - image to register or null
      Returns:
      registered image
      Throws:
      IllegalStateException - if image failed to save to disk