Removed script wrapper
This commit is contained in:
@@ -30,13 +30,6 @@ public class ScriptStubGenerator{
|
||||
DataInputStream.class, DataOutputStream.class, Integer.class, Float.class, Double.class, Long.class, Boolean.class, Short.class, Byte.class, Character.class);
|
||||
Array<String> nopackage = Array.with("java.lang", "java");
|
||||
|
||||
String fileTemplate = "package mindustry.mod;\n" +
|
||||
"\nimport arc.struct.*;\n" +
|
||||
"//obviously autogenerated, do not touch\n" +
|
||||
"public class ClassAccess{\n" +
|
||||
"\tpublic static final ObjectSet<String> allowedClassNames = ObjectSet.with($ALLOWED_CLASS_NAMES$);\n" +
|
||||
"}";
|
||||
|
||||
List<ClassLoader> classLoadersList = new LinkedList<>();
|
||||
classLoadersList.add(ClasspathHelper.contextClassLoader());
|
||||
classLoadersList.add(ClasspathHelper.staticClassLoader());
|
||||
@@ -73,8 +66,5 @@ public class ScriptStubGenerator{
|
||||
//Log.info(result);
|
||||
|
||||
new Fi("core/assets/scripts/global.js").writeString(result.toString());
|
||||
new Fi("core/src/mindustry/mod/ClassAccess.java").writeString(fileTemplate
|
||||
.replace("$ALLOWED_CLASSES$", classes.toString(", ", type -> type.getName() + ".class"))
|
||||
.replace("$ALLOWED_CLASS_NAMES$", classes.toString(", ", type -> "\"" + type.getName() + "\"")));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user