@@ -5,7 +5,7 @@ Subject: [PATCH] Port to NeoForge
55
66
77diff --git a/build.gradle b/build.gradle
8- index fc1d4f0a..b3e311de 100644
8+ index 65900af6..03077e34 100644
99--- a/build.gradle
1010+++ b/build.gradle
1111@@ -1,6 +1,6 @@
@@ -25,19 +25,11 @@ index fc1d4f0a..b3e311de 100644
2525 afterEvaluate {
2626 migrateMappings.configure {
2727 outputDir = project.file("build/remappedSrc")
28- @@ -63,29 +63,35 @@ allprojects {
28+ @@ -63,29 +63,27 @@ allprojects {
2929 includeGroup "com.bawnorton.mixinsquared"
3030 }
3131 }
3232+ maven { url = "https://maven.neoforged.net/releases/" }
33- + maven {
34- + name = "Maven for PR #2639" // https://github.com/neoforged/NeoForge/pull/2639
35- + url = uri("https://prmaven.neoforged.net/NeoForge/pr2639")
36- + content {
37- + includeModule("net.neoforged", "neoforge")
38- + includeModule("net.neoforged", "testframework")
39- + }
40- + }
4133 }
4234 }
4335
@@ -70,7 +62,7 @@ index fc1d4f0a..b3e311de 100644
7062 loom {
7163 def file = project(":c2me-base").file("src/main/resources/c2me-base.accesswidener")
7264 accessWidenerPath = file
73- @@ -99,12 +105 ,15 @@ configure (allprojects - project(":tests")) {
65+ @@ -99,12 +97 ,15 @@ configure (allprojects - project(":tests")) {
7466 ideConfigGenerated project.rootProject == project
7567 }
7668 }
@@ -87,7 +79,7 @@ index fc1d4f0a..b3e311de 100644
8779 expand "version": version + "+" + minecraft_version
8880 }
8981 }
90- @@ -113,6 +122 ,10 @@ configure (allprojects - project(":tests")) {
82+ @@ -113,6 +114 ,10 @@ configure (allprojects - project(":tests")) {
9183 from rootProject.file("LICENSE")
9284 }
9385
@@ -98,7 +90,7 @@ index fc1d4f0a..b3e311de 100644
9890 java {
9991 withSourcesJar()
10092 }
101- @@ -149,16 +162 ,16 @@ configure (allprojects - project(":tests")) {
93+ @@ -149,16 +154 ,16 @@ configure (allprojects - project(":tests")) {
10294 configure (allprojects - project(":tests")) {
10395 dependencies {
10496 implementation "com.ibm.async:asyncutil:${async_util_version}"
@@ -118,7 +110,7 @@ index fc1d4f0a..b3e311de 100644
118110 }
119111
120112 test {
121- @@ -189,13 +202 ,20 @@ dependencies {
113+ @@ -189,13 +194 ,20 @@ dependencies {
122114 // includeApi project(":libs")
123115 // include project(":libs")
124116 include implementation("com.ibm.async:asyncutil:${async_util_version}")
@@ -142,7 +134,7 @@ index fc1d4f0a..b3e311de 100644
142134 // include implementation("com.ishland.flowsched:flowsched")
143135
144136 // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs.
145- @@ -261,20 +281 ,19 @@ if (!project.minecraft_version.contains("w") && !project.minecraft_version.conta
137+ @@ -261,20 +273 ,19 @@ if (!project.minecraft_version.contains("w") && !project.minecraft_version.conta
146138 subprojects.forEach { remapJar.dependsOn("${it.path}:remapJar") }
147139
148140 dependencies {
@@ -217,7 +209,7 @@ index 0aa3ca5c..6d3e8c66 100644
217209+
218210 }
219211diff --git a/c2me-base/src/main/java/com/ishland/c2me/base/ModuleEntryPoint.java b/c2me-base/src/main/java/com/ishland/c2me/base/ModuleEntryPoint.java
220- index cebb961c..f4655bf6 100644
212+ index cebb961c..7cbc5991 100644
221213--- a/c2me-base/src/main/java/com/ishland/c2me/base/ModuleEntryPoint.java
222214+++ b/c2me-base/src/main/java/com/ishland/c2me/base/ModuleEntryPoint.java
223215@@ -2,8 +2,8 @@ package com.ishland.c2me.base;
@@ -255,7 +247,7 @@ index cebb961c..f4655bf6 100644
255247 .setVariable("is_windows", PlatformDependent.isWindows() ? 1 : 0)
256248 .setVariable("is_j9vm", PlatformDependent.isJ9Jvm() ? 1 : 0)
257249- .setVariable("is_client", FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT ? 1 : 0)
258- + .setVariable("is_client", FMLEnvironment.dist == Dist.CLIENT ? 1 : 0)
250+ + .setVariable("is_client", FMLEnvironment.getDist() == Dist.CLIENT ? 1 : 0)
259251 .setVariable("cpus", Runtime.getRuntime().availableProcessors())
260252 .setVariable("mem_gb", Runtime.getRuntime().maxMemory() / 1024.0 / 1024.0 / 1024.0)
261253 .evaluate()
@@ -288,7 +280,7 @@ index 7fd0863f..ff8f3dab 100644
288280 if (!isEnabled) {
289281 LOGGER.info("Disabling {}", mixinPackage);
290282diff --git a/c2me-base/src/main/java/com/ishland/c2me/base/common/config/ConfigSystem.java b/c2me-base/src/main/java/com/ishland/c2me/base/common/config/ConfigSystem.java
291- index 480df3b6..bc6c6f3c 100644
283+ index 480df3b6..deaf7b00 100644
292284--- a/c2me-base/src/main/java/com/ishland/c2me/base/common/config/ConfigSystem.java
293285+++ b/c2me-base/src/main/java/com/ishland/c2me/base/common/config/ConfigSystem.java
294286@@ -3,11 +3,16 @@ package com.ishland.c2me.base.common.config;
@@ -327,7 +319,7 @@ index 480df3b6..bc6c6f3c 100644
327319 public ConfigAccessor incompatibleMod(String modId, String predicate) {
328320 try {
329321- final Optional<ModContainer> optional = FabricLoader.getInstance().getModContainer(modId);
330- + LoadingModList loadingModList = FMLLoader.getLoadingModList();
322+ + LoadingModList loadingModList = FMLLoader.getCurrent(). getLoadingModList();
331323+ Optional<ModInfo> optional = loadingModList.getMods().stream().filter(modInfo1 -> modInfo1.getModId().equals(modId)).findFirst();
332324 if (optional.isPresent()) {
333325- final ModContainer modContainer = optional.get();
@@ -1255,7 +1247,7 @@ index 11104c69..4ac10b14 100644
12551247+ }
12561248+ }
12571249diff --git a/c2me-fixes-worldgen-threading-issues/src/main/java/com/ishland/c2me/fixes/worldgen/threading_issues/common/debug/SMAPSourceDebugExtension.java b/c2me-fixes-worldgen-threading-issues/src/main/java/com/ishland/c2me/fixes/worldgen/threading_issues/common/debug/SMAPSourceDebugExtension.java
1258- index 64d9c2ae..b5f8136b 100644
1250+ index 64d9c2ae..db890dd7 100644
12591251--- a/c2me-fixes-worldgen-threading-issues/src/main/java/com/ishland/c2me/fixes/worldgen/threading_issues/common/debug/SMAPSourceDebugExtension.java
12601252+++ b/c2me-fixes-worldgen-threading-issues/src/main/java/com/ishland/c2me/fixes/worldgen/threading_issues/common/debug/SMAPSourceDebugExtension.java
12611253@@ -36,7 +36,8 @@
@@ -1273,7 +1265,7 @@ index 64d9c2ae..b5f8136b 100644
12731265 }
12741266 if (path == null) return null;
12751267- final Path gameDir = FabricLoader.getInstance().getGameDir().toAbsolutePath().normalize();
1276- + final Path gameDir = FMLLoader.getGamePath ().toAbsolutePath().normalize();
1268+ + final Path gameDir = FMLLoader.getCurrent().getGameDir ().toAbsolutePath().normalize();
12771269 return gameDir.relativize(path).toString();
12781270 }
12791271
@@ -3286,7 +3278,7 @@ index 11104c69..4f5ad227 100644
32863278+ }
32873279+ }
32883280diff --git a/c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/compat/lithium/LithiumChunkStatusTrackerInvoker.java b/c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/compat/lithium/LithiumChunkStatusTrackerInvoker.java
3289- index e6a1c51e..b5d915a8 100644
3281+ index e6a1c51e..7f3ded5d 100644
32903282--- a/c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/compat/lithium/LithiumChunkStatusTrackerInvoker.java
32913283+++ b/c2me-rewrites-chunk-system/src/main/java/com/ishland/c2me/rewrites/chunksystem/common/compat/lithium/LithiumChunkStatusTrackerInvoker.java
32923284@@ -1,8 +1,8 @@
@@ -3331,7 +3323,7 @@ index e6a1c51e..b5d915a8 100644
33313323 }
33323324
33333325+ private static boolean lithiumExists() {
3334- + return FMLLoader.getLoadingModList().getMods().stream().anyMatch(modInfo1 -> modInfo1.getModId().equals("lithium"));
3326+ + return FMLLoader.getCurrent(). getLoadingModList().getMods().stream().anyMatch(modInfo1 -> modInfo1.getModId().equals("lithium"));
33353327+ }
33363328+
33373329 public static void invokeOnChunkInaccessible(ServerWorld world, ChunkPos pos) {
@@ -4049,7 +4041,7 @@ index 5a092ec9..00000000
40494041- }
40504042- }
40514043diff --git a/gradle.properties b/gradle.properties
4052- index f3461159..e522f8ed 100644
4044+ index eba49ece..a0222b17 100644
40534045--- a/gradle.properties
40544046+++ b/gradle.properties
40554047@@ -8,20 +8,24 @@ gradle-curseforge-publish.interop.forge-gradle=false
@@ -4062,12 +4054,12 @@ index f3461159..e522f8ed 100644
40624054+ loom.platform=neoforge
40634055 # Fabric Properties
40644056 # check these on https://fabricmc.net/versions.html
4065- minecraft_version=1.21.9-rc1
4066- yarn_mappings=1.21.9-rc1 +build.1
4057+ minecraft_version=1.21.9
4058+ yarn_mappings=1.21.9+build.1
40674059- loader_version=0.17.2
4068- - fabric_version=0.133.10 +1.21.9
4060+ - fabric_version=0.133.14 +1.21.9
40694061+ # neoforge version, latest version can be found on https://projects.neoforged.net/neoforged/neoforge
4070- + forge_version=21.9.0-alpha.1.21.9-rc1.20250929.111741
4062+ + forge_version=21.9.0-beta
40714063+ # https://github.com/architectury/architectury-loom/issues/230
40724064+ yarn_mappings_patch_neoforge_version=1.21+build.4
40734065 # Mod Properties
0 commit comments