Package io.github.nacvark.hudengine.api
Class HudEngineProvider
java.lang.Object
io.github.nacvark.hudengine.api.HudEngineProvider
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 Summary
-
Method Details
-
find
The running engine, or empty if it is not installed or failed to start. -
get
The running engine.- Throws:
IllegalStateException- if HUDEngine is not installed, has not enabled yet, or failed to compile. Declaring it as adependin your plugin.yml guarantees the ordering; it does not guarantee it compiled.
-