Class Category
- All Implemented Interfaces:
Comparable<Category>
Formerly an enum; now an open registry so plugins can contribute their own
categories. The built-in categories are declared below as static constants and
register themselves in declaration order, so Category.COMBAT and
Category.values() behave exactly as they did when this was an enum —
including the panel ordering the ClickGUI derives from values().
Plugins register through register(String, String, int) using a
namespaced id ("myplugin:utilities") to avoid colliding with the
built-ins or with each other. Registration is not thread-safe against
concurrent readers by design — register during plugin load, before the
ClickGUI builds its panels and before config is applied.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic CategoryLooks up a category by its (case-insensitive) id, or null when unregistered.voidRemove any runtime color override; revert to the compiled default.intOrders by registration index, matching the old enum ordinal ordering.intgetColor()Returns color in ARGB format for Minecraft rendering.intDefault ARGB color (ignores override) — used by the ClickGui module to seed its color picker.Returns the 6-digit RGB hex string (e.g.getId()Unique registry key —"combat", or"myplugin:utilities"for plugins.intindex()Registration index — replaces the old enumordinal().booleanbooleanstatic CategoryRegisters a new category, visible in the ClickGUI.static CategoryRegisters a new category.Live unmodifiable view of the registry — avoids the array copy ofvalues().voidsetColorOverride(int argb) Apply a runtime ARGB color override (e.g.toString()static voidunregister(Category category) Removes a previously registered category — used to roll back a plugin's categories on unload, so the ClickGUI does not keep an empty panel.static Category[]values()All registered categories, in registration order.
-
Field Details
-
COMBAT
-
MOVEMENT
-
PLAYER
-
RENDER
-
UTILITY
-
WORLD
-
CLIENT
-
-
Method Details
-
register
Registers a new category, visible in the ClickGUI.- Parameters:
id- unique key; namespace plugin categories as"pluginid:name"displayName- label shown on the panel headercolor- packed RRGGBBAA (note: not ARGB — seegetColor())
-
register
Registers a new category.- Parameters:
hiddenByDefault- when true the category is hidden untilisUnlocked()reports otherwise- Throws:
IllegalArgumentException- if the id is blank or already registered
-
values
All registered categories, in registration order. Built-ins come first in their declaration order, then plugin categories in load order.Returns a fresh array each call, mirroring enum
values()— safe to iterate while unrelated code registers. -
registered
Live unmodifiable view of the registry — avoids the array copy ofvalues(). -
byId
Looks up a category by its (case-insensitive) id, or null when unregistered. -
unregister
Removes a previously registered category — used to roll back a plugin's categories on unload, so the ClickGUI does not keep an empty panel.Built-in categories are refused: removing one would strand the modules that reference it. Registration indices of surviving categories are left alone, so ordering stays stable.
-
getId
Unique registry key —"combat", or"myplugin:utilities"for plugins. -
getDisplayName
-
getColor
public int getColor()Returns color in ARGB format for Minecraft rendering. HonorssetColorOverride(int). -
getHexColor
Returns the 6-digit RGB hex string (e.g. "FF5555") for use in&#RRGGBBcolor codes. -
getDefaultColor
public int getDefaultColor()Default ARGB color (ignores override) — used by the ClickGui module to seed its color picker. -
setColorOverride
public void setColorOverride(int argb) Apply a runtime ARGB color override (e.g. from the ClickGui module). -
clearColorOverride
public void clearColorOverride()Remove any runtime color override; revert to the compiled default. -
index
public int index()Registration index — replaces the old enumordinal(). -
isHiddenByDefault
public boolean isHiddenByDefault() -
isUnlocked
public boolean isUnlocked() -
compareTo
Orders by registration index, matching the old enum ordinal ordering.- Specified by:
compareToin interfaceComparable<Category>
-
toString
-