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
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
…actor, constants, docs
|
All review comments have been addressed. Changes include:
Ready for re-review. @drtheodor |
|
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
|
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
| } | ||
|
|
||
| @LuaExpose | ||
| public int x() { |
…method for improved Lua scripting support
…istency Add Testmod Client 2 configuration in build.gradle
|
no activity on this for a while - marking it |
accidentally merged #58