From 2a89880b0dd63193d933781a5145826472f996ab Mon Sep 17 00:00:00 2001 From: BlayTheNinth <1933180+BlayTheNinth@users.noreply.github.com> Date: Tue, 5 Dec 2023 23:38:36 +0100 Subject: [PATCH] feat(neoforge): Update to NeoForge 20.2.86, add final pieces to make it runnable --- gradle.properties | 2 +- neoforge/build.gradle | 10 ++++------ .../mods/balm/neoforge/world/NeoForgeBalmWorldGen.java | 4 ---- .../net.blay09.mods.balm.api.BalmRuntimeFactory | 1 + ...lay09.mods.balm.api.client.BalmClientRuntimeFactory | 1 + 5 files changed, 7 insertions(+), 11 deletions(-) create mode 100644 neoforge/src/main/resources/META-INF/services/net.blay09.mods.balm.api.BalmRuntimeFactory create mode 100644 neoforge/src/main/resources/META-INF/services/net.blay09.mods.balm.api.client.BalmClientRuntimeFactory diff --git a/gradle.properties b/gradle.properties index 684e63b1..9c446755 100644 --- a/gradle.properties +++ b/gradle.properties @@ -26,7 +26,7 @@ forge_version_range=[48,) forge_loader_version_range=[48,) # NeoForge -neoforge_version = 20.2.59-beta +neoforge_version = 20.2.86 neoforge_version_range=[20.2,) neoforge_loader_version_range=[1,) diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 3ced32f1..7d7e68de 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -69,15 +69,13 @@ dependencies { apply from: 'dependencies.gradle' // NeoGradle compiles the game, but we don't want to add our common code to the game's code -TaskCollection.metaClass.excludingNeoTasks = { -> - delegate.matching { !it.name.startsWith("neo") } -} +Spec notNeoTask = { Task it -> !it.name.startsWith("neo") } as Spec -tasks.withType(JavaCompile).excludingNeoTasks().configureEach { +tasks.withType(JavaCompile).matching(notNeoTask).configureEach { source(project(":shared").sourceSets.main.allSource) } -tasks.withType(Javadoc).excludingNeoTasks().configureEach { +tasks.withType(Javadoc).matching(notNeoTask).configureEach { source(project(":shared").sourceSets.main.allJava) } @@ -85,7 +83,7 @@ tasks.named("sourcesJar", Jar) { from(project(":shared").sourceSets.main.allSource) } -tasks.withType(ProcessResources).excludingNeoTasks().configureEach { +tasks.withType(ProcessResources).matching(notNeoTask).configureEach { from project(":shared").sourceSets.main.resources } diff --git a/neoforge/src/main/java/net/blay09/mods/balm/neoforge/world/NeoForgeBalmWorldGen.java b/neoforge/src/main/java/net/blay09/mods/balm/neoforge/world/NeoForgeBalmWorldGen.java index c4ff1cc0..b83ed7e8 100644 --- a/neoforge/src/main/java/net/blay09/mods/balm/neoforge/world/NeoForgeBalmWorldGen.java +++ b/neoforge/src/main/java/net/blay09/mods/balm/neoforge/world/NeoForgeBalmWorldGen.java @@ -53,10 +53,6 @@ public void commonSetup(FMLCommonSetupEvent event) { public static final Codec BALM_BIOME_MODIFIER_CODEC = Codec.unit(BalmBiomeModifier.INSTANCE); private final Map registrations = new ConcurrentHashMap<>(); - public NeoForgeBalmWorldGen() { - NeoForge.EVENT_BUS.register(this); - } - @Override public > DeferredObject registerFeature(ResourceLocation identifier, Supplier supplier) { final var register = DeferredRegisters.get(Registries.FEATURE, identifier.getNamespace()); diff --git a/neoforge/src/main/resources/META-INF/services/net.blay09.mods.balm.api.BalmRuntimeFactory b/neoforge/src/main/resources/META-INF/services/net.blay09.mods.balm.api.BalmRuntimeFactory new file mode 100644 index 00000000..3b8baf49 --- /dev/null +++ b/neoforge/src/main/resources/META-INF/services/net.blay09.mods.balm.api.BalmRuntimeFactory @@ -0,0 +1 @@ +net.blay09.mods.balm.neoforge.NeoForgeBalmRuntimeFactory \ No newline at end of file diff --git a/neoforge/src/main/resources/META-INF/services/net.blay09.mods.balm.api.client.BalmClientRuntimeFactory b/neoforge/src/main/resources/META-INF/services/net.blay09.mods.balm.api.client.BalmClientRuntimeFactory new file mode 100644 index 00000000..c91f2a28 --- /dev/null +++ b/neoforge/src/main/resources/META-INF/services/net.blay09.mods.balm.api.client.BalmClientRuntimeFactory @@ -0,0 +1 @@ +net.blay09.mods.balm.neoforge.client.NeoForgeBalmClientRuntimeFactory \ No newline at end of file