Class GuiThemes

java.lang.Object
dev.boze.api.gui.GuiThemes

public final class GuiThemes extends Object
Registry of GUI themes.
Register addon themes from Addon.initialize(). Boze ships boze:classic, which is used whenever the selected theme is not registered.
  • Method Details

    • register

      public static void register(GuiTheme theme)
      Registers a theme. Ids must be unique; a second theme with the same id is rejected.
      Parameters:
      theme - The theme to register
      Throws:
      IllegalArgumentException - If a theme with the same id is already registered
    • get

      public static GuiTheme get(String id)
      Parameters:
      id - Theme id, for example boze:classic
      Returns:
      The registered theme with this id, or null
    • all

      public static List<GuiTheme> all()
      Returns:
      Every registered theme, in registration order
    • active

      public static GuiTheme active()
      Returns:
      The theme the GUI opens with
    • select

      public static void select(String id)
      Selects the theme the GUI opens with. An open GUI switches at the start of the next frame.
      Parameters:
      id - Theme id