All ScriptHandlers that send packets now directly define their data through the ScriptHandler class itself, NOT through their own GuiScript extended class.
- Renamed `getScriptIndex` to `getLanguageIndex` in `GuiScriptInterface` and its subclasses to resolve naming ambiguity between tabs and engine selection.
2. Janino reflection based function calls like:
Color script = scriptHandler.callFunction("getColor", Color.class, ctx);
Compared to current:
Color script = scriptHandler.getScript().call(f -> f.getColor(ctx));
- Defines the packet-backed script GUI contract used by GuiScriptInterface for “streamed” script loading/saving.
- Updated EffectScript, LinkedItemScript and RecipeScript to implement IScriptHandlerPacket
- Removed GuiScriptEffect, GuiScriptLinkedItem and GuiScriptRecipe as their functionality got replaced with new interface handled by GuiScriptInterface
- ScriptHandler now holds a list of containers
- Delegated single container handling to SingleScriptHandler
IScriptHandler refactor:
- Moved ScriptContext/Hook logic to it
- More default methods + hooked them to GuIScriptInterface
run(String, Event) methods to IScriptUnit interface, with JaninoScript
delegating to callByHookType(). This provides a cleaner abstraction that
supports both ScriptContainer and JaninoScript without type checking.
Affected files:
- IScriptUnit: Added run() methods to interface
- JaninoScript: Implemented run() delegation methods
- DataScript, PlayerDataScript, GlobalNPCDataScript, ForgeDataScript
- EffectScript, LinkedItemScript, RecipeScript
- ScriptCustomItem, TileScripted: Refactored to use polymorphic calls