diff --git a/build.gradle b/build.gradle index 9c5379a5..4b23ac10 100644 --- a/build.gradle +++ b/build.gradle @@ -16,6 +16,7 @@ static String stringifyVersion(int ver) { } def mcVersionStr = stringifyVersion(mcVersion) def supportedVersionRange = [ + 11605: [null, "1.16.5"], 11802: [null, "1.18.2"], 11902: ["1.19", "1.19.2"], 11904: ["1.19.3", "1.19.4"], @@ -98,10 +99,11 @@ dependencies { else if (mcVersion <= 12001) modImplementation "net.fabricmc:fabric-loader:0.14.21" else - modImplementation "net.fabricmc:fabric-loader:0.14.22" + modImplementation "net.fabricmc:fabric-loader:0.15.3" // For testing modLocalRuntime modCompileOnlyApi("net.fabricmc.fabric-api:fabric-api:" + [ + 11605: "0.42.0+1.16", 11802: "0.76.0+1.18.2", 11902: "0.76.0+1.19.2", 11904: "0.83.0+1.19.4", @@ -110,17 +112,17 @@ dependencies { ][mcVersion]) } else { if (!isNeo) { - forge "net.minecraftforge:forge:" + [ - 11802: "1.18.2-40.2.9", - 11902: "1.19.2-43.2.14", - 11904: "1.19.4-45.1.0", - 12001: "1.20.1-47.0.3", - 12002: "1.20.2-48.0.13", + forge "net.minecraftforge:forge:${mcVersionStr}-" + [ + 11605: "36.2.41", + 11802: "40.2.9", + 11902: "43.2.14", + 11904: "45.1.0", + 12001: "47.0.3", + 12002: "48.0.13", ][mcVersion] } else { neoForge "net.neoforged:neoforge:" + [ 12002: "20.2.51-beta" - // TODO: 1.20.3 ][mcVersion] } } @@ -129,80 +131,83 @@ dependencies { if (!isFabric) forgeRuntimeLibrary("blue.endless:jankson:${project.jankson_version}") - // These act like a dummy, technically only here to provide their modules/packages - if (isFabric) { - modCompileOnly("com.tterrag.registrate_fabric:Registrate:MC1.18.2-1.1.7") - modCompileOnly("io.github.fabricators_of_create:Porting-Lib:${project.port_lib_version_1_18_2}") - modCompileOnly("com.simibubi.create:create-fabric-${project.minecraft_version_1_18_2}:${project.create_version_1_18_2}") - } else { - modCompileOnly("com.jozufozu.flywheel:flywheel-forge-1.18.2:0.6.8.a-99") - modCompileOnly("com.simibubi.create:create-1.18.2:0.5.0.i-249:slim") { transitive = false } - modCompileOnly("com.tterrag.registrate:Registrate:MC1.18.2-1.1.3") - } + // Don't wanna deal with these atm + if (mcVersion > 11605) { + // These act like a dummy, technically only here to provide their modules/packages + if (isFabric) { + modCompileOnly("com.tterrag.registrate_fabric:Registrate:MC1.18.2-1.1.7") + modCompileOnly("io.github.fabricators_of_create:Porting-Lib:${project.port_lib_version_1_18_2}") + modCompileOnly("com.simibubi.create:create-fabric-${project.minecraft_version_1_18_2}:${project.create_version_1_18_2}") + } else { + modCompileOnly("com.jozufozu.flywheel:flywheel-forge-1.18.2:0.6.8.a-99") + modCompileOnly("com.simibubi.create:create-1.18.2:0.5.0.i-249:slim") { transitive = false } + modCompileOnly("com.tterrag.registrate:Registrate:MC1.18.2-1.1.3") + } - // EMI - if (mcVersion <= 11802 && isFabric) { - modCompileOnly("dev.emi:emi:0.7.3+${mcVersionStr}:api") - if (project.recipe_viewer == "emi") - modLocalRuntime("dev.emi:emi:0.7.3+${mcVersionStr}") - } else { - def suffix = [ - 11902: "1.19.2", - 11904: "1.19.4", - 12001: "1.20.1", - 12002: "1.20.2", - 12003: "1.20.2", // TODO - ] - // EMI support multiple platform since 1.0.0 - // EMI seems to also skip 1.19 and 1.19.1 - modCompileOnly("dev.emi:emi-${isFabric ? "fabric" : "forge"}:${project.emi_version}+${mcVersion >= 11902 ? suffix[mcVersion] : '1.19.2'}:api") - if (project.recipe_viewer == "emi") - modLocalRuntime("dev.emi:emi-${isFabric ? "fabric" : "forge"}:${project.emi_version}+${mcVersion >= 11902 ? suffix[mcVersion] : '1.19.2'}") - } + // EMI + if (mcVersion <= 11802 && isFabric) { + modCompileOnly("dev.emi:emi:0.7.3+${mcVersionStr}:api") + if (project.recipe_viewer == "emi") + modLocalRuntime("dev.emi:emi:0.7.3+${mcVersionStr}") + } else { + def suffix = [ + 11902: "1.19.2", + 11904: "1.19.4", + 12001: "1.20.1", + 12002: "1.20.2", + 12003: "1.20.2", // TODO + ] + // EMI support multiple platform since 1.0.0 + // EMI seems to also skip 1.19 and 1.19.1 + modCompileOnly("dev.emi:emi-${isFabric ? "fabric" : "forge"}:${project.emi_version}+${mcVersion >= 11902 ? suffix[mcVersion] : '1.19.2'}:api") + if (project.recipe_viewer == "emi") + modLocalRuntime("dev.emi:emi-${isFabric ? "fabric" : "forge"}:${project.emi_version}+${mcVersion >= 11902 ? suffix[mcVersion] : '1.19.2'}") + } - // REI - def reiVersions = [ - 11802: "8.3.618", - 11902: "9.1.619", - 11904: "11.0.621", - 12001: "12.0.625", - 12002: "13.0.666", - 12003: "13.0.666", // TODO - ] - if (isFabric) - modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:${reiVersions[mcVersion]}") - else // I need the full package since for whatever reason @REIPluginClient is not included in API, thanks REI - modCompileOnly("me.shedaniel:RoughlyEnoughItems-forge:${reiVersions[mcVersion]}") - if (project.recipe_viewer == "rei") { - if (mcVersion == 11902) // REI's stupid dep bug - modLocalRuntime("dev.architectury:architectury-fabric:6.5.77") - modLocalRuntime("me.shedaniel:RoughlyEnoughItems-${isFabric ? "fabric" : "forge"}:${reiVersions[mcVersion]}") - } + // REI + def reiVersions = [ + 11802: "8.3.618", + 11902: "9.1.619", + 11904: "11.0.621", + 12001: "12.0.625", + 12002: "13.0.666", + 12003: "13.0.666", // TODO + ] + if (isFabric) + modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:${reiVersions[mcVersion]}") + else // I need the full package since for whatever reason @REIPluginClient is not included in API, thanks REI + modCompileOnly("me.shedaniel:RoughlyEnoughItems-forge:${reiVersions[mcVersion]}") + if (project.recipe_viewer == "rei") { + if (mcVersion == 11902) // REI's stupid dep bug + modLocalRuntime("dev.architectury:architectury-fabric:6.5.77") + modLocalRuntime("me.shedaniel:RoughlyEnoughItems-${isFabric ? "fabric" : "forge"}:${reiVersions[mcVersion]}") + } - // JEI - def jeiVersions = [ - 11802: "10.2.1.1004", - 11902: "11.6.0.1015", - 11904: "13.1.0.13", - 12001: "15.0.0.12", - 12002: "16.0.0.28", - 12003: "16.0.0.28", // TODO - ] - def jeiMc = [ - 12003: "1.20.2", - ] - modCompileOnly("mezz.jei:jei-${jeiMc[mcVersion] ?: mcVersionStr}-common-api:${jeiVersions[mcVersion]}") - modCompileOnly("mezz.jei:jei-${jeiMc[mcVersion] ?: mcVersionStr}-${isFabric ? "fabric" : "forge"}-api:${jeiVersions[mcVersion]}") - if (project.recipe_viewer == "jei") - modLocalRuntime("mezz.jei:jei-${jeiMc[mcVersion] ?: mcVersionStr}-${isFabric ? "fabric" : "forge"}:${jeiVersions[mcVersion]}") - - /* FIXME: Broken, somehow - if (mcVersion == 11802 && isFabric) { - modLocalRuntime("com.tterrag.registrate_fabric:Registrate:MC1.18.2-1.1.7") - modLocalRuntime("io.github.fabricators_of_create:Porting-Lib:${project.port_lib_version_1_18_2}") - modLocalRuntime("com.simibubi.create:create-fabric-${project.minecraft_version_1_18_2}:${project.create_version_1_18_2}") + // JEI + def jeiVersions = [ + 11802: "10.2.1.1004", + 11902: "11.6.0.1015", + 11904: "13.1.0.13", + 12001: "15.0.0.12", + 12002: "16.0.0.28", + 12003: "16.0.0.28", // TODO + ] + def jeiMc = [ + 12003: "1.20.2", + ] + modCompileOnly("mezz.jei:jei-${jeiMc[mcVersion] ?: mcVersionStr}-common-api:${jeiVersions[mcVersion]}") + modCompileOnly("mezz.jei:jei-${jeiMc[mcVersion] ?: mcVersionStr}-${isFabric ? "fabric" : "forge"}-api:${jeiVersions[mcVersion]}") + if (project.recipe_viewer == "jei") + modLocalRuntime("mezz.jei:jei-${jeiMc[mcVersion] ?: mcVersionStr}-${isFabric ? "fabric" : "forge"}:${jeiVersions[mcVersion]}") + + /* FIXME: Broken, somehow + if (mcVersion == 11802 && isFabric) { + modLocalRuntime("com.tterrag.registrate_fabric:Registrate:MC1.18.2-1.1.7") + modLocalRuntime("io.github.fabricators_of_create:Porting-Lib:${project.port_lib_version_1_18_2}") + modLocalRuntime("com.simibubi.create:create-fabric-${project.minecraft_version_1_18_2}:${project.create_version_1_18_2}") + } + */ } - */ compileOnly 'org.projectlombok:lombok:1.18.24' annotationProcessor 'org.projectlombok:lombok:1.18.24' @@ -276,6 +281,7 @@ jar { } def mcReleaseVersions = [ + 11605: ["1.16.5"], 11802: ["1.18.2"], 11902: ["1.19", "1.19.1", "1.19.2"], 11904: ["1.19.3", "1.19.4"], @@ -285,7 +291,7 @@ def mcReleaseVersions = [ publishMods { file = tasks.remapJar.archiveFile - displayName = "[${isFabric ? "FABRIC" : (isNeo ? "NEOFORGE" : "FORGE")} MC${mcReleaseVersions[0] + (mcReleaseVersions.size() > 1 ? "+" : "")}] v${project.mod_version}-${project.version_stage}" + displayName = "[${isFabric ? "FABRIC" : (isNeo ? "NEOFORGE" : "FORGE")} MC${mcReleaseVersions[0] + (mcReleaseVersions.size() > 1 ? "+" : "")}] v${project.mod_version}-${project.version_stage}${mcVersion <= 11605 ? " (LITE)" : ""}" changelog = System.getenv("CHANGELOG") ?: "Please visit our [releases](https://github.com/null2264/CobbleGen/releases) for a changelog" version = project.version if (isFabric) { @@ -331,4 +337,4 @@ publishMods { } } } -} +} \ No newline at end of file diff --git a/root.gradle.kts b/root.gradle.kts index 394f6728..b1245d5f 100644 --- a/root.gradle.kts +++ b/root.gradle.kts @@ -14,6 +14,8 @@ preprocess { val fabric11902 = createNode("1.19.2-fabric", 11902, "mojang") val forge11802 = createNode("1.18.2-forge", 11802, "mojang") val fabric11802 = createNode("1.18.2-fabric", 11802, "mojang") + val forge11605 = createNode("1.16.5-forge", 11605, "mojang") + val fabric11605 = createNode("1.16.5-fabric", 11605, "mojang") neo12002.link(fabric12002) @@ -22,9 +24,11 @@ preprocess { forge11904.link(fabric11904) forge11902.link(fabric11902) forge11802.link(fabric11802) + forge11605.link(fabric11605) fabric12002.link(fabric12001) fabric12001.link(fabric11904) fabric11904.link(fabric11902) fabric11902.link(fabric11802) -} + fabric11802.link(fabric11605) +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 2a30e7ed..10c4b1ab 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -19,6 +19,8 @@ rootProject.name = "CobbleGen" rootProject.buildFileName = "root.gradle.kts" listOf( + "1.16.5-fabric", + "1.16.5-forge", "1.18.2-fabric", "1.18.2-forge", "1.19.2-fabric", @@ -36,4 +38,4 @@ listOf( projectDir = file("versions/$version") buildFileName = "../../build.gradle" } -} +} \ No newline at end of file diff --git a/src/main/java/io/github/null2264/cobblegen/integration/CreatePlugin.java b/src/main/java/io/github/null2264/cobblegen/integration/CreatePlugin.java index 057522c3..6c71df59 100644 --- a/src/main/java/io/github/null2264/cobblegen/integration/CreatePlugin.java +++ b/src/main/java/io/github/null2264/cobblegen/integration/CreatePlugin.java @@ -1,3 +1,4 @@ +//#if MC>1.16.5 package io.github.null2264.cobblegen.integration; import io.github.null2264.cobblegen.CGPlugin; @@ -42,4 +43,5 @@ public void registerInteraction(CGRegistry registry) { if (firstInit) firstInit = false; } -} \ No newline at end of file +} +//#endif \ No newline at end of file diff --git a/src/main/java/io/github/null2264/cobblegen/integration/viewer/FluidInteractionRecipeHolder.java b/src/main/java/io/github/null2264/cobblegen/integration/viewer/FluidInteractionRecipeHolder.java index db798e67..e3924d9c 100644 --- a/src/main/java/io/github/null2264/cobblegen/integration/viewer/FluidInteractionRecipeHolder.java +++ b/src/main/java/io/github/null2264/cobblegen/integration/viewer/FluidInteractionRecipeHolder.java @@ -1,3 +1,4 @@ +//#if MC>1.16.5 package io.github.null2264.cobblegen.integration.viewer; import io.github.null2264.cobblegen.config.WeightedBlock; @@ -16,4 +17,5 @@ public class FluidInteractionRecipeHolder private final @NotNull WeightedBlock result; private final @NotNull GeneratorType type; private final @NotNull Block modifier; -} \ No newline at end of file +} +//#endif \ No newline at end of file diff --git a/src/main/java/io/github/null2264/cobblegen/integration/viewer/emi/CGEMIPlugin.java b/src/main/java/io/github/null2264/cobblegen/integration/viewer/emi/CGEMIPlugin.java index 3536ef55..076ad3b7 100644 --- a/src/main/java/io/github/null2264/cobblegen/integration/viewer/emi/CGEMIPlugin.java +++ b/src/main/java/io/github/null2264/cobblegen/integration/viewer/emi/CGEMIPlugin.java @@ -1,4 +1,4 @@ -//#if FABRIC>=1 && MC<=11802 || MC>=11900 +//#if FABRIC>=1 && MC<=1.18.2 && MC>1.16.5 || MC>=1.19 package io.github.null2264.cobblegen.integration.viewer.emi; import dev.emi.emi.api.EmiPlugin; diff --git a/src/main/java/io/github/null2264/cobblegen/integration/viewer/emi/FluidInteractionRecipe.java b/src/main/java/io/github/null2264/cobblegen/integration/viewer/emi/FluidInteractionRecipe.java index 1a944da0..e4ea9df9 100644 --- a/src/main/java/io/github/null2264/cobblegen/integration/viewer/emi/FluidInteractionRecipe.java +++ b/src/main/java/io/github/null2264/cobblegen/integration/viewer/emi/FluidInteractionRecipe.java @@ -1,4 +1,4 @@ -//#if FABRIC>=1 && MC<=11802 || MC>=11900 +//#if FABRIC>=1 && MC<=1.18.2 && MC>1.16.5 || MC>=1.19 package io.github.null2264.cobblegen.integration.viewer.emi; import dev.emi.emi.api.recipe.EmiRecipe; diff --git a/src/main/java/io/github/null2264/cobblegen/integration/viewer/jei/CGJEIPlugin.java b/src/main/java/io/github/null2264/cobblegen/integration/viewer/jei/CGJEIPlugin.java index 17833b77..26cf2d67 100644 --- a/src/main/java/io/github/null2264/cobblegen/integration/viewer/jei/CGJEIPlugin.java +++ b/src/main/java/io/github/null2264/cobblegen/integration/viewer/jei/CGJEIPlugin.java @@ -1,3 +1,4 @@ +//#if MC>1.16.5 package io.github.null2264.cobblegen.integration.viewer.jei; import io.github.null2264.cobblegen.CobbleGen; @@ -77,4 +78,5 @@ public void registerRecipes(IRecipeRegistration registration) { ), recipes); }))); } -} \ No newline at end of file +} +//#endif \ No newline at end of file diff --git a/src/main/java/io/github/null2264/cobblegen/integration/viewer/jei/FluidInteractionCategory.java b/src/main/java/io/github/null2264/cobblegen/integration/viewer/jei/FluidInteractionCategory.java index 32c137d8..1883444d 100644 --- a/src/main/java/io/github/null2264/cobblegen/integration/viewer/jei/FluidInteractionCategory.java +++ b/src/main/java/io/github/null2264/cobblegen/integration/viewer/jei/FluidInteractionCategory.java @@ -1,3 +1,4 @@ +//#if MC>1.16.5 package io.github.null2264.cobblegen.integration.viewer.jei; import io.github.null2264.cobblegen.compat.GraphicsCompat; @@ -233,4 +234,5 @@ public Class getRecipeClass() { return FluidInteractionRecipeHolder.class; } //#endif -} \ No newline at end of file +} +//#endif \ No newline at end of file diff --git a/src/main/java/io/github/null2264/cobblegen/integration/viewer/rei/CGREIPlugin.java b/src/main/java/io/github/null2264/cobblegen/integration/viewer/rei/CGREIPlugin.java index 08bc0902..23774b51 100644 --- a/src/main/java/io/github/null2264/cobblegen/integration/viewer/rei/CGREIPlugin.java +++ b/src/main/java/io/github/null2264/cobblegen/integration/viewer/rei/CGREIPlugin.java @@ -1,3 +1,4 @@ +//#if MC>1.16.5 package io.github.null2264.cobblegen.integration.viewer.rei; import io.github.null2264.cobblegen.CobbleGen; @@ -56,4 +57,5 @@ public void registerDisplays(DisplayRegistry registry) { ); }))); } -} \ No newline at end of file +} +//#endif \ No newline at end of file diff --git a/src/main/java/io/github/null2264/cobblegen/integration/viewer/rei/FluidInteractionCategory.java b/src/main/java/io/github/null2264/cobblegen/integration/viewer/rei/FluidInteractionCategory.java index 17cecca7..15fb7b5e 100644 --- a/src/main/java/io/github/null2264/cobblegen/integration/viewer/rei/FluidInteractionCategory.java +++ b/src/main/java/io/github/null2264/cobblegen/integration/viewer/rei/FluidInteractionCategory.java @@ -1,3 +1,4 @@ +//#if MC>1.16.5 package io.github.null2264.cobblegen.integration.viewer.rei; import io.github.null2264.cobblegen.compat.TextCompat; @@ -182,4 +183,5 @@ public List setupDisplay(FluidInteractionRecipe display, Rectangle bound public CategoryIdentifier getCategoryIdentifier() { return generateIdentifier(type); } -} \ No newline at end of file +} +//#endif \ No newline at end of file diff --git a/src/main/java/io/github/null2264/cobblegen/integration/viewer/rei/FluidInteractionRecipe.java b/src/main/java/io/github/null2264/cobblegen/integration/viewer/rei/FluidInteractionRecipe.java index bcc39ed3..5b67145e 100644 --- a/src/main/java/io/github/null2264/cobblegen/integration/viewer/rei/FluidInteractionRecipe.java +++ b/src/main/java/io/github/null2264/cobblegen/integration/viewer/rei/FluidInteractionRecipe.java @@ -1,3 +1,4 @@ +//#if MC>1.16.5 package io.github.null2264.cobblegen.integration.viewer.rei; import io.github.null2264.cobblegen.config.WeightedBlock; @@ -8,9 +9,7 @@ import me.shedaniel.rei.api.common.entry.EntryIngredient; import me.shedaniel.rei.api.common.util.EntryStacks; import net.minecraft.world.level.block.Block; -import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.material.Fluid; -import org.jetbrains.annotations.Nullable; import java.util.List; @@ -57,4 +56,5 @@ public List getOutputEntries() { public CategoryIdentifier getCategoryIdentifier() { return FluidInteractionCategory.generateIdentifier(getType()); } -} \ No newline at end of file +} +//#endif \ No newline at end of file diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 145ff0b3..46604613 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -19,6 +19,7 @@ "main": [ "io.github.null2264.cobblegen.CobbleGen" ], + //#if MC>1.16.5 "jei_mod_plugin": [ "io.github.null2264.cobblegen.integration.viewer.jei.CGJEIPlugin" ], @@ -28,9 +29,12 @@ "emi": [ "io.github.null2264.cobblegen.integration.viewer.emi.CGEMIPlugin" ], + //#endif "cobblegen_plugin": [ "io.github.null2264.cobblegen.integration.BuiltInPlugin", + //#if MC>1.16.5 "io.github.null2264.cobblegen.integration.CreatePlugin" + //#endif ] }, "mixins": [ diff --git a/versions/1.16.5-fabric/.gitkeep b/versions/1.16.5-fabric/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/versions/1.16.5-forge/gradle.properties b/versions/1.16.5-forge/gradle.properties new file mode 100644 index 00000000..32f842a6 --- /dev/null +++ b/versions/1.16.5-forge/gradle.properties @@ -0,0 +1 @@ +loom.platform=forge \ No newline at end of file