Skip to content

Commit

Permalink
Disabling logging of compiler warnings in interpreter mode
Browse files Browse the repository at this point in the history
  • Loading branch information
PseudoKnight committed Sep 12, 2019
1 parent 9fd1bcb commit 6f6f5b7
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -7,6 +7,7 @@
import com.laytonsmith.core.MethodScriptCompiler;
import com.laytonsmith.core.ParseTree;
import com.laytonsmith.core.Static;
import com.laytonsmith.core.compiler.CompilerEnvironment;
import com.laytonsmith.core.compiler.TokenStream;
import com.laytonsmith.core.environments.CommandHelperEnvironment;
import com.laytonsmith.core.environments.Environment;
Expand Down Expand Up @@ -134,8 +135,10 @@ public void execute(String script, final MCPlayer p) throws ConfigCompileExcepti
gEnv.SetDynamicScriptingMode(true);
CommandHelperEnvironment cEnv = new CommandHelperEnvironment();
cEnv.SetPlayer(p);
Environment env = Environment.createEnvironment(gEnv, cEnv);
ParseTree tree = MethodScriptCompiler.compile(stream, null, env.getEnvClasses());
CompilerEnvironment compilerEnv = new CompilerEnvironment();
compilerEnv.setLogCompilerWarnings(false);
Environment env = Environment.createEnvironment(gEnv, cEnv, compilerEnv);
ParseTree tree = MethodScriptCompiler.compile(stream, env, env.getEnvClasses());
try {
MethodScriptCompiler.registerAutoIncludes(env, null);
MethodScriptCompiler.execute(tree, env, output -> {
Expand Down

0 comments on commit 6f6f5b7

Please sign in to comment.