From 6ec77160996d80cb5671906e3c807a4e625fa1a3 Mon Sep 17 00:00:00 2001 From: Darien Johnson <84008186+CADIndie@users.noreply.github.com> Date: Mon, 4 Dec 2023 00:42:16 -0500 Subject: [PATCH 1/7] Fix RAM Setter --- lib/src/main/java/pojlib/api/API_V1.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/main/java/pojlib/api/API_V1.java b/lib/src/main/java/pojlib/api/API_V1.java index 1d650ec7..1ba885ce 100644 --- a/lib/src/main/java/pojlib/api/API_V1.java +++ b/lib/src/main/java/pojlib/api/API_V1.java @@ -51,7 +51,7 @@ public class API_V1 { public static String currentDownload; public static String profileImage; public static String profileName; - public static String memoryValue = "3072"; + public static String memoryValue; public static boolean developerMods; public static MinecraftAccount currentAcc; public static boolean advancedDebugger; From 1c4d1eafe62ce837137fdd776874b65ade61dc40 Mon Sep 17 00:00:00 2001 From: The Judge <53906078+thejudge156@users.noreply.github.com> Date: Sun, 3 Dec 2023 21:45:34 -0800 Subject: [PATCH 2/7] Update devmods.json --- devmods.json | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/devmods.json b/devmods.json index 02c27ca4..f97ecbf6 100644 --- a/devmods.json +++ b/devmods.json @@ -2,8 +2,8 @@ "1.20.2": [ { "slug": "Vivecraft", - "version": "1.0", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v1.0-1.20.2-LTS/vivecraft.jar" + "version": "1.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.2/vivecraft.jar" }, { "slug": "Fabric-API", @@ -79,8 +79,8 @@ "1.20.1": [ { "slug": "Vivecraft", - "version": "1.0.2", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v1.0-1.20.1-LTS/vivecraft.jar" + "version": "1.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.1/vivecraft.jar" }, { "slug": "Fabric-API", @@ -161,8 +161,8 @@ "1.19.4": [ { "slug": "Vivecraft", - "version": "1.0.2", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v1.0-1.19.4-LTS/vivecraft.jar" + "version": "1.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.19.4/vivecraft.jar" }, { "slug": "Fabric-API", @@ -263,8 +263,8 @@ "1.19.2": [ { "slug": "Vivecraft", - "version": "1.0.1", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v1.0-1.19-LTS/vivecraft.jar" + "version": "1.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.19.2/vivecraft.jar" }, { "slug": "Fabric-API", @@ -355,8 +355,8 @@ "1.18.2": [ { "slug": "Vivecraft", - "version": "1.0.1", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v1.0-1.18.2-LTS/vivecraft.jar" + "version": "1.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.18.2/vivecraft.jar" }, { "slug": "Fabric-API", From 251d140ef015c68fd0347e0e7999364a71420ba6 Mon Sep 17 00:00:00 2001 From: The Judge <53906078+thejudge156@users.noreply.github.com> Date: Sun, 3 Dec 2023 22:37:59 -0800 Subject: [PATCH 3/7] Fix 1.19.2 --- devmods.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devmods.json b/devmods.json index f97ecbf6..d59bcfff 100644 --- a/devmods.json +++ b/devmods.json @@ -263,7 +263,7 @@ "1.19.2": [ { "slug": "Vivecraft", - "version": "1.1", + "version": "1.1.1", "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.19.2/vivecraft.jar" }, { From 599a19538de0f779e2bad1f8152636feeb4bc137 Mon Sep 17 00:00:00 2001 From: The Judge <53906078+thejudge156@users.noreply.github.com> Date: Sun, 3 Dec 2023 22:49:02 -0800 Subject: [PATCH 4/7] Fix 1.18.2 --- devmods.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devmods.json b/devmods.json index d59bcfff..078b3e0e 100644 --- a/devmods.json +++ b/devmods.json @@ -355,7 +355,7 @@ "1.18.2": [ { "slug": "Vivecraft", - "version": "1.1", + "version": "1.1.1", "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.18.2/vivecraft.jar" }, { From 7dfbef317faec9b28eaa7757c04630fc5389b9d0 Mon Sep 17 00:00:00 2001 From: The Judge <53906078+thejudge156@users.noreply.github.com> Date: Mon, 4 Dec 2023 08:42:38 -0800 Subject: [PATCH 5/7] Lets try this again --- devmods.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devmods.json b/devmods.json index 078b3e0e..4ddca403 100644 --- a/devmods.json +++ b/devmods.json @@ -263,7 +263,7 @@ "1.19.2": [ { "slug": "Vivecraft", - "version": "1.1.1", + "version": "1.1.2", "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.19.2/vivecraft.jar" }, { @@ -355,7 +355,7 @@ "1.18.2": [ { "slug": "Vivecraft", - "version": "1.1.1", + "version": "1.1.2", "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.18.2/vivecraft.jar" }, { From dcb2d15d0d5839f78733cff08dfe3337393e06a8 Mon Sep 17 00:00:00 2001 From: Florian Reintgen <85225228+HowToCodeDE@users.noreply.github.com> Date: Mon, 4 Dec 2023 17:46:41 +0100 Subject: [PATCH 6/7] Updating Fabric API for 1.20.1 to 0.89.0 for mod compatibility (#29) * bump Fabric API for 1.20.1 to 0.89.0 for mod compat --- devmods.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devmods.json b/devmods.json index 4ddca403..184ce896 100644 --- a/devmods.json +++ b/devmods.json @@ -84,8 +84,8 @@ }, { "slug": "Fabric-API", - "version": "0.87.0", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/lcnQpW9C/fabric-api-0.87.0%2B1.20.1.jar" + "version": "0.89.0", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/1sf8i9fy/fabric-api-0.89.0%2B1.20.1.jar" }, { "slug": "Lithium", From 7e7e050f164c0a59180754f5d21235875b3d1b27 Mon Sep 17 00:00:00 2001 From: Darien Johnson <84008186+CADIndie@users.noreply.github.com> Date: Fri, 8 Dec 2023 23:03:45 -0500 Subject: [PATCH 7/7] Mod Loader Switching --- lib/src/main/java/pojlib/api/API_V1.java | 22 +++--------- .../pojlib/instance/MinecraftInstance.java | 36 ++++++++++++++++--- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/lib/src/main/java/pojlib/api/API_V1.java b/lib/src/main/java/pojlib/api/API_V1.java index 24fc7825..7f6b38d2 100644 --- a/lib/src/main/java/pojlib/api/API_V1.java +++ b/lib/src/main/java/pojlib/api/API_V1.java @@ -86,21 +86,6 @@ public static String getQCSupportedVersionName(MinecraftMeta.MinecraftVersion ve return APIHandler.getQCSupportedVersionName(version); } - /** - * A collection of loader types - */ - public enum ModLoader { - Vanilla(0), - Fabric(1), - Quilt(2); - - public final int index; - - ModLoader(int i) { - this.index = i; - } - } - /** * Loads an instance from the filesystem. * @@ -119,17 +104,18 @@ public static MinecraftInstance load(String instanceName, String gameDir) { * @param instanceName The name of the instance being created - can be anything, used for identification * @param home The base directory where minecraft should be setup * @param minecraftVersion The version of minecraft to install + * @param modLoader The mod loader to install * @return A minecraft instance object * @throws IOException Throws if download of library or asset fails */ - public static MinecraftInstance createNewInstance(Activity activity, String instanceName, String home, MinecraftMeta.MinecraftVersion minecraftVersion) throws IOException { + public static MinecraftInstance createNewInstance(Activity activity, String instanceName, String home, MinecraftMeta.MinecraftVersion minecraftVersion, MinecraftInstance.ModLoader modLoader) throws IOException { if(ignoreInstanceName) { - return MinecraftInstance.create(activity, instanceName, home, minecraftVersion); + return MinecraftInstance.create(activity, instanceName, home, minecraftVersion, modLoader); } else if (instanceName.contains("/") || instanceName.contains("!")) { throw new IOException("You cannot use special characters (!, /, ., etc) when creating instances."); } else { - return MinecraftInstance.create(activity, instanceName, home, minecraftVersion); + return MinecraftInstance.create(activity, instanceName, home, minecraftVersion, modLoader); } } diff --git a/lib/src/main/java/pojlib/instance/MinecraftInstance.java b/lib/src/main/java/pojlib/instance/MinecraftInstance.java index 4402e835..c890072e 100644 --- a/lib/src/main/java/pojlib/instance/MinecraftInstance.java +++ b/lib/src/main/java/pojlib/instance/MinecraftInstance.java @@ -39,26 +39,54 @@ public class MinecraftInstance { public String assetsDir; public String mainClass; + public enum ModLoader { + Fabric(0), + Quilt(1), + Forge(2), + NeoForge(3); + + public final int index; + + ModLoader(int i) { + this.index = i; + } + } + //creates a new instance of a minecraft version, install game + mod loader, stores non login related launch info to json - public static MinecraftInstance create(Activity activity, String instanceName, String gameDir, MinecraftMeta.MinecraftVersion minecraftVersion) throws IOException { + public static MinecraftInstance create(Activity activity, String instanceName, String gameDir, MinecraftMeta.MinecraftVersion minecraftVersion, ModLoader modLoader) throws IOException { Logger.getInstance().appendToLog("Creating new instance: " + instanceName); MinecraftInstance instance = new MinecraftInstance(); instance.versionName = minecraftVersion.id; instance.gameDir = new File(gameDir).getAbsolutePath(); + VersionInfo modLoaderVersionInfo = null; + switch (modLoader) { + case Fabric: { + FabricMeta.FabricVersion fabricVersion = FabricMeta.getLatestStableVersion(); + modLoaderVersionInfo = FabricMeta.getVersionInfo(fabricVersion, minecraftVersion); + } + case Quilt: { + QuiltMeta.QuiltVersion quiltVersion = QuiltMeta.getLatestVersion(); + modLoaderVersionInfo = QuiltMeta.getVersionInfo(quiltVersion, minecraftVersion); + } + default: { + FabricMeta.FabricVersion fabricVersion = FabricMeta.getLatestStableVersion(); + modLoaderVersionInfo = FabricMeta.getVersionInfo(fabricVersion, minecraftVersion); + } + } + VersionInfo minecraftVersionInfo = MinecraftMeta.getVersionInfo(minecraftVersion); instance.versionType = minecraftVersionInfo.type; - FabricMeta.FabricVersion fabricVersion = FabricMeta.getLatestStableVersion(); - VersionInfo modLoaderVersionInfo = FabricMeta.getVersionInfo(fabricVersion, minecraftVersion); instance.mainClass = modLoaderVersionInfo.mainClass; // Install minecraft + VersionInfo finalModLoaderVersionInfo = modLoaderVersionInfo; new Thread(() -> { try { String clientClasspath = Installer.installClient(minecraftVersionInfo, gameDir); String minecraftClasspath = Installer.installLibraries(minecraftVersionInfo, gameDir); - String modLoaderClasspath = Installer.installLibraries(modLoaderVersionInfo, gameDir); + String modLoaderClasspath = Installer.installLibraries(finalModLoaderVersionInfo, gameDir); String lwjgl = Installer.installLwjgl(activity); instance.classpath = clientClasspath + File.pathSeparator + minecraftClasspath + File.pathSeparator + modLoaderClasspath + File.pathSeparator + lwjgl;