Conversation
- Add core Lua infrastructure (GuiScript, GuiScriptManager, LuaBinder, LuaExpose annotation) - Add LuaElement wrapper to expose AmbleElement properties to Lua scripts - Add Minecraft API bindings (MinecraftData, MinecraftEntity, LuaItemStack) - Integrate script callbacks (onInit, onClick, onRelease, onHover) into AmbleButton - Add script property support in JSON GUI definitions - Improve AmbleText with proper text wrapping and shadow toggle - Add setDimensions helper to AmbleElement
- Rename GuiScript to AmbleScript and GuiScriptManager to ScriptManager - Move scripts from gui/script/ to script/ folder for broader use - Add ExecuteScriptCommand (/amblescript execute) to run scripts via chat - Auto-discover scripts on resource reload for command tab-completion - Add onExecute callback support for scripts triggered by command
Introduce server-side Lua scripting system parallel to client scripts: - Add ServerScriptManager for managing data pack scripts - Add ServerScriptCommand with enable/disable/execute/toggle/list commands - Refactor Lua bindings to shared script.lua package - Add ServerMinecraftData with server-specific APIs - Include example server scripts (admin_commands, tick_counter, etc.)
- enable/disable/toggle only suggest scripts with onTick method - execute only suggests scripts with onExecute method
drtheodor
requested changes
Jan 8, 2026
src/main/java/dev/amble/lib/client/gui/registry/AmbleGuiRegistry.java
Outdated
Show resolved
Hide resolved
Key improvements: - Extract AbstractScriptManager for DRY between client/server scripts - Add type-specific coercion methods to LuaBinder for clarity - Add toString methods for Vector3f, Vec3d, BlockPos in Lua - Add structured NBT access via nbt() method, deprecate nbtString() - Use IntIntImmutablePair from fastutil in AmbleElement - Add text caching in AmbleText to avoid recalculation - Add @ApiStatus.Internal and javadoc to LuaElement.unwrap() - Add init() method with javadoc to AmbleGuiRegistry - Pass resourceId to parse() for better error context - Add validation for array sizes and identifier parsing - Add FALLBACK_LAYOUT constant in AmbleContainer - Add script name logging via setScriptName/getLogPrefix - Rename ExecuteScriptCommand to ClientScriptCommand - Use Command.SINGLE_SUCCESS consistently
drtheodor
requested changes
Jan 9, 2026
…actor, constants, docs
Member
Author
|
All review comments have been addressed. Changes include:
Ready for re-review. @drtheodor |
Member
Author
|
Implemented support for checking any registered keybind, not just the hardcoded movement keys. Changes to \isKeyPressed:
New method \getKeybinds():
This allows Lua scripts to check any keybind from vanilla Minecraft or mods. |
- Support shorthand keybind names: forward, jump, inventory, sprint, etc. - Support raw keyboard keys: r, h, space, left_shift, escape, f1, etc. - Support registered keybind translation keys - Add isMouseButtonPressed for mouse button checks - Falls back through keybinds then raw keys for maximum flexibility
Member
Author
|
Updated: Merged the functionality into a single \isKeyPressed\ method that now supports:
Example usage in Lua: -- Still works with keybinds Also added \isMouseButtonPressed()\ for mouse button checks. |
- Add LUA_SCRIPTING.md with full API reference, lifecycle callbacks, and examples - Add GUI_SYSTEM.md with JSON structure docs, properties reference, and Lua integration - Update README.md with brief descriptions and links to new documentation - Fix AmbleGuiRegistry to auto-create child AmbleText when button has text property
drtheodor
requested changes
Jan 11, 2026
src/main/java/dev/amble/lib/client/command/ClientScriptCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/amble/lib/client/command/ClientScriptCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/amble/lib/client/command/ClientScriptCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/amble/lib/client/command/ClientScriptCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/amble/lib/client/command/ClientScriptCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/amble/lib/client/command/ClientScriptCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/amble/lib/client/command/ClientScriptCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/amble/lib/client/command/ClientScriptCommand.java
Outdated
Show resolved
Hide resolved
src/main/java/dev/amble/lib/client/command/ClientScriptCommand.java
Outdated
Show resolved
Hide resolved
| } | ||
|
|
||
| @LuaExpose | ||
| public int x() { |
…method for improved Lua scripting support
drtheodor
requested changes
Jan 11, 2026
src/main/java/dev/amble/lib/client/command/ClientScriptCommand.java
Outdated
Show resolved
Hide resolved
…istency Add Testmod Client 2 configuration in build.gradle
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
accidentally merged #58