Added run(EnumScriptType, Event) and

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
This commit is contained in:
bigguy345 committed 2026-01-14 00:16:58 +02:00
1 parent cd60a03544
commit cc0959dcfe
12 files changed
+156 -52

No files matched your search

@@ -153,9 +153,7 @@ public class DataScript implements IScriptHandler {
}
for (IScriptUnit script : this.eventScripts) {
if (script instanceof ScriptContainer) {
((ScriptContainer) script).run(type, event);
}
script.run(type, event);
}
ScriptContainer script = scripts.get(type);