mirror of
https://github.com/packwiz/packwiz-installer.git
synced 2025-04-19 21:16:30 +02:00
Add more deserialisation classes
This commit is contained in:
parent
26c3261848
commit
917d10c448
@ -12,6 +12,7 @@ import java.nio.file.Paths;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonIOException;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.moandjiezana.toml.Toml;
|
||||
|
||||
import link.infra.packwiz.installer.metadata.ManifestFile;
|
||||
@ -33,7 +34,12 @@ public class UpdateManager {
|
||||
public Side side = Side.CLIENT;
|
||||
|
||||
public static enum Side {
|
||||
CLIENT("client"), SERVER("server"), BOTH("both", new Side[] { CLIENT, SERVER });
|
||||
@SerializedName("client")
|
||||
CLIENT("client"),
|
||||
@SerializedName("server")
|
||||
SERVER("server"),
|
||||
@SerializedName("both")
|
||||
BOTH("both", new Side[] { CLIENT, SERVER });
|
||||
|
||||
private final String sideName;
|
||||
private final Side[] depSides;
|
||||
|
@ -14,5 +14,8 @@ public class IndexFile {
|
||||
@SerializedName("hash-format")
|
||||
public String hashFormat;
|
||||
public String hash;
|
||||
public String alias;
|
||||
public boolean metafile;
|
||||
public boolean preserve;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package link.infra.packwiz.installer.metadata;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import link.infra.packwiz.installer.UpdateManager.Options.Side;
|
||||
|
||||
class ModFile {
|
||||
public String name;
|
||||
public String filename;
|
||||
public Side side;
|
||||
|
||||
public Download download;
|
||||
public static class Download {
|
||||
public URI url;
|
||||
@SerializedName("hash-format")
|
||||
public String hashFormat;
|
||||
public String hash;
|
||||
}
|
||||
|
||||
public Map<String, Object> update;
|
||||
|
||||
public Option option;
|
||||
public static class Option {
|
||||
public boolean optional;
|
||||
public String description;
|
||||
@SerializedName("default")
|
||||
public boolean defaultValue;
|
||||
}
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user