mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 05:15:11 +00:00
Implemented 1.12 event scripting API.
This commit is contained in:
1 parent
feeef71b5a
commit
bb1da8376d
8 files changed
+174
-87
No files matched your search
@@ -105,9 +105,6 @@ public class PlayerDataScript implements IScriptHandler {
|
||||
for(int var7 = 0; var7 < this.scripts.size(); ++var7) {
|
||||
script = (EventScriptContainer)this.scripts.get(var7);
|
||||
|
||||
if(!script.type.equals(type.function))
|
||||
continue;
|
||||
|
||||
if(!ScriptController.Instance.playerScripts.errored.contains(Integer.valueOf(var7))) {
|
||||
if(script == null || script.errored || !script.hasCode())
|
||||
return;
|
||||
@@ -128,7 +125,7 @@ public class PlayerDataScript implements IScriptHandler {
|
||||
if(result == null)
|
||||
engine.put("event", result = new PlayerEvent(this.getPlayer()));
|
||||
script.engine.put("API", new WrapperNpcAPI());
|
||||
script.run(engine);
|
||||
script.run(type, event);
|
||||
|
||||
if (script.errored) {
|
||||
ScriptController.Instance.playerScripts.errored.add(var7);
|
||||
|
||||
Reference in new issue
Block a user