public class Installer {
public static void install() {
- String version = Versions.build;
- String mcVersion = Versions.minecraft;
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Throwable t) {
try {
String osName = getOsName();
File minecraftFolder = getMinecraftFolder(osName);
- File versionFolder = new File(minecraftFolder, "versions/BBOR-" + version + "/");
+ String version = "BBOR-" + Versions.minecraft;
+ File versionFolder = new File(minecraftFolder, "versions/" + version + "/");
versionFolder.mkdirs();
- File versionJson = new File(versionFolder, "BBOR-" + version + ".json");
+ File versionJson = new File(versionFolder, version + ".json");
Files.copy(Installer.class.getResourceAsStream("/profile.json"), versionJson.toPath(), StandardCopyOption.REPLACE_EXISTING);
try {
File profilesJson = new File(minecraftFolder, "launcher_profiles.json");
if (profilesJson.exists()) {
- String identifier = "\"bbor-" + mcVersion + "\"";
+ String identifier = "\"" + version.toLowerCase() + "\"";
String contents = new String(Files.readAllBytes(profilesJson.toPath()));
if (contents.contains(identifier)) {
contents = contents.replaceAll(",\n?\\s*" + identifier + "\\s*:\\s*\\{[^}]*},", ",");
" \"type\": \"custom\",\n" +
" \"created\": \"" + date + "T00:00:00.000Z\",\n" +
" \"lastUsed\": \"2100-01-01T00:00:00.000Z\",\n" +
- " \"lastVersionId\": \"BBOR-" + version + "\"\n" +
+ " \"lastVersionId\": \"" + version + "\"\n" +
" },\n");
Files.write(profilesJson.toPath(), contents.getBytes());
if (source.startsWith("/") && osName.contains("win")) {
source = source.substring(1);
}
- File mainJar = new File(minecraftFolder, "libraries/com/irtimaled/bbor/" + version + "/bbor-" + version + ".jar");
+ File mainJar = new File(minecraftFolder, "libraries/com/irtimaled/bbor/" + Versions.minecraft + "/" + version.toLowerCase() + ".jar");
mainJar.getParentFile().mkdirs();
Files.copy(Paths.get(source), mainJar.toPath(), StandardCopyOption.REPLACE_EXISTING);
} catch (Throwable t) {
}
JOptionPane.showMessageDialog(null,
- "Bounding Box Outline Reloaded " + version + " has been successfully installed!\n" +
+ "Bounding Box Outline Reloaded " + Versions.build + " for " + Versions.minecraft + " has been successfully installed!\n" +
"\n" +
"Re-open the Minecraft Launcher to see it in the dropdown.",
"Bounding Box Outline Reloaded Installer", JOptionPane.INFORMATION_MESSAGE);
{
"inheritsFrom": "${mcVersion}",
- "id": "BBOR-${version}",
+ "id": "BBOR-${mcVersion}",
"jar": "${mcVersion}",
"time": "${formattedTime}",
"type": "release",
"mainClass": "net.minecraft.launchwrapper.Launch",
"libraries": [
{
- "name": "com.irtimaled:bbor:${version}",
+ "name": "com.irtimaled:bbor:${mcVersion}",
"url": "https://github.com/irtimaled/maven/releases/download/"
},
{