Commit 160c4ae8 authored by superblaubeere27's avatar superblaubeere27

Add mod system

parent 441da114
......@@ -46,7 +46,7 @@ public class LiquidLauncher {
public static final boolean DEVEL_VERSION = true;
public static final Logger LOGGER = Logger.getLogger(LAUNCHER_NAME);
public static final String LAUNCHER_OPENSOURCE_PROJECT = "https://git.liquidbounce.net/CCBlueX/LiquidLauncherV2";
private static final double LAUNCHER_VERSION = 1.0;
private static final double LAUNCHER_VERSION = 1.1;
public static final String LAUNCHER_VERSION_STRING = "v" + LAUNCHER_VERSION + "-SNAPSHOT";
private static final String LIQUIDLAUNCHER_DOWNLOAD = "https://ci.liquidbounce.net/job/LiquidLauncher/";
public static LiquidLauncher liquidLauncher;
......@@ -299,6 +299,26 @@ public class LiquidLauncher {
}
}
if (tree.getModsFolder().exists()) {
tree.getModsFolder().delete();
tree.getModsFolder().mkdirs();
}
int seis = versionMods.get(clientBuild.getMinecraftVersion()).size();
for (int i = 0; i < seis; i++) {
Mod mod = versionMods.get(clientBuild.getMinecraftVersion()).get(i);
File modFile = new File(mod.getPath());
if (!modFile.exists()) {
versionMods.get(clientBuild.getMinecraftVersion()).remove(mod);
LOGGER.warning("The mod " + mod.getName() + " file at " + modFile.getAbsolutePath() + " does not exist");
continue;
}
if (mod.isActivated()) {
Files.copy(modFile, new File(tree.getModsFolder(), modFile.getName()));
LOGGER.info("The mod " + mod.getName() + " was copied");
} else {
LOGGER.info("The mod " + mod.getName() + " was ignored (not activated)");
}
}
assetManager = new AssetManager(tree.getAssets());
final JsonObject obj = jsonParser.parse(new InputStreamReader(new FileInputStream(tree.getForgeJson()))).getAsJsonObject();
final JsonObject mcJ = jsonParser.parse(new InputStreamReader(new FileInputStream(tree.getMinecraftJson()))).getAsJsonObject();
......
......@@ -35,7 +35,6 @@ public class ConfigureModsForm extends JDialog {
$$$setupUI$$$();
}
public ConfigureModsForm(String clientVersion) {
super();
this.clientVersion = clientVersion;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment