mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 04:54:51 +00:00
Double clicking events in the hook list will now paste them into your code. More scripting functions added for NPCs.
This commit is contained in:
1 parent
547f5ab82d
commit
f14bc107d3
5 files changed
+586
-30
No files matched your search
@@ -85,8 +85,9 @@ public class ScriptContainer {
|
||||
public void run(ScriptEngine engine){
|
||||
StringWriter sw = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter(sw);
|
||||
engine.getContext().setWriter(pw);
|
||||
engine.getContext().setErrorWriter(pw);
|
||||
this.engine.getContext().setWriter(pw);
|
||||
this.engine.getContext().setErrorWriter(pw);
|
||||
|
||||
try {
|
||||
if(compScript == null && engine instanceof Compilable)
|
||||
compScript = ((Compilable)engine).compile(getFullCode());
|
||||
@@ -96,12 +97,13 @@ public class ScriptContainer {
|
||||
}
|
||||
else
|
||||
engine.eval(getFullCode());
|
||||
|
||||
} catch (Exception e) {
|
||||
errored = true;
|
||||
appandConsole(e.getMessage());
|
||||
} catch (Throwable var14) {
|
||||
this.errored = true;
|
||||
var14.printStackTrace(pw);
|
||||
} finally {
|
||||
this.appandConsole(sw.getBuffer().toString().trim());
|
||||
pw.close();
|
||||
}
|
||||
appandConsole(sw.getBuffer().toString().trim());
|
||||
}
|
||||
|
||||
public void run(EnumScriptType type, Event event) {
|
||||
|
||||
Reference in new issue
Block a user