Partial 7.0 merge - API preview

This commit is contained in:
Anuken
2021-06-02 11:08:08 -04:00
parent ea75a357ca
commit 28b235ef07
531 changed files with 12356 additions and 6286 deletions

View File

@@ -25,12 +25,13 @@ public class Scripts implements Disposable{
private static final Seq<String> blacklist = Seq.with(".net.", "java.net", "files", "reflect", "javax", "rhino", "file", "channels", "jdk",
"runtime", "util.os", "rmi", "security", "org.", "sun.", "beans", "sql", "http", "exec", "compiler", "process", "system",
".awt", "socket", "classloader", "oracle", "invoke", "java.util.function", "java.util.stream", "org.", "mod.classmap");
private static final Seq<String> whitelist = Seq.with("mindustry.net", "netserver", "netclient", "com.sun.proxy.$proxy", "jdk.proxy1", "mindustry.gen.",
"mindustry.logic.", "mindustry.async.", "saveio", "systemcursor", "filetreeinitevent");
private static final Seq<String> whitelist = Seq.with("mindustry.net", "netserver", "netclient", "com.sun.proxy.$proxy", "jdk.proxy", "mindustry.gen.",
"mindustry.logic.", "mindustry.async.", "saveio", "systemcursor", "filetreeinitevent", "asyncexecutor");
private final Context context;
private final Scriptable scope;
private boolean errored;
LoadedMod currentMod = null;
public static boolean allowClass(String type){
@@ -41,10 +42,6 @@ public class Scripts implements Disposable{
Time.mark();
context = Vars.platform.getScriptContext();
context.setClassShutter(Scripts::allowClass);
context.getWrapFactory().setJavaPrimitiveWrap(false);
context.setLanguageVersion(Context.VERSION_ES6);
scope = new ImporterTopLevel(context);
new RequireBuilder()