Package io.github.nacvark.hudengine.api
Interface HudEngine
public interface HudEngine
Entry point for plugins building on HUDEngine.
Obtain it through HudEngineProvider.get(), which resolves it from the services manager,
and hold onto the interface rather than the implementation:
HudEngine hud = HudEngineProvider.get();
hud.values().register("myplugin:mana", player -> String.valueOf(mana.of(player)));
hud.player(player).show("quest_tracker");
Everything here runs on the calling thread and does no I/O, so it is safe to call from an event
handler. The exception is reload(), which recompiles the whole pack.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordThe outcome of a reload. -
Method Summary
Modifier and TypeMethodDescriptioncompass()Where a plugin publishes points for compasses to point at.booleanWhether a HUD with this key was compiled.huds()Every compiled HUD, in the order the configuration defined them.booleanWhether the engine compiled successfully and is currently rendering.metrics()Pixel measurement against a HUD's real fonts.player(org.bukkit.entity.Player player) What one player currently sees, and how to change it.reload()Recompiles the configuration and swaps the model in.values()Where a plugin publishes values for HUD patterns to draw.
-
Method Details
-
huds
Every compiled HUD, in the order the configuration defined them. -
hasHud
Whether a HUD with this key was compiled. -
player
What one player currently sees, and how to change it. -
values
HudValues values()Where a plugin publishes values for HUD patterns to draw. -
compass
HudCompass compass()Where a plugin publishes points for compasses to point at. -
metrics
HudMetrics metrics()Pixel measurement against a HUD's real fonts. -
reload
HudEngine.ReloadResult reload()Recompiles the configuration and swaps the model in.Text and positions change at once. Clients only see new textures, fonts or glyph positions once they receive the pack again, which in practice means a reconnect.
-
isRunning
boolean isRunning()Whether the engine compiled successfully and is currently rendering.
-