Class Module<C extends ModuleConfig>

java.lang.Object
net.lynxclient.api.module.Module<C>
Direct Known Subclasses:
HudWidget

public abstract class Module<C extends ModuleConfig> extends Object
A feature with its own switch and settings – LynxClient's built-in features and addons are both modules. While enabled, the module is registered on the event bus, so @Subscribe methods only run when it is on.
  • Constructor Details

  • Method Details

    • id

      public final String id()
      Stable id, also the translation prefix and the config file name
    • category

      public final Category category()
    • config

      public final C config()
    • isEnabled

      public final boolean isEnabled()
    • isToggleable

      public boolean isToggleable()
      false for modules that are always on (e.g. general settings) – the menu shows no switch for them
    • isSettingVisible

      public boolean isSettingVisible(String key)
      false hides a setting in the menu, e.g. one that does not exist on this Minecraft version
    • onEnable

      protected void onEnable()
      After the module was switched on (also at start-up when it is on).
    • onDisable

      protected void onDisable()
      After the module was switched off.
    • dispatchEnabled

      public final void dispatchEnabled(boolean enabled)
      Called by LynxClient – not for addons.