Merge; internal changes

This commit is contained in:
Anuken
2020-01-10 11:30:42 -05:00
161 changed files with 7865 additions and 5181 deletions

File diff suppressed because one or more lines are too long

View File

@@ -333,8 +333,8 @@ public class ContentParser{
}
private void readBundle(ContentType type, String name, JsonValue value){
UnlockableContent cont = Vars.content.getByName(type, name) instanceof UnlockableContent ?
Vars.content.getByName(type, name) : null;
UnlockableContent cont = locate(type, name) instanceof UnlockableContent ?
locate(type, name) : null;
String entryName = cont == null ? type + "." + currentMod.name + "-" + name + "." : type + "." + cont.name + ".";
I18NBundle bundle = Core.bundle;

View File

@@ -0,0 +1,19 @@
package mindustry.mod;
/** Mod listing as a data class. */
public class ModListing{
public String repo, name, author, lastUpdated, description;
public int stars;
@Override
public String toString(){
return "ModListing{" +
"repo='" + repo + '\'' +
", name='" + name + '\'' +
", author='" + author + '\'' +
", lastUpdated='" + lastUpdated + '\'' +
", description='" + description + '\'' +
", stars=" + stars +
'}';
}
}

View File

@@ -512,10 +512,8 @@ public class Mods implements Loadable{
for(ContentType type : ContentType.all){
Fi folder = contentRoot.child(type.name().toLowerCase() + "s");
if(folder.exists()){
for(Fi file : folder.list()){
if(file.extension().equals("json") || file.extension().equals("hjson")){
runs.add(new LoadRun(type, file, mod));
}
for(Fi file : folder.findAll(f -> f.extension().equals("json") || f.extension().equals("hjson"))){
runs.add(new LoadRun(type, file, mod));
}
}
}

View File

@@ -21,7 +21,8 @@ public class Scripts implements Disposable{
context.setClassShutter(type -> (ClassAccess.allowedClassNames.contains(type) || type.startsWith("$Proxy") ||
type.startsWith("adapter") || type.contains("PrintStream") ||
type.startsWith("mindustry")) && !type.equals("mindustry.mod.ClassAccess"));
context.getWrapFactory().setJavaPrimitiveWrap(false);
scope = new ImporterTopLevel(context);
wrapper = Core.files.internal("scripts/wrapper.js").readString();