Add Forge meta
This commit is contained in:
parent
b560f84d5f
commit
04c6ecb541
|
@ -1,24 +1,13 @@
|
|||
package ley.anvil.addonscript.forge;
|
||||
|
||||
import ley.anvil.addonscript.v1.AddonscriptJSON;
|
||||
import ley.anvil.addonscript.wrapper.MetaData;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ForgeMeta extends AddonscriptJSON.Meta {
|
||||
public class ForgeMeta extends MetaData {
|
||||
|
||||
public ForgeMeta() {
|
||||
name = "Minecraft Forge";
|
||||
contributors = new ArrayList<>();
|
||||
contributors.add(getContrib("LexManos", "owner")); //TODO Complete Contributor list
|
||||
contributors.put("LexManos", new String[]{"owner"}); //TODO Complete Contributor list
|
||||
website = "https://forums.minecraftforge.net/";
|
||||
}
|
||||
|
||||
private AddonscriptJSON.Contributor getContrib(String name, String role) {
|
||||
AddonscriptJSON.Contributor con = new AddonscriptJSON.Contributor();
|
||||
con.name = name;
|
||||
con.roles = new ArrayList<>();
|
||||
con.roles.add(role);
|
||||
return con;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package ley.anvil.addonscript.wrapper;
|
||||
|
||||
import jdk.nashorn.api.scripting.URLReader;
|
||||
import ley.anvil.addonscript.forge.ForgeMeta;
|
||||
import ley.anvil.addonscript.installer.InternalDirInstaller;
|
||||
import ley.anvil.addonscript.util.HTTPRequest;
|
||||
import ley.anvil.addonscript.util.Utils;
|
||||
|
@ -250,10 +251,14 @@ public class ASWrapper {
|
|||
}
|
||||
|
||||
public boolean hasLocalMeta() {
|
||||
if (Utils.notEmpty(relation.id) && relation.id.equals("forge"))
|
||||
return true;
|
||||
return relation.meta != null;
|
||||
}
|
||||
|
||||
public MetaData getLocalMeta() {
|
||||
if (Utils.notEmpty(relation.id) && relation.id.equals("forge"))
|
||||
return new ForgeMeta();
|
||||
if (hasLocalMeta())
|
||||
return new MetaData(relation.meta);
|
||||
return new MetaData();
|
||||
|
|
Loading…
Reference in New Issue