Skip to content

GuiForge v0.3.0

Latest

Choose a tag to compare

@Diego6k9 Diego6k9 released this 11 Oct 15:18
· 3 commits to master since this release

Added

  • Translations for {tokens}. GuiManager.setTranslator(Translator) lets a plugin provide text for any {key} in item names, lore, GUI titles and messages. The translator receives the viewer, so it can use the player's client language. Translations are MiniMessage and can contain other tokens.
  • Gui.placeholderComponent(token, fn). Inserts a component as it is, so a placeholder can carry its own colours and formatting. Dynamic values can still be plain text via Component.text(...).
  • LangFiles. Loads <base>_<language>.yml from the plugin's resources, flattens nested keys to dotted keys, and falls back to a fallback language.

Changed

  • Placeholder values are inserted as components instead of escaped strings. Plain placeholder(token, fn) behaves the same: its text is never parsed as MiniMessage.
  • Titles and message: actions use the same renderer as item names and lore.

Breaking

  • Translator takes a Player instead of a Locale. The Translator interface is new in this release, so only code written against the unreleased API is affected.

Notes

  • Unknown tokens stay visible as {token}, which makes missing translations easy to spot.
  • Translations that refer to each other are expanded a limited number of rounds, so cycles cannot hang the render. Cycles are not detected yet and show up as long repeated text.