From 9487b952b109e3d18cc359cd344d7da43ad8ba96 Mon Sep 17 00:00:00 2001 From: The Judge Date: Wed, 10 Apr 2024 17:54:05 -0700 Subject: [PATCH 01/27] WHOOPS --- coremods.json | 94 -------- devmods.json | 100 +++++---- mods.json | 209 +++++++++++++++--- .../pojlib/instance/MinecraftInstance.java | 123 +++-------- src/main/java/pojlib/util/APIHandler.java | 6 +- src/main/java/pojlib/util/CustomMods.java | 16 -- src/main/java/pojlib/util/InstanceJson.java | 22 ++ .../util/{CoreMods.java => ModsJson.java} | 7 +- 8 files changed, 297 insertions(+), 280 deletions(-) delete mode 100644 coremods.json delete mode 100644 src/main/java/pojlib/util/CustomMods.java create mode 100644 src/main/java/pojlib/util/InstanceJson.java rename src/main/java/pojlib/util/{CoreMods.java => ModsJson.java} (74%) diff --git a/coremods.json b/coremods.json deleted file mode 100644 index 1a113a46..00000000 --- a/coremods.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "versions": [ - { - "name": "1.20.4", - "mods": [ - { - "slug": "Vivecraft", - "version": "1.0", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.4/vivecraft.jar" - }, - { - "slug": "Fabric-API", - "version": "0.91.2", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/yGY1P8Yr/fabric-api-0.91.2%2B1.20.4.jar" - } - ] - }, - { - "name": "1.20.2", - "mods": [ - { - "slug": "Vivecraft", - "version": "1.1.1", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.2/vivecraft.jar" - }, - { - "slug": "Fabric-API", - "version": "0.91.1", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/qg6wQgub/fabric-api-0.91.1%2B1.20.2.jar" - } - ] - }, - { - "name": "1.20.1", - "mods": [ - { - "slug": "Vivecraft", - "version": "1.1.1", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.1/vivecraft.jar" - }, - { - "slug": "Fabric-API", - "version": "0.91.0", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/YblXfKtI/fabric-api-0.91.0%2B1.20.1.jar" - } - ] - }, - { - "name": "1.19.4", - "mods": [ - { - "slug": "Vivecraft", - "version": "1.1.1", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.19.4/vivecraft.jar" - }, - { - "slug": "Fabric-API", - "version": "0.87.2", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/nyAmoHlr/fabric-api-0.87.2%2B1.19.4.jar" - } - ] - }, - { - "name": "1.19.2", - "mods": [ - { - "slug": "Vivecraft", - "version": "1.1.3", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.19.2/vivecraft.jar" - }, - { - "slug": "Fabric-API", - "version": "0.77.0", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/6g95K303/fabric-api-0.77.0%2B1.19.2.jar" - } - ] - }, - { - "name": "1.18.2", - "mods": [ - { - "slug": "Vivecraft", - "version": "1.1.3", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.18.2/vivecraft.jar" - }, - { - "slug": "Fabric-API", - "version": "0.77.0", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/qk28POfr/fabric-api-0.77.0%2B1.18.2.jar" - } - ] - } - ] -} diff --git a/devmods.json b/devmods.json index a5ff92a6..d3bbacb8 100644 --- a/devmods.json +++ b/devmods.json @@ -2,7 +2,7 @@ "versions": [ { "name": "1.20.4", - "mods": [ + "coreMods": [ { "slug": "Vivecraft", "version": "1.0", @@ -10,13 +10,15 @@ }, { "slug": "Fabric-API", - "version": "0.96.11", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/htRy7kbI/fabric-api-0.96.11%2B1.20.4.jar" - }, + "version": "0.91.2", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/yGY1P8Yr/fabric-api-0.91.2%2B1.20.4.jar" + } + ], + "defaultMods": [ { "slug": "Sodium", - "version": "0.5.8", - "download_link": "https://github.com/QuestCraftPlusPlus/sodium-fabric/releases/download/mc1.20.4-0.5.8/sodium-fabric-0.5.8+mc1.20.4.jar" + "version": "0.5.5", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/InGKdfel/sodium-fabric-mc1.20.3-0.5.5.jar" }, { "slug": "Cloth-Config", @@ -45,8 +47,8 @@ }, { "slug": "Simple-Voice-Chat", - "version": "2.5.1", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/lobOF2Co/voicechat-fabric-1.20.4-2.5.1.jar" + "version": "2.4.30", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/kp8RtRlH/voicechat-fabric-1.20.4-2.4.30.jar" }, { "slug": "Modern-Fix", @@ -57,7 +59,7 @@ }, { "name": "1.20.2", - "mods": [ + "coreMods": [ { "slug": "Vivecraft", "version": "1.1.1", @@ -67,7 +69,9 @@ "slug": "Fabric-API", "version": "0.91.1", "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/qg6wQgub/fabric-api-0.91.1%2B1.20.2.jar" - }, + } + ], + "defaultMods": [ { "slug": "Lithium", "version": "0.12.0", @@ -85,8 +89,8 @@ }, { "slug": "Sodium", - "version": "0.5.5.1", - "download_link": "https://github.com/QuestCraftPlusPlus/sodium-fabric/releases/download/mc1.20.2-0.5.5/sodium-fabric-mc1.20.2-0.5.5.jar" + "version": "0.5.5", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/pmgeU5yX/sodium-fabric-mc1.20.2-0.5.5.jar" }, { "slug": "Cloth-Config", @@ -126,23 +130,18 @@ { "slug": "Simple-Voice-Chat", "version": "2.4.28", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/Pq4BryXi/voicechat-fabric-1.20.2-2.5.1.jar" + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/5XcFdUYz/voicechat-fabric-1.20.2-2.4.28.jar" }, { "slug": "Modern-Fix", "version": "5.9.0", "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/FDGaMHFj/modernfix-fabric-5.9.0%2Bmc1.20.1.jar" - }, - { - "slug": "EBE", - "version": "0.9.1", - "download_link": "https://cdn.modrinth.com/data/OVuFYfre/versions/eIFo7wvq/enhancedblockentities-0.9.1%2B1.20.2.jar" } ] }, { "name": "1.20.1", - "mods": [ + "coreMods": [ { "slug": "Vivecraft", "version": "1.1.1", @@ -152,7 +151,9 @@ "slug": "Fabric-API", "version": "0.91.0", "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/YblXfKtI/fabric-api-0.91.0%2B1.20.1.jar" - }, + } + ], + "defaultMods": [ { "slug": "Lithium", "version": "0.11.2", @@ -170,8 +171,8 @@ }, { "slug": "Sodium", - "version": "0.5.8", - "download_link": "https://github.com/QuestCraftPlusPlus/sodium-fabric/releases/download/mc1.20.1-0.5.8/sodium-fabric-0.5.8+mc1.20.1.jar" + "version": "0.5.2", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/6SSPmLc9/sodium-fabric-mc1.20.1-0.5.2.jar" }, { "slug": "Cloth-Config", @@ -185,8 +186,8 @@ }, { "slug": "Fabric-Language-Kotlin", - "version": "1.10.19+kotlin.1.9.23", - "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/ZMokinzs/fabric-language-kotlin-1.10.19%2Bkotlin.1.9.23.jar" + "version": "1.9.5+kotlin.1.8.22", + "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/ADg3gvlr/fabric-language-kotlin-1.9.5%2Bkotlin.1.8.22.jar" }, { "slug": "Krypton", @@ -215,8 +216,8 @@ }, { "slug": "Simple-Voice-Chat", - "version": "2.5.1", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/ot113WbU/voicechat-fabric-1.20.1-2.5.1.jar" + "version": "2.4.12", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/NkZguN8n/voicechat-fabric-1.20.1-2.4.12.jar" }, { "slug": "Modern-Fix", @@ -227,7 +228,7 @@ }, { "name": "1.19.4", - "mods": [ + "coreMods": [ { "slug": "Vivecraft", "version": "1.1.1", @@ -237,11 +238,13 @@ "slug": "Fabric-API", "version": "0.87.2", "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/nyAmoHlr/fabric-api-0.87.2%2B1.19.4.jar" - }, + } + ], + "defaultMods": [ { "slug": "Simple-Voice-Chat", - "version": "2.5.1", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/u7rKquVn/voicechat-fabric-1.19.4-2.5.1.jar" + "version": "2.4.10", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/cgPK1BnP/voicechat-fabric-1.19.4-2.4.10.jar" }, { "slug": "Lithium", @@ -263,6 +266,11 @@ "version": "1.6.2", "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/UvJN5Cy4/entityculling-fabric-1.6.2-mc1.19.4.jar" }, + { + "slug": "Sodium", + "version": "0.4.10", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/b4hTi3mo/sodium-fabric-mc1.19.4-0.4.10%2Bbuild.24.jar" + }, { "slug": "Cloth-Config", "version": "9.0.94", @@ -327,7 +335,7 @@ }, { "name": "1.19.2", - "mods": [ + "coreMods": [ { "slug": "Vivecraft", "version": "1.1.3", @@ -337,7 +345,9 @@ "slug": "Fabric-API", "version": "0.77.0", "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/6g95K303/fabric-api-0.77.0%2B1.19.2.jar" - }, + } + ], + "defaultMods": [ { "slug": "LazyDFU", "version": "1.3", @@ -345,8 +355,8 @@ }, { "slug": "Simple-Voice-Chat", - "version": "2.5.1", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/KfPEtgDQ/voicechat-fabric-1.19.2-2.5.1.jar" + "version": "2.4.10", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/onVH7UO9/voicechat-fabric-1.19.2-2.4.10.jar" }, { "slug": "Lithium", @@ -368,6 +378,11 @@ "version": "1.6.1", "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/twdGLDHv/entityculling-fabric-1.6.1-mc1.19.2.jar" }, + { + "slug": "Sodium", + "version": "0.4.4", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/rAfhHfow/sodium-fabric-mc1.19.2-0.4.4%2Bbuild.18.jar" + }, { "slug": "Cloth-Config", "version": "8.2.88", @@ -417,7 +432,7 @@ }, { "name": "1.18.2", - "mods": [ + "coreMods": [ { "slug": "Vivecraft", "version": "1.1.3", @@ -427,7 +442,9 @@ "slug": "Fabric-API", "version": "0.77.0", "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/qk28POfr/fabric-api-0.77.0%2B1.18.2.jar" - }, + } + ], + "defaultMods": [ { "slug": "LazyDFU", "version": "1.2", @@ -435,8 +452,8 @@ }, { "slug": "Simple-Voice-Chat", - "version": "2.5.1", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/oz82VCKL/voicechat-fabric-1.18.2-2.5.1.jar" + "version": "2.4.10", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/QKFGOJUD/voicechat-fabric-1.18.2-2.4.10.jar" }, { "slug": "Lithium", @@ -458,6 +475,11 @@ "version": "1.5.1", "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/1.5.1-fabric-1.18/entityculling-fabric-mc1.18-1.5.1.jar" }, + { + "slug": "Sodium", + "version": "0.4.1", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/mc1.18.2-0.4.1/sodium-fabric-mc1.18.2-0.4.1%2Bbuild.15.jar" + }, { "slug": "Better-Biome-Blend", "version": "1.3.5", @@ -511,4 +533,4 @@ ] } ] -} +} \ No newline at end of file diff --git a/mods.json b/mods.json index df973231..5ef0fb25 100644 --- a/mods.json +++ b/mods.json @@ -1,18 +1,159 @@ { "versions": [ + { + "name": "1.20.4", + "coreMods": [ + { + "slug": "Vivecraft", + "version": "1.0", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.4/vivecraft.jar" + }, + { + "slug": "Fabric-API", + "version": "0.91.2", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/yGY1P8Yr/fabric-api-0.91.2%2B1.20.4.jar" + } + ], + "defaultMods": [ + { + "slug": "Sodium", + "version": "0.5.5", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/InGKdfel/sodium-fabric-mc1.20.3-0.5.5.jar" + }, + { + "slug": "Cloth-Config", + "version": "13.0.114", + "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/YFpDLLdu/cloth-config-13.0.114-fabric.jar" + }, + { + "slug": "Fabric-Language-Kotlin", + "version": "1.10.16+kotlin.1.9.21", + "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/VJUqKopR/fabric-language-kotlin-1.10.16%2Bkotlin.1.9.21.jar" + }, + { + "slug": "Server-Core", + "version": "1.4.0", + "download_link": "https://cdn.modrinth.com/data/4WWQxlQP/versions/H1fXXdNC/servercore-fabric-1.4.0%2B1.20.3.jar" + }, + { + "slug": "C2me", + "version": "0.2.0+alpha.11.38", + "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/o0DcaA0L/c2me-fabric-mc1.20.4-0.2.0%2Balpha.11.38.jar" + }, + { + "slug": "ImmediatelyFast", + "version": "1.2.8", + "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/3EgIBnht/ImmediatelyFast-Fabric-1.2.8%2B1.20.4.jar" + }, + { + "slug": "Simple-Voice-Chat", + "version": "2.4.30", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/kp8RtRlH/voicechat-fabric-1.20.4-2.4.30.jar" + }, + { + "slug": "Modern-Fix", + "version": "5.10.0", + "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/vxDb5tOq/modernfix-fabric-5.10.0%2Bmc1.20.3.jar" + } + ] + }, + { + "name": "1.20.2", + "coreMods": [ + { + "slug": "Vivecraft", + "version": "1.1.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.2/vivecraft.jar" + }, + { + "slug": "Fabric-API", + "version": "0.91.1", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/qg6wQgub/fabric-api-0.91.1%2B1.20.2.jar" + } + ], + "defaultMods": [ + { + "slug": "Lithium", + "version": "0.12.0", + "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/qdzL5Hkg/lithium-fabric-mc1.20.2-0.12.0.jar" + }, + { + "slug": "Ferrite-Core", + "version": "6.0.1", + "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/unerR5MN/ferritecore-6.0.1-fabric.jar" + }, + { + "slug": "Entity-Culling", + "version": "1.6.2", + "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/BDwHAdWc/entityculling-fabric-1.6.2-mc1.20.1.jar" + }, + { + "slug": "Sodium", + "version": "0.5.5", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/pmgeU5yX/sodium-fabric-mc1.20.2-0.5.5.jar" + }, + { + "slug": "Cloth-Config", + "version": "12.0.109", + "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/LnfolBYb/cloth-config-12.0.109-fabric.jar" + }, + { + "slug": "Fabric-Language-Kotlin", + "version": "1.10.13+kotlin.1.9.20", + "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/atZwzPrT/fabric-language-kotlin-1.10.13%2Bkotlin.1.9.20.jar" + }, + { + "slug": "Krypton", + "version": "0.2.4", + "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/cQ60Ouax/krypton-0.2.4.jar" + }, + { + "slug": "Server-Core", + "version": "1.3.9", + "download_link": "https://cdn.modrinth.com/data/4WWQxlQP/versions/sicenHyA/servercore-fabric-1.3.9%2B1.20.2.jar" + }, + { + "slug": "Mod-Menu", + "version": "8.0.0", + "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/TwfjidT5/modmenu-8.0.0.jar" + }, + { + "slug": "C2me", + "version": "0.2.0+alpha.10.126", + "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/ilKwGRiJ/c2me-fabric-mc1.20.2-0.2.0%2Balpha.10.126.jar" + }, + { + "slug": "ImmediatelyFast", + "version": "1.2.6", + "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/mbeaDZtb/ImmediatelyFast-1.2.6%2B1.20.2.jar" + }, + { + "slug": "Simple-Voice-Chat", + "version": "2.4.28", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/5XcFdUYz/voicechat-fabric-1.20.2-2.4.28.jar" + }, + { + "slug": "Modern-Fix", + "version": "5.9.0", + "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/FDGaMHFj/modernfix-fabric-5.9.0%2Bmc1.20.1.jar" + } + ] + }, { "name": "1.20.1", - "mods": [ + "coreMods": [ { "slug": "Vivecraft", - "version": "0.2", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v0.1-1.20-Zink/vivecraft.jar" + "version": "1.1.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.1/vivecraft.jar" }, { "slug": "Fabric-API", "version": "0.91.0", "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/YblXfKtI/fabric-api-0.91.0%2B1.20.1.jar" - }, + } + ], + "defaultMods": [ { "slug": "Lithium", "version": "0.11.2", @@ -30,8 +171,8 @@ }, { "slug": "Sodium", - "version": "0.5.3", - "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/4OZL6q9h/sodium-fabric-mc1.20.1-0.5.3.jar" + "version": "0.5.2", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/6SSPmLc9/sodium-fabric-mc1.20.1-0.5.2.jar" }, { "slug": "Cloth-Config", @@ -75,38 +216,35 @@ }, { "slug": "Simple-Voice-Chat", - "version": "2.5.1", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/ot113WbU/voicechat-fabric-1.20.1-2.5.1.jar" + "version": "2.4.12", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/NkZguN8n/voicechat-fabric-1.20.1-2.4.12.jar" }, { "slug": "Modern-Fix", "version": "5.9.0", "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/FDGaMHFj/modernfix-fabric-5.9.0%2Bmc1.20.1.jar" - }, - { - "slug": "Fabric-Language-Kotlin", - "version": "1.9.5+kotlin.1.8.22", - "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/ADg3gvlr/fabric-language-kotlin-1.9.5%2Bkotlin.1.8.22.jar" } ] }, { "name": "1.19.4", - "mods": [ + "coreMods": [ { "slug": "Vivecraft", - "version": "0.1", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v0.1-1.19.4-Zink/vivecraft.jar" + "version": "1.1.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.19.4/vivecraft.jar" }, { "slug": "Fabric-API", "version": "0.87.2", "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/nyAmoHlr/fabric-api-0.87.2%2B1.19.4.jar" - }, + } + ], + "defaultMods": [ { "slug": "Simple-Voice-Chat", - "version": "2.5.1", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/u7rKquVn/voicechat-fabric-1.19.4-2.5.1.jar" + "version": "2.4.10", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/cgPK1BnP/voicechat-fabric-1.19.4-2.4.10.jar" }, { "slug": "Lithium", @@ -192,27 +330,24 @@ "slug": "Modern-Fix", "version": "5.7.2", "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/LXlsO4Vo/modernfix-fabric-5.7.2%2Bmc1.19.4.jar" - }, - { - "slug": "Fabric-Language-Kotlin", - "version": "1.9.3+kotlin.1.8.20", - "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/MkcO8aQ0/fabric-language-kotlin-1.9.3%2Bkotlin.1.8.20.jar" } ] }, { "name": "1.19.2", - "mods": [ + "coreMods": [ { "slug": "Vivecraft", - "version": "0.1", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v0.1-1.19.2-Zink/vivecraft.jar" + "version": "1.1.3", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.19.2/vivecraft.jar" }, { "slug": "Fabric-API", "version": "0.77.0", "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/6g95K303/fabric-api-0.77.0%2B1.19.2.jar" - }, + } + ], + "defaultMods": [ { "slug": "LazyDFU", "version": "1.3", @@ -220,8 +355,8 @@ }, { "slug": "Simple-Voice-Chat", - "version": "2.5.1", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/KfPEtgDQ/voicechat-fabric-1.19.2-2.5.1.jar" + "version": "2.4.10", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/onVH7UO9/voicechat-fabric-1.19.2-2.4.10.jar" }, { "slug": "Lithium", @@ -297,17 +432,19 @@ }, { "name": "1.18.2", - "mods": [ + "coreMods": [ { "slug": "Vivecraft", - "version": "0.1", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v0.1-1.18.2-Zink/vivecraft.jar" + "version": "1.1.3", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.18.2/vivecraft.jar" }, { "slug": "Fabric-API", "version": "0.77.0", "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/qk28POfr/fabric-api-0.77.0%2B1.18.2.jar" - }, + } + ], + "defaultMods": [ { "slug": "LazyDFU", "version": "1.2", @@ -315,8 +452,8 @@ }, { "slug": "Simple-Voice-Chat", - "version": "2.5.1", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/oz82VCKL/voicechat-fabric-1.18.2-2.5.1.jar" + "version": "2.4.10", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/QKFGOJUD/voicechat-fabric-1.18.2-2.4.10.jar" }, { "slug": "Lithium", diff --git a/src/main/java/pojlib/instance/MinecraftInstance.java b/src/main/java/pojlib/instance/MinecraftInstance.java index d420eb65..6e70cc7f 100644 --- a/src/main/java/pojlib/instance/MinecraftInstance.java +++ b/src/main/java/pojlib/instance/MinecraftInstance.java @@ -22,8 +22,8 @@ import pojlib.install.QuiltMeta; import pojlib.install.VersionInfo; import pojlib.util.Constants; -import pojlib.util.CoreMods; -import pojlib.util.CustomMods; +import pojlib.util.ModsJson; +import pojlib.util.InstanceJson; import pojlib.util.DownloadUtils; import pojlib.util.FileUtil; import pojlib.util.GsonUtils; @@ -135,6 +135,7 @@ private static synchronized void updateInstancesJson(String gameDir, MinecraftIn instancesJson.addProperty("instanceVersion", instance.versionName); instancesJson.addProperty("gameDir", instance.gameDir); + instancesArray.add(instancesJson); GsonUtils.objectToJsonFile(instancesFilePath, instancesArray); @@ -172,73 +173,21 @@ public List generateLaunchArgs(MinecraftAccount account) { return allArgs; } - public void updateOrDownloadMods() { + public void updateOrDownloadMods() throws Exception{ API_V1.finishedDownloading = false; new Thread(() -> { - try { - File mods = new File(Constants.USER_HOME + "/mods-new.json"); - File modsOld = new File(Constants.USER_HOME + "/mods.json"); - File customMods = new File(Constants.USER_HOME + "/custom_mods.json"); - - if (API_V1.developerMods) { - DownloadUtils.downloadFile(DEV_MODS, mods); - } else { DownloadUtils.downloadFile(MODS, mods); } - - CustomMods customModsObj = GsonUtils.jsonFileToObject(customMods.getAbsolutePath(), CustomMods.class); - CoreMods obj = GsonUtils.jsonFileToObject(mods.getAbsolutePath(), CoreMods.class); - CoreMods objOld = GsonUtils.jsonFileToObject(modsOld.getAbsolutePath(), CoreMods.class); - - if(customMods.exists()) { - assert customModsObj != null; - for(CustomMods.InstanceMods instMods : customModsObj.instances) { - if(!instMods.version.equals(this.versionName)) { - continue; - } - for(CustomMods.ModInfo info : instMods.mods) { - API_V1.currentDownload = info.name; - DownloadUtils.downloadFile(info.url, new File(Constants.MC_DIR + "/mods/" + this.versionName + "/" + info.name + ".jar")); - } - } - } - boolean downloadAll = !(new File(Constants.MC_DIR + "/mods/" + this.versionName).exists()); - - if(modsOld.exists()) { - for(CoreMods.Version version : objOld.versions) { - if(!version.name.equals(this.versionName)) { - continue; - } - for(CoreMods.Mod mod : version.mods) { - for(CoreMods.Version newVer : obj.versions) { - if (!newVer.name.equals(this.versionName)) { - continue; - } - for(CoreMods.Mod newMod : newVer.mods) { - if((!newMod.version.equals(mod.version) || downloadAll) && newMod.slug.equals(mod.slug)) { - API_V1.currentDownload = newMod.slug; - DownloadUtils.downloadFile(newMod.download_link, new File(Constants.MC_DIR + "/mods/" + this.versionName + "/" + newMod.slug + ".jar")); - } - } - } - } - } - } else { - for(CoreMods.Version version : obj.versions) { - if (!version.name.equals(this.versionName)) { - continue; - } - for(CoreMods.Mod mod : version.mods) { - API_V1.currentDownload = mod.slug; - DownloadUtils.downloadFile(mod.download_link, new File(Constants.MC_DIR + "/mods/" + this.versionName + "/" + mod.slug + ".jar")); - } - } - } + File coreMods = new File(Constants.USER_HOME + "/coreMods.json"); + File instances = new File(Constants.USER_HOME + "/instances.json"); - FileUtils.copyFile(mods, modsOld); - mods.delete(); - } catch (IOException e) { - e.printStackTrace(); + if (API_V1.developerMods) { + DownloadUtils.downloadFile(DEV_MODS, coreMods); + } else { + DownloadUtils.downloadFile(MODS, coreMods); } + CustomModsJson customModsObj = GsonUtils.jsonFileToObject(customMods.getAbsolutePath(), CustomModsJson.class); + ModsJson obj = GsonUtils.jsonFileToObject(mods.getAbsolutePath(), ModsJson.class); + API_V1.finishedDownloading = true; }).start(); } @@ -246,12 +195,12 @@ public void updateOrDownloadMods() { public void addCustomMod(String name, String version, String url) { File customMods = new File(Constants.MC_DIR, CUSTOM_MODS); if(!customMods.exists()) { - CustomMods mods = new CustomMods(); - mods.instances = new CustomMods.InstanceMods[1]; - mods.instances[0] = new CustomMods.InstanceMods(); + CustomModsJson mods = new CustomModsJson(); + mods.instances = new CustomModsJson.InstanceMods[1]; + mods.instances[0] = new CustomModsJson.InstanceMods(); mods.instances[0].version = this.versionName; - mods.instances[0].mods = new CustomMods.ModInfo[1]; - mods.instances[0].mods[0] = new CustomMods.ModInfo(); + mods.instances[0].mods = new CustomModsJson.ModInfo[1]; + mods.instances[0].mods[0] = new CustomModsJson.ModInfo(); mods.instances[0].mods[0].name = name; mods.instances[0].mods[0].version = version; mods.instances[0].mods[0].url = url; @@ -260,17 +209,17 @@ public void addCustomMod(String name, String version, String url) { return; } - CustomMods mods = GsonUtils.jsonFileToObject(customMods.getPath(), CustomMods.class); - for(CustomMods.InstanceMods instance : mods.instances) { + CustomModsJson mods = GsonUtils.jsonFileToObject(customMods.getPath(), CustomModsJson.class); + for(CustomModsJson.InstanceMods instance : mods.instances) { if(instance.version.equals(this.versionName)) { - ArrayList modInfoArray = new ArrayList<>(Arrays.asList(instance.mods)); - CustomMods.ModInfo info = new CustomMods.ModInfo(); + ArrayList modInfoArray = new ArrayList<>(Arrays.asList(instance.mods)); + CustomModsJson.ModInfo info = new CustomModsJson.ModInfo(); info.name = name; info.version = version; info.url = url; modInfoArray.add(info); - CustomMods.ModInfo[] infos = new CustomMods.ModInfo[modInfoArray.size()]; + CustomModsJson.ModInfo[] infos = new CustomModsJson.ModInfo[modInfoArray.size()]; infos = modInfoArray.toArray(infos); instance.mods = infos; @@ -280,18 +229,18 @@ public void addCustomMod(String name, String version, String url) { } // If instance does not exist in file, create it - ArrayList instanceInfo = new ArrayList<>(Arrays.asList(mods.instances)); - CustomMods.InstanceMods instMods = new CustomMods.InstanceMods(); + ArrayList instanceInfo = new ArrayList<>(Arrays.asList(mods.instances)); + CustomModsJson.InstanceMods instMods = new CustomModsJson.InstanceMods(); instMods.version = this.versionName; - instMods.mods = new CustomMods.ModInfo[1]; - instMods.mods[0] = new CustomMods.ModInfo(); + instMods.mods = new CustomModsJson.ModInfo[1]; + instMods.mods[0] = new CustomModsJson.ModInfo(); instMods.mods[0].name = name; instMods.mods[0].version = version; instMods.mods[0].url = url; instanceInfo.add(instanceInfo.size(), instMods); // Set the array - mods.instances = instanceInfo.toArray(new CustomMods.InstanceMods[0]); + mods.instances = instanceInfo.toArray(new CustomModsJson.InstanceMods[0]); GsonUtils.objectToJsonFile(customMods.getAbsolutePath(), mods); } @@ -301,11 +250,11 @@ public boolean hasCustomMod(String name) throws IOException { return false; } - CustomMods mods = GsonUtils.jsonFileToObject(customMods.getPath(), CustomMods.class); + CustomModsJson mods = GsonUtils.jsonFileToObject(customMods.getPath(), CustomModsJson.class); assert mods != null; - for(CustomMods.InstanceMods instance : mods.instances) { + for(CustomModsJson.InstanceMods instance : mods.instances) { if(instance.version.equals(this.versionName)) { - for (CustomMods.ModInfo info : instance.mods) { + for (CustomModsJson.ModInfo info : instance.mods) { // Check if core mod is already included File modsOld = new File(Constants.USER_HOME + "/mods.json"); if(!modsOld.exists()) { @@ -352,17 +301,17 @@ public boolean removeMod(String name) { } } - CustomMods mods = GsonUtils.jsonFileToObject(customMods.getAbsolutePath(), CustomMods.class); + CustomModsJson mods = GsonUtils.jsonFileToObject(customMods.getAbsolutePath(), CustomModsJson.class); assert mods != null; - for(CustomMods.InstanceMods instance : mods.instances) { + for(CustomModsJson.InstanceMods instance : mods.instances) { if(instance.version.equals(this.versionName)) { - for (CustomMods.ModInfo info : instance.mods) { + for (CustomModsJson.ModInfo info : instance.mods) { if(info.name.equals(name)) { - ArrayList modInfoArray = new ArrayList<>(Arrays.asList(instance.mods)); + ArrayList modInfoArray = new ArrayList<>(Arrays.asList(instance.mods)); File mod = new File(Constants.MC_DIR + "/mods/" + this.versionName + "/" + info.name + ".jar"); mod.delete(); modInfoArray.remove(info); - instance.mods = modInfoArray.toArray(new CustomMods.ModInfo[0]); + instance.mods = modInfoArray.toArray(new CustomModsJson.ModInfo[0]); GsonUtils.objectToJsonFile(customMods.getAbsolutePath(), mods); return true; } diff --git a/src/main/java/pojlib/util/APIHandler.java b/src/main/java/pojlib/util/APIHandler.java index 4d5d590f..2d4156b1 100644 --- a/src/main/java/pojlib/util/APIHandler.java +++ b/src/main/java/pojlib/util/APIHandler.java @@ -4,7 +4,6 @@ import static pojlib.instance.MinecraftInstance.MODS; import com.google.gson.Gson; -import com.google.gson.JsonObject; import java.io.*; import java.net.HttpURLConnection; @@ -16,7 +15,6 @@ import pojlib.api.API_V1; import pojlib.install.MinecraftMeta; -import pojlib.instance.MinecraftInstance; public class APIHandler { public final String baseUrl; @@ -113,8 +111,8 @@ public static MinecraftMeta.MinecraftVersion[] getQCSupportedVersions() throws I DownloadUtils.downloadFile(DEV_MODS, mods); } else { DownloadUtils.downloadFile(MODS, mods); } - CoreMods modsJson = GsonUtils.jsonFileToObject(mods.getAbsolutePath(), CoreMods.class); - for(CoreMods.Version version : modsJson.versions) { + ModsJson modsJson = GsonUtils.jsonFileToObject(mods.getAbsolutePath(), ModsJson.class); + for(ModsJson.Version version : modsJson.versions) { MinecraftMeta.MinecraftVersion[] versions = MinecraftMeta.getVersions(); for(MinecraftMeta.MinecraftVersion mcVer : versions) { if(mcVer.id.equals(version.name)) { diff --git a/src/main/java/pojlib/util/CustomMods.java b/src/main/java/pojlib/util/CustomMods.java deleted file mode 100644 index e53275ec..00000000 --- a/src/main/java/pojlib/util/CustomMods.java +++ /dev/null @@ -1,16 +0,0 @@ -package pojlib.util; - -public class CustomMods { - public InstanceMods[] instances; - - public static class InstanceMods { - public String version; - public ModInfo[] mods; - } - - public static class ModInfo { - public String name; - public String version; - public String url; - } -} diff --git a/src/main/java/pojlib/util/InstanceJson.java b/src/main/java/pojlib/util/InstanceJson.java new file mode 100644 index 00000000..0d5a82ad --- /dev/null +++ b/src/main/java/pojlib/util/InstanceJson.java @@ -0,0 +1,22 @@ +package pojlib.util; + +public class InstanceJson { + public Instance[] instances; + + public static class Instance { + public String instanceName; + public String instanceVersion; + public String modsDir; + public ModInfo[] mods; + } + + public static class ModInfo { + public String name; + public String version; + public String url; + } + + public void updateInstance() { + + } +} diff --git a/src/main/java/pojlib/util/CoreMods.java b/src/main/java/pojlib/util/ModsJson.java similarity index 74% rename from src/main/java/pojlib/util/CoreMods.java rename to src/main/java/pojlib/util/ModsJson.java index 87e98494..c7ad68f2 100644 --- a/src/main/java/pojlib/util/CoreMods.java +++ b/src/main/java/pojlib/util/ModsJson.java @@ -1,13 +1,12 @@ package pojlib.util; -import java.util.List; - -public class CoreMods { +public class ModsJson { public Version[] versions; public static class Version { public String name; - public Mod[] mods; + public Mod[] coreMods; + public Mod[] defaultMods; } public static class Mod { From c2dd986416c24bcd661519b6096641b03ddb3eff Mon Sep 17 00:00:00 2001 From: The Judge Date: Thu, 11 Apr 2024 20:15:20 -0700 Subject: [PATCH 02/27] Finish Instance Refactor --- src/main/java/pojlib/api/API_V1.java | 57 ++- .../java/pojlib/instance/InstanceHandler.java | 182 ++++++++++ .../pojlib/instance/MinecraftInstance.java | 335 ------------------ .../pojlib/instance/MinecraftInstances.java | 109 ++++++ src/main/java/pojlib/util/APIHandler.java | 11 +- src/main/java/pojlib/util/InstanceJson.java | 22 -- src/main/java/pojlib/util/ModInfo.java | 7 + src/main/java/pojlib/util/ModsJson.java | 14 +- 8 files changed, 335 insertions(+), 402 deletions(-) create mode 100644 src/main/java/pojlib/instance/InstanceHandler.java delete mode 100644 src/main/java/pojlib/instance/MinecraftInstance.java create mode 100644 src/main/java/pojlib/instance/MinecraftInstances.java delete mode 100644 src/main/java/pojlib/util/InstanceJson.java create mode 100644 src/main/java/pojlib/util/ModInfo.java diff --git a/src/main/java/pojlib/api/API_V1.java b/src/main/java/pojlib/api/API_V1.java index 1a453c71..a63289ad 100644 --- a/src/main/java/pojlib/api/API_V1.java +++ b/src/main/java/pojlib/api/API_V1.java @@ -4,33 +4,17 @@ import android.content.Context; import android.net.ConnectivityManager; import android.net.NetworkCapabilities; -import android.net.NetworkInfo; -import android.util.Log; import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import org.json.JSONException; - -import pojlib.UnityPlayerActivity; import pojlib.account.MinecraftAccount; import pojlib.install.*; -import pojlib.instance.MinecraftInstance; +import pojlib.instance.InstanceHandler; +import pojlib.instance.MinecraftInstances; import pojlib.util.APIHandler; -import pojlib.util.Constants; import pojlib.util.LoginHelper; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.net.URL; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; import java.util.Date; /** @@ -65,20 +49,23 @@ public static MinecraftMeta.MinecraftVersion[] getMinecraftVersions() { return MinecraftMeta.getVersions(); } - public static void addCustomMod(MinecraftInstance instance, String name, String version, String url) { - instance.addCustomMod(name, version, url); + public static void addMod(MinecraftInstances instances, MinecraftInstances.Instance instance, + String home, String name, String version, String url) { + InstanceHandler.addMod(instances, instance, home, name, version, url); } - public static boolean hasMod(MinecraftInstance instance, String name) throws IOException { - return instance.hasCustomMod(name); + public static boolean hasMod(MinecraftInstances.Instance instance, String name) { + return InstanceHandler.hasMod(instance, name); } /** * @return if the operation succeeds */ - public static boolean removeMod(MinecraftInstance instance, String name) { - return instance.removeMod(name); + public static boolean removeMod(MinecraftInstances instances, MinecraftInstances.Instance instance, + String home, String name) { + return InstanceHandler.removeMod(instances, instance, home, name); } + public static MinecraftMeta.MinecraftVersion[] getQCSupportedVersions() throws IOException { return APIHandler.getQCSupportedVersions(); } @@ -88,14 +75,17 @@ public static String getQCSupportedVersionName(MinecraftMeta.MinecraftVersion ve } /** - * Loads an instance from the filesystem. + * Loads all instances from the filesystem. * - * @param instanceName The instance being loaded * @param gameDir .minecraft directory. * @return A minecraft instance object */ - public static MinecraftInstance load(String instanceName, String gameDir) { - return MinecraftInstance.load(instanceName, gameDir); + public static MinecraftInstances loadAll(String gameDir) { + return InstanceHandler.load(gameDir); + } + + public static MinecraftInstances.Instance load(MinecraftInstances instances, String name) { + return instances.load(name); } /** @@ -109,19 +99,20 @@ public static MinecraftInstance load(String instanceName, String gameDir) { * @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, MinecraftInstance.ModLoader modLoader) throws IOException { + public static MinecraftInstances.Instance createNewInstance(Activity activity, String instanceName, String home, + MinecraftMeta.MinecraftVersion minecraftVersion, InstanceHandler.ModLoader modLoader, String modsFolderName) throws IOException { if(ignoreInstanceName) { - return MinecraftInstance.create(activity, instanceName, home, minecraftVersion, modLoader); + return InstanceHandler.create(activity, instanceName, home, minecraftVersion, modLoader, modsFolderName); } 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, modLoader); + return InstanceHandler.create(activity, instanceName, home, minecraftVersion, modLoader, modsFolderName); } } - public static void launchInstance(Activity activity, MinecraftAccount account, MinecraftInstance instance) { - instance.launchInstance(activity, account); + public static void launchInstance(Activity activity, MinecraftAccount account, MinecraftInstances.Instance instance) { + InstanceHandler.launchInstance(activity, account, instance); } /** diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java new file mode 100644 index 00000000..c4da6249 --- /dev/null +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -0,0 +1,182 @@ +package pojlib.instance; + +import android.app.Activity; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; + +import pojlib.account.MinecraftAccount; +import pojlib.api.API_V1; +import pojlib.install.FabricMeta; +import pojlib.install.Installer; +import pojlib.install.MinecraftMeta; +import pojlib.install.QuiltMeta; +import pojlib.install.VersionInfo; +import pojlib.util.Constants; +import pojlib.util.ModInfo; +import pojlib.util.ModsJson; +import pojlib.util.DownloadUtils; +import pojlib.util.GsonUtils; +import pojlib.util.JREUtils; +import pojlib.util.Logger; +import pojlib.util.VLoader; + +public class InstanceHandler { + public static final String MODS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/QuestCraft/mods.json"; + public static final String DEV_MODS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/QuestCraft/devmods.json"; + + 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 MinecraftInstances.Instance create(Activity activity, String instanceName, String gameDir, MinecraftMeta.MinecraftVersion minecraftVersion, ModLoader modLoader, String modsFolderName) { + Logger.getInstance().appendToLog("Creating new instance: " + instanceName); + + MinecraftInstances.Instance instance = new MinecraftInstances.Instance(); + instance.instanceName = instanceName; + instance.versionName = minecraftVersion.id; + instance.gameDir = new File(gameDir).getAbsolutePath(); + if(modsFolderName != null) { + instance.modsDirName = modsFolderName; + } else { + instance.modsDirName = instance.versionName; + } + + VersionInfo modLoaderVersionInfo = null; + switch (modLoader) { + case Fabric: { + FabricMeta.FabricVersion fabricVersion = FabricMeta.getLatestStableVersion(); + assert fabricVersion != null; + modLoaderVersionInfo = FabricMeta.getVersionInfo(fabricVersion, minecraftVersion); + break; + } + case Quilt: { + QuiltMeta.QuiltVersion quiltVersion = QuiltMeta.getLatestVersion(); + assert quiltVersion != null; + modLoaderVersionInfo = QuiltMeta.getVersionInfo(quiltVersion, minecraftVersion); + break; + } + case Forge: + case NeoForge: + { + System.out.println("Error!: You cannot use Forge or NeoForge with QuestCraft!"); + break; + } + } + + VersionInfo minecraftVersionInfo = MinecraftMeta.getVersionInfo(minecraftVersion); + instance.versionType = minecraftVersionInfo.type; + 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(finalModLoaderVersionInfo, gameDir); + String lwjgl = Installer.installLwjgl(activity); + + instance.classpath = clientClasspath + File.pathSeparator + minecraftClasspath + File.pathSeparator + modLoaderClasspath + File.pathSeparator + lwjgl; + + instance.assetsDir = Installer.installAssets(minecraftVersionInfo, gameDir, activity); + } catch (IOException e) { + e.printStackTrace(); + } + instance.assetIndex = minecraftVersionInfo.assetIndex.id; + + MinecraftInstances instances; + try { + instances = GsonUtils.jsonFileToObject(gameDir + "/instances.json", MinecraftInstances.class); + } catch (Exception e) { + instances = new MinecraftInstances(); + } + assert instances != null; + instances.instances.add(instance); + + // Write instance to json file + GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); + API_V1.finishedDownloading = true; + }).start(); + + return instance; + } + + // Load an instance from json + public static MinecraftInstances load(String gameDir) { + return GsonUtils.jsonFileToObject(gameDir + "/instances.json", MinecraftInstances.class); + } + + public static void addMod(MinecraftInstances instances, MinecraftInstances.Instance instance, + String gameDir, String name, String version, String url) { + ModInfo info = new ModInfo(); + info.name = name; + info.url = url; + info.version = version; + + instance.mods.add(info); + + GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); + } + + public static boolean hasMod(MinecraftInstances.Instance instance, String name) { + for(ModInfo info : instance.mods) { + if(info.name.equals(name)) { + return true; + } + } + + return false; + } + + public static boolean removeMod(MinecraftInstances instances, MinecraftInstances.Instance instance, String gameDir, String name) { + ModInfo oldInfo = null; + for(ModInfo info : instance.mods) { + if(info.name.equals(name)) { + oldInfo = info; + break; + } + } + + if(oldInfo != null) { + instance.mods.remove(oldInfo); + GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); + } + + return oldInfo != null; + } + + // Return true if instance was deleted + public static boolean delete(MinecraftInstances instances, MinecraftInstances.Instance instance, String gameDir) { + instances.instances.remove(instance); + GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); + + return true; + } + + public static void launchInstance(Activity activity, MinecraftAccount account, MinecraftInstances.Instance instance) { + try { + JREUtils.redirectAndPrintJRELog(); + VLoader.setAndroidInitInfo(activity); + while(!API_V1.finishedDownloading); + JREUtils.launchJavaVM(activity, instance.generateLaunchArgs(account), instance.versionName); + } catch (Throwable e) { + e.printStackTrace(); + } + } +} \ No newline at end of file diff --git a/src/main/java/pojlib/instance/MinecraftInstance.java b/src/main/java/pojlib/instance/MinecraftInstance.java deleted file mode 100644 index 6e70cc7f..00000000 --- a/src/main/java/pojlib/instance/MinecraftInstance.java +++ /dev/null @@ -1,335 +0,0 @@ -package pojlib.instance; - -import android.app.Activity; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - -import org.apache.commons.io.FileUtils; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import pojlib.account.MinecraftAccount; -import pojlib.api.API_V1; -import pojlib.install.FabricMeta; -import pojlib.install.Installer; -import pojlib.install.MinecraftMeta; -import pojlib.install.QuiltMeta; -import pojlib.install.VersionInfo; -import pojlib.util.Constants; -import pojlib.util.ModsJson; -import pojlib.util.InstanceJson; -import pojlib.util.DownloadUtils; -import pojlib.util.FileUtil; -import pojlib.util.GsonUtils; -import pojlib.util.JREUtils; -import pojlib.util.Logger; -import pojlib.util.VLoader; - -public class MinecraftInstance { - public static final String MODS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/QuestCraft/mods.json"; - public static final String DEV_MODS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/QuestCraft/devmods.json"; - public static final String CUSTOM_MODS = "custom_mods.json"; - public String versionName; - public String instanceName; - public String versionType; - public String classpath; - public String gameDir; - public String assetIndex; - 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, ModLoader modLoader) { - Logger.getInstance().appendToLog("Creating new instance: " + instanceName); - - MinecraftInstance instance = new MinecraftInstance(); - instance.instanceName = instanceName; - instance.versionName = minecraftVersion.id; - instance.gameDir = new File(gameDir).getAbsolutePath(); - - VersionInfo modLoaderVersionInfo = null; - switch (modLoader) { - case Fabric: { - FabricMeta.FabricVersion fabricVersion = FabricMeta.getLatestStableVersion(); - assert fabricVersion != null; - modLoaderVersionInfo = FabricMeta.getVersionInfo(fabricVersion, minecraftVersion); - break; - } - case Quilt: { - QuiltMeta.QuiltVersion quiltVersion = QuiltMeta.getLatestVersion(); - assert quiltVersion != null; - modLoaderVersionInfo = QuiltMeta.getVersionInfo(quiltVersion, minecraftVersion); - break; - } - case Forge: - case NeoForge: - { - System.out.println("Error!: You cannot use Forge or NeoForge with QuestCraft!"); - break; - } - } - - VersionInfo minecraftVersionInfo = MinecraftMeta.getVersionInfo(minecraftVersion); - instance.versionType = minecraftVersionInfo.type; - 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(finalModLoaderVersionInfo, gameDir); - String lwjgl = Installer.installLwjgl(activity); - - instance.classpath = clientClasspath + File.pathSeparator + minecraftClasspath + File.pathSeparator + modLoaderClasspath + File.pathSeparator + lwjgl; - - instance.assetsDir = Installer.installAssets(minecraftVersionInfo, gameDir, activity); - } catch (IOException e) { - e.printStackTrace(); - } - instance.assetIndex = minecraftVersionInfo.assetIndex.id; - - // Write instance to json file - GsonUtils.objectToJsonFile(gameDir + "/instances/" + instanceName + "/instance.json", instance); - API_V1.finishedDownloading = true; - }).start(); - - updateInstancesJson(gameDir, instance); - return instance; - } - - private static synchronized void updateInstancesJson(String gameDir, MinecraftInstance instance) { - String instancesFilePath = gameDir + "/instances.json"; - JsonArray instancesArray; - - try { - if (new File(instancesFilePath).exists()) { - String jsonContent = FileUtil.read(instancesFilePath); - instancesArray = GsonUtils.GLOBAL_GSON.fromJson(jsonContent, JsonArray.class); - } else { - instancesArray = new JsonArray(); - } - - JsonObject instancesJson = new JsonObject(); - instancesJson.addProperty("instanceName", instance.instanceName); - instancesJson.addProperty("instanceVersion", instance.versionName); - instancesJson.addProperty("gameDir", instance.gameDir); - - - instancesArray.add(instancesJson); - - GsonUtils.objectToJsonFile(instancesFilePath, instancesArray); - } catch (IOException e) { - e.printStackTrace(); - } - } - - // Load an instance from json - public static MinecraftInstance load(String instanceName, String gameDir) { - String path = gameDir + "/instances/" + instanceName + "/instance.json"; - return GsonUtils.jsonFileToObject(path, MinecraftInstance.class); - } - - // Return true if instance was deleted - public static boolean delete(String instanceName, String gameDir) throws IOException { - if (API_V1.ignoreInstanceName) { - return new File(gameDir + "/instances/" + instanceName).delete(); - } else if (instanceName.contains("/") || instanceName.contains("!")) { - throw new IOException("You cannot use special characters (!, /, ., etc) when deleting instances."); - } else { - return new File(gameDir + "/instances/" + instanceName).delete(); - } - - } - - public List generateLaunchArgs(MinecraftAccount account) { - String[] mcArgs = {"--username", account.username, "--version", versionName, "--gameDir", gameDir, - "--assetsDir", assetsDir, "--assetIndex", assetIndex, "--uuid", account.uuid.replaceAll("-", ""), - "--accessToken", account.accessToken, "--userType", account.userType, "--versionType", versionType}; - - List allArgs = new ArrayList<>(Arrays.asList("-cp", classpath)); - allArgs.add(mainClass); - allArgs.addAll(Arrays.asList(mcArgs)); - return allArgs; - } - - public void updateOrDownloadMods() throws Exception{ - API_V1.finishedDownloading = false; - new Thread(() -> { - File coreMods = new File(Constants.USER_HOME + "/coreMods.json"); - File instances = new File(Constants.USER_HOME + "/instances.json"); - - if (API_V1.developerMods) { - DownloadUtils.downloadFile(DEV_MODS, coreMods); - } else { - DownloadUtils.downloadFile(MODS, coreMods); - } - - CustomModsJson customModsObj = GsonUtils.jsonFileToObject(customMods.getAbsolutePath(), CustomModsJson.class); - ModsJson obj = GsonUtils.jsonFileToObject(mods.getAbsolutePath(), ModsJson.class); - - API_V1.finishedDownloading = true; - }).start(); - } - - public void addCustomMod(String name, String version, String url) { - File customMods = new File(Constants.MC_DIR, CUSTOM_MODS); - if(!customMods.exists()) { - CustomModsJson mods = new CustomModsJson(); - mods.instances = new CustomModsJson.InstanceMods[1]; - mods.instances[0] = new CustomModsJson.InstanceMods(); - mods.instances[0].version = this.versionName; - mods.instances[0].mods = new CustomModsJson.ModInfo[1]; - mods.instances[0].mods[0] = new CustomModsJson.ModInfo(); - mods.instances[0].mods[0].name = name; - mods.instances[0].mods[0].version = version; - mods.instances[0].mods[0].url = url; - - GsonUtils.objectToJsonFile(customMods.getPath(), mods); - return; - } - - CustomModsJson mods = GsonUtils.jsonFileToObject(customMods.getPath(), CustomModsJson.class); - for(CustomModsJson.InstanceMods instance : mods.instances) { - if(instance.version.equals(this.versionName)) { - ArrayList modInfoArray = new ArrayList<>(Arrays.asList(instance.mods)); - CustomModsJson.ModInfo info = new CustomModsJson.ModInfo(); - info.name = name; - info.version = version; - info.url = url; - modInfoArray.add(info); - - CustomModsJson.ModInfo[] infos = new CustomModsJson.ModInfo[modInfoArray.size()]; - infos = modInfoArray.toArray(infos); - - instance.mods = infos; - GsonUtils.objectToJsonFile(customMods.getPath(), mods); - return; - } - } - - // If instance does not exist in file, create it - ArrayList instanceInfo = new ArrayList<>(Arrays.asList(mods.instances)); - CustomModsJson.InstanceMods instMods = new CustomModsJson.InstanceMods(); - instMods.version = this.versionName; - instMods.mods = new CustomModsJson.ModInfo[1]; - instMods.mods[0] = new CustomModsJson.ModInfo(); - instMods.mods[0].name = name; - instMods.mods[0].version = version; - instMods.mods[0].url = url; - instanceInfo.add(instanceInfo.size(), instMods); - - // Set the array - mods.instances = instanceInfo.toArray(new CustomModsJson.InstanceMods[0]); - GsonUtils.objectToJsonFile(customMods.getAbsolutePath(), mods); - } - - public boolean hasCustomMod(String name) throws IOException { - File customMods = new File(Constants.MC_DIR, CUSTOM_MODS); - if(!customMods.exists()) { - return false; - } - - CustomModsJson mods = GsonUtils.jsonFileToObject(customMods.getPath(), CustomModsJson.class); - assert mods != null; - for(CustomModsJson.InstanceMods instance : mods.instances) { - if(instance.version.equals(this.versionName)) { - for (CustomModsJson.ModInfo info : instance.mods) { - // Check if core mod is already included - File modsOld = new File(Constants.USER_HOME + "/mods.json"); - if(!modsOld.exists()) { - if (API_V1.developerMods) { - DownloadUtils.downloadFile(DEV_MODS, modsOld); - } else { DownloadUtils.downloadFile(MODS, modsOld); } - } - JsonObject objOld = GsonUtils.jsonFileToObject(modsOld.getAbsolutePath(), JsonObject.class); - assert objOld != null; - for (JsonElement verMod : objOld.getAsJsonArray(this.versionName)) { - JsonObject object = verMod.getAsJsonObject(); - String slug = object.get("slug").getAsString(); - if(name.equalsIgnoreCase(slug)) { - return true; - } - } - if(info.name.equalsIgnoreCase(name)) { - return true; - } - } - break; - } - } - return false; - } - - public boolean removeMod(String name) { - File customMods = new File(Constants.MC_DIR, CUSTOM_MODS); - if(!customMods.exists()) { - return false; - } - - // Check if core mod is already included, if so, don't delete - File modsOld = new File(Constants.USER_HOME + "/mods.json"); - if(modsOld.exists()) { - JsonObject objOld = GsonUtils.jsonFileToObject(modsOld.getAbsolutePath(), JsonObject.class); - assert objOld != null; - for (JsonElement verMod : objOld.getAsJsonArray(this.versionName)) { - JsonObject object = verMod.getAsJsonObject(); - String slug = object.get("slug").getAsString().replace("-", " "); - if(name.equals(slug)) { - return false; - } - } - } - - CustomModsJson mods = GsonUtils.jsonFileToObject(customMods.getAbsolutePath(), CustomModsJson.class); - assert mods != null; - for(CustomModsJson.InstanceMods instance : mods.instances) { - if(instance.version.equals(this.versionName)) { - for (CustomModsJson.ModInfo info : instance.mods) { - if(info.name.equals(name)) { - ArrayList modInfoArray = new ArrayList<>(Arrays.asList(instance.mods)); - File mod = new File(Constants.MC_DIR + "/mods/" + this.versionName + "/" + info.name + ".jar"); - mod.delete(); - modInfoArray.remove(info); - instance.mods = modInfoArray.toArray(new CustomModsJson.ModInfo[0]); - GsonUtils.objectToJsonFile(customMods.getAbsolutePath(), mods); - return true; - } - } - break; - } - } - return false; - } - - public void launchInstance(Activity activity, MinecraftAccount account) { - try { - JREUtils.redirectAndPrintJRELog(); - VLoader.setAndroidInitInfo(activity); - while(!API_V1.finishedDownloading); - JREUtils.launchJavaVM(activity, generateLaunchArgs(account), versionName); - } catch (Throwable e) { - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/src/main/java/pojlib/instance/MinecraftInstances.java b/src/main/java/pojlib/instance/MinecraftInstances.java new file mode 100644 index 00000000..191de124 --- /dev/null +++ b/src/main/java/pojlib/instance/MinecraftInstances.java @@ -0,0 +1,109 @@ +package pojlib.instance; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import pojlib.account.MinecraftAccount; +import pojlib.api.API_V1; +import pojlib.util.DownloadUtils; +import pojlib.util.GsonUtils; +import pojlib.util.Logger; +import pojlib.util.ModInfo; +import pojlib.util.ModsJson; + +public class MinecraftInstances { + public ArrayList instances; + + public Instance load(String name) { + for(Instance instance : instances) { + if(instance.instanceName.equals(name)) { + return instance; + } + } + + return null; + } + + public static class Instance { + public String instanceName; + public String versionName; + public String modsDirName; + public String versionType; + public String classpath; + public String gameDir; + public String assetIndex; + public String assetsDir; + public String mainClass; + public ArrayList mods; + + public List generateLaunchArgs(MinecraftAccount account) { + String[] mcArgs = {"--username", account.username, "--version", versionName, "--gameDir", gameDir, + "--assetsDir", assetsDir, "--assetIndex", assetIndex, "--uuid", account.uuid.replaceAll("-", ""), + "--accessToken", account.accessToken, "--userType", account.userType, "--versionType", versionType}; + + List allArgs = new ArrayList<>(Arrays.asList("-cp", classpath)); + allArgs.add(mainClass); + allArgs.addAll(Arrays.asList(mcArgs)); + return allArgs; + } + + private ModsJson parseModsJson(String gameDir) throws Exception { + File mods = new File(gameDir + "mods.json"); + if(API_V1.developerMods) { + DownloadUtils.downloadFile(InstanceHandler.DEV_MODS, mods); + } else { + DownloadUtils.downloadFile(InstanceHandler.MODS, mods); + } + + return GsonUtils.jsonFileToObject(mods.getAbsolutePath(), ModsJson.class); + } + + public void updateMods(String gameDir) { + try { + ModsJson modsJson = parseModsJson(gameDir); + + ModsJson.Version version = null; + for(ModsJson.Version info : modsJson.versions) { + if(!info.name.equals(versionName)) { + continue; + } + version = info; + break; + } + + assert version != null; + for(ModInfo info : version.coreMods) { + for(ModInfo currInfo : mods) { + if(!currInfo.name.equals(info.name)) { + continue; + } + if(currInfo.version.equals(info.version)) { + continue; + } + + File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.name); + DownloadUtils.downloadFile(info.url, mod); + } + } + + for(ModInfo info : version.defaultMods) { + for(ModInfo currInfo : mods) { + if(!currInfo.name.equals(info.name)) { + continue; + } + if(currInfo.version.equals(info.version)) { + continue; + } + + File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.name); + DownloadUtils.downloadFile(info.url, mod); + } + } + } catch (Exception e) { + Logger.getInstance().appendToLog("Mods failed to download! Are you offline?\n" + e.getMessage()); + } + } + } +} diff --git a/src/main/java/pojlib/util/APIHandler.java b/src/main/java/pojlib/util/APIHandler.java index 2d4156b1..2959cf6b 100644 --- a/src/main/java/pojlib/util/APIHandler.java +++ b/src/main/java/pojlib/util/APIHandler.java @@ -1,11 +1,16 @@ package pojlib.util; -import static pojlib.instance.MinecraftInstance.DEV_MODS; -import static pojlib.instance.MinecraftInstance.MODS; +import static pojlib.instance.InstanceHandler.DEV_MODS; +import static pojlib.instance.InstanceHandler.MODS; import com.google.gson.Gson; -import java.io.*; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; diff --git a/src/main/java/pojlib/util/InstanceJson.java b/src/main/java/pojlib/util/InstanceJson.java deleted file mode 100644 index 0d5a82ad..00000000 --- a/src/main/java/pojlib/util/InstanceJson.java +++ /dev/null @@ -1,22 +0,0 @@ -package pojlib.util; - -public class InstanceJson { - public Instance[] instances; - - public static class Instance { - public String instanceName; - public String instanceVersion; - public String modsDir; - public ModInfo[] mods; - } - - public static class ModInfo { - public String name; - public String version; - public String url; - } - - public void updateInstance() { - - } -} diff --git a/src/main/java/pojlib/util/ModInfo.java b/src/main/java/pojlib/util/ModInfo.java new file mode 100644 index 00000000..d26f4ec6 --- /dev/null +++ b/src/main/java/pojlib/util/ModInfo.java @@ -0,0 +1,7 @@ +package pojlib.util; + +public class ModInfo { + public String name; + public String version; + public String url; +} \ No newline at end of file diff --git a/src/main/java/pojlib/util/ModsJson.java b/src/main/java/pojlib/util/ModsJson.java index c7ad68f2..3fe432f4 100644 --- a/src/main/java/pojlib/util/ModsJson.java +++ b/src/main/java/pojlib/util/ModsJson.java @@ -1,17 +1,13 @@ package pojlib.util; +import java.util.ArrayList; + public class ModsJson { - public Version[] versions; + public ArrayList versions; public static class Version { public String name; - public Mod[] coreMods; - public Mod[] defaultMods; - } - - public static class Mod { - public String slug; - public String version; - public String download_link; + public ArrayList coreMods; + public ArrayList defaultMods; } } From 7b5ae4dff6508c2a38de663cc5838cf90d263d7f Mon Sep 17 00:00:00 2001 From: The Judge Date: Thu, 11 Apr 2024 20:22:22 -0700 Subject: [PATCH 03/27] Add deletion, fix mod dir and default mods --- src/main/java/pojlib/api/API_V1.java | 10 ++++--- .../java/pojlib/instance/InstanceHandler.java | 7 +++-- .../pojlib/instance/MinecraftInstances.java | 26 ++++++++++++------- src/main/java/pojlib/util/JREUtils.java | 4 +-- 4 files changed, 30 insertions(+), 17 deletions(-) diff --git a/src/main/java/pojlib/api/API_V1.java b/src/main/java/pojlib/api/API_V1.java index a63289ad..819e5927 100644 --- a/src/main/java/pojlib/api/API_V1.java +++ b/src/main/java/pojlib/api/API_V1.java @@ -88,6 +88,10 @@ public static MinecraftInstances.Instance load(MinecraftInstances instances, Str return instances.load(name); } + public static boolean deleteInstance(MinecraftInstances instances, MinecraftInstances.Instance instance, String gameDir) { + return InstanceHandler.delete(instances, instance, gameDir); + } + /** * Creates a new game instance with a selected mod loader. The latest version of the mod loader will be installed * @@ -99,15 +103,15 @@ public static MinecraftInstances.Instance load(MinecraftInstances instances, Str * @return A minecraft instance object * @throws IOException Throws if download of library or asset fails */ - public static MinecraftInstances.Instance createNewInstance(Activity activity, String instanceName, String home, + public static MinecraftInstances.Instance createNewInstance(Activity activity, String instanceName, String home, boolean useDefaultMods, MinecraftMeta.MinecraftVersion minecraftVersion, InstanceHandler.ModLoader modLoader, String modsFolderName) throws IOException { if(ignoreInstanceName) { - return InstanceHandler.create(activity, instanceName, home, minecraftVersion, modLoader, modsFolderName); + return InstanceHandler.create(activity, instanceName, home, useDefaultMods, minecraftVersion, modLoader, modsFolderName); } else if (instanceName.contains("/") || instanceName.contains("!")) { throw new IOException("You cannot use special characters (!, /, ., etc) when creating instances."); } else { - return InstanceHandler.create(activity, instanceName, home, minecraftVersion, modLoader, modsFolderName); + return InstanceHandler.create(activity, instanceName, home, useDefaultMods, minecraftVersion, modLoader, modsFolderName); } } diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index c4da6249..68c6911e 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -44,13 +44,15 @@ public enum ModLoader { } //creates a new instance of a minecraft version, install game + mod loader, stores non login related launch info to json - public static MinecraftInstances.Instance create(Activity activity, String instanceName, String gameDir, MinecraftMeta.MinecraftVersion minecraftVersion, ModLoader modLoader, String modsFolderName) { + public static MinecraftInstances.Instance create(Activity activity, String instanceName, String gameDir, boolean useDefaultMods, + MinecraftMeta.MinecraftVersion minecraftVersion, ModLoader modLoader, String modsFolderName) { Logger.getInstance().appendToLog("Creating new instance: " + instanceName); MinecraftInstances.Instance instance = new MinecraftInstances.Instance(); instance.instanceName = instanceName; instance.versionName = minecraftVersion.id; instance.gameDir = new File(gameDir).getAbsolutePath(); + instance.defaultMods = useDefaultMods; if(modsFolderName != null) { instance.modsDirName = modsFolderName; } else { @@ -173,8 +175,9 @@ public static void launchInstance(Activity activity, MinecraftAccount account, M try { JREUtils.redirectAndPrintJRELog(); VLoader.setAndroidInitInfo(activity); + instance.updateMods(Constants.MC_DIR); while(!API_V1.finishedDownloading); - JREUtils.launchJavaVM(activity, instance.generateLaunchArgs(account), instance.versionName); + JREUtils.launchJavaVM(activity, instance.generateLaunchArgs(account), instance.modsDirName); } catch (Throwable e) { e.printStackTrace(); } diff --git a/src/main/java/pojlib/instance/MinecraftInstances.java b/src/main/java/pojlib/instance/MinecraftInstances.java index 191de124..95572396 100644 --- a/src/main/java/pojlib/instance/MinecraftInstances.java +++ b/src/main/java/pojlib/instance/MinecraftInstances.java @@ -37,6 +37,7 @@ public static class Instance { public String assetsDir; public String mainClass; public ArrayList mods; + public boolean defaultMods; public List generateLaunchArgs(MinecraftAccount account) { String[] mcArgs = {"--username", account.username, "--version", versionName, "--gameDir", gameDir, @@ -61,6 +62,7 @@ private ModsJson parseModsJson(String gameDir) throws Exception { } public void updateMods(String gameDir) { + API_V1.finishedDownloading = false; try { ModsJson modsJson = parseModsJson(gameDir); @@ -88,21 +90,25 @@ public void updateMods(String gameDir) { } } - for(ModInfo info : version.defaultMods) { - for(ModInfo currInfo : mods) { - if(!currInfo.name.equals(info.name)) { - continue; + if(defaultMods) { + for (ModInfo info : version.defaultMods) { + for (ModInfo currInfo : mods) { + if (!currInfo.name.equals(info.name)) { + continue; + } + if (currInfo.version.equals(info.version)) { + continue; + } + + File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.name); + DownloadUtils.downloadFile(info.url, mod); } - if(currInfo.version.equals(info.version)) { - continue; - } - - File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.name); - DownloadUtils.downloadFile(info.url, mod); } } + API_V1.finishedDownloading = true; } catch (Exception e) { Logger.getInstance().appendToLog("Mods failed to download! Are you offline?\n" + e.getMessage()); + API_V1.finishedDownloading = true; } } } diff --git a/src/main/java/pojlib/util/JREUtils.java b/src/main/java/pojlib/util/JREUtils.java index ee620464..ca40a348 100644 --- a/src/main/java/pojlib/util/JREUtils.java +++ b/src/main/java/pojlib/util/JREUtils.java @@ -171,7 +171,7 @@ public static void setJavaEnvironment(Activity activity) throws Throwable { setLdLibraryPath(jvmLibraryPath+":"+LD_LIBRARY_PATH); } - public static int launchJavaVM(final Activity activity, final List JVMArgs, String versionName) throws Throwable { + public static int launchJavaVM(final Activity activity, final List JVMArgs, String modsDirName) throws Throwable { JREUtils.relocateLibPath(activity); setJavaEnvironment(activity); @@ -196,7 +196,7 @@ public static int launchJavaVM(final Activity activity, final List JVMAr userArgs.add("-Dorg.lwjgl.opengl.libname=" + graphicsLib); userArgs.add("-Dorg.lwjgl.opengles.libname=" + "/system/lib64/libGLESv3.so"); userArgs.add("-Dorg.lwjgl.egl.libname=" + "/system/lib64/libEGL_dri.so"); - userArgs.add("-Dfabric.addMods=" + Constants.MC_DIR + "/mods/" + versionName); + userArgs.add("-Dfabric.addMods=" + Constants.MC_DIR + "/mods/" + modsDirName); userArgs.addAll(JVMArgs); System.out.println(JVMArgs); From 16090a8b60b775bcc25a63d86ae881e473e560f2 Mon Sep 17 00:00:00 2001 From: The Judge Date: Fri, 12 Apr 2024 11:23:09 -0700 Subject: [PATCH 04/27] Add javadocs (CAD get better at reading code) --- src/main/java/pojlib/api/API_V1.java | 70 +++++++++++++++++-- .../java/pojlib/instance/InstanceHandler.java | 4 ++ .../pojlib/instance/MinecraftInstances.java | 2 +- 3 files changed, 68 insertions(+), 8 deletions(-) diff --git a/src/main/java/pojlib/api/API_V1.java b/src/main/java/pojlib/api/API_V1.java index 819e5927..869ca41a 100644 --- a/src/main/java/pojlib/api/API_V1.java +++ b/src/main/java/pojlib/api/API_V1.java @@ -49,21 +49,47 @@ public static MinecraftMeta.MinecraftVersion[] getMinecraftVersions() { return MinecraftMeta.getVersions(); } + /** + * Add a mod to an instance + * + * @param instances Acquired from {@link pojlib.api.API_V1#loadAll(String)} + * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, MinecraftMeta.MinecraftVersion, InstanceHandler.ModLoader, String)} + * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} + * @param gameDir .minecraft directory + * @param name Mod name + * @param version Mod version + * @param url Mod download URL + */ public static void addMod(MinecraftInstances instances, MinecraftInstances.Instance instance, - String home, String name, String version, String url) { - InstanceHandler.addMod(instances, instance, home, name, version, url); + String gameDir, String name, String version, String url) { + InstanceHandler.addMod(instances, instance, gameDir, name, version, url); } + /** + * Check if an instance has a mod + * + * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, MinecraftMeta.MinecraftVersion, InstanceHandler.ModLoader, String)} + * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} + * @param name Mod name + * @return True if the mod is already in the instance + */ public static boolean hasMod(MinecraftInstances.Instance instance, String name) { return InstanceHandler.hasMod(instance, name); } /** - * @return if the operation succeeds + * Remove a mod from an instance + * + * @param instances Acquired from {@link pojlib.api.API_V1#loadAll(String)} + * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, MinecraftMeta.MinecraftVersion, InstanceHandler.ModLoader, String)} + * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} + * @param gameDir .minecraft directory + * @param name Mod name + * @return True if the mod was deleted */ public static boolean removeMod(MinecraftInstances instances, MinecraftInstances.Instance instance, - String home, String name) { - return InstanceHandler.removeMod(instances, instance, home, name); + String gameDir, String name) { + return InstanceHandler.removeMod(instances, instance, gameDir, name); } public static MinecraftMeta.MinecraftVersion[] getQCSupportedVersions() throws IOException { @@ -84,10 +110,26 @@ public static MinecraftInstances loadAll(String gameDir) { return InstanceHandler.load(gameDir); } + /** + * Load a specific instance by name + * + * @param instances Acquired from {@link pojlib.api.API_V1#loadAll(String)} + * @param name Name of the instance + * @return The instance, or null if an instance with name does not exist + */ public static MinecraftInstances.Instance load(MinecraftInstances instances, String name) { return instances.load(name); } + /** + * Delete an instance + * NOTE: Only deletes the instance, not the correlated mods for said instance + * + * @param instances Acquired from {@link pojlib.api.API_V1#loadAll(String)} + * @param instance Instance object + * @param gameDir .minecraft directory. + * @return True if it deletes successfully, false otherwise. + */ public static boolean deleteInstance(MinecraftInstances instances, MinecraftInstances.Instance instance, String gameDir) { return InstanceHandler.delete(instances, instance, gameDir); } @@ -98,6 +140,7 @@ public static boolean deleteInstance(MinecraftInstances instances, MinecraftInst * @param activity The active android activity * @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 useDefaultMods Use QC's default mods for the version (Core mods are automatically included) * @param minecraftVersion The version of minecraft to install * @param modLoader The mod loader to install * @return A minecraft instance object @@ -115,6 +158,14 @@ public static MinecraftInstances.Instance createNewInstance(Activity activity, S } } + /** + * Launch an instance + * + * @param activity Android activity object + * @param account Account object + * @param instance Instance object from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, MinecraftMeta.MinecraftVersion, InstanceHandler.ModLoader, String)} + * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} + */ public static void launchInstance(Activity activity, MinecraftAccount account, MinecraftInstances.Instance instance) { InstanceHandler.launchInstance(activity, account, instance); } @@ -122,13 +173,18 @@ public static void launchInstance(Activity activity, MinecraftAccount account, M /** * Logs the user out * - * @param activity The base directory where minecraft should be setup - * @return True if logout was successful + * @param activity The base directory where minecraft should be setup + * @return True if logout was successful */ public static boolean logout(Activity activity) { return MinecraftAccount.logout(activity); } + /** + * Start the login process + * + * @param activity Android activity object + */ public static void login(Activity activity) { ConnectivityManager connManager = (ConnectivityManager) activity.getSystemService(Context.CONNECTIVITY_SERVICE); diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index 68c6911e..7ad03c2f 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -156,6 +156,10 @@ public static boolean removeMod(MinecraftInstances instances, MinecraftInstances } if(oldInfo != null) { + // Delete the mod + File modFile = new File(gameDir + "/mods/" + instance.modsDirName + "/" + name + ".jar"); + modFile.delete(); + instance.mods.remove(oldInfo); GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); } diff --git a/src/main/java/pojlib/instance/MinecraftInstances.java b/src/main/java/pojlib/instance/MinecraftInstances.java index 95572396..b5db3b2b 100644 --- a/src/main/java/pojlib/instance/MinecraftInstances.java +++ b/src/main/java/pojlib/instance/MinecraftInstances.java @@ -100,7 +100,7 @@ public void updateMods(String gameDir) { continue; } - File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.name); + File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.name + ".jar"); DownloadUtils.downloadFile(info.url, mod); } } From 83e2522cb2aa1657cbfc48f9bff7f14fc72f9807 Mon Sep 17 00:00:00 2001 From: The Judge Date: Fri, 12 Apr 2024 12:07:07 -0700 Subject: [PATCH 05/27] Testing fixes --- src/main/java/pojlib/api/API_V1.java | 2 +- src/main/java/pojlib/instance/InstanceHandler.java | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/main/java/pojlib/api/API_V1.java b/src/main/java/pojlib/api/API_V1.java index 869ca41a..fbd3952a 100644 --- a/src/main/java/pojlib/api/API_V1.java +++ b/src/main/java/pojlib/api/API_V1.java @@ -106,7 +106,7 @@ public static String getQCSupportedVersionName(MinecraftMeta.MinecraftVersion ve * @param gameDir .minecraft directory. * @return A minecraft instance object */ - public static MinecraftInstances loadAll(String gameDir) { + public static MinecraftInstances loadAll(String gameDir) throws IOException { return InstanceHandler.load(gameDir); } diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index 7ad03c2f..cc72bdae 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -27,8 +27,8 @@ import pojlib.util.VLoader; public class InstanceHandler { - public static final String MODS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/QuestCraft/mods.json"; - public static final String DEV_MODS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/QuestCraft/devmods.json"; + public static final String MODS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/instance-refactor/mods.json"; + public static final String DEV_MODS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/instance-refactor/devmods.json"; public enum ModLoader { Fabric(0), @@ -121,7 +121,15 @@ public static MinecraftInstances.Instance create(Activity activity, String insta // Load an instance from json public static MinecraftInstances load(String gameDir) { - return GsonUtils.jsonFileToObject(gameDir + "/instances.json", MinecraftInstances.class); + MinecraftInstances instances; + try { + instances = GsonUtils.jsonFileToObject(gameDir + "/instances.json", MinecraftInstances.class); + } catch (Exception e) { + instances = new MinecraftInstances(); + } + assert instances != null; + + return instances; } public static void addMod(MinecraftInstances instances, MinecraftInstances.Instance instance, From 9015fdb97a563320dbd01ee8cdded8dd3792dbcd Mon Sep 17 00:00:00 2001 From: The Judge Date: Fri, 12 Apr 2024 18:28:59 -0700 Subject: [PATCH 06/27] Add supportedVersions.json --- src/main/java/pojlib/api/API_V1.java | 6 +--- src/main/java/pojlib/util/APIHandler.java | 38 +++++++---------------- supportedVersions.json | 10 ++++++ 3 files changed, 22 insertions(+), 32 deletions(-) create mode 100644 supportedVersions.json diff --git a/src/main/java/pojlib/api/API_V1.java b/src/main/java/pojlib/api/API_V1.java index fbd3952a..e61bbcce 100644 --- a/src/main/java/pojlib/api/API_V1.java +++ b/src/main/java/pojlib/api/API_V1.java @@ -92,14 +92,10 @@ public static boolean removeMod(MinecraftInstances instances, MinecraftInstances return InstanceHandler.removeMod(instances, instance, gameDir, name); } - public static MinecraftMeta.MinecraftVersion[] getQCSupportedVersions() throws IOException { + public static String[] getQCSupportedVersions() { return APIHandler.getQCSupportedVersions(); } - public static String getQCSupportedVersionName(MinecraftMeta.MinecraftVersion version) { - return APIHandler.getQCSupportedVersionName(version); - } - /** * Loads all instances from the filesystem. * diff --git a/src/main/java/pojlib/util/APIHandler.java b/src/main/java/pojlib/util/APIHandler.java index 2959cf6b..0aff2afa 100644 --- a/src/main/java/pojlib/util/APIHandler.java +++ b/src/main/java/pojlib/util/APIHandler.java @@ -1,8 +1,5 @@ package pojlib.util; -import static pojlib.instance.InstanceHandler.DEV_MODS; -import static pojlib.instance.InstanceHandler.MODS; - import com.google.gson.Gson; import java.io.BufferedReader; @@ -14,13 +11,9 @@ import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; import java.util.HashMap; import java.util.stream.Collectors; -import pojlib.api.API_V1; -import pojlib.install.MinecraftMeta; - public class APIHandler { public final String baseUrl; @@ -109,29 +102,20 @@ public static T postFullUrl(String url, HashMap query, T bod return new Gson().fromJson(postRaw(url + parseQueries(query), body.toString()), tClass); } - public static MinecraftMeta.MinecraftVersion[] getQCSupportedVersions() throws IOException { - ArrayList versionsList = new ArrayList<>(); - File mods = new File(Constants.USER_HOME + "/mods-new.json"); - if (API_V1.developerMods) { - DownloadUtils.downloadFile(DEV_MODS, mods); - } else { DownloadUtils.downloadFile(MODS, mods); } - - ModsJson modsJson = GsonUtils.jsonFileToObject(mods.getAbsolutePath(), ModsJson.class); - for(ModsJson.Version version : modsJson.versions) { - MinecraftMeta.MinecraftVersion[] versions = MinecraftMeta.getVersions(); - for(MinecraftMeta.MinecraftVersion mcVer : versions) { - if(mcVer.id.equals(version.name)) { - versionsList.add(mcVer); - } - } - } + public static final String SUPPORTED_VERSIONS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/instance-refactor/supportedVersions.json"; - mods.delete(); + public static String[] getQCSupportedVersions() { + File versionsJson = new File(Constants.MC_DIR + "/supportedVersions.json"); + try { + DownloadUtils.downloadFile(SUPPORTED_VERSIONS, versionsJson); + } catch (IOException e) { + Logger.getInstance().appendToLog("Error while grabbing supported versions!\n" + e.getMessage()); + } - return versionsList.toArray(new MinecraftMeta.MinecraftVersion[0]); + return GsonUtils.jsonFileToObject(versionsJson.getAbsolutePath(), SupportedVersions.class).supportedVersions; } - public static String getQCSupportedVersionName(MinecraftMeta.MinecraftVersion version) { - return version.id; + public static class SupportedVersions { + public String[] supportedVersions; } } \ No newline at end of file diff --git a/supportedVersions.json b/supportedVersions.json new file mode 100644 index 00000000..a13b39fe --- /dev/null +++ b/supportedVersions.json @@ -0,0 +1,10 @@ +{ + "supportedVersions": [ + "1.20.4", + "1.20.2", + "1.20.1", + "1.19.4", + "1.19.2", + "1.18.2" + ] +} \ No newline at end of file From 760f207379efbaae191dad2f739d6082ec7fe020 Mon Sep 17 00:00:00 2001 From: Darien Johnson <84008186+CADIndie@users.noreply.github.com> Date: Sat, 13 Apr 2024 01:15:37 -0400 Subject: [PATCH 07/27] Fix Minecraft Version API --- src/main/java/pojlib/api/API_V1.java | 18 +++++------------- src/main/java/pojlib/install/FabricMeta.java | 4 ++-- .../java/pojlib/install/MinecraftMeta.java | 9 +++++++-- src/main/java/pojlib/install/QuiltMeta.java | 4 ++-- .../java/pojlib/instance/InstanceHandler.java | 16 +++++++++++++--- .../pojlib/instance/MinecraftInstances.java | 10 +++++++++- 6 files changed, 38 insertions(+), 23 deletions(-) diff --git a/src/main/java/pojlib/api/API_V1.java b/src/main/java/pojlib/api/API_V1.java index e61bbcce..08164674 100644 --- a/src/main/java/pojlib/api/API_V1.java +++ b/src/main/java/pojlib/api/API_V1.java @@ -42,18 +42,11 @@ public class API_V1 { public static boolean advancedDebugger; - /** - * @return A list of every minecraft version - */ - public static MinecraftMeta.MinecraftVersion[] getMinecraftVersions() { - return MinecraftMeta.getVersions(); - } - /** * Add a mod to an instance * * @param instances Acquired from {@link pojlib.api.API_V1#loadAll(String)} - * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, MinecraftMeta.MinecraftVersion, InstanceHandler.ModLoader, String)} + * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, InstanceHandler.ModLoader, String)} * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} * @param gameDir .minecraft directory * @param name Mod name @@ -68,7 +61,7 @@ public static void addMod(MinecraftInstances instances, MinecraftInstances.Insta /** * Check if an instance has a mod * - * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, MinecraftMeta.MinecraftVersion, InstanceHandler.ModLoader, String)} + * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, InstanceHandler.ModLoader, String)} * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} * @param name Mod name * @return True if the mod is already in the instance @@ -81,7 +74,7 @@ public static boolean hasMod(MinecraftInstances.Instance instance, String name) * Remove a mod from an instance * * @param instances Acquired from {@link pojlib.api.API_V1#loadAll(String)} - * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, MinecraftMeta.MinecraftVersion, InstanceHandler.ModLoader, String)} + * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, InstanceHandler.ModLoader, String)} * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} * @param gameDir .minecraft directory * @param name Mod name @@ -142,8 +135,7 @@ public static boolean deleteInstance(MinecraftInstances instances, MinecraftInst * @return A minecraft instance object * @throws IOException Throws if download of library or asset fails */ - public static MinecraftInstances.Instance createNewInstance(Activity activity, String instanceName, String home, boolean useDefaultMods, - MinecraftMeta.MinecraftVersion minecraftVersion, InstanceHandler.ModLoader modLoader, String modsFolderName) throws IOException { + public static MinecraftInstances.Instance createNewInstance(Activity activity, String instanceName, String home, boolean useDefaultMods, String minecraftVersion, InstanceHandler.ModLoader modLoader, String modsFolderName) throws IOException { if(ignoreInstanceName) { return InstanceHandler.create(activity, instanceName, home, useDefaultMods, minecraftVersion, modLoader, modsFolderName); @@ -159,7 +151,7 @@ public static MinecraftInstances.Instance createNewInstance(Activity activity, S * * @param activity Android activity object * @param account Account object - * @param instance Instance object from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, MinecraftMeta.MinecraftVersion, InstanceHandler.ModLoader, String)} + * @param instance Instance object from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, InstanceHandler.ModLoader, String)} * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} */ public static void launchInstance(Activity activity, MinecraftAccount account, MinecraftInstances.Instance instance) { diff --git a/src/main/java/pojlib/install/FabricMeta.java b/src/main/java/pojlib/install/FabricMeta.java index bbf08525..f2cb3642 100644 --- a/src/main/java/pojlib/install/FabricMeta.java +++ b/src/main/java/pojlib/install/FabricMeta.java @@ -26,7 +26,7 @@ public static FabricVersion getLatestStableVersion() { return null; } - public static VersionInfo getVersionInfo(FabricVersion fabricVersion, MinecraftMeta.MinecraftVersion minecraftVersion) { - return handler.get(String.format("versions/loader/%s/%s/profile/json", minecraftVersion.id, fabricVersion.version), VersionInfo.class); + public static VersionInfo getVersionInfo(FabricVersion fabricVersion, String minecraftVersion) { + return handler.get(String.format("versions/loader/%s/%s/profile/json", minecraftVersion, fabricVersion.version), VersionInfo.class); } } \ No newline at end of file diff --git a/src/main/java/pojlib/install/MinecraftMeta.java b/src/main/java/pojlib/install/MinecraftMeta.java index 615156e7..3215c318 100644 --- a/src/main/java/pojlib/install/MinecraftMeta.java +++ b/src/main/java/pojlib/install/MinecraftMeta.java @@ -24,7 +24,12 @@ public static MinecraftVersion[] getVersions() { return handler.get("mc/game/version_manifest_v2.json", MinecraftVersions.class).versions; } - public static VersionInfo getVersionInfo(MinecraftVersion minecraftVersion) { - return handler.get(String.format("v1/packages/%s/%s.json", minecraftVersion.sha1, minecraftVersion.id), VersionInfo.class); + public static VersionInfo getVersionInfo(String versionName) { + for (MinecraftVersion minecraftVersion : getVersions()) { + if (minecraftVersion.id.equals(versionName)) { + return handler.get(String.format("v1/packages/%s/%s.json", minecraftVersion.sha1, minecraftVersion.id), VersionInfo.class); + } + } + return null; } } \ No newline at end of file diff --git a/src/main/java/pojlib/install/QuiltMeta.java b/src/main/java/pojlib/install/QuiltMeta.java index c2fec366..6375a685 100644 --- a/src/main/java/pojlib/install/QuiltMeta.java +++ b/src/main/java/pojlib/install/QuiltMeta.java @@ -23,7 +23,7 @@ public static QuiltVersion getLatestVersion() { return null; } - public static VersionInfo getVersionInfo(QuiltVersion quiltVersion, MinecraftMeta.MinecraftVersion minecraftVersion) { - return handler.get(String.format("versions/loader/%s/%s/profile/json", minecraftVersion.id, quiltVersion.version), VersionInfo.class); + public static VersionInfo getVersionInfo(QuiltVersion quiltVersion, String minecraftVersion) { + return handler.get(String.format("versions/loader/%s/%s/profile/json", minecraftVersion, quiltVersion.version), VersionInfo.class); } } \ No newline at end of file diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index cc72bdae..a7210c91 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -44,13 +44,23 @@ public enum ModLoader { } //creates a new instance of a minecraft version, install game + mod loader, stores non login related launch info to json - public static MinecraftInstances.Instance create(Activity activity, String instanceName, String gameDir, boolean useDefaultMods, - MinecraftMeta.MinecraftVersion minecraftVersion, ModLoader modLoader, String modsFolderName) { + public static MinecraftInstances.Instance create(Activity activity, String instanceName, String gameDir, boolean useDefaultMods, String minecraftVersion, ModLoader modLoader, String modsFolderName) { + File instancesFile = new File(gameDir + "/instances.json"); + if (instancesFile.exists()) { + MinecraftInstances instances = GsonUtils.jsonFileToObject(instancesFile.getAbsolutePath(), MinecraftInstances.class); + for (MinecraftInstances.Instance instance : instances.instances) { + if (instance.instanceName.equals(instanceName)) { + Logger.getInstance().appendToLog("Instance " + instanceName + " already exists! Using original instance."); + return instance; + } + } + } + Logger.getInstance().appendToLog("Creating new instance: " + instanceName); MinecraftInstances.Instance instance = new MinecraftInstances.Instance(); instance.instanceName = instanceName; - instance.versionName = minecraftVersion.id; + instance.versionName = minecraftVersion; instance.gameDir = new File(gameDir).getAbsolutePath(); instance.defaultMods = useDefaultMods; if(modsFolderName != null) { diff --git a/src/main/java/pojlib/instance/MinecraftInstances.java b/src/main/java/pojlib/instance/MinecraftInstances.java index b5db3b2b..8a9e9133 100644 --- a/src/main/java/pojlib/instance/MinecraftInstances.java +++ b/src/main/java/pojlib/instance/MinecraftInstances.java @@ -26,6 +26,10 @@ public Instance load(String name) { return null; } + public Instance[] toArray() { + return instances.toArray(new Instance[0]); + } + public static class Instance { public String instanceName; public String versionName; @@ -42,7 +46,7 @@ public static class Instance { public List generateLaunchArgs(MinecraftAccount account) { String[] mcArgs = {"--username", account.username, "--version", versionName, "--gameDir", gameDir, "--assetsDir", assetsDir, "--assetIndex", assetIndex, "--uuid", account.uuid.replaceAll("-", ""), - "--accessToken", account.accessToken, "--userType", account.userType, "--versionType", versionType}; + "--accessToken", account.accessToken, "--userType", account.userType, "--versionType", "release"}; List allArgs = new ArrayList<>(Arrays.asList("-cp", classpath)); allArgs.add(mainClass); @@ -50,6 +54,10 @@ public List generateLaunchArgs(MinecraftAccount account) { return allArgs; } + public ModInfo[] toArray() { + return mods.toArray(new ModInfo[0]); + } + private ModsJson parseModsJson(String gameDir) throws Exception { File mods = new File(gameDir + "mods.json"); if(API_V1.developerMods) { From c22a0b5ec28567d427928a31a13f2b6fbab230ac Mon Sep 17 00:00:00 2001 From: The Judge Date: Fri, 12 Apr 2024 23:35:36 -0700 Subject: [PATCH 08/27] Fixes --- src/main/java/pojlib/api/API_V1.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/pojlib/api/API_V1.java b/src/main/java/pojlib/api/API_V1.java index 08164674..5ad0dd8f 100644 --- a/src/main/java/pojlib/api/API_V1.java +++ b/src/main/java/pojlib/api/API_V1.java @@ -46,7 +46,7 @@ public class API_V1 { * Add a mod to an instance * * @param instances Acquired from {@link pojlib.api.API_V1#loadAll(String)} - * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, InstanceHandler.ModLoader, String)} + * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, String)} * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} * @param gameDir .minecraft directory * @param name Mod name @@ -61,7 +61,7 @@ public static void addMod(MinecraftInstances instances, MinecraftInstances.Insta /** * Check if an instance has a mod * - * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, InstanceHandler.ModLoader, String)} + * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, String)} * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} * @param name Mod name * @return True if the mod is already in the instance @@ -74,7 +74,7 @@ public static boolean hasMod(MinecraftInstances.Instance instance, String name) * Remove a mod from an instance * * @param instances Acquired from {@link pojlib.api.API_V1#loadAll(String)} - * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, InstanceHandler.ModLoader, String)} + * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, String)} * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} * @param gameDir .minecraft directory * @param name Mod name @@ -131,18 +131,17 @@ public static boolean deleteInstance(MinecraftInstances instances, MinecraftInst * @param home The base directory where minecraft should be setup * @param useDefaultMods Use QC's default mods for the version (Core mods are automatically included) * @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 MinecraftInstances.Instance createNewInstance(Activity activity, String instanceName, String home, boolean useDefaultMods, String minecraftVersion, InstanceHandler.ModLoader modLoader, String modsFolderName) throws IOException { + public static MinecraftInstances.Instance createNewInstance(Activity activity, String instanceName, String home, boolean useDefaultMods, String minecraftVersion, String modsFolderName) throws IOException { if(ignoreInstanceName) { - return InstanceHandler.create(activity, instanceName, home, useDefaultMods, minecraftVersion, modLoader, modsFolderName); + return InstanceHandler.create(activity, instanceName, home, useDefaultMods, minecraftVersion, InstanceHandler.ModLoader.Fabric, modsFolderName); } else if (instanceName.contains("/") || instanceName.contains("!")) { throw new IOException("You cannot use special characters (!, /, ., etc) when creating instances."); } else { - return InstanceHandler.create(activity, instanceName, home, useDefaultMods, minecraftVersion, modLoader, modsFolderName); + return InstanceHandler.create(activity, instanceName, home, useDefaultMods, minecraftVersion, InstanceHandler.ModLoader.Fabric, modsFolderName); } } @@ -151,7 +150,7 @@ public static MinecraftInstances.Instance createNewInstance(Activity activity, S * * @param activity Android activity object * @param account Account object - * @param instance Instance object from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, InstanceHandler.ModLoader, String)} + * @param instance Instance object from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, String)} * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} */ public static void launchInstance(Activity activity, MinecraftAccount account, MinecraftInstances.Instance instance) { From 9ff174ec1d570cdffe2af92cfb918f090771bd57 Mon Sep 17 00:00:00 2001 From: The Judge Date: Fri, 12 Apr 2024 23:54:01 -0700 Subject: [PATCH 09/27] oops --- src/main/java/pojlib/instance/MinecraftInstances.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/pojlib/instance/MinecraftInstances.java b/src/main/java/pojlib/instance/MinecraftInstances.java index 8a9e9133..18997fe8 100644 --- a/src/main/java/pojlib/instance/MinecraftInstances.java +++ b/src/main/java/pojlib/instance/MinecraftInstances.java @@ -27,6 +27,9 @@ public Instance load(String name) { } public Instance[] toArray() { + if(instances == null) { + return new Instance[0]; + } return instances.toArray(new Instance[0]); } From 9f1767bbfd263f9abf95b45df1903f305715838e Mon Sep 17 00:00:00 2001 From: The Judge Date: Sat, 13 Apr 2024 00:15:38 -0700 Subject: [PATCH 10/27] Damn you GSON --- .../java/pojlib/instance/InstanceHandler.java | 17 +++++++++++++---- .../pojlib/instance/MinecraftInstances.java | 11 ++++------- src/main/java/pojlib/util/ModsJson.java | 8 +++----- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index a7210c91..6ece52e5 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -2,6 +2,7 @@ import android.app.Activity; +import com.google.common.collect.Lists; import com.google.gson.JsonElement; import com.google.gson.JsonObject; @@ -119,7 +120,9 @@ public static MinecraftInstances.Instance create(Activity activity, String insta instances = new MinecraftInstances(); } assert instances != null; - instances.instances.add(instance); + ArrayList instances1 = Lists.newArrayList(instances.instances); + instances1.add(instance); + instances.instances = instances1.toArray(new MinecraftInstances.Instance[0]); // Write instance to json file GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); @@ -149,7 +152,9 @@ public static void addMod(MinecraftInstances instances, MinecraftInstances.Insta info.url = url; info.version = version; - instance.mods.add(info); + ArrayList mods = Lists.newArrayList(instance.mods); + mods.add(info); + instance.mods = mods.toArray(mods.toArray(new ModInfo[0])); GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); } @@ -178,7 +183,9 @@ public static boolean removeMod(MinecraftInstances instances, MinecraftInstances File modFile = new File(gameDir + "/mods/" + instance.modsDirName + "/" + name + ".jar"); modFile.delete(); - instance.mods.remove(oldInfo); + ArrayList mods = Lists.newArrayList(instance.mods); + mods.remove(oldInfo); + instance.mods = mods.toArray(mods.toArray(new ModInfo[0])); GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); } @@ -187,7 +194,9 @@ public static boolean removeMod(MinecraftInstances instances, MinecraftInstances // Return true if instance was deleted public static boolean delete(MinecraftInstances instances, MinecraftInstances.Instance instance, String gameDir) { - instances.instances.remove(instance); + ArrayList instances1 = Lists.newArrayList(instances.instances); + instances1.remove(instance); + instances.instances = instances1.toArray(new MinecraftInstances.Instance[0]); GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); return true; diff --git a/src/main/java/pojlib/instance/MinecraftInstances.java b/src/main/java/pojlib/instance/MinecraftInstances.java index 18997fe8..c18a1552 100644 --- a/src/main/java/pojlib/instance/MinecraftInstances.java +++ b/src/main/java/pojlib/instance/MinecraftInstances.java @@ -14,7 +14,7 @@ import pojlib.util.ModsJson; public class MinecraftInstances { - public ArrayList instances; + public Instance[] instances; public Instance load(String name) { for(Instance instance : instances) { @@ -27,10 +27,7 @@ public Instance load(String name) { } public Instance[] toArray() { - if(instances == null) { - return new Instance[0]; - } - return instances.toArray(new Instance[0]); + return instances; } public static class Instance { @@ -43,7 +40,7 @@ public static class Instance { public String assetIndex; public String assetsDir; public String mainClass; - public ArrayList mods; + public ModInfo[] mods; public boolean defaultMods; public List generateLaunchArgs(MinecraftAccount account) { @@ -58,7 +55,7 @@ public List generateLaunchArgs(MinecraftAccount account) { } public ModInfo[] toArray() { - return mods.toArray(new ModInfo[0]); + return mods; } private ModsJson parseModsJson(String gameDir) throws Exception { diff --git a/src/main/java/pojlib/util/ModsJson.java b/src/main/java/pojlib/util/ModsJson.java index 3fe432f4..96e03334 100644 --- a/src/main/java/pojlib/util/ModsJson.java +++ b/src/main/java/pojlib/util/ModsJson.java @@ -1,13 +1,11 @@ package pojlib.util; -import java.util.ArrayList; - public class ModsJson { - public ArrayList versions; + public Version[] versions; public static class Version { public String name; - public ArrayList coreMods; - public ArrayList defaultMods; + public ModInfo[] coreMods; + public ModInfo[] defaultMods; } } From c3c9f2d61db5eeaa2a50f2c64be407232af5f89d Mon Sep 17 00:00:00 2001 From: The Judge Date: Sat, 13 Apr 2024 00:20:22 -0700 Subject: [PATCH 11/27] I get a bit silly when I am tired --- src/main/java/pojlib/instance/MinecraftInstances.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/pojlib/instance/MinecraftInstances.java b/src/main/java/pojlib/instance/MinecraftInstances.java index c18a1552..9848ced3 100644 --- a/src/main/java/pojlib/instance/MinecraftInstances.java +++ b/src/main/java/pojlib/instance/MinecraftInstances.java @@ -27,6 +27,9 @@ public Instance load(String name) { } public Instance[] toArray() { + if(instances == null) { + return new Instance[0]; + } return instances; } @@ -55,6 +58,9 @@ public List generateLaunchArgs(MinecraftAccount account) { } public ModInfo[] toArray() { + if(mods == null) { + return new ModInfo[0]; + } return mods; } From fd9602f53d8deed7ef3f75542210f3dbc7dbd21a Mon Sep 17 00:00:00 2001 From: The Judge Date: Sat, 13 Apr 2024 00:34:30 -0700 Subject: [PATCH 12/27] Bye bye --- src/main/java/pojlib/instance/InstanceHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index 6ece52e5..7a369c96 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -140,7 +140,9 @@ public static MinecraftInstances load(String gameDir) { } catch (Exception e) { instances = new MinecraftInstances(); } - assert instances != null; + if(instances == null) { + instances = new MinecraftInstances(); + } return instances; } From 62b289a899dee6afd547f0a1c81856553bd3c9bf Mon Sep 17 00:00:00 2001 From: The Judge Date: Sat, 13 Apr 2024 00:37:59 -0700 Subject: [PATCH 13/27] So long gay bowser --- src/main/java/pojlib/instance/InstanceHandler.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index 7a369c96..de199cef 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -119,7 +119,12 @@ public static MinecraftInstances.Instance create(Activity activity, String insta } catch (Exception e) { instances = new MinecraftInstances(); } - assert instances != null; + + if(instances == null) { + instances = new MinecraftInstances(); + GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); + } + ArrayList instances1 = Lists.newArrayList(instances.instances); instances1.add(instance); instances.instances = instances1.toArray(new MinecraftInstances.Instance[0]); @@ -142,6 +147,7 @@ public static MinecraftInstances load(String gameDir) { } if(instances == null) { instances = new MinecraftInstances(); + GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); } return instances; From 77e1345144b645aff4b9def84cb2f698bbb01dda Mon Sep 17 00:00:00 2001 From: The Judge Date: Sat, 13 Apr 2024 00:45:26 -0700 Subject: [PATCH 14/27] Arrays are fun, said no one ever --- src/main/java/pojlib/instance/InstanceHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index de199cef..64086d51 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -118,10 +118,12 @@ public static MinecraftInstances.Instance create(Activity activity, String insta instances = GsonUtils.jsonFileToObject(gameDir + "/instances.json", MinecraftInstances.class); } catch (Exception e) { instances = new MinecraftInstances(); + instances.instances = new MinecraftInstances.Instance[0]; } if(instances == null) { instances = new MinecraftInstances(); + instances.instances = new MinecraftInstances.Instance[0]; GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); } @@ -144,9 +146,11 @@ public static MinecraftInstances load(String gameDir) { instances = GsonUtils.jsonFileToObject(gameDir + "/instances.json", MinecraftInstances.class); } catch (Exception e) { instances = new MinecraftInstances(); + instances.instances = new MinecraftInstances.Instance[0]; } if(instances == null) { instances = new MinecraftInstances(); + instances.instances = new MinecraftInstances.Instance[0]; GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); } From c4c16a6b73bdda983de968e9f05d2f10a6093e40 Mon Sep 17 00:00:00 2001 From: Darien Johnson <84008186+CADIndie@users.noreply.github.com> Date: Sat, 13 Apr 2024 17:41:36 -0400 Subject: [PATCH 15/27] Move Mod Update Call --- src/main/java/pojlib/api/API_V1.java | 10 ++++++++++ src/main/java/pojlib/instance/InstanceHandler.java | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/main/java/pojlib/api/API_V1.java b/src/main/java/pojlib/api/API_V1.java index 5ad0dd8f..74cbb1dc 100644 --- a/src/main/java/pojlib/api/API_V1.java +++ b/src/main/java/pojlib/api/API_V1.java @@ -12,6 +12,7 @@ import pojlib.instance.InstanceHandler; import pojlib.instance.MinecraftInstances; import pojlib.util.APIHandler; +import pojlib.util.Constants; import pojlib.util.LoginHelper; import java.io.IOException; @@ -145,6 +146,15 @@ public static MinecraftInstances.Instance createNewInstance(Activity activity, S } } + /** + * Update the mods for the selected instance + * + * @param instance The instance to update + */ + public static void updateMods(MinecraftInstances.Instance instance) { + instance.updateMods(Constants.MC_DIR); + } + /** * Launch an instance * diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index 64086d51..66df2f78 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -133,7 +133,10 @@ public static MinecraftInstances.Instance create(Activity activity, String insta // Write instance to json file GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); + instance.updateMods(Constants.MC_DIR); + API_V1.finishedDownloading = true; + Logger.getInstance().appendToLog("Finished Downloading!"); }).start(); return instance; @@ -218,8 +221,6 @@ public static void launchInstance(Activity activity, MinecraftAccount account, M try { JREUtils.redirectAndPrintJRELog(); VLoader.setAndroidInitInfo(activity); - instance.updateMods(Constants.MC_DIR); - while(!API_V1.finishedDownloading); JREUtils.launchJavaVM(activity, instance.generateLaunchArgs(account), instance.modsDirName); } catch (Throwable e) { e.printStackTrace(); From f2d94fa4a89131f16f382f5d1a45838fd8c16f8c Mon Sep 17 00:00:00 2001 From: The Judge Date: Sat, 13 Apr 2024 15:53:01 -0700 Subject: [PATCH 16/27] Finish instance refactor --- src/main/java/pojlib/api/API_V1.java | 4 +- .../java/pojlib/instance/InstanceHandler.java | 10 ++-- .../pojlib/instance/MinecraftInstances.java | 51 ++++++++++++++----- src/main/java/pojlib/util/APIHandler.java | 2 +- src/main/java/pojlib/util/LoginHelper.java | 6 +-- src/main/java/pojlib/util/ModInfo.java | 4 +- 6 files changed, 51 insertions(+), 26 deletions(-) diff --git a/src/main/java/pojlib/api/API_V1.java b/src/main/java/pojlib/api/API_V1.java index 74cbb1dc..e0ac566d 100644 --- a/src/main/java/pojlib/api/API_V1.java +++ b/src/main/java/pojlib/api/API_V1.java @@ -151,8 +151,8 @@ public static MinecraftInstances.Instance createNewInstance(Activity activity, S * * @param instance The instance to update */ - public static void updateMods(MinecraftInstances.Instance instance) { - instance.updateMods(Constants.MC_DIR); + public static void updateMods(MinecraftInstances instances, MinecraftInstances.Instance instance) { + instance.updateMods(Constants.MC_DIR, instances); } /** diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index 66df2f78..caf7262c 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -133,7 +133,7 @@ public static MinecraftInstances.Instance create(Activity activity, String insta // Write instance to json file GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); - instance.updateMods(Constants.MC_DIR); + instance.updateMods(Constants.MC_DIR, instances); API_V1.finishedDownloading = true; Logger.getInstance().appendToLog("Finished Downloading!"); @@ -163,8 +163,8 @@ public static MinecraftInstances load(String gameDir) { public static void addMod(MinecraftInstances instances, MinecraftInstances.Instance instance, String gameDir, String name, String version, String url) { ModInfo info = new ModInfo(); - info.name = name; - info.url = url; + info.slug = name; + info.download_link = url; info.version = version; ArrayList mods = Lists.newArrayList(instance.mods); @@ -176,7 +176,7 @@ public static void addMod(MinecraftInstances instances, MinecraftInstances.Insta public static boolean hasMod(MinecraftInstances.Instance instance, String name) { for(ModInfo info : instance.mods) { - if(info.name.equals(name)) { + if(info.slug.equals(name)) { return true; } } @@ -187,7 +187,7 @@ public static boolean hasMod(MinecraftInstances.Instance instance, String name) public static boolean removeMod(MinecraftInstances instances, MinecraftInstances.Instance instance, String gameDir, String name) { ModInfo oldInfo = null; for(ModInfo info : instance.mods) { - if(info.name.equals(name)) { + if(info.slug.equals(name)) { oldInfo = info; break; } diff --git a/src/main/java/pojlib/instance/MinecraftInstances.java b/src/main/java/pojlib/instance/MinecraftInstances.java index 9848ced3..ca2d4885 100644 --- a/src/main/java/pojlib/instance/MinecraftInstances.java +++ b/src/main/java/pojlib/instance/MinecraftInstances.java @@ -65,7 +65,7 @@ public ModInfo[] toArray() { } private ModsJson parseModsJson(String gameDir) throws Exception { - File mods = new File(gameDir + "mods.json"); + File mods = new File(gameDir + "/mods.json"); if(API_V1.developerMods) { DownloadUtils.downloadFile(InstanceHandler.DEV_MODS, mods); } else { @@ -75,53 +75,78 @@ private ModsJson parseModsJson(String gameDir) throws Exception { return GsonUtils.jsonFileToObject(mods.getAbsolutePath(), ModsJson.class); } - public void updateMods(String gameDir) { + public void updateMods(String gameDir, MinecraftInstances instances) { API_V1.finishedDownloading = false; + if(mods == null) { + mods = new ModInfo[0]; + } try { ModsJson modsJson = parseModsJson(gameDir); ModsJson.Version version = null; for(ModsJson.Version info : modsJson.versions) { - if(!info.name.equals(versionName)) { - continue; + if(info.name.equals(versionName)) { + version = info; + break; } - version = info; - break; } assert version != null; + + File modsDir = new File(gameDir + "/mods/" + modsDirName); + if(!modsDir.exists()) { + ArrayList modInfos = new ArrayList<>(); + for(ModInfo info : version.coreMods) { + File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.slug + ".jar"); + DownloadUtils.downloadFile(info.download_link, mod); + modInfos.add(info); + } + for(ModInfo info : version.defaultMods) { + File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.slug + ".jar"); + DownloadUtils.downloadFile(info.download_link, mod); + modInfos.add(info); + } + mods = modInfos.toArray(modInfos.toArray(new ModInfo[0])); + GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); + API_V1.finishedDownloading = true; + return; + } + for(ModInfo info : version.coreMods) { for(ModInfo currInfo : mods) { - if(!currInfo.name.equals(info.name)) { + if(!currInfo.slug.equals(info.slug)) { continue; } if(currInfo.version.equals(info.version)) { continue; } - File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.name); - DownloadUtils.downloadFile(info.url, mod); + File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.slug + ".jar"); + DownloadUtils.downloadFile(info.download_link, mod); + info = currInfo; } } if(defaultMods) { for (ModInfo info : version.defaultMods) { for (ModInfo currInfo : mods) { - if (!currInfo.name.equals(info.name)) { + if (!currInfo.slug.equals(info.slug)) { continue; } if (currInfo.version.equals(info.version)) { continue; } - File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.name + ".jar"); - DownloadUtils.downloadFile(info.url, mod); + File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.slug + ".jar"); + DownloadUtils.downloadFile(info.download_link, mod); + info = currInfo; } } } + GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); API_V1.finishedDownloading = true; } catch (Exception e) { - Logger.getInstance().appendToLog("Mods failed to download! Are you offline?\n" + e.getMessage()); + Logger.getInstance().appendToLog("Mods failed to download! Are you offline?\n" + e); API_V1.finishedDownloading = true; } } diff --git a/src/main/java/pojlib/util/APIHandler.java b/src/main/java/pojlib/util/APIHandler.java index 0aff2afa..934a3172 100644 --- a/src/main/java/pojlib/util/APIHandler.java +++ b/src/main/java/pojlib/util/APIHandler.java @@ -109,7 +109,7 @@ public static String[] getQCSupportedVersions() { try { DownloadUtils.downloadFile(SUPPORTED_VERSIONS, versionsJson); } catch (IOException e) { - Logger.getInstance().appendToLog("Error while grabbing supported versions!\n" + e.getMessage()); + Logger.getInstance().appendToLog("Error while grabbing supported versions!\n" + e); } return GsonUtils.jsonFileToObject(versionsJson.getAbsolutePath(), SupportedVersions.class).supportedVersions; diff --git a/src/main/java/pojlib/util/LoginHelper.java b/src/main/java/pojlib/util/LoginHelper.java index 64a003eb..b544c66a 100644 --- a/src/main/java/pojlib/util/LoginHelper.java +++ b/src/main/java/pojlib/util/LoginHelper.java @@ -65,7 +65,7 @@ public static MinecraftAccount getNewToken(Activity activity) { IAccount account = accounts.iterator().next(); future = pca.acquireTokenSilently(SilentParameters.builder(Set.of("XboxLive.SignIn", "XboxLive.offline_access"), account).build()); } catch (MalformedURLException e) { - Logger.getInstance().appendToLog(e.getMessage()); + Logger.getInstance().appendToLog(e.toString()); throw new RuntimeException(e); } @@ -73,7 +73,7 @@ public static MinecraftAccount getNewToken(Activity activity) { IAuthenticationResult res = future.get(); return MinecraftAccount.load(activity.getFilesDir() + "/accounts", res.accessToken(), String.valueOf(res.expiresOnDate().getTime())); } catch (ExecutionException | InterruptedException e) { - Logger.getInstance().appendToLog(e.getMessage()); + Logger.getInstance().appendToLog(e.toString()); throw new RuntimeException(e); } } @@ -96,7 +96,7 @@ public static void beginLogin(Activity activity) { API_V1.profileName = API_V1.currentAcc.username; } catch (ExecutionException | InterruptedException e) { API_V1.msaMessage = "Something went wrong! Couldn't reach the Microsoft Auth servers.\n" - + e.getMessage(); + + e; } }); diff --git a/src/main/java/pojlib/util/ModInfo.java b/src/main/java/pojlib/util/ModInfo.java index d26f4ec6..d52cee89 100644 --- a/src/main/java/pojlib/util/ModInfo.java +++ b/src/main/java/pojlib/util/ModInfo.java @@ -1,7 +1,7 @@ package pojlib.util; public class ModInfo { - public String name; + public String slug; public String version; - public String url; + public String download_link; } \ No newline at end of file From 2cafb9d0f45eb2bd0831e8f4d22055c377644cdf Mon Sep 17 00:00:00 2001 From: The Judge Date: Sat, 13 Apr 2024 17:24:49 -0700 Subject: [PATCH 17/27] Fix sodium --- devmods.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/devmods.json b/devmods.json index d3bbacb8..e3125099 100644 --- a/devmods.json +++ b/devmods.json @@ -17,8 +17,8 @@ "defaultMods": [ { "slug": "Sodium", - "version": "0.5.5", - "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/InGKdfel/sodium-fabric-mc1.20.3-0.5.5.jar" + "version": "0.5.8", + "download_link": "https://github.com/QuestCraftPlusPlus/sodium-fabric/releases/download/mc1.20.4-0.5.8/sodium-fabric-0.5.8+mc1.20.4.jar" }, { "slug": "Cloth-Config", @@ -90,7 +90,7 @@ { "slug": "Sodium", "version": "0.5.5", - "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/pmgeU5yX/sodium-fabric-mc1.20.2-0.5.5.jar" + "download_link": "https://github.com/QuestCraftPlusPlus/sodium-fabric/releases/download/mc1.20.2-0.5.5/sodium-fabric-mc1.20.2-0.5.5.jar" }, { "slug": "Cloth-Config", @@ -171,8 +171,8 @@ }, { "slug": "Sodium", - "version": "0.5.2", - "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/6SSPmLc9/sodium-fabric-mc1.20.1-0.5.2.jar" + "version": "0.5.8", + "download_link": "https://github.com/QuestCraftPlusPlus/sodium-fabric/releases/download/mc1.20.1-0.5.8/sodium-fabric-0.5.8+mc1.20.1.jar" }, { "slug": "Cloth-Config", From afed4e764e3855297a073aba9d0dba7c6ebd59cf Mon Sep 17 00:00:00 2001 From: The Judge Date: Sun, 14 Apr 2024 11:55:52 -0700 Subject: [PATCH 18/27] Fixes --- src/main/java/pojlib/instance/InstanceHandler.java | 4 ++-- src/main/java/pojlib/instance/MinecraftInstances.java | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index caf7262c..dcfdd604 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -176,7 +176,7 @@ public static void addMod(MinecraftInstances instances, MinecraftInstances.Insta public static boolean hasMod(MinecraftInstances.Instance instance, String name) { for(ModInfo info : instance.mods) { - if(info.slug.equals(name)) { + if(info.slug.equalsIgnoreCase(name)) { return true; } } @@ -187,7 +187,7 @@ public static boolean hasMod(MinecraftInstances.Instance instance, String name) public static boolean removeMod(MinecraftInstances instances, MinecraftInstances.Instance instance, String gameDir, String name) { ModInfo oldInfo = null; for(ModInfo info : instance.mods) { - if(info.slug.equals(name)) { + if(info.slug.equalsIgnoreCase(name)) { oldInfo = info; break; } diff --git a/src/main/java/pojlib/instance/MinecraftInstances.java b/src/main/java/pojlib/instance/MinecraftInstances.java index ca2d4885..debdd2bb 100644 --- a/src/main/java/pojlib/instance/MinecraftInstances.java +++ b/src/main/java/pojlib/instance/MinecraftInstances.java @@ -143,6 +143,15 @@ public void updateMods(String gameDir, MinecraftInstances instances) { } } } + + // Download custom mods + for(ModInfo currInfo : mods) { + File mod = new File(gameDir + "/mods/" + modsDirName + "/" + currInfo.slug + ".jar"); + if(!mod.exists()) { + DownloadUtils.downloadFile(currInfo.download_link, mod); + } + } + GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); API_V1.finishedDownloading = true; } catch (Exception e) { From beb2717a72210f7e8905e9cbb98057aa92a82940 Mon Sep 17 00:00:00 2001 From: The Judge Date: Sun, 14 Apr 2024 17:27:09 -0700 Subject: [PATCH 19/27] Handle xr errors --- src/main/jni/vloader.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/jni/vloader.cpp b/src/main/jni/vloader.cpp index 01a28f29..b7e93165 100644 --- a/src/main/jni/vloader.cpp +++ b/src/main/jni/vloader.cpp @@ -76,7 +76,7 @@ Java_pojlib_util_VLoader_setAndroidInitInfo(JNIEnv *env, jclass clazz, jobject c (PFN_xrVoidFunction *) (&initializeLoader)); if(!XR_SUCCEEDED(res)) { - printf("Error!"); + printf("xrGetInstanceProcAddr returned %d.\n", res); } XrLoaderInitInfoAndroidKHR loaderInitInfoAndroidKhr = { @@ -86,7 +86,10 @@ Java_pojlib_util_VLoader_setAndroidInitInfo(JNIEnv *env, jclass clazz, jobject c ctx }; - initializeLoader((const XrLoaderInitInfoBaseHeaderKHR *) &loaderInitInfoAndroidKhr); + res = initializeLoader((const XrLoaderInitInfoBaseHeaderKHR *) &loaderInitInfoAndroidKhr); + if(!XR_SUCCEEDED(res)) { + printf("xrInitializeLoaderKHR returned %d.\n", res); + } } extern "C" From 82bb77051c06447416d2df8f1ca15eb32dfc571d Mon Sep 17 00:00:00 2001 From: TheJudge156 Date: Mon, 15 Apr 2024 12:19:34 -0700 Subject: [PATCH 20/27] Fix race condition --- src/main/java/pojlib/api/API_V1.java | 6 ++-- .../java/pojlib/instance/InstanceHandler.java | 31 +++++++------------ 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/src/main/java/pojlib/api/API_V1.java b/src/main/java/pojlib/api/API_V1.java index e0ac566d..f722460f 100644 --- a/src/main/java/pojlib/api/API_V1.java +++ b/src/main/java/pojlib/api/API_V1.java @@ -135,14 +135,14 @@ public static boolean deleteInstance(MinecraftInstances instances, MinecraftInst * @return A minecraft instance object * @throws IOException Throws if download of library or asset fails */ - public static MinecraftInstances.Instance createNewInstance(Activity activity, String instanceName, String home, boolean useDefaultMods, String minecraftVersion, String modsFolderName) throws IOException { + public static MinecraftInstances.Instance createNewInstance(Activity activity, MinecraftInstances instances, String instanceName, String home, boolean useDefaultMods, String minecraftVersion, String modsFolderName) throws IOException { if(ignoreInstanceName) { - return InstanceHandler.create(activity, instanceName, home, useDefaultMods, minecraftVersion, InstanceHandler.ModLoader.Fabric, modsFolderName); + return InstanceHandler.create(activity, instances, instanceName, home, useDefaultMods, minecraftVersion, InstanceHandler.ModLoader.Fabric, modsFolderName); } else if (instanceName.contains("/") || instanceName.contains("!")) { throw new IOException("You cannot use special characters (!, /, ., etc) when creating instances."); } else { - return InstanceHandler.create(activity, instanceName, home, useDefaultMods, minecraftVersion, InstanceHandler.ModLoader.Fabric, modsFolderName); + return InstanceHandler.create(activity, instances, instanceName, home, useDefaultMods, minecraftVersion, InstanceHandler.ModLoader.Fabric, modsFolderName); } } diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index dcfdd604..d2e8856e 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -45,10 +45,9 @@ public enum ModLoader { } //creates a new instance of a minecraft version, install game + mod loader, stores non login related launch info to json - public static MinecraftInstances.Instance create(Activity activity, String instanceName, String gameDir, boolean useDefaultMods, String minecraftVersion, ModLoader modLoader, String modsFolderName) { + public static MinecraftInstances.Instance create(Activity activity, MinecraftInstances instances, String instanceName, String gameDir, boolean useDefaultMods, String minecraftVersion, ModLoader modLoader, String modsFolderName) { File instancesFile = new File(gameDir + "/instances.json"); if (instancesFile.exists()) { - MinecraftInstances instances = GsonUtils.jsonFileToObject(instancesFile.getAbsolutePath(), MinecraftInstances.class); for (MinecraftInstances.Instance instance : instances.instances) { if (instance.instanceName.equals(instanceName)) { Logger.getInstance().appendToLog("Instance " + instanceName + " already exists! Using original instance."); @@ -98,6 +97,16 @@ public static MinecraftInstances.Instance create(Activity activity, String insta // Install minecraft VersionInfo finalModLoaderVersionInfo = modLoaderVersionInfo; + + if(instances.instances == null) { + instances.instances = new MinecraftInstances.Instance[0]; + GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); + } + + ArrayList instances1 = Lists.newArrayList(instances.instances); + instances1.add(instance); + instances.instances = instances1.toArray(new MinecraftInstances.Instance[0]); + new Thread(() -> { try { String clientClasspath = Installer.installClient(minecraftVersionInfo, gameDir); @@ -113,24 +122,6 @@ public static MinecraftInstances.Instance create(Activity activity, String insta } instance.assetIndex = minecraftVersionInfo.assetIndex.id; - MinecraftInstances instances; - try { - instances = GsonUtils.jsonFileToObject(gameDir + "/instances.json", MinecraftInstances.class); - } catch (Exception e) { - instances = new MinecraftInstances(); - instances.instances = new MinecraftInstances.Instance[0]; - } - - if(instances == null) { - instances = new MinecraftInstances(); - instances.instances = new MinecraftInstances.Instance[0]; - GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); - } - - ArrayList instances1 = Lists.newArrayList(instances.instances); - instances1.add(instance); - instances.instances = instances1.toArray(new MinecraftInstances.Instance[0]); - // Write instance to json file GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); instance.updateMods(Constants.MC_DIR, instances); From a44b46f2ee0e0bef88be92d8cf00057cd472d2b5 Mon Sep 17 00:00:00 2001 From: TheJudge156 Date: Mon, 15 Apr 2024 12:23:54 -0700 Subject: [PATCH 21/27] Don't need to save the json yet --- src/main/java/pojlib/instance/InstanceHandler.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index d2e8856e..228f922d 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -100,7 +100,6 @@ public static MinecraftInstances.Instance create(Activity activity, MinecraftIns if(instances.instances == null) { instances.instances = new MinecraftInstances.Instance[0]; - GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); } ArrayList instances1 = Lists.newArrayList(instances.instances); From 92618f7fcbc13af101ac4774a9b537d8097c6956 Mon Sep 17 00:00:00 2001 From: The Judge Date: Mon, 15 Apr 2024 18:41:23 -0700 Subject: [PATCH 22/27] Fix default mods toggle --- src/main/java/pojlib/instance/MinecraftInstances.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/pojlib/instance/MinecraftInstances.java b/src/main/java/pojlib/instance/MinecraftInstances.java index debdd2bb..8b4189e7 100644 --- a/src/main/java/pojlib/instance/MinecraftInstances.java +++ b/src/main/java/pojlib/instance/MinecraftInstances.java @@ -101,10 +101,12 @@ public void updateMods(String gameDir, MinecraftInstances instances) { DownloadUtils.downloadFile(info.download_link, mod); modInfos.add(info); } - for(ModInfo info : version.defaultMods) { - File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.slug + ".jar"); - DownloadUtils.downloadFile(info.download_link, mod); - modInfos.add(info); + if(defaultMods) { + for (ModInfo info : version.defaultMods) { + File mod = new File(gameDir + "/mods/" + modsDirName + "/" + info.slug + ".jar"); + DownloadUtils.downloadFile(info.download_link, mod); + modInfos.add(info); + } } mods = modInfos.toArray(modInfos.toArray(new ModInfo[0])); GsonUtils.objectToJsonFile(gameDir + "/instances.json", instances); From e03b9748b8599b85e84c16750355cf90755c8697 Mon Sep 17 00:00:00 2001 From: The Judge Date: Mon, 15 Apr 2024 18:51:48 -0700 Subject: [PATCH 23/27] Add imageURL --- src/main/java/pojlib/api/API_V1.java | 7 ++++--- src/main/java/pojlib/instance/InstanceHandler.java | 8 ++------ src/main/java/pojlib/instance/MinecraftInstances.java | 1 + 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main/java/pojlib/api/API_V1.java b/src/main/java/pojlib/api/API_V1.java index f722460f..387e8cbe 100644 --- a/src/main/java/pojlib/api/API_V1.java +++ b/src/main/java/pojlib/api/API_V1.java @@ -132,17 +132,18 @@ public static boolean deleteInstance(MinecraftInstances instances, MinecraftInst * @param home The base directory where minecraft should be setup * @param useDefaultMods Use QC's default mods for the version (Core mods are automatically included) * @param minecraftVersion The version of minecraft to install + * @param imageURL Modpack image url, nullable * @return A minecraft instance object * @throws IOException Throws if download of library or asset fails */ - public static MinecraftInstances.Instance createNewInstance(Activity activity, MinecraftInstances instances, String instanceName, String home, boolean useDefaultMods, String minecraftVersion, String modsFolderName) throws IOException { + public static MinecraftInstances.Instance createNewInstance(Activity activity, MinecraftInstances instances, String instanceName, String home, boolean useDefaultMods, String minecraftVersion, String modsFolderName, String imageURL) throws IOException { if(ignoreInstanceName) { - return InstanceHandler.create(activity, instances, instanceName, home, useDefaultMods, minecraftVersion, InstanceHandler.ModLoader.Fabric, modsFolderName); + return InstanceHandler.create(activity, instances, instanceName, home, useDefaultMods, minecraftVersion, InstanceHandler.ModLoader.Fabric, modsFolderName, imageURL); } else if (instanceName.contains("/") || instanceName.contains("!")) { throw new IOException("You cannot use special characters (!, /, ., etc) when creating instances."); } else { - return InstanceHandler.create(activity, instances, instanceName, home, useDefaultMods, minecraftVersion, InstanceHandler.ModLoader.Fabric, modsFolderName); + return InstanceHandler.create(activity, instances, instanceName, home, useDefaultMods, minecraftVersion, InstanceHandler.ModLoader.Fabric, modsFolderName, imageURL); } } diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index 228f922d..c857083b 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -3,13 +3,10 @@ import android.app.Activity; import com.google.common.collect.Lists; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import java.io.File; import java.io.IOException; import java.util.ArrayList; -import java.util.Arrays; import pojlib.account.MinecraftAccount; import pojlib.api.API_V1; @@ -20,8 +17,6 @@ import pojlib.install.VersionInfo; import pojlib.util.Constants; import pojlib.util.ModInfo; -import pojlib.util.ModsJson; -import pojlib.util.DownloadUtils; import pojlib.util.GsonUtils; import pojlib.util.JREUtils; import pojlib.util.Logger; @@ -45,7 +40,7 @@ public enum ModLoader { } //creates a new instance of a minecraft version, install game + mod loader, stores non login related launch info to json - public static MinecraftInstances.Instance create(Activity activity, MinecraftInstances instances, String instanceName, String gameDir, boolean useDefaultMods, String minecraftVersion, ModLoader modLoader, String modsFolderName) { + public static MinecraftInstances.Instance create(Activity activity, MinecraftInstances instances, String instanceName, String gameDir, boolean useDefaultMods, String minecraftVersion, ModLoader modLoader, String modsFolderName, String imageURL) { File instancesFile = new File(gameDir + "/instances.json"); if (instancesFile.exists()) { for (MinecraftInstances.Instance instance : instances.instances) { @@ -60,6 +55,7 @@ public static MinecraftInstances.Instance create(Activity activity, MinecraftIns MinecraftInstances.Instance instance = new MinecraftInstances.Instance(); instance.instanceName = instanceName; + instance.instanceImageURL = imageURL; instance.versionName = minecraftVersion; instance.gameDir = new File(gameDir).getAbsolutePath(); instance.defaultMods = useDefaultMods; diff --git a/src/main/java/pojlib/instance/MinecraftInstances.java b/src/main/java/pojlib/instance/MinecraftInstances.java index 8b4189e7..28185c24 100644 --- a/src/main/java/pojlib/instance/MinecraftInstances.java +++ b/src/main/java/pojlib/instance/MinecraftInstances.java @@ -35,6 +35,7 @@ public Instance[] toArray() { public static class Instance { public String instanceName; + public String instanceImageURL; public String versionName; public String modsDirName; public String versionType; From 1e3cfc5c5c004b39f9038b844af4213237a82603 Mon Sep 17 00:00:00 2001 From: The Judge Date: Mon, 15 Apr 2024 18:53:15 -0700 Subject: [PATCH 24/27] Fix javadocs --- src/main/java/pojlib/api/API_V1.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/pojlib/api/API_V1.java b/src/main/java/pojlib/api/API_V1.java index 387e8cbe..4fd97575 100644 --- a/src/main/java/pojlib/api/API_V1.java +++ b/src/main/java/pojlib/api/API_V1.java @@ -47,7 +47,7 @@ public class API_V1 { * Add a mod to an instance * * @param instances Acquired from {@link pojlib.api.API_V1#loadAll(String)} - * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, String)} + * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, MinecraftInstances, String, String, boolean, String, String, String)} * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} * @param gameDir .minecraft directory * @param name Mod name @@ -62,7 +62,7 @@ public static void addMod(MinecraftInstances instances, MinecraftInstances.Insta /** * Check if an instance has a mod * - * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, String)} + * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, MinecraftInstances, String, String, boolean, String, String, String)} * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} * @param name Mod name * @return True if the mod is already in the instance @@ -75,7 +75,7 @@ public static boolean hasMod(MinecraftInstances.Instance instance, String name) * Remove a mod from an instance * * @param instances Acquired from {@link pojlib.api.API_V1#loadAll(String)} - * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, String)} + * @param instance Acquired from {@link pojlib.api.API_V1#createNewInstance(Activity, MinecraftInstances, String, String, boolean, String, String, String)} * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} * @param gameDir .minecraft directory * @param name Mod name @@ -161,7 +161,7 @@ public static void updateMods(MinecraftInstances instances, MinecraftInstances.I * * @param activity Android activity object * @param account Account object - * @param instance Instance object from {@link pojlib.api.API_V1#createNewInstance(Activity, String, String, boolean, String, String)} + * @param instance Instance object from {@link pojlib.api.API_V1#createNewInstance(Activity, MinecraftInstances, String, String, boolean, String, String, String)} * or {@link pojlib.api.API_V1#load(MinecraftInstances, String)} */ public static void launchInstance(Activity activity, MinecraftAccount account, MinecraftInstances.Instance instance) { From 49a9357a75e932930d11a9fdec96370ce2f42200 Mon Sep 17 00:00:00 2001 From: The Judge Date: Mon, 15 Apr 2024 18:57:22 -0700 Subject: [PATCH 25/27] Fix actions? --- .github/workflows/gradle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 2638bcaa..b6b3aa97 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -29,7 +29,7 @@ jobs: java-version: '17' distribution: 'temurin' - name: Make Gradle wrapper executable - run: chmod +x ./gradlew + run: git lfs pull | chmod +x ./gradlew - name: Build with Gradle uses: gradle/gradle-build-action@v2 with: From e6f34363d5e982849b16650308193bf1a10c7cf5 Mon Sep 17 00:00:00 2001 From: Darien Johnson <84008186+CADIndie@users.noreply.github.com> Date: Wed, 17 Apr 2024 16:50:08 -0400 Subject: [PATCH 26/27] Slightly More Logging --- .../java/pojlib/account/MinecraftAccount.java | 9 ++++-- .../java/pojlib/instance/InstanceHandler.java | 6 ---- src/main/java/pojlib/util/DownloadUtils.java | 28 +------------------ 3 files changed, 7 insertions(+), 36 deletions(-) diff --git a/src/main/java/pojlib/account/MinecraftAccount.java b/src/main/java/pojlib/account/MinecraftAccount.java index 14ecd45a..fabe9f44 100644 --- a/src/main/java/pojlib/account/MinecraftAccount.java +++ b/src/main/java/pojlib/account/MinecraftAccount.java @@ -16,6 +16,7 @@ import pojlib.util.Constants; import pojlib.util.GsonUtils; +import pojlib.util.Logger; public class MinecraftAccount { @@ -37,7 +38,9 @@ public static MinecraftAccount login(String gameDir, String[] response) throws I public static boolean logout(Activity activity) { File accountFile = new File(activity.getFilesDir() + "/accounts/account.json"); - return accountFile.delete(); + File accountCache = new File(Constants.USER_HOME + "/cache_data"); + + return accountFile.delete() && accountCache.delete(); } //Try this before using login - the account will have been saved to disk if previously logged in @@ -54,16 +57,16 @@ public static MinecraftAccount load(String path, @Nullable String newToken, @Nul GsonUtils.objectToJsonFile(path + "/account.json", acc); return acc; } catch (IOException | JSONException e) { + Logger.getInstance().appendToLog("Unable to load account! | " + e); return null; } } public static String getSkinFaceUrl(MinecraftAccount account) { - //TODO: Log this to latestlog.txt for Support staff try { return Constants.MINOTAR_URL + "/helm/" + account.uuid; } catch (NullPointerException e) { - System.out.println("Username not set! Please set your username at Minecraft.net and try again."); + Logger.getInstance().appendToLog("Username likely not set! Please set your username at Minecraft.net and try again. | " + e); return null; } } diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index c857083b..a5c0cb64 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -79,12 +79,6 @@ public static MinecraftInstances.Instance create(Activity activity, MinecraftIns modLoaderVersionInfo = QuiltMeta.getVersionInfo(quiltVersion, minecraftVersion); break; } - case Forge: - case NeoForge: - { - System.out.println("Error!: You cannot use Forge or NeoForge with QuestCraft!"); - break; - } } VersionInfo minecraftVersionInfo = MinecraftMeta.getVersionInfo(minecraftVersion); diff --git a/src/main/java/pojlib/util/DownloadUtils.java b/src/main/java/pojlib/util/DownloadUtils.java index 88a08609..ad561e02 100644 --- a/src/main/java/pojlib/util/DownloadUtils.java +++ b/src/main/java/pojlib/util/DownloadUtils.java @@ -1,9 +1,5 @@ package pojlib.util; -import android.content.res.AssetManager; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; import org.apache.commons.codec.binary.Hex; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.IOUtils; @@ -14,17 +10,10 @@ import java.net.HttpURLConnection; import java.net.URL; import java.nio.file.Files; -import java.util.ArrayList; import java.util.Objects; -import static pojlib.util.FileUtil.read; -import static pojlib.util.GsonUtils.GLOBAL_GSON; - public class DownloadUtils { - public static AssetManager assetManager; - - private static void download(URL url, OutputStream os) throws IOException { final int MAX_RETRIES = 3; int attempts = 0; @@ -96,23 +85,8 @@ public static boolean compareSHA1(File f, String sourceSHA) { else return true; // fake match }catch (IOException e) { - System.out.println("Fake-matching a hash due to a read error: " + e); + Logger.getInstance().appendToLog("Fake-matching a hash due to a read error: " + e); return true; } } - - public static ArrayList getCompatibleVersions(String tag) { - ArrayList versions = new ArrayList<>(); - try { - InputStream stream = assetManager.open("jsons/modmanager.json"); - JsonObject versionsJson = GLOBAL_GSON.fromJson(read(stream), JsonObject.class); - - for (JsonElement version : versionsJson.get("compatible_versions").getAsJsonObject().getAsJsonArray(tag)) { - versions.add(version.getAsString()); - } - } catch (IOException e) { - e.printStackTrace(); - } - return versions; - } } From d81200e75ba07ccdd5d8c010d406a2d35d2a3380 Mon Sep 17 00:00:00 2001 From: TheJudge156 Date: Thu, 18 Apr 2024 11:46:32 -0700 Subject: [PATCH 27/27] Prep for merge --- mods.json | 933 ++++++++---------- mods_new.json | 536 ++++++++++ .../java/pojlib/instance/InstanceHandler.java | 4 +- src/main/java/pojlib/util/APIHandler.java | 2 +- 4 files changed, 937 insertions(+), 538 deletions(-) create mode 100644 mods_new.json diff --git a/mods.json b/mods.json index 5ef0fb25..71497c12 100644 --- a/mods.json +++ b/mods.json @@ -1,536 +1,399 @@ -{ - "versions": [ - { - "name": "1.20.4", - "coreMods": [ - { - "slug": "Vivecraft", - "version": "1.0", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.4/vivecraft.jar" - }, - { - "slug": "Fabric-API", - "version": "0.91.2", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/yGY1P8Yr/fabric-api-0.91.2%2B1.20.4.jar" - } - ], - "defaultMods": [ - { - "slug": "Sodium", - "version": "0.5.5", - "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/InGKdfel/sodium-fabric-mc1.20.3-0.5.5.jar" - }, - { - "slug": "Cloth-Config", - "version": "13.0.114", - "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/YFpDLLdu/cloth-config-13.0.114-fabric.jar" - }, - { - "slug": "Fabric-Language-Kotlin", - "version": "1.10.16+kotlin.1.9.21", - "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/VJUqKopR/fabric-language-kotlin-1.10.16%2Bkotlin.1.9.21.jar" - }, - { - "slug": "Server-Core", - "version": "1.4.0", - "download_link": "https://cdn.modrinth.com/data/4WWQxlQP/versions/H1fXXdNC/servercore-fabric-1.4.0%2B1.20.3.jar" - }, - { - "slug": "C2me", - "version": "0.2.0+alpha.11.38", - "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/o0DcaA0L/c2me-fabric-mc1.20.4-0.2.0%2Balpha.11.38.jar" - }, - { - "slug": "ImmediatelyFast", - "version": "1.2.8", - "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/3EgIBnht/ImmediatelyFast-Fabric-1.2.8%2B1.20.4.jar" - }, - { - "slug": "Simple-Voice-Chat", - "version": "2.4.30", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/kp8RtRlH/voicechat-fabric-1.20.4-2.4.30.jar" - }, - { - "slug": "Modern-Fix", - "version": "5.10.0", - "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/vxDb5tOq/modernfix-fabric-5.10.0%2Bmc1.20.3.jar" - } - ] - }, - { - "name": "1.20.2", - "coreMods": [ - { - "slug": "Vivecraft", - "version": "1.1.1", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.2/vivecraft.jar" - }, - { - "slug": "Fabric-API", - "version": "0.91.1", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/qg6wQgub/fabric-api-0.91.1%2B1.20.2.jar" - } - ], - "defaultMods": [ - { - "slug": "Lithium", - "version": "0.12.0", - "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/qdzL5Hkg/lithium-fabric-mc1.20.2-0.12.0.jar" - }, - { - "slug": "Ferrite-Core", - "version": "6.0.1", - "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/unerR5MN/ferritecore-6.0.1-fabric.jar" - }, - { - "slug": "Entity-Culling", - "version": "1.6.2", - "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/BDwHAdWc/entityculling-fabric-1.6.2-mc1.20.1.jar" - }, - { - "slug": "Sodium", - "version": "0.5.5", - "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/pmgeU5yX/sodium-fabric-mc1.20.2-0.5.5.jar" - }, - { - "slug": "Cloth-Config", - "version": "12.0.109", - "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/LnfolBYb/cloth-config-12.0.109-fabric.jar" - }, - { - "slug": "Fabric-Language-Kotlin", - "version": "1.10.13+kotlin.1.9.20", - "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/atZwzPrT/fabric-language-kotlin-1.10.13%2Bkotlin.1.9.20.jar" - }, - { - "slug": "Krypton", - "version": "0.2.4", - "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/cQ60Ouax/krypton-0.2.4.jar" - }, - { - "slug": "Server-Core", - "version": "1.3.9", - "download_link": "https://cdn.modrinth.com/data/4WWQxlQP/versions/sicenHyA/servercore-fabric-1.3.9%2B1.20.2.jar" - }, - { - "slug": "Mod-Menu", - "version": "8.0.0", - "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/TwfjidT5/modmenu-8.0.0.jar" - }, - { - "slug": "C2me", - "version": "0.2.0+alpha.10.126", - "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/ilKwGRiJ/c2me-fabric-mc1.20.2-0.2.0%2Balpha.10.126.jar" - }, - { - "slug": "ImmediatelyFast", - "version": "1.2.6", - "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/mbeaDZtb/ImmediatelyFast-1.2.6%2B1.20.2.jar" - }, - { - "slug": "Simple-Voice-Chat", - "version": "2.4.28", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/5XcFdUYz/voicechat-fabric-1.20.2-2.4.28.jar" - }, - { - "slug": "Modern-Fix", - "version": "5.9.0", - "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/FDGaMHFj/modernfix-fabric-5.9.0%2Bmc1.20.1.jar" - } - ] - }, - { - "name": "1.20.1", - "coreMods": [ - { - "slug": "Vivecraft", - "version": "1.1.1", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.1/vivecraft.jar" - }, - { - "slug": "Fabric-API", - "version": "0.91.0", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/YblXfKtI/fabric-api-0.91.0%2B1.20.1.jar" - } - ], - "defaultMods": [ - { - "slug": "Lithium", - "version": "0.11.2", - "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/ZSNsJrPI/lithium-fabric-mc1.20.1-0.11.2.jar" - }, - { - "slug": "Ferrite-Core", - "version": "6.0.0", - "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/FCnCG6PS/ferritecore-6.0.0-fabric.jar" - }, - { - "slug": "Entity-Culling", - "version": "1.6.2", - "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/d20sUcYn/entityculling-fabric-1.6.2-mc1.20.jar" - }, - { - "slug": "Sodium", - "version": "0.5.2", - "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/6SSPmLc9/sodium-fabric-mc1.20.1-0.5.2.jar" - }, - { - "slug": "Cloth-Config", - "version": "11.0.99", - "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/y0kQixP8/cloth-config-11.0.99-fabric.jar" - }, - { - "slug": "FastLoad", - "version": "3.4.0", - "download_link": "https://cdn.modrinth.com/data/kCpssoSb/versions/ys9T20o4/Fastload%2B1.18.2-1.20-3.4.0.jar" - }, - { - "slug": "Fabric-Language-Kotlin", - "version": "1.9.5+kotlin.1.8.22", - "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/ADg3gvlr/fabric-language-kotlin-1.9.5%2Bkotlin.1.8.22.jar" - }, - { - "slug": "Krypton", - "version": "0.2.3", - "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/jiDwS0W1/krypton-0.2.3.jar" - }, - { - "slug": "Server-Core", - "version": "1.3.7-1.20.1", - "download_link": "https://cdn.modrinth.com/data/4WWQxlQP/versions/exA4UxFq/servercore-fabric-1.3.7%2B1.20.1.jar" - }, - { - "slug": "Mod-Menu", - "version": "7.0.1", - "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/RTFDnTKf/modmenu-7.0.1.jar" - }, - { - "slug": "C2me", - "version": "0.2.0+alpha.10.91", - "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/t4juSkze/c2me-fabric-mc1.20.1-0.2.0%2Balpha.10.91.jar" - }, - { - "slug": "ImmediatelyFast", - "version": "1.1.15", - "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/4IDo27OL/ImmediatelyFast-1.1.15%2B1.20.1.jar" - }, - { - "slug": "Simple-Voice-Chat", - "version": "2.4.12", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/NkZguN8n/voicechat-fabric-1.20.1-2.4.12.jar" - }, - { - "slug": "Modern-Fix", - "version": "5.9.0", - "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/FDGaMHFj/modernfix-fabric-5.9.0%2Bmc1.20.1.jar" - } - ] - }, - { - "name": "1.19.4", - "coreMods": [ - { - "slug": "Vivecraft", - "version": "1.1.1", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.19.4/vivecraft.jar" - }, - { - "slug": "Fabric-API", - "version": "0.87.2", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/nyAmoHlr/fabric-api-0.87.2%2B1.19.4.jar" - } - ], - "defaultMods": [ - { - "slug": "Simple-Voice-Chat", - "version": "2.4.10", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/cgPK1BnP/voicechat-fabric-1.19.4-2.4.10.jar" - }, - { - "slug": "Lithium", - "version": "0.11.1", - "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/14hWYkog/lithium-fabric-mc1.19.4-0.11.1.jar" - }, - { - "slug": "Ferrite-Core", - "version": "5.2.0", - "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/RbR7EG8T/ferritecore-5.2.0-fabric.jar" - }, - { - "slug": "Smooth-Boot", - "version": "1.7.0", - "download_link": "https://cdn.modrinth.com/data/FWumhS4T/versions/I9TkHxLI/smoothboot-fabric-1.19.4-1.7.0.jar" - }, - { - "slug": "Entity-Culling", - "version": "1.6.2", - "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/UvJN5Cy4/entityculling-fabric-1.6.2-mc1.19.4.jar" - }, - { - "slug": "Sodium", - "version": "0.4.10", - "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/b4hTi3mo/sodium-fabric-mc1.19.4-0.4.10%2Bbuild.24.jar" - }, - { - "slug": "Cloth-Config", - "version": "9.0.94", - "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/M3yxljrZ/cloth-config-9.0.94-fabric.jar" - }, - { - "slug": "Starlight", - "version": "1.1.1", - "download_link": "https://cdn.modrinth.com/data/H8CaAYZC/versions/1.1.1%2B1.19/starlight-1.1.1%2Bfabric.ae22326.jar" - }, - { - "slug": "Krypton", - "version": "0.2.2", - "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/Tncui9tU/krypton-0.2.2.jar" - }, - { - "slug": "Better-Biome-Blend", - "version": "1.19-1.3.6-fabric", - "download_link": "https://cdn.modrinth.com/data/Rs6c7WyL/versions/1.19.0-1.3.6/betterbiomeblend-1.19.0-1.3.6-fabric.jar" - }, - { - "slug": "FastLoad", - "version": "3.1.1", - "download_link": "https://cdn.modrinth.com/data/kCpssoSb/versions/tykaPrWr/Fastload%2B1.18.2-1.19.4-3.1.1.jar" - }, - { - "slug": "Fabric-Language-Kotlin", - "version": "1.9.3+kotlin.1.8.20", - "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/MkcO8aQ0/fabric-language-kotlin-1.9.3%2Bkotlin.1.8.20.jar" - }, - { - "slug": "Server-Core", - "version": "1.3.5-1.19.4", - "download_link": "https://cdn.modrinth.com/data/4WWQxlQP/versions/aq6o4qRe/servercore-1.3.5-1.19.4.jar" - }, - { - "slug": "Mod-Menu", - "version": "6.2.1", - "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/yjjsLqbS/modmenu-6.2.1.jar" - }, - { - "slug": "C2me", - "version": "0.2.0+alpha.10.51", - "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/2LxKBERD/c2me-fabric-mc1.19.4-0.2.0%2Balpha.10.51.jar" - }, - { - "slug": "ImmediatelyFast", - "version": "1.1.12", - "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/8IFFeKYy/ImmediatelyFast-1.1.12%2B1.19.4.jar" - }, - { - "slug": "Noxesium", - "version": "0.1.8", - "download_link": "https://cdn.modrinth.com/data/Kw7Sm3Xf/versions/5QKzTtlI/noxesium-0.1.8.jar" - }, - { - "slug": "Modern-Fix", - "version": "5.7.2", - "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/LXlsO4Vo/modernfix-fabric-5.7.2%2Bmc1.19.4.jar" - } - ] - }, - { - "name": "1.19.2", - "coreMods": [ - { - "slug": "Vivecraft", - "version": "1.1.3", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.19.2/vivecraft.jar" - }, - { - "slug": "Fabric-API", - "version": "0.77.0", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/6g95K303/fabric-api-0.77.0%2B1.19.2.jar" - } - ], - "defaultMods": [ - { - "slug": "LazyDFU", - "version": "1.3", - "download_link": "https://cdn.modrinth.com/data/hvFnDODi/versions/0.1.3/lazydfu-0.1.3.jar" - }, - { - "slug": "Simple-Voice-Chat", - "version": "2.4.10", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/onVH7UO9/voicechat-fabric-1.19.2-2.4.10.jar" - }, - { - "slug": "Lithium", - "version": "0.11.1", - "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/m6sVgAi6/lithium-fabric-mc1.19.2-0.11.1.jar" - }, - { - "slug": "Ferrite-Core", - "version": "5.0.3", - "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/kwjHqfz7/ferritecore-5.0.3-fabric.jar" - }, - { - "slug": "Smooth-Boot", - "version": "1.7.1", - "download_link": "https://cdn.modrinth.com/data/FWumhS4T/versions/1.19-1.7.1/smoothboot-fabric-1.19-1.7.1.jar" - }, - { - "slug": "Entity-Culling", - "version": "1.6.1", - "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/twdGLDHv/entityculling-fabric-1.6.1-mc1.19.2.jar" - }, - { - "slug": "Sodium", - "version": "0.4.4", - "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/rAfhHfow/sodium-fabric-mc1.19.2-0.4.4%2Bbuild.18.jar" - }, - { - "slug": "Cloth-Config", - "version": "8.2.88", - "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/EXrxCjl6/cloth-config-8.2.88-fabric.jar" - }, - { - "slug": "Starlight", - "version": "1.1.1", - "download_link": "https://cdn.modrinth.com/data/H8CaAYZC/versions/1.1.1%2B1.19/starlight-1.1.1%2Bfabric.ae22326.jar" - }, - { - "slug": "Krypton", - "version": "0.2.1", - "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/0.2.1/krypton-0.2.1.jar" - }, - { - "slug": "Mod_Menu", - "version": "4.2.0-beta.2", - "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/gSoPJyVn/modmenu-4.2.0-beta.2.jar" - }, - { - "slug": "C2me", - "version": "0.2.0+alpha.9.9", - "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/8rUarScX/c2me-fabric-mc1.19.2-0.2.0%2Balpha.9.9.jar" - }, - { - "slug": "Better-Biome-Blend", - "version": "1.3.6", - "download_link": "https://cdn.modrinth.com/data/Rs6c7WyL/versions/1.19.0-1.3.6/betterbiomeblend-1.19.0-1.3.6-fabric.jar" - }, - { - "slug": "ImmediatelyFast", - "version": "1.1.12", - "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/4yVqQKQO/ImmediatelyFast-1.1.12%2B1.19.jar" - }, - { - "slug": "Noxesium", - "version": "0.1.4", - "download_link": "https://cdn.modrinth.com/data/Kw7Sm3Xf/versions/WhRq6Q4n/noxesium-0.1.4.jar" - }, - { - "slug": "Modern-Fix", - "version": "5.9.0", - "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/b1FKKAz8/modernfix-fabric-5.9.0%2Bmc1.19.2.jar" - } - ] - }, - { - "name": "1.18.2", - "coreMods": [ - { - "slug": "Vivecraft", - "version": "1.1.3", - "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.18.2/vivecraft.jar" - }, - { - "slug": "Fabric-API", - "version": "0.77.0", - "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/qk28POfr/fabric-api-0.77.0%2B1.18.2.jar" - } - ], - "defaultMods": [ - { - "slug": "LazyDFU", - "version": "1.2", - "download_link": "https://cdn.modrinth.com/data/hvFnDODi/versions/0.1.2/lazydfu-0.1.2.jar" - }, - { - "slug": "Simple-Voice-Chat", - "version": "2.4.10", - "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/QKFGOJUD/voicechat-fabric-1.18.2-2.4.10.jar" - }, - { - "slug": "Lithium", - "version": "0.10.3", - "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/ALnv7Npy/lithium-fabric-mc1.18.2-0.10.3.jar" - }, - { - "slug": "Ferrite-Core", - "version": "4.2.1", - "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/4.2.0/ferritecore-4.2.0-fabric.jar" - }, - { - "slug": "Smooth-Boot", - "version": "1.7.0", - "download_link": "https://cdn.modrinth.com/data/FWumhS4T/versions/iy4eaYy2/smoothboot-fabric-1.18.2-1.7.0.jar" - }, - { - "slug": "Entity-Culling", - "version": "1.5.1", - "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/1.5.1-fabric-1.18/entityculling-fabric-mc1.18-1.5.1.jar" - }, - { - "slug": "Sodium", - "version": "0.4.1", - "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/mc1.18.2-0.4.1/sodium-fabric-mc1.18.2-0.4.1%2Bbuild.15.jar" - }, - { - "slug": "Better-Biome-Blend", - "version": "1.3.5", - "download_link": "https://cdn.modrinth.com/data/Rs6c7WyL/versions/1.18.2-1.3.5-fabric/betterbiomeblend-1.18.2-1.3.5-fabric.jar" - }, - { - "slug": "C2me", - "version": "0.2.0", - "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/U5BK0DTf/c2me-fabric-mc1.18.2-0.2.0%2Balpha.7.35.jar" - }, - { - "slug": "Cloth-Config", - "version": "6.3.81", - "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/gPqHXnrg/cloth-config-6.3.81-fabric.jar" - }, - { - "slug": "Cull-Less-Leaves", - "version": "1.0.1", - "download_link": "https://cdn.modrinth.com/data/iG6ZHsUV/versions/1.0.1/CullLessLeaves-1.0.1.jar" - }, - { - "slug": "FastLoad", - "version": "1.5.9", - "download_link": "https://cdn.modrinth.com/data/kCpssoSb/versions/K9vr5fdy/Fastload%2B1.18.2-1.5.9.jar" - }, - { - "slug": "ImmediatelyFast", - "version": "1.1.6", - "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/zImGOGqD/ImmediatelyFast-1.1.6%2B1.18.2.jar" - }, - { - "slug": "Starlight", - "version": "1.0.2", - "download_link": "https://cdn.modrinth.com/data/H8CaAYZC/versions/1.0.2%2B1.18.2/starlight-1.0.2%2Bfabric.89b8d9f.jar" - }, - { - "slug": "Krypton", - "version": "0.1.9", - "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/0.1.9/krypton-0.1.9.jar" - }, - { - "slug": "Mod-Menu", - "version": "3.2.5", - "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/nVxObSbX/modmenu-3.2.5.jar" - }, - { - "slug": "Modern-Fix", - "version": "5.9.0", - "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/qNrVNwfw/modernfix-fabric-5.9.0%2Bmc1.18.2.jar" - } - ] - } - ] +{ + "versions": [ + { + "name": "1.20.1", + "mods": [ + { + "slug": "Vivecraft", + "version": "0.2", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v0.1-1.20-Zink/vivecraft.jar" + }, + { + "slug": "Fabric-API", + "version": "0.91.0", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/YblXfKtI/fabric-api-0.91.0%2B1.20.1.jar" + }, + { + "slug": "Lithium", + "version": "0.11.2", + "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/ZSNsJrPI/lithium-fabric-mc1.20.1-0.11.2.jar" + }, + { + "slug": "Ferrite-Core", + "version": "6.0.0", + "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/FCnCG6PS/ferritecore-6.0.0-fabric.jar" + }, + { + "slug": "Entity-Culling", + "version": "1.6.2", + "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/d20sUcYn/entityculling-fabric-1.6.2-mc1.20.jar" + }, + { + "slug": "Sodium", + "version": "0.5.3", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/4OZL6q9h/sodium-fabric-mc1.20.1-0.5.3.jar" + }, + { + "slug": "Cloth-Config", + "version": "11.0.99", + "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/y0kQixP8/cloth-config-11.0.99-fabric.jar" + }, + { + "slug": "FastLoad", + "version": "3.4.0", + "download_link": "https://cdn.modrinth.com/data/kCpssoSb/versions/ys9T20o4/Fastload%2B1.18.2-1.20-3.4.0.jar" + }, + { + "slug": "Fabric-Language-Kotlin", + "version": "1.9.5+kotlin.1.8.22", + "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/ADg3gvlr/fabric-language-kotlin-1.9.5%2Bkotlin.1.8.22.jar" + }, + { + "slug": "Krypton", + "version": "0.2.3", + "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/jiDwS0W1/krypton-0.2.3.jar" + }, + { + "slug": "Server-Core", + "version": "1.3.7-1.20.1", + "download_link": "https://cdn.modrinth.com/data/4WWQxlQP/versions/exA4UxFq/servercore-fabric-1.3.7%2B1.20.1.jar" + }, + { + "slug": "Mod-Menu", + "version": "7.0.1", + "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/RTFDnTKf/modmenu-7.0.1.jar" + }, + { + "slug": "C2me", + "version": "0.2.0+alpha.10.91", + "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/t4juSkze/c2me-fabric-mc1.20.1-0.2.0%2Balpha.10.91.jar" + }, + { + "slug": "ImmediatelyFast", + "version": "1.1.15", + "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/4IDo27OL/ImmediatelyFast-1.1.15%2B1.20.1.jar" + }, + { + "slug": "Simple-Voice-Chat", + "version": "2.5.1", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/ot113WbU/voicechat-fabric-1.20.1-2.5.1.jar" + }, + { + "slug": "Modern-Fix", + "version": "5.9.0", + "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/FDGaMHFj/modernfix-fabric-5.9.0%2Bmc1.20.1.jar" + }, + { + "slug": "Fabric-Language-Kotlin", + "version": "1.9.5+kotlin.1.8.22", + "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/ADg3gvlr/fabric-language-kotlin-1.9.5%2Bkotlin.1.8.22.jar" + } + ] + }, + { + "name": "1.19.4", + "mods": [ + { + "slug": "Vivecraft", + "version": "0.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v0.1-1.19.4-Zink/vivecraft.jar" + }, + { + "slug": "Fabric-API", + "version": "0.87.2", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/nyAmoHlr/fabric-api-0.87.2%2B1.19.4.jar" + }, + { + "slug": "Simple-Voice-Chat", + "version": "2.5.1", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/u7rKquVn/voicechat-fabric-1.19.4-2.5.1.jar" + }, + { + "slug": "Lithium", + "version": "0.11.1", + "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/14hWYkog/lithium-fabric-mc1.19.4-0.11.1.jar" + }, + { + "slug": "Ferrite-Core", + "version": "5.2.0", + "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/RbR7EG8T/ferritecore-5.2.0-fabric.jar" + }, + { + "slug": "Smooth-Boot", + "version": "1.7.0", + "download_link": "https://cdn.modrinth.com/data/FWumhS4T/versions/I9TkHxLI/smoothboot-fabric-1.19.4-1.7.0.jar" + }, + { + "slug": "Entity-Culling", + "version": "1.6.2", + "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/UvJN5Cy4/entityculling-fabric-1.6.2-mc1.19.4.jar" + }, + { + "slug": "Sodium", + "version": "0.4.10", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/b4hTi3mo/sodium-fabric-mc1.19.4-0.4.10%2Bbuild.24.jar" + }, + { + "slug": "Cloth-Config", + "version": "9.0.94", + "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/M3yxljrZ/cloth-config-9.0.94-fabric.jar" + }, + { + "slug": "Starlight", + "version": "1.1.1", + "download_link": "https://cdn.modrinth.com/data/H8CaAYZC/versions/1.1.1%2B1.19/starlight-1.1.1%2Bfabric.ae22326.jar" + }, + { + "slug": "Krypton", + "version": "0.2.2", + "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/Tncui9tU/krypton-0.2.2.jar" + }, + { + "slug": "Better-Biome-Blend", + "version": "1.19-1.3.6-fabric", + "download_link": "https://cdn.modrinth.com/data/Rs6c7WyL/versions/1.19.0-1.3.6/betterbiomeblend-1.19.0-1.3.6-fabric.jar" + }, + { + "slug": "FastLoad", + "version": "3.1.1", + "download_link": "https://cdn.modrinth.com/data/kCpssoSb/versions/tykaPrWr/Fastload%2B1.18.2-1.19.4-3.1.1.jar" + }, + { + "slug": "Fabric-Language-Kotlin", + "version": "1.9.3+kotlin.1.8.20", + "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/MkcO8aQ0/fabric-language-kotlin-1.9.3%2Bkotlin.1.8.20.jar" + }, + { + "slug": "Server-Core", + "version": "1.3.5-1.19.4", + "download_link": "https://cdn.modrinth.com/data/4WWQxlQP/versions/aq6o4qRe/servercore-1.3.5-1.19.4.jar" + }, + { + "slug": "Mod-Menu", + "version": "6.2.1", + "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/yjjsLqbS/modmenu-6.2.1.jar" + }, + { + "slug": "C2me", + "version": "0.2.0+alpha.10.51", + "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/2LxKBERD/c2me-fabric-mc1.19.4-0.2.0%2Balpha.10.51.jar" + }, + { + "slug": "ImmediatelyFast", + "version": "1.1.12", + "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/8IFFeKYy/ImmediatelyFast-1.1.12%2B1.19.4.jar" + }, + { + "slug": "Noxesium", + "version": "0.1.8", + "download_link": "https://cdn.modrinth.com/data/Kw7Sm3Xf/versions/5QKzTtlI/noxesium-0.1.8.jar" + }, + { + "slug": "Modern-Fix", + "version": "5.7.2", + "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/LXlsO4Vo/modernfix-fabric-5.7.2%2Bmc1.19.4.jar" + }, + { + "slug": "Fabric-Language-Kotlin", + "version": "1.9.3+kotlin.1.8.20", + "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/MkcO8aQ0/fabric-language-kotlin-1.9.3%2Bkotlin.1.8.20.jar" + } + ] + }, + { + "name": "1.19.2", + "mods": [ + { + "slug": "Vivecraft", + "version": "0.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v0.1-1.19.2-Zink/vivecraft.jar" + }, + { + "slug": "Fabric-API", + "version": "0.77.0", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/6g95K303/fabric-api-0.77.0%2B1.19.2.jar" + }, + { + "slug": "LazyDFU", + "version": "1.3", + "download_link": "https://cdn.modrinth.com/data/hvFnDODi/versions/0.1.3/lazydfu-0.1.3.jar" + }, + { + "slug": "Simple-Voice-Chat", + "version": "2.5.1", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/KfPEtgDQ/voicechat-fabric-1.19.2-2.5.1.jar" + }, + { + "slug": "Lithium", + "version": "0.11.1", + "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/m6sVgAi6/lithium-fabric-mc1.19.2-0.11.1.jar" + }, + { + "slug": "Ferrite-Core", + "version": "5.0.3", + "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/kwjHqfz7/ferritecore-5.0.3-fabric.jar" + }, + { + "slug": "Smooth-Boot", + "version": "1.7.1", + "download_link": "https://cdn.modrinth.com/data/FWumhS4T/versions/1.19-1.7.1/smoothboot-fabric-1.19-1.7.1.jar" + }, + { + "slug": "Entity-Culling", + "version": "1.6.1", + "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/twdGLDHv/entityculling-fabric-1.6.1-mc1.19.2.jar" + }, + { + "slug": "Sodium", + "version": "0.4.4", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/rAfhHfow/sodium-fabric-mc1.19.2-0.4.4%2Bbuild.18.jar" + }, + { + "slug": "Cloth-Config", + "version": "8.2.88", + "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/EXrxCjl6/cloth-config-8.2.88-fabric.jar" + }, + { + "slug": "Starlight", + "version": "1.1.1", + "download_link": "https://cdn.modrinth.com/data/H8CaAYZC/versions/1.1.1%2B1.19/starlight-1.1.1%2Bfabric.ae22326.jar" + }, + { + "slug": "Krypton", + "version": "0.2.1", + "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/0.2.1/krypton-0.2.1.jar" + }, + { + "slug": "Mod_Menu", + "version": "4.2.0-beta.2", + "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/gSoPJyVn/modmenu-4.2.0-beta.2.jar" + }, + { + "slug": "C2me", + "version": "0.2.0+alpha.9.9", + "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/8rUarScX/c2me-fabric-mc1.19.2-0.2.0%2Balpha.9.9.jar" + }, + { + "slug": "Better-Biome-Blend", + "version": "1.3.6", + "download_link": "https://cdn.modrinth.com/data/Rs6c7WyL/versions/1.19.0-1.3.6/betterbiomeblend-1.19.0-1.3.6-fabric.jar" + }, + { + "slug": "ImmediatelyFast", + "version": "1.1.12", + "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/4yVqQKQO/ImmediatelyFast-1.1.12%2B1.19.jar" + }, + { + "slug": "Noxesium", + "version": "0.1.4", + "download_link": "https://cdn.modrinth.com/data/Kw7Sm3Xf/versions/WhRq6Q4n/noxesium-0.1.4.jar" + }, + { + "slug": "Modern-Fix", + "version": "5.9.0", + "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/b1FKKAz8/modernfix-fabric-5.9.0%2Bmc1.19.2.jar" + } + ] + }, + { + "name": "1.18.2", + "mods": [ + { + "slug": "Vivecraft", + "version": "0.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftMod/releases/download/v0.1-1.18.2-Zink/vivecraft.jar" + }, + { + "slug": "Fabric-API", + "version": "0.77.0", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/qk28POfr/fabric-api-0.77.0%2B1.18.2.jar" + }, + { + "slug": "LazyDFU", + "version": "1.2", + "download_link": "https://cdn.modrinth.com/data/hvFnDODi/versions/0.1.2/lazydfu-0.1.2.jar" + }, + { + "slug": "Simple-Voice-Chat", + "version": "2.5.1", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/oz82VCKL/voicechat-fabric-1.18.2-2.5.1.jar" + }, + { + "slug": "Lithium", + "version": "0.10.3", + "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/ALnv7Npy/lithium-fabric-mc1.18.2-0.10.3.jar" + }, + { + "slug": "Ferrite-Core", + "version": "4.2.1", + "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/4.2.0/ferritecore-4.2.0-fabric.jar" + }, + { + "slug": "Smooth-Boot", + "version": "1.7.0", + "download_link": "https://cdn.modrinth.com/data/FWumhS4T/versions/iy4eaYy2/smoothboot-fabric-1.18.2-1.7.0.jar" + }, + { + "slug": "Entity-Culling", + "version": "1.5.1", + "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/1.5.1-fabric-1.18/entityculling-fabric-mc1.18-1.5.1.jar" + }, + { + "slug": "Sodium", + "version": "0.4.1", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/mc1.18.2-0.4.1/sodium-fabric-mc1.18.2-0.4.1%2Bbuild.15.jar" + }, + { + "slug": "Better-Biome-Blend", + "version": "1.3.5", + "download_link": "https://cdn.modrinth.com/data/Rs6c7WyL/versions/1.18.2-1.3.5-fabric/betterbiomeblend-1.18.2-1.3.5-fabric.jar" + }, + { + "slug": "C2me", + "version": "0.2.0", + "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/U5BK0DTf/c2me-fabric-mc1.18.2-0.2.0%2Balpha.7.35.jar" + }, + { + "slug": "Cloth-Config", + "version": "6.3.81", + "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/gPqHXnrg/cloth-config-6.3.81-fabric.jar" + }, + { + "slug": "Cull-Less-Leaves", + "version": "1.0.1", + "download_link": "https://cdn.modrinth.com/data/iG6ZHsUV/versions/1.0.1/CullLessLeaves-1.0.1.jar" + }, + { + "slug": "FastLoad", + "version": "1.5.9", + "download_link": "https://cdn.modrinth.com/data/kCpssoSb/versions/K9vr5fdy/Fastload%2B1.18.2-1.5.9.jar" + }, + { + "slug": "ImmediatelyFast", + "version": "1.1.6", + "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/zImGOGqD/ImmediatelyFast-1.1.6%2B1.18.2.jar" + }, + { + "slug": "Starlight", + "version": "1.0.2", + "download_link": "https://cdn.modrinth.com/data/H8CaAYZC/versions/1.0.2%2B1.18.2/starlight-1.0.2%2Bfabric.89b8d9f.jar" + }, + { + "slug": "Krypton", + "version": "0.1.9", + "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/0.1.9/krypton-0.1.9.jar" + }, + { + "slug": "Mod-Menu", + "version": "3.2.5", + "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/nVxObSbX/modmenu-3.2.5.jar" + }, + { + "slug": "Modern-Fix", + "version": "5.9.0", + "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/qNrVNwfw/modernfix-fabric-5.9.0%2Bmc1.18.2.jar" + } + ] + } + ] } \ No newline at end of file diff --git a/mods_new.json b/mods_new.json new file mode 100644 index 00000000..f7cf0d57 --- /dev/null +++ b/mods_new.json @@ -0,0 +1,536 @@ +{ + "versions": [ + { + "name": "1.20.4", + "coreMods": [ + { + "slug": "Vivecraft", + "version": "1.0", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.4/vivecraft.jar" + }, + { + "slug": "Fabric-API", + "version": "0.91.2", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/yGY1P8Yr/fabric-api-0.91.2%2B1.20.4.jar" + } + ], + "defaultMods": [ + { + "slug": "Sodium", + "version": "0.5.5", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/InGKdfel/sodium-fabric-mc1.20.3-0.5.5.jar" + }, + { + "slug": "Cloth-Config", + "version": "13.0.114", + "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/YFpDLLdu/cloth-config-13.0.114-fabric.jar" + }, + { + "slug": "Fabric-Language-Kotlin", + "version": "1.10.16+kotlin.1.9.21", + "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/VJUqKopR/fabric-language-kotlin-1.10.16%2Bkotlin.1.9.21.jar" + }, + { + "slug": "Server-Core", + "version": "1.4.0", + "download_link": "https://cdn.modrinth.com/data/4WWQxlQP/versions/H1fXXdNC/servercore-fabric-1.4.0%2B1.20.3.jar" + }, + { + "slug": "C2me", + "version": "0.2.0+alpha.11.38", + "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/o0DcaA0L/c2me-fabric-mc1.20.4-0.2.0%2Balpha.11.38.jar" + }, + { + "slug": "ImmediatelyFast", + "version": "1.2.8", + "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/3EgIBnht/ImmediatelyFast-Fabric-1.2.8%2B1.20.4.jar" + }, + { + "slug": "Simple-Voice-Chat", + "version": "2.4.30", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/kp8RtRlH/voicechat-fabric-1.20.4-2.4.30.jar" + }, + { + "slug": "Modern-Fix", + "version": "5.10.0", + "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/vxDb5tOq/modernfix-fabric-5.10.0%2Bmc1.20.3.jar" + } + ] + }, + { + "name": "1.20.2", + "coreMods": [ + { + "slug": "Vivecraft", + "version": "1.1.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.2/vivecraft.jar" + }, + { + "slug": "Fabric-API", + "version": "0.91.1", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/qg6wQgub/fabric-api-0.91.1%2B1.20.2.jar" + } + ], + "defaultMods": [ + { + "slug": "Lithium", + "version": "0.12.0", + "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/qdzL5Hkg/lithium-fabric-mc1.20.2-0.12.0.jar" + }, + { + "slug": "Ferrite-Core", + "version": "6.0.1", + "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/unerR5MN/ferritecore-6.0.1-fabric.jar" + }, + { + "slug": "Entity-Culling", + "version": "1.6.2", + "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/BDwHAdWc/entityculling-fabric-1.6.2-mc1.20.1.jar" + }, + { + "slug": "Sodium", + "version": "0.5.5", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/pmgeU5yX/sodium-fabric-mc1.20.2-0.5.5.jar" + }, + { + "slug": "Cloth-Config", + "version": "12.0.109", + "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/LnfolBYb/cloth-config-12.0.109-fabric.jar" + }, + { + "slug": "Fabric-Language-Kotlin", + "version": "1.10.13+kotlin.1.9.20", + "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/atZwzPrT/fabric-language-kotlin-1.10.13%2Bkotlin.1.9.20.jar" + }, + { + "slug": "Krypton", + "version": "0.2.4", + "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/cQ60Ouax/krypton-0.2.4.jar" + }, + { + "slug": "Server-Core", + "version": "1.3.9", + "download_link": "https://cdn.modrinth.com/data/4WWQxlQP/versions/sicenHyA/servercore-fabric-1.3.9%2B1.20.2.jar" + }, + { + "slug": "Mod-Menu", + "version": "8.0.0", + "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/TwfjidT5/modmenu-8.0.0.jar" + }, + { + "slug": "C2me", + "version": "0.2.0+alpha.10.126", + "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/ilKwGRiJ/c2me-fabric-mc1.20.2-0.2.0%2Balpha.10.126.jar" + }, + { + "slug": "ImmediatelyFast", + "version": "1.2.6", + "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/mbeaDZtb/ImmediatelyFast-1.2.6%2B1.20.2.jar" + }, + { + "slug": "Simple-Voice-Chat", + "version": "2.4.28", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/5XcFdUYz/voicechat-fabric-1.20.2-2.4.28.jar" + }, + { + "slug": "Modern-Fix", + "version": "5.9.0", + "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/FDGaMHFj/modernfix-fabric-5.9.0%2Bmc1.20.1.jar" + } + ] + }, + { + "name": "1.20.1", + "coreMods": [ + { + "slug": "Vivecraft", + "version": "1.1.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.20.1/vivecraft.jar" + }, + { + "slug": "Fabric-API", + "version": "0.91.0", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/YblXfKtI/fabric-api-0.91.0%2B1.20.1.jar" + } + ], + "defaultMods": [ + { + "slug": "Lithium", + "version": "0.11.2", + "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/ZSNsJrPI/lithium-fabric-mc1.20.1-0.11.2.jar" + }, + { + "slug": "Ferrite-Core", + "version": "6.0.0", + "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/FCnCG6PS/ferritecore-6.0.0-fabric.jar" + }, + { + "slug": "Entity-Culling", + "version": "1.6.2", + "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/d20sUcYn/entityculling-fabric-1.6.2-mc1.20.jar" + }, + { + "slug": "Sodium", + "version": "0.5.2", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/6SSPmLc9/sodium-fabric-mc1.20.1-0.5.2.jar" + }, + { + "slug": "Cloth-Config", + "version": "11.0.99", + "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/y0kQixP8/cloth-config-11.0.99-fabric.jar" + }, + { + "slug": "FastLoad", + "version": "3.4.0", + "download_link": "https://cdn.modrinth.com/data/kCpssoSb/versions/ys9T20o4/Fastload%2B1.18.2-1.20-3.4.0.jar" + }, + { + "slug": "Fabric-Language-Kotlin", + "version": "1.9.5+kotlin.1.8.22", + "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/ADg3gvlr/fabric-language-kotlin-1.9.5%2Bkotlin.1.8.22.jar" + }, + { + "slug": "Krypton", + "version": "0.2.3", + "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/jiDwS0W1/krypton-0.2.3.jar" + }, + { + "slug": "Server-Core", + "version": "1.3.7-1.20.1", + "download_link": "https://cdn.modrinth.com/data/4WWQxlQP/versions/exA4UxFq/servercore-fabric-1.3.7%2B1.20.1.jar" + }, + { + "slug": "Mod-Menu", + "version": "7.0.1", + "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/RTFDnTKf/modmenu-7.0.1.jar" + }, + { + "slug": "C2me", + "version": "0.2.0+alpha.10.91", + "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/t4juSkze/c2me-fabric-mc1.20.1-0.2.0%2Balpha.10.91.jar" + }, + { + "slug": "ImmediatelyFast", + "version": "1.1.15", + "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/4IDo27OL/ImmediatelyFast-1.1.15%2B1.20.1.jar" + }, + { + "slug": "Simple-Voice-Chat", + "version": "2.4.12", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/NkZguN8n/voicechat-fabric-1.20.1-2.4.12.jar" + }, + { + "slug": "Modern-Fix", + "version": "5.9.0", + "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/FDGaMHFj/modernfix-fabric-5.9.0%2Bmc1.20.1.jar" + } + ] + }, + { + "name": "1.19.4", + "coreMods": [ + { + "slug": "Vivecraft", + "version": "1.1.1", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.19.4/vivecraft.jar" + }, + { + "slug": "Fabric-API", + "version": "0.87.2", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/nyAmoHlr/fabric-api-0.87.2%2B1.19.4.jar" + } + ], + "defaultMods": [ + { + "slug": "Simple-Voice-Chat", + "version": "2.4.10", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/cgPK1BnP/voicechat-fabric-1.19.4-2.4.10.jar" + }, + { + "slug": "Lithium", + "version": "0.11.1", + "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/14hWYkog/lithium-fabric-mc1.19.4-0.11.1.jar" + }, + { + "slug": "Ferrite-Core", + "version": "5.2.0", + "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/RbR7EG8T/ferritecore-5.2.0-fabric.jar" + }, + { + "slug": "Smooth-Boot", + "version": "1.7.0", + "download_link": "https://cdn.modrinth.com/data/FWumhS4T/versions/I9TkHxLI/smoothboot-fabric-1.19.4-1.7.0.jar" + }, + { + "slug": "Entity-Culling", + "version": "1.6.2", + "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/UvJN5Cy4/entityculling-fabric-1.6.2-mc1.19.4.jar" + }, + { + "slug": "Sodium", + "version": "0.4.10", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/b4hTi3mo/sodium-fabric-mc1.19.4-0.4.10%2Bbuild.24.jar" + }, + { + "slug": "Cloth-Config", + "version": "9.0.94", + "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/M3yxljrZ/cloth-config-9.0.94-fabric.jar" + }, + { + "slug": "Starlight", + "version": "1.1.1", + "download_link": "https://cdn.modrinth.com/data/H8CaAYZC/versions/1.1.1%2B1.19/starlight-1.1.1%2Bfabric.ae22326.jar" + }, + { + "slug": "Krypton", + "version": "0.2.2", + "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/Tncui9tU/krypton-0.2.2.jar" + }, + { + "slug": "Better-Biome-Blend", + "version": "1.19-1.3.6-fabric", + "download_link": "https://cdn.modrinth.com/data/Rs6c7WyL/versions/1.19.0-1.3.6/betterbiomeblend-1.19.0-1.3.6-fabric.jar" + }, + { + "slug": "FastLoad", + "version": "3.1.1", + "download_link": "https://cdn.modrinth.com/data/kCpssoSb/versions/tykaPrWr/Fastload%2B1.18.2-1.19.4-3.1.1.jar" + }, + { + "slug": "Fabric-Language-Kotlin", + "version": "1.9.3+kotlin.1.8.20", + "download_link": "https://cdn.modrinth.com/data/Ha28R6CL/versions/MkcO8aQ0/fabric-language-kotlin-1.9.3%2Bkotlin.1.8.20.jar" + }, + { + "slug": "Server-Core", + "version": "1.3.5-1.19.4", + "download_link": "https://cdn.modrinth.com/data/4WWQxlQP/versions/aq6o4qRe/servercore-1.3.5-1.19.4.jar" + }, + { + "slug": "Mod-Menu", + "version": "6.2.1", + "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/yjjsLqbS/modmenu-6.2.1.jar" + }, + { + "slug": "C2me", + "version": "0.2.0+alpha.10.51", + "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/2LxKBERD/c2me-fabric-mc1.19.4-0.2.0%2Balpha.10.51.jar" + }, + { + "slug": "ImmediatelyFast", + "version": "1.1.12", + "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/8IFFeKYy/ImmediatelyFast-1.1.12%2B1.19.4.jar" + }, + { + "slug": "Noxesium", + "version": "0.1.8", + "download_link": "https://cdn.modrinth.com/data/Kw7Sm3Xf/versions/5QKzTtlI/noxesium-0.1.8.jar" + }, + { + "slug": "Modern-Fix", + "version": "5.7.2", + "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/LXlsO4Vo/modernfix-fabric-5.7.2%2Bmc1.19.4.jar" + } + ] + }, + { + "name": "1.19.2", + "coreMods": [ + { + "slug": "Vivecraft", + "version": "1.1.3", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.19.2/vivecraft.jar" + }, + { + "slug": "Fabric-API", + "version": "0.77.0", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/6g95K303/fabric-api-0.77.0%2B1.19.2.jar" + } + ], + "defaultMods": [ + { + "slug": "LazyDFU", + "version": "1.3", + "download_link": "https://cdn.modrinth.com/data/hvFnDODi/versions/0.1.3/lazydfu-0.1.3.jar" + }, + { + "slug": "Simple-Voice-Chat", + "version": "2.4.10", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/onVH7UO9/voicechat-fabric-1.19.2-2.4.10.jar" + }, + { + "slug": "Lithium", + "version": "0.11.1", + "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/m6sVgAi6/lithium-fabric-mc1.19.2-0.11.1.jar" + }, + { + "slug": "Ferrite-Core", + "version": "5.0.3", + "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/kwjHqfz7/ferritecore-5.0.3-fabric.jar" + }, + { + "slug": "Smooth-Boot", + "version": "1.7.1", + "download_link": "https://cdn.modrinth.com/data/FWumhS4T/versions/1.19-1.7.1/smoothboot-fabric-1.19-1.7.1.jar" + }, + { + "slug": "Entity-Culling", + "version": "1.6.1", + "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/twdGLDHv/entityculling-fabric-1.6.1-mc1.19.2.jar" + }, + { + "slug": "Sodium", + "version": "0.4.4", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/rAfhHfow/sodium-fabric-mc1.19.2-0.4.4%2Bbuild.18.jar" + }, + { + "slug": "Cloth-Config", + "version": "8.2.88", + "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/EXrxCjl6/cloth-config-8.2.88-fabric.jar" + }, + { + "slug": "Starlight", + "version": "1.1.1", + "download_link": "https://cdn.modrinth.com/data/H8CaAYZC/versions/1.1.1%2B1.19/starlight-1.1.1%2Bfabric.ae22326.jar" + }, + { + "slug": "Krypton", + "version": "0.2.1", + "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/0.2.1/krypton-0.2.1.jar" + }, + { + "slug": "Mod_Menu", + "version": "4.2.0-beta.2", + "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/gSoPJyVn/modmenu-4.2.0-beta.2.jar" + }, + { + "slug": "C2me", + "version": "0.2.0+alpha.9.9", + "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/8rUarScX/c2me-fabric-mc1.19.2-0.2.0%2Balpha.9.9.jar" + }, + { + "slug": "Better-Biome-Blend", + "version": "1.3.6", + "download_link": "https://cdn.modrinth.com/data/Rs6c7WyL/versions/1.19.0-1.3.6/betterbiomeblend-1.19.0-1.3.6-fabric.jar" + }, + { + "slug": "ImmediatelyFast", + "version": "1.1.12", + "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/4yVqQKQO/ImmediatelyFast-1.1.12%2B1.19.jar" + }, + { + "slug": "Noxesium", + "version": "0.1.4", + "download_link": "https://cdn.modrinth.com/data/Kw7Sm3Xf/versions/WhRq6Q4n/noxesium-0.1.4.jar" + }, + { + "slug": "Modern-Fix", + "version": "5.9.0", + "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/b1FKKAz8/modernfix-fabric-5.9.0%2Bmc1.19.2.jar" + } + ] + }, + { + "name": "1.18.2", + "coreMods": [ + { + "slug": "Vivecraft", + "version": "1.1.3", + "download_link": "https://github.com/QuestCraftPlusPlus/VivecraftBuilder/releases/download/1.18.2/vivecraft.jar" + }, + { + "slug": "Fabric-API", + "version": "0.77.0", + "download_link": "https://cdn.modrinth.com/data/P7dR8mSH/versions/qk28POfr/fabric-api-0.77.0%2B1.18.2.jar" + } + ], + "defaultMods": [ + { + "slug": "LazyDFU", + "version": "1.2", + "download_link": "https://cdn.modrinth.com/data/hvFnDODi/versions/0.1.2/lazydfu-0.1.2.jar" + }, + { + "slug": "Simple-Voice-Chat", + "version": "2.4.10", + "download_link": "https://cdn.modrinth.com/data/9eGKb6K1/versions/QKFGOJUD/voicechat-fabric-1.18.2-2.4.10.jar" + }, + { + "slug": "Lithium", + "version": "0.10.3", + "download_link": "https://cdn.modrinth.com/data/gvQqBUqZ/versions/ALnv7Npy/lithium-fabric-mc1.18.2-0.10.3.jar" + }, + { + "slug": "Ferrite-Core", + "version": "4.2.1", + "download_link": "https://cdn.modrinth.com/data/uXXizFIs/versions/4.2.0/ferritecore-4.2.0-fabric.jar" + }, + { + "slug": "Smooth-Boot", + "version": "1.7.0", + "download_link": "https://cdn.modrinth.com/data/FWumhS4T/versions/iy4eaYy2/smoothboot-fabric-1.18.2-1.7.0.jar" + }, + { + "slug": "Entity-Culling", + "version": "1.5.1", + "download_link": "https://cdn.modrinth.com/data/NNAgCjsB/versions/1.5.1-fabric-1.18/entityculling-fabric-mc1.18-1.5.1.jar" + }, + { + "slug": "Sodium", + "version": "0.4.1", + "download_link": "https://cdn.modrinth.com/data/AANobbMI/versions/mc1.18.2-0.4.1/sodium-fabric-mc1.18.2-0.4.1%2Bbuild.15.jar" + }, + { + "slug": "Better-Biome-Blend", + "version": "1.3.5", + "download_link": "https://cdn.modrinth.com/data/Rs6c7WyL/versions/1.18.2-1.3.5-fabric/betterbiomeblend-1.18.2-1.3.5-fabric.jar" + }, + { + "slug": "C2me", + "version": "0.2.0", + "download_link": "https://cdn.modrinth.com/data/VSNURh3q/versions/U5BK0DTf/c2me-fabric-mc1.18.2-0.2.0%2Balpha.7.35.jar" + }, + { + "slug": "Cloth-Config", + "version": "6.3.81", + "download_link": "https://cdn.modrinth.com/data/9s6osm5g/versions/gPqHXnrg/cloth-config-6.3.81-fabric.jar" + }, + { + "slug": "Cull-Less-Leaves", + "version": "1.0.1", + "download_link": "https://cdn.modrinth.com/data/iG6ZHsUV/versions/1.0.1/CullLessLeaves-1.0.1.jar" + }, + { + "slug": "FastLoad", + "version": "1.5.9", + "download_link": "https://cdn.modrinth.com/data/kCpssoSb/versions/K9vr5fdy/Fastload%2B1.18.2-1.5.9.jar" + }, + { + "slug": "ImmediatelyFast", + "version": "1.1.6", + "download_link": "https://cdn.modrinth.com/data/5ZwdcRci/versions/zImGOGqD/ImmediatelyFast-1.1.6%2B1.18.2.jar" + }, + { + "slug": "Starlight", + "version": "1.0.2", + "download_link": "https://cdn.modrinth.com/data/H8CaAYZC/versions/1.0.2%2B1.18.2/starlight-1.0.2%2Bfabric.89b8d9f.jar" + }, + { + "slug": "Krypton", + "version": "0.1.9", + "download_link": "https://cdn.modrinth.com/data/fQEb0iXm/versions/0.1.9/krypton-0.1.9.jar" + }, + { + "slug": "Mod-Menu", + "version": "3.2.5", + "download_link": "https://cdn.modrinth.com/data/mOgUt4GM/versions/nVxObSbX/modmenu-3.2.5.jar" + }, + { + "slug": "Modern-Fix", + "version": "5.9.0", + "download_link": "https://cdn.modrinth.com/data/nmDcB62a/versions/qNrVNwfw/modernfix-fabric-5.9.0%2Bmc1.18.2.jar" + } + ] + } + ] +} \ No newline at end of file diff --git a/src/main/java/pojlib/instance/InstanceHandler.java b/src/main/java/pojlib/instance/InstanceHandler.java index 228f922d..c7f45631 100644 --- a/src/main/java/pojlib/instance/InstanceHandler.java +++ b/src/main/java/pojlib/instance/InstanceHandler.java @@ -28,8 +28,8 @@ import pojlib.util.VLoader; public class InstanceHandler { - public static final String MODS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/instance-refactor/mods.json"; - public static final String DEV_MODS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/instance-refactor/devmods.json"; + public static final String MODS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/QuestCraft/mods.json"; + public static final String DEV_MODS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/QuestCraft/devmods.json"; public enum ModLoader { Fabric(0), diff --git a/src/main/java/pojlib/util/APIHandler.java b/src/main/java/pojlib/util/APIHandler.java index 934a3172..9106310a 100644 --- a/src/main/java/pojlib/util/APIHandler.java +++ b/src/main/java/pojlib/util/APIHandler.java @@ -102,7 +102,7 @@ public static T postFullUrl(String url, HashMap query, T bod return new Gson().fromJson(postRaw(url + parseQueries(query), body.toString()), tClass); } - public static final String SUPPORTED_VERSIONS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/instance-refactor/supportedVersions.json"; + public static final String SUPPORTED_VERSIONS = "https://raw.githubusercontent.com/QuestCraftPlusPlus/Pojlib/QuestCraft/supportedVersions.json"; public static String[] getQCSupportedVersions() { File versionsJson = new File(Constants.MC_DIR + "/supportedVersions.json");