Skip to content

Commit

Permalink
chore: Initial 1.16.5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
null2264 committed Jan 2, 2024
1 parent 2bd8a5e commit cea8311
Show file tree
Hide file tree
Showing 15 changed files with 122 additions and 93 deletions.
166 changes: 86 additions & 80 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down Expand Up @@ -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",
Expand All @@ -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]
}
}
Expand All @@ -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'
Expand Down Expand Up @@ -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"],
Expand All @@ -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) {
Expand Down Expand Up @@ -331,4 +337,4 @@ publishMods {
}
}
}
}
}
6 changes: 5 additions & 1 deletion root.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)
}
4 changes: 3 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -36,4 +38,4 @@ listOf(
projectDir = file("versions/$version")
buildFileName = "../../build.gradle"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//#if MC>1.16.5
package io.github.null2264.cobblegen.integration;

import io.github.null2264.cobblegen.CGPlugin;
Expand Down Expand Up @@ -42,4 +43,5 @@ public void registerInteraction(CGRegistry registry) {

if (firstInit) firstInit = false;
}
}
}
//#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//#if MC>1.16.5
package io.github.null2264.cobblegen.integration.viewer;

import io.github.null2264.cobblegen.config.WeightedBlock;
Expand All @@ -16,4 +17,5 @@ public class FluidInteractionRecipeHolder
private final @NotNull WeightedBlock result;
private final @NotNull GeneratorType type;
private final @NotNull Block modifier;
}
}
//#endif
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//#if MC>1.16.5
package io.github.null2264.cobblegen.integration.viewer.jei;

import io.github.null2264.cobblegen.CobbleGen;
Expand Down Expand Up @@ -77,4 +78,5 @@ public void registerRecipes(IRecipeRegistration registration) {
), recipes);
})));
}
}
}
//#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//#if MC>1.16.5
package io.github.null2264.cobblegen.integration.viewer.jei;

import io.github.null2264.cobblegen.compat.GraphicsCompat;
Expand Down Expand Up @@ -233,4 +234,5 @@ public Class<? extends FluidInteractionRecipeHolder> getRecipeClass() {
return FluidInteractionRecipeHolder.class;
}
//#endif
}
}
//#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//#if MC>1.16.5
package io.github.null2264.cobblegen.integration.viewer.rei;

import io.github.null2264.cobblegen.CobbleGen;
Expand Down Expand Up @@ -56,4 +57,5 @@ public void registerDisplays(DisplayRegistry registry) {
);
})));
}
}
}
//#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//#if MC>1.16.5
package io.github.null2264.cobblegen.integration.viewer.rei;

import io.github.null2264.cobblegen.compat.TextCompat;
Expand Down Expand Up @@ -182,4 +183,5 @@ public List<Widget> setupDisplay(FluidInteractionRecipe display, Rectangle bound
public CategoryIdentifier<? extends FluidInteractionRecipe> getCategoryIdentifier() {
return generateIdentifier(type);
}
}
}
//#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//#if MC>1.16.5
package io.github.null2264.cobblegen.integration.viewer.rei;

import io.github.null2264.cobblegen.config.WeightedBlock;
Expand All @@ -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;

Expand Down Expand Up @@ -57,4 +56,5 @@ public List<EntryIngredient> getOutputEntries() {
public CategoryIdentifier<?> getCategoryIdentifier() {
return FluidInteractionCategory.generateIdentifier(getType());
}
}
}
//#endif
Loading

0 comments on commit cea8311

Please sign in to comment.