mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 11:54:47 +00:00
Scripted player tick events are functional, GUI for player events is complete. Global player events run as they should now, just need to start implementing more of them.
This commit is contained in:
1 parent
6aa98aecf3
commit
1ee14920ff
26 files changed
+1223
-1091
No files matched your search
@@ -111,13 +111,29 @@ public class DataScript {
|
||||
script.engine.put(obs[i].toString(), ob);
|
||||
}
|
||||
|
||||
return callScript(script);
|
||||
//return callScript(script);
|
||||
ScriptEngine engine = script.engine;
|
||||
engine.put("npc", dummyNpc);
|
||||
engine.put("world", dummyWorld);
|
||||
ScriptEvent result = (ScriptEvent) engine.get("event");
|
||||
if(result == null)
|
||||
engine.put("event", result = new ScriptEvent());
|
||||
engine.put("EntityType", entities);
|
||||
engine.put("RoleType", roles);
|
||||
engine.put("JobType", jobs);
|
||||
script.run(engine);
|
||||
|
||||
if(clientNeedsUpdate){
|
||||
npc.updateClient = true;
|
||||
clientNeedsUpdate = false;
|
||||
}
|
||||
if(aiNeedsUpdate){
|
||||
npc.updateAI = true;
|
||||
aiNeedsUpdate = false;
|
||||
}
|
||||
return result.isCancelled();
|
||||
}
|
||||
|
||||
public boolean isEnabled(){
|
||||
return enabled && ScriptController.HasStart && !npc.worldObj.isRemote && !scripts.isEmpty();
|
||||
}
|
||||
|
||||
/*
|
||||
private boolean callScript(ScriptContainer script){
|
||||
ScriptEngine engine = script.engine;
|
||||
engine.put("npc", dummyNpc);
|
||||
@@ -129,7 +145,7 @@ public class DataScript {
|
||||
engine.put("RoleType", roles);
|
||||
engine.put("JobType", jobs);
|
||||
script.run(engine);
|
||||
|
||||
|
||||
if(clientNeedsUpdate){
|
||||
npc.updateClient = true;
|
||||
clientNeedsUpdate = false;
|
||||
@@ -140,6 +156,11 @@ public class DataScript {
|
||||
}
|
||||
return result.isCancelled();
|
||||
}
|
||||
*/
|
||||
|
||||
public boolean isEnabled(){
|
||||
return enabled && ScriptController.HasStart && !npc.worldObj.isRemote && !scripts.isEmpty();
|
||||
}
|
||||
|
||||
public void setWorld(World world) {
|
||||
if(world instanceof WorldServer)
|
||||
|
||||
Reference in new issue
Block a user