From 613dca61bfb3000037ce2c354cdbaa3534655571 Mon Sep 17 00:00:00 2001 From: UnRealDinnerbone Date: Sun, 31 Dec 2023 19:43:00 -0600 Subject: [PATCH] Fixed maven publish and test item --- CHANGELOG.md | 4 +-- build.gradle | 5 +++- .../trenzalore/TestItems.java | 26 ------------------- forge/build.gradle | 17 +----------- gradle.properties | 2 +- neo/build.gradle | 4 +-- .../trenzalore/TrenzaloreForge.java | 6 +++-- neo/src/main/resources/META-INF/mods.toml | 4 +-- ...trenzalore.api.platform.services.IRegistry | 1 - 9 files changed, 15 insertions(+), 54 deletions(-) delete mode 100644 common/src/main/java/com/unrealdinnerbone/trenzalore/TestItems.java diff --git a/CHANGELOG.md b/CHANGELOG.md index c01f4fd..944f163 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,3 @@ -### 4.0.0 +### 4.0.1 -- Updated to 1.20.4 \ No newline at end of file +- Fixed Maven Publishing \ No newline at end of file diff --git a/build.gradle b/build.gradle index fb2e8fa..d801238 100644 --- a/build.gradle +++ b/build.gradle @@ -35,6 +35,9 @@ subprojects { sourceSets.main.resources.srcDir project.file('src/generated/resources') + java.toolchain.languageVersion = JavaLanguageVersion.of(17) + + base { archivesName = "${project.property("mod_name")}-${project.name}".toLowerCase() } @@ -66,7 +69,7 @@ subprojects { } } publications { - mavenJava(MavenPublication) { + register("mavenJava", MavenPublication) { groupId project.group artifactId project.getArchivesBaseName() } diff --git a/common/src/main/java/com/unrealdinnerbone/trenzalore/TestItems.java b/common/src/main/java/com/unrealdinnerbone/trenzalore/TestItems.java deleted file mode 100644 index 17b2aa0..0000000 --- a/common/src/main/java/com/unrealdinnerbone/trenzalore/TestItems.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.unrealdinnerbone.trenzalore; - -import com.unrealdinnerbone.trenzalore.api.platform.services.IRegistry; -import com.unrealdinnerbone.trenzalore.api.registry.RegistryEntry; -import com.unrealdinnerbone.trenzalore.api.registry.RegistryObjects; -import net.minecraft.core.registries.BuiltInRegistries; -import net.minecraft.core.registries.Registries; -import net.minecraft.world.item.Item; - -import java.util.List; - -public class TestItems implements IRegistry { - - private static final RegistryObjects ITEMS = RegistryObjects.of(Registries.ITEM); - - public static final RegistryEntry TEST_ITEM = ITEMS.register("test_item", () -> new Item(new Item.Properties())); - @Override - public List> getRegistryObjects() { - return List.of(ITEMS); - } - - @Override - public String getModID() { - return Trenzalore.MOD_ID; - } -} diff --git a/forge/build.gradle b/forge/build.gradle index a1a9cec..51e00c1 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -2,19 +2,4 @@ multiLoader.forge() { forgeVersion.set("${forge_version}") } -jarJar.enable() - -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - fg.component(it) - } - } -} - -tasks.jarJar { - finalizedBy("reobfJarJar") - setArchivesBaseName("${project.property("mod_name")}-${project.name}".toLowerCase()) - -} \ No newline at end of file +publishing.publications.mavenJava.artifact jar \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 0c9ce5e..189ee44 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project -mod_version=4.0.0 +mod_version=4.0.1 maven_group=com.unrealdinnerbone mod_name=Trenzalore mod_author=UnRealDinnerbone diff --git a/neo/build.gradle b/neo/build.gradle index 5158f39..327bf91 100644 --- a/neo/build.gradle +++ b/neo/build.gradle @@ -2,7 +2,5 @@ multiLoader.neo() { neoVersion.set("${neo_version}") } - - -java.toolchain.languageVersion = JavaLanguageVersion.of(17) +publishing.publications.mavenJava.from components.java diff --git a/neo/src/main/java/com/unrealdinnerbone/trenzalore/TrenzaloreForge.java b/neo/src/main/java/com/unrealdinnerbone/trenzalore/TrenzaloreForge.java index 0eafb6d..da97439 100644 --- a/neo/src/main/java/com/unrealdinnerbone/trenzalore/TrenzaloreForge.java +++ b/neo/src/main/java/com/unrealdinnerbone/trenzalore/TrenzaloreForge.java @@ -1,16 +1,18 @@ package com.unrealdinnerbone.trenzalore; import com.unrealdinnerbone.trenzalore.platform.NeoPlatformHelper; +import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.common.Mod; +import net.neoforged.fml.event.IModBusEvent; import net.neoforged.fml.javafmlmod.FMLJavaModLoadingContext; import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent; @Mod(Trenzalore.MOD_ID) public class TrenzaloreForge { - public TrenzaloreForge() { + public TrenzaloreForge(IEventBus modEventBus) { Trenzalore.init(); - FMLJavaModLoadingContext.get().getModEventBus().addListener(TrenzaloreForge::onCreativeTab); + modEventBus.addListener(TrenzaloreForge::onCreativeTab); } public static void onCreativeTab(BuildCreativeModeTabContentsEvent event) { diff --git a/neo/src/main/resources/META-INF/mods.toml b/neo/src/main/resources/META-INF/mods.toml index 51f6480..e69d2e9 100644 --- a/neo/src/main/resources/META-INF/mods.toml +++ b/neo/src/main/resources/META-INF/mods.toml @@ -11,13 +11,13 @@ authors="UnRealDinnerbone" description="This mod adds a few small helpers to provide compatibility with Forge / Fabric." [[dependencies.trenzalore]] modId="neoforge" - mandatory=true + required=true versionRange="[1.0,)" ordering="NONE" side="BOTH" [[dependencies.trenzalore]] modId="minecraft" - mandatory=true + required=true versionRange="[${minecraft_version}]" ordering="NONE" side="BOTH" diff --git a/neo/src/main/resources/META-INF/services/com.unrealdinnerbone.trenzalore.api.platform.services.IRegistry b/neo/src/main/resources/META-INF/services/com.unrealdinnerbone.trenzalore.api.platform.services.IRegistry index 8b02861..523c2c0 100644 --- a/neo/src/main/resources/META-INF/services/com.unrealdinnerbone.trenzalore.api.platform.services.IRegistry +++ b/neo/src/main/resources/META-INF/services/com.unrealdinnerbone.trenzalore.api.platform.services.IRegistry @@ -1,2 +1 @@ com.unrealdinnerbone.trenzalore.TrenzaloreNeoRegistry -com.unrealdinnerbone.trenzalore.TestItems