Skip to content

Releases

GuiForge v0.3.0

Choose a tag to compare

@Diego6k9 Diego6k9 released this 11 Oct 15:18

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.

GuiForge v0.2.0

Choose a tag to compare

@Diego6k9 Diego6k9 released this 10 Oct 19:39

Changes

  • New slot pattern name filler for background items that fill all free slots. The older name empty is still accepted, so existing layouts keep working.
  • Templates and docs use filler.
  • Skin hashes accept 1 to 64 hex characters.
  • Starter templates in templates/: paginated shop, auction listing, category menu, admin toggles, confirm dialog.

Available on Maven Central as io.github.diego6k9:guiforge:0.2.0

GuiForge v0.1.2

Choose a tag to compare

@Diego6k9 Diego6k9 released this 10 Oct 18:22

Changes

  • Skin hashes for minecraft:player_head accept 1 to 64 hex characters (was exactly 64).
  • Starter templates in templates/ for a paginated shop, auction listing, category menu, admin toggles and confirm dialog.
  • Player-head arrows in the paginated templates.
  • Glint on border frames and filler items in templates.

Available on Maven Central as io.github.diego6k9:guiforge:0.1.2

GuiForge v0.1.1

Choose a tag to compare

@Diego6k9 Diego6k9 released this 10 Oct 16:52

Fixes and additions after the first release.

Fixes

  • Demo GUIs no longer ship with the library. v0.1.0 contained GuiForge's demo plugin descriptor (paper-plugin.yml) and demo layouts. Every plugin that shaded v0.1.0 therefore loaded the demo instead of its own plugin, and the demo GUIs appeared. v0.1.1 leaves them out. The demo plugin is still part of the test server build.
  • Double clicks count once. A double click fired an extra click event, so one click on "Next page" could skip several pages, and a double click on a purchase button could run it twice. Double-click events are now ignored.

Additions

  • Page tokens for paginated GUIs: {page}, {pages}, {prevPage} and {nextPage} work in item names, lore and message: actions. Example: "name": "<yellow>Next page <gold>({nextPage}/{pages})</gold>". Page tokens are not filled in the GUI title, because the title is set when the menu opens. These names are reserved for placeholders. Details in docs/format-v1.md.

Documentation

  • Complete Javadoc for the public API (Gui, GuiManager, ClickContext, format classes).

Upgrading

Drop-in update from v0.1.0. If you shade GuiForge into your plugin, update to v0.1.1 to get rid of the demo plugin descriptor.

Maven

<dependency>
  <groupId>io.github.diego6k9</groupId>
  <artifactId>guiforge</artifactId>
  <version>0.1.1</version>
</dependency>

GuiForge v0.1.0

Choose a tag to compare

@Diego6k9 Diego6k9 released this 10 Oct 00:28

The first release of GuiForge, a runtime library for data-driven GUIs on Paper. Design a menu as a JSON layout, load it at runtime, and bind click handlers to items by key. Layouts can be created in the GuiForge web editor.

Highlights

  • Layouts from JSON. Fixed items, borders and fill patterns, and a documented format (format-v1). See docs/format-v1.md.
  • Click handlers by key. Bind behaviour to an item with gui.onClick("buy", ctx -> …). Unknown keys fail fast with a clear message, so typos don't go unnoticed.
  • Per-player items. itemFor renders an item for each viewer on every render, e.g. for balances or owned state. refresh() updates everyone who has the GUI open.
  • Placeholders. {token} works in item names, lore and the GUI title. Values are inserted as plain text, so player input cannot inject MiniMessage tags.
  • Rich text. Names, lore and titles accept MiniMessage. Default italics are removed.
  • Pagination. Paginated GUIs take a list of objects with setContents and receive the clicked object in onContentClick. Each viewer has their own page state.
  • Lifecycle hooks. onOpen and onClose run for every viewer, including when a GUI is replaced or the player leaves.
  • Declarative actions. Layouts can use close, next-page, prev-page, open:<gui-id>, sound:<name>[:volume:pitch] and message:<text>.
  • Custom actions. registerAction("prefix:", handler) adds your own action types for layouts. Built-in prefixes are protected.
  • Attribute hiding. Item attributes such as enchantment and damage lines are hidden by default. Set hideAttributes to false per item to show them again.

Getting started

Add the dependency:

<dependency>
  <groupId>io.github.diego6k9</groupId>
  <artifactId>guiforge</artifactId>
  <version>0.1.0</version>
</dependency>

Create one GuiManager per plugin and reuse it. A second manager for the same plugin throws an IllegalStateException:

GuiManager guis = new GuiManager(this);
Gui<Object> shop = guis.load("gui/shop.json");
shop.onClick("buy", ctx -> ctx.player().sendMessage("Bought!"));
shop.placeholder("balance", player -> "100");
shop.open(player);

load throws an UncheckedIOException if the resource is missing or cannot be read, so no checked exception handling is needed.

Requirements

  • JDK 25
  • Paper API 26.3 (provided by the server, not bundled)
  • Gson is a normal dependency. Plugins that shade GuiForge should relocate Gson too.

Known limitations

  • This is a first release. The layout format and the Java API may still change before 1.0. Breaking changes will be listed in the release notes.
  • Declarative actions are limited to the built-in set. Anything more complex goes through registerAction.

Links

Feedback and bug reports are welcome in the issue tracker.