Contributing
Build Galdur UI, run it with the test mod, and send a pull request. Here is how the repository is organised and the rules it follows.
Build and run
.\gradlew.bat runClient # starts the development client (library + test mod).\gradlew.bat build # compiles, runs the tests and builds the jar in build/libs.\gradlew.bat test # unit tests only (without starting Minecraft)You need Java 21. On Linux and macOS, use ./gradlew instead of .\gradlew.bat.
The test mod
Demo screens, test blocks and debug tools live in a separate source set, src/testmod, as a second mod (galduruitest). Development runs load it next to Galdur UI; it is never in the library jar.
| Command | What it does |
|---|---|
/galdurui test | Demo screen of every widget. |
/galdurui window | Demo of the declarative GaldurWindow API. |
/galdurui debug | Toggles the layout debug outlines. |
/galdurui fps | Toggles an FPS counter that stays visible on screens (F3 is hidden there). |
/galduruidev chest | Gives a test chest (also in the "Functional Blocks" creative tab) that opens in a GaldurContainerScreen. |
/galduruidev terminal | Opens a test terminal: a grid of every item in the game above the inventory. |
The test mod also adds a blue theme resource pack (Options → Resource Packs), which overrides only part of theme.json.
Structure
com.galdurstudio.galdurui.api: public, stable API used by our mods.api.menuis the only package that can load on a dedicated server; all others are client-only.com.galdurstudio.galdurui.internal: internal implementation, may change at any time.internal.render.GaldurRenderis the only class that callsGuiGraphics.- No public
apisignature exposes aninternaltype.
Rules
- Never make
api.*depend oninternal.*types in a public signature. - Keep development tools in the test mod, never in the library jar.
- Public API methods may stay unused inside the repository (
GaldurButton.withSprites,GaldurLabel.getText,GaldurPanelLayout.withSprite…): they are part of the API offered to mods. - Write Javadoc for every public class and method: this site's API reference is generated from it.
- Update the Changelog under
[Unreleased].
Sprites
If you change a sprite's shape, regenerate them with .\gradlew.bat generateSprites and commit the PNGs: CI fails if they no longer match the generator. See Sprites.
Questions
Open an issue on GitHub, or ask on the Discord: we answer every question.