mirror of
https://github.com/Anvilcraft/modpacktools
synced 2024-11-17 23:41:55 +01:00
another reformat
This commit is contained in:
parent
b1ab51a932
commit
1161556118
4 changed files with 26 additions and 34 deletions
|
@ -43,7 +43,6 @@ public class Commands {
|
|||
|
||||
/**
|
||||
* Adds a mod to the modpack
|
||||
*
|
||||
* @param modlink Can be a link to a curseforge file or to a file download
|
||||
*/
|
||||
public static void addMod(String[] modlink) {
|
||||
|
@ -128,7 +127,6 @@ public class Commands {
|
|||
|
||||
/**
|
||||
* Builds the modpack as a server
|
||||
*
|
||||
* @param dir The directory where to create the server
|
||||
*/
|
||||
public static void buildServer(String[] dir) {
|
||||
|
@ -137,7 +135,6 @@ public class Commands {
|
|||
|
||||
/**
|
||||
* Downloads all mods in this pack
|
||||
*
|
||||
* @param dir The mods directory
|
||||
*/
|
||||
public static void downloadMods(String[] dir) {
|
||||
|
@ -146,7 +143,6 @@ public class Commands {
|
|||
|
||||
/**
|
||||
* Creates a modlist of this pack
|
||||
*
|
||||
* @param format 1 Can be html or csv, 2 can be any valid file to write to
|
||||
*/
|
||||
public static void createModlist(String[] format) {
|
||||
|
@ -237,7 +233,6 @@ public class Commands {
|
|||
|
||||
/**
|
||||
* Creates a server from a modpack zip file
|
||||
*
|
||||
* @param args The path to the zip file, The directory where to create the server
|
||||
*/
|
||||
public static void makeServer(String[] args) {
|
||||
|
|
|
@ -28,31 +28,6 @@ public class ModInfo {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String[] getAuthors() {
|
||||
ArrayList<String> authorArr = new ArrayList<>();
|
||||
for(JsonElement author : authors) {
|
||||
JsonObject authorObj = (JsonObject) author;
|
||||
authorArr.add(authorObj.get("name").getAsString());
|
||||
}
|
||||
return authorArr.toArray(new String[authorArr.size()]);
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
public int getDownloads() {
|
||||
return downloads;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public static ArrayList<ModInfo> getModInfo() {
|
||||
try {
|
||||
System.out.println("Getting Info From Curse API");
|
||||
|
@ -83,4 +58,29 @@ public class ModInfo {
|
|||
return null;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String[] getAuthors() {
|
||||
ArrayList<String> authorArr = new ArrayList<>();
|
||||
for(JsonElement author : authors) {
|
||||
JsonObject authorObj = (JsonObject) author;
|
||||
authorArr.add(authorObj.get("name").getAsString());
|
||||
}
|
||||
return authorArr.toArray(new String[authorArr.size()]);
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
public int getDownloads() {
|
||||
return downloads;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,10 +6,10 @@ import java.io.*;
|
|||
import java.net.URISyntaxException;
|
||||
|
||||
public class Config {
|
||||
private final String CONFIG_NAME = "modpacktoolsconfig.json";
|
||||
public final File JAR_LOCATION;
|
||||
public final File CONFIG_LOCATION;
|
||||
public final JsonObject CONFIG;
|
||||
private final String CONFIG_NAME = "modpacktoolsconfig.json";
|
||||
|
||||
public Config() {
|
||||
//Get the Location of the jarfile
|
||||
|
@ -36,7 +36,6 @@ public class Config {
|
|||
|
||||
/**
|
||||
* reads the config it it exists and otherwise copies it
|
||||
*
|
||||
* @return the json object of the config file
|
||||
*/
|
||||
private JsonObject readConfig() {
|
||||
|
|
|
@ -11,7 +11,6 @@ import java.nio.charset.StandardCharsets;
|
|||
public class Util {
|
||||
/**
|
||||
* Reads a Json File
|
||||
*
|
||||
* @param file the file to read
|
||||
* @return the file content as JsonObject
|
||||
*/
|
||||
|
@ -33,7 +32,6 @@ public class Util {
|
|||
|
||||
/**
|
||||
* sends a http post request
|
||||
*
|
||||
* @param url the url to send the request to
|
||||
* @param contentType what content type should be used. Example: "application/json; utf-8"
|
||||
* @param accept what content is accepted. Example: "application/json"
|
||||
|
|
Loading…
Reference in a new issue