Class HudEngineProvider

java.lang.Object
io.github.nacvark.hudengine.api.HudEngineProvider

public final class HudEngineProvider extends Object
Resolves the running HudEngine.

HUDEngine registers itself with the services manager on enable, so declare it as a depend or softdepend in your plugin.yml and look it up in onEnable:


 HudEngine hud = HudEngineProvider.get();
 

Or, if your plugin should work without it:


 HudEngineProvider.find().ifPresent(hud -> hud.values().register(...));
 
  • Method Details

    • find

      public static Optional<HudEngine> find()
      The running engine, or empty if it is not installed or failed to start.
    • get

      public static HudEngine get()
      The running engine.
      Throws:
      IllegalStateException - if HUDEngine is not installed, has not enabled yet, or failed to compile. Declaring it as a depend in your plugin.yml guarantees the ordering; it does not guarantee it compiled.