Made constant BlockPos calculateLogBaseTwo calculation explicit, enabled player events by default.

This commit is contained in:
luisc committed 2021-10-12 04:20:33 -05:00
1 parent 699182f4c0
commit 047552d9e5
7 files changed
+12 -30

No files matched your search

+2 -23
View File
@@ -111,29 +111,9 @@ public class DataScript {
script.engine.put(obs[i].toString(), ob);
}
//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();
return callScript(script);
}
/*
private boolean callScript(ScriptContainer script){
ScriptEngine engine = script.engine;
engine.put("npc", dummyNpc);
@@ -156,7 +136,6 @@ public class DataScript {
}
return result.isCancelled();
}
*/
public boolean isEnabled(){
return enabled && ScriptController.HasStart && !npc.worldObj.isRemote && !scripts.isEmpty();