Revert to use fabric mod.json format

dev/0.11
modmuss50 2018-10-25 12:32:39 +01:00
parent 5446a322d4
commit 252b06bfc2
1 changed files with 10 additions and 12 deletions

View File

@ -280,19 +280,17 @@ public class AbstractPlugin implements Plugin<Project> {
Gson gson = new Gson(); Gson gson = new Gson();
try { try {
JsonElement jsonElement = gson.fromJson(new FileReader(modJson), JsonElement.class); JsonElement jsonElement = gson.fromJson(new FileReader(modJson), JsonElement.class);
JsonArray jsonArray = jsonElement.getAsJsonArray(); JsonObject jsonObject = jsonElement.getAsJsonObject();
for (int i = 0; i < jsonArray.size(); i++) { if ((extension.version == null || extension.version.isEmpty()) && jsonObject.has("version")) {
JsonObject jsonObject = jsonArray.get(i).getAsJsonObject(); project.setVersion(jsonObject.get("version").getAsString());
if ((extension.version == null || extension.version.isEmpty()) && jsonObject.has("version")) {
project.setVersion(jsonObject.get("version").getAsString());
}
if (jsonObject.has("group")) {
project.setGroup(jsonObject.get("group").getAsString());
}
if (jsonObject.has("description")) {
project.setDescription(jsonObject.get("description").getAsString());
}
} }
if (jsonObject.has("group")) {
project.setGroup(jsonObject.get("group").getAsString());
}
if (jsonObject.has("description")) {
project.setDescription(jsonObject.get("description").getAsString());
}
//TODO load deps
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
//This wont happen as we have checked for it //This wont happen as we have checked for it