diff --git a/CHANGELOG.md b/CHANGELOG.md index 642b17d..7b528ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,2 @@ -## [2.3.1] -- Updated CI / Build Script \ No newline at end of file +## [82.0.1] +- Build on Architectury \ No newline at end of file diff --git a/Common/build.gradle b/Common/build.gradle deleted file mode 100644 index a5443f1..0000000 --- a/Common/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -plugins { - id 'java' - id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' - id 'maven-publish' -} - -base { - archivesName = "${project.property("mod_name")}-${project.name}" -} - -minecraft { - version(minecraft_version) -} - - -dependencies { - compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5' -} - -publishing { - publications { - mavenCommon(MavenPublication) { - artifactId base.archivesName.get() - from components.java - } - } -} diff --git a/Fabric/build.gradle b/Fabric/build.gradle deleted file mode 100644 index 83f06ed..0000000 --- a/Fabric/build.gradle +++ /dev/null @@ -1,68 +0,0 @@ -plugins { - id 'fabric-loom' version '1.4-SNAPSHOT' - id 'maven-publish' - id 'idea' -} - -base { - archivesName = "${project.property("mod_name")}-${project.name}" -} - -Project commonProject = parent.project("Common") - -repositories { - maven { - url "https://api.modrinth.com/maven" - content { - includeGroup "maven.modrinth" - } - } -} - -dependencies { - minecraft "com.mojang:minecraft:${minecraft_version}" - mappings loom.officialMojangMappings() - modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" - modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}" - implementation commonProject - - // Modmenu - modRuntimeOnly("maven.modrinth:modmenu:${modmenu_version}") -} - -loom { - mixin { - defaultRefmapName = "${mod_id}.refmap.json" - } - runs { - client { - client() - setConfigName("Fabric Client") - ideConfigGenerated(true) - runDir("run_client") - } - server { - server() - setConfigName("Fabric Server") - ideConfigGenerated(true) - runDir("run_server") - } - } -} - -processResources { - from commonProject.sourceSets.main.resources -} - -tasks.withType(JavaCompile) { - source(commonProject.sourceSets.main.allSource) -} - -publishing { - publications { - mavenFabric(MavenPublication) { - artifactId project.base.archivesName.get() - from components.java - } - } -} diff --git a/Forge/build.gradle b/Forge/build.gradle deleted file mode 100644 index 34ae4e3..0000000 --- a/Forge/build.gradle +++ /dev/null @@ -1,77 +0,0 @@ -plugins { - id 'java' - id 'eclipse' - id 'maven-publish' - id 'net.minecraftforge.gradle' version '6.0.+' - id 'org.spongepowered.mixin' version '0.7-SNAPSHOT' -} - -base { - archivesName = "${project.property("mod_name")}-${project.name}" -} - -Project commonProject = parent.project("Common") - -mixin { - add commonProject.sourceSets.main, "${mod_id}.refmap.json" - config("${mod_id}.mixins.json") -} - -minecraft { - mappings channel: 'official', version: minecraft_version - - runs { - client { - workingDirectory project.file('run') - ideaModule "${parent.name}.${project.name}.main" - taskName 'Client' - property 'mixin.env.remapRefMap', 'true' - property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" - mods { - modClientRun { - source sourceSets.main - source commonProject.sourceSets.main - } - } - } - - server { - workingDirectory project.file('run') - ideaModule "${parent.name}.${project.name}.main" - taskName 'Server' - property 'mixin.env.remapRefMap', 'true' - property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg" - mods { - modServerRun { - source sourceSets.main - source commonProject.sourceSets.main - } - } - } - } -} - -dependencies { - minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" - compileOnly commonProject - annotationProcessor "org.spongepowered:mixin:0.8.5:processor" -} - -tasks.withType(JavaCompile) { - source(commonProject.sourceSets.main.allSource) -} - -processResources { - from commonProject.sourceSets.main.resources -} - -jar.finalizedBy('reobfJar') - -publishing { - publications { - register("mavenForge", MavenPublication) { - artifactId base.archivesName.get() - artifact jar - } - } -} diff --git a/Neoforge/build.gradle b/Neoforge/build.gradle deleted file mode 100644 index ac8f6d1..0000000 --- a/Neoforge/build.gradle +++ /dev/null @@ -1,65 +0,0 @@ -plugins { - id 'idea' - id 'maven-publish' - id 'net.neoforged.gradle.userdev' version '7.0.+' - id 'net.neoforged.gradle.mixin' version '7.0+' - id 'java-library' -} - -base { - archivesName = "${project.property("mod_name")}-${project.name}" -} - -Project commonProject = parent.project("Common") - -mixin { - config("${mod_id}.mixins.json") -} - -runs { - configureEach { - modSource project.sourceSets.main - } - - client { - systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id - } - - server { - systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id - programArgument '--nogui' - } -} - -dependencies { - implementation "net.neoforged:neoforge:${neoforge_version}" - compileOnly commonProject -} - -publishing { - publications { - register("mavenNeoforge", MavenPublication) { - artifactId base.archivesName.get() - artifact jar - } - } -} - -// Thanks jared -Spec notNeoTask = { Task it -> !it.name.startsWith("neo") } as Spec - -tasks.withType(JavaCompile).matching(notNeoTask).configureEach { - source(project(":Common").sourceSets.main.allSource) -} - -tasks.withType(Javadoc).matching(notNeoTask).configureEach { - source(project(":Common").sourceSets.main.allJava) -} - -tasks.named("sourcesJar", Jar) { - from(project(":Common").sourceSets.main.allSource) -} - -tasks.withType(ProcessResources).matching(notNeoTask).configureEach { - from project(":Common").sourceSets.main.resources -} diff --git a/build.gradle b/build.gradle index f58b081..320451a 100644 --- a/build.gradle +++ b/build.gradle @@ -1,50 +1,51 @@ plugins { + id "architectury-plugin" version "3.4-SNAPSHOT" + id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false id "me.modmuss50.mod-publish-plugin" version "0.4.5" - id "org.jetbrains.gradle.plugin.idea-ext" version "1.1.7" } -subprojects { - apply plugin: 'java' - apply plugin: 'maven-publish' +architectury { + minecraft = rootProject.minecraft_version +} - java.toolchain.languageVersion = JavaLanguageVersion.of(17) +subprojects { + apply plugin: "dev.architectury.loom" + apply plugin: "maven-publish" - def env = System.getenv(); - ext.ENV = env + loom { + silentMojangMappingsLicense() + } - version = "${mod_version}" - group = parent.maven_group + dependencies { + minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" + mappings loom.officialMojangMappings() + } - jar { - from(rootProject.file("LICENSE")) { - rename { "${it}_${mod_name}" } - } - manifest { - attributes([ - 'Specification-Title' : mod_name, - 'Specification-Vendor' : mod_author, - 'Specification-Version' : project.jar.archiveVersion, - 'Implementation-Title' : project.name, - 'Implementation-Version' : project.jar.archiveVersion, - 'Implementation-Vendor' : mod_author, - 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), - 'Timestamp' : System.currentTimeMillis(), - 'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})", - 'Built-On-Minecraft' : minecraft_version - ]) + publishing { + repositories { + if (providers.environmentVariable("NANITE_TOKEN").isPresent()) { + maven { + url "https://maven.nanite.dev/releases" + credentials { + username = "nanite" + password = providers.environmentVariable("NANITE_TOKEN").get() + } + } + } } } +} + +allprojects { + apply plugin: "java" + apply plugin: "architectury-plugin" + apply plugin: "maven-publish" + + archivesBaseName = rootProject.archives_base_name + version = rootProject.mod_version + group = rootProject.maven_group repositories { - mavenCentral() - maven { - name = 'Sponge / Mixin' - url = 'https://repo.spongepowered.org/repository/maven-public/' - } - maven { - name = 'Nanite Releases' - url = 'https://maven.nanite.dev/releases' - } } tasks.withType(JavaCompile) { @@ -55,31 +56,6 @@ subprojects { java { withSourcesJar() } - - processResources { - def buildProps = project.properties.clone() - buildProps.put('file', [jarVersion: project.version]) - - filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml']) { - expand buildProps - } - } - - def token = providers.environmentVariable("NANITE_TOKEN") - - publishing { - repositories { - if (token.isPresent()) { - maven { - url "https://maven.nanite.dev/releases" - credentials { - username = "nanite" - password = token.get() - } - } - } - } - } } publishMods { @@ -89,20 +65,20 @@ publishMods { type = STABLE def fabricOptions = publishOptions { - file = project.provider { project(":Fabric").tasks.remapJar }.flatMap { it.archiveFile } - displayName = "[FABRIC][${minecraft_version}] Yeetus Experimentus ${mod_version}" + file = project.provider { project(":fabric").tasks.remapJar }.flatMap { it.archiveFile } + displayName = "[FABRIC][${minecraft_version}] ${project.name} ${mod_version}" modLoaders.add("fabric") } def forgeOptions = publishOptions { - file = project.provider { project(":Forge").tasks.jar }.flatMap { it.archiveFile } - displayName = "[FORGE][${minecraft_version}] Yeetus Experimentus ${mod_version}" + file = project.provider { project(":forge").tasks.remapJar }.flatMap { it.archiveFile } + displayName = "[FORGE][${minecraft_version}] ${project.name} ${mod_version}" modLoaders.add("forge") } - def neoforgeOptions = publishOptions { - file = project.provider { project(":Neoforge").tasks.jar }.flatMap { it.archiveFile } - displayName = "[NEOFORGE][${minecraft_version}] Yeetus Experimentus ${mod_version}" + def neoForge = publishOptions { + file = project.provider { project(":neoforge").tasks.remapJar }.flatMap { it.archiveFile } + displayName = "[NEOFORGE][${minecraft_version}] ${project.name} ${mod_version}" modLoaders.add("neoforge") } @@ -130,7 +106,7 @@ publishMods { } curseforge("curseforgeNeoForge") { - from(curseForgeOptions, neoforgeOptions) + from(curseForgeOptions, neoForge) } if (providers.environmentVariable("MODRINTH_TOKEN").getOrNull() != null) { @@ -145,8 +121,8 @@ publishMods { from(modrinthOptions, forgeOptions) } - modrinth("modrinthNeoForge") { - from(modrinthOptions, neoforgeOptions) + modrinth("modrinthNeoforge") { + from(modrinthOptions, neoForge) } } -} +} \ No newline at end of file diff --git a/common/build.gradle b/common/build.gradle new file mode 100644 index 0000000..aac6c63 --- /dev/null +++ b/common/build.gradle @@ -0,0 +1,20 @@ +architectury { + common(rootProject.enabled_platforms.split(",")) +} + +loom { + accessWidenerPath = file("src/main/resources/yeetusexperimentus.accesswidener") +} + +dependencies { + modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" +} + +publishing { + publications { + mavenCommon(MavenPublication) { + artifactId = "${rootProject.archivesBaseName}-${project.name}" + from components.java + } + } +} \ No newline at end of file diff --git a/Common/src/main/java/com/sunekaer/yeetusexperimentus/YeetusExperimentus.java b/common/src/main/java/com/sunekaer/yeetusexperimentus/YeetusExperimentus.java similarity index 78% rename from Common/src/main/java/com/sunekaer/yeetusexperimentus/YeetusExperimentus.java rename to common/src/main/java/com/sunekaer/yeetusexperimentus/YeetusExperimentus.java index 693bf48..e8e9fcf 100644 --- a/Common/src/main/java/com/sunekaer/yeetusexperimentus/YeetusExperimentus.java +++ b/common/src/main/java/com/sunekaer/yeetusexperimentus/YeetusExperimentus.java @@ -2,5 +2,6 @@ public class YeetusExperimentus { public static final String MOD_ID = "yeetusexperimentus"; - + public static void init() { + } } diff --git a/Common/src/main/java/com/sunekaer/yeetusexperimentus/mixin/CreateWorldScreenMixin.java b/common/src/main/java/com/sunekaer/yeetusexperimentus/mixin/CreateWorldScreenMixin.java similarity index 100% rename from Common/src/main/java/com/sunekaer/yeetusexperimentus/mixin/CreateWorldScreenMixin.java rename to common/src/main/java/com/sunekaer/yeetusexperimentus/mixin/CreateWorldScreenMixin.java diff --git a/Common/src/main/java/com/sunekaer/yeetusexperimentus/mixin/WorldOpenFlowsMixin.java b/common/src/main/java/com/sunekaer/yeetusexperimentus/mixin/WorldOpenFlowsMixin.java similarity index 100% rename from Common/src/main/java/com/sunekaer/yeetusexperimentus/mixin/WorldOpenFlowsMixin.java rename to common/src/main/java/com/sunekaer/yeetusexperimentus/mixin/WorldOpenFlowsMixin.java diff --git a/common/src/main/resources/architectury.common.json b/common/src/main/resources/architectury.common.json new file mode 100644 index 0000000..92e9275 --- /dev/null +++ b/common/src/main/resources/architectury.common.json @@ -0,0 +1,3 @@ +{ + "accessWidener": "yeetusexperimentus.accesswidener" +} \ No newline at end of file diff --git a/Common/src/main/resources/pack.mcmeta b/common/src/main/resources/pack.mcmeta similarity index 100% rename from Common/src/main/resources/pack.mcmeta rename to common/src/main/resources/pack.mcmeta diff --git a/Common/src/main/resources/yeetusexperimentus.mixins.json b/common/src/main/resources/yeetusexperimentus-common.mixins.json similarity index 85% rename from Common/src/main/resources/yeetusexperimentus.mixins.json rename to common/src/main/resources/yeetusexperimentus-common.mixins.json index 4274add..8464aed 100644 --- a/Common/src/main/resources/yeetusexperimentus.mixins.json +++ b/common/src/main/resources/yeetusexperimentus-common.mixins.json @@ -2,7 +2,6 @@ "required": true, "package": "com.sunekaer.yeetusexperimentus.mixin", "compatibilityLevel": "JAVA_17", - "refmap": "yeetusexperimentus.refmap.json", "mixins": [ ], "client": [ diff --git a/Common/src/main/resources/yeetusexperimentus-logo.png b/common/src/main/resources/yeetusexperimentus-logo.png similarity index 100% rename from Common/src/main/resources/yeetusexperimentus-logo.png rename to common/src/main/resources/yeetusexperimentus-logo.png diff --git a/common/src/main/resources/yeetusexperimentus.accesswidener b/common/src/main/resources/yeetusexperimentus.accesswidener new file mode 100644 index 0000000..13268c3 --- /dev/null +++ b/common/src/main/resources/yeetusexperimentus.accesswidener @@ -0,0 +1 @@ +accessWidener v2 named \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle new file mode 100644 index 0000000..69c8e4c --- /dev/null +++ b/fabric/build.gradle @@ -0,0 +1,77 @@ +plugins { + id "com.github.johnrengelman.shadow" version "7.1.2" +} + +architectury { + platformSetupLoomIde() + fabric() +} + +loom { + accessWidenerPath = project(":common").loom.accessWidenerPath +} + +configurations { + common + shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this. + compileClasspath.extendsFrom common + runtimeClasspath.extendsFrom common + developmentFabric.extendsFrom common +} + +dependencies { + modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" + modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}" + + common(project(path: ":common", configuration: "namedElements")) { transitive false } + shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false } +} + +processResources { + inputs.property "version", project.version + + filesMatching("fabric.mod.json") { + expand "version": project.version + } +} + +shadowJar { + exclude "architectury.common.json" + + configurations = [project.configurations.shadowCommon] + setArchiveClassifier("dev-shadow") +} + +remapJar { + injectAccessWidener = true + input.set shadowJar.archiveFile + dependsOn shadowJar + archiveBaseName.set "${rootProject.archives_base_name}-${project.name}" + setArchiveClassifier(null) +} + + +jar { + setArchiveClassifier("dev") +} + +sourcesJar { + def commonSources = project(":common").sourcesJar + dependsOn commonSources + from commonSources.archiveFile.map { zipTree(it) } +} + +components.java { + withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { + skip() + } +} + +publishing { + publications { + mavenFabric(MavenPublication) { + artifactId = "${rootProject.archivesBaseName}-${project.name}" + from components.java + } + } +} \ No newline at end of file diff --git a/fabric/src/main/java/com/sunekaer/yeetusexperimentus/fabric/YeetusExperimentusFabric.java b/fabric/src/main/java/com/sunekaer/yeetusexperimentus/fabric/YeetusExperimentusFabric.java new file mode 100644 index 0000000..a7a00ab --- /dev/null +++ b/fabric/src/main/java/com/sunekaer/yeetusexperimentus/fabric/YeetusExperimentusFabric.java @@ -0,0 +1,11 @@ +package com.sunekaer.yeetusexperimentus.fabric; + +import com.sunekaer.yeetusexperimentus.YeetusExperimentus; +import net.fabricmc.api.ModInitializer; + +public class YeetusExperimentusFabric implements ModInitializer { + @Override + public void onInitialize() { + YeetusExperimentus.init(); + } +} diff --git a/Fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json similarity index 91% rename from Fabric/src/main/resources/fabric.mod.json rename to fabric/src/main/resources/fabric.mod.json index 31fdabb..82ffdff 100644 --- a/Fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -19,12 +19,12 @@ "environment": "*", "entrypoints": {}, "mixins": [ - "yeetusexperimentus.mixins.json" + "yeetusexperimentus-common.mixins.json" ], "depends": { "fabricloader": ">=0.14", "fabric": "*", - "minecraft": ">=1.20", + "minecraft": ">=1.20.2", "java": ">=17" } } diff --git a/forge/build.gradle b/forge/build.gradle new file mode 100644 index 0000000..478e849 --- /dev/null +++ b/forge/build.gradle @@ -0,0 +1,89 @@ +plugins { + id "com.github.johnrengelman.shadow" version "7.1.2" +} + +architectury { + platformSetupLoomIde() + forge() +} + +loom { + accessWidenerPath = project(":common").loom.accessWidenerPath + + forge { + convertAccessWideners = true + extraAccessWideners.add loom.accessWidenerPath.get().asFile.name + mixinConfigs = [ + "yeetusexperimentus-common.mixins.json" + ] + } +} + +configurations { + common + shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this. + compileClasspath.extendsFrom common + runtimeClasspath.extendsFrom common + developmentForge.extendsFrom common +} + +dependencies { + forge "net.minecraftforge:forge:${rootProject.minecraft_version}-${rootProject.forge_version}" + + common(project(path: ":common", configuration: "namedElements")) { transitive false } + shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } +} + +processResources { + inputs.property "version", project.version + + filesMatching("META-INF/mods.toml") { + expand "version": project.version + } +} + +shadowJar { + exclude "fabric.mod.json" + exclude "architectury.common.json" + + configurations = [project.configurations.shadowCommon] + setArchiveClassifier("dev-shadow") +} + +remapJar { + input.set shadowJar.archiveFile + dependsOn shadowJar + archiveBaseName.set "${rootProject.archives_base_name}-${project.name}" + setArchiveClassifier(null) +} + +jar { + setArchiveClassifier("dev") +} + +sourcesJar { + def commonSources = project(":common").sourcesJar + dependsOn commonSources + from commonSources.archiveFile.map { zipTree(it) } +} + +components.java { + withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { + skip() + } +} + +sourceSets.each { + def dir = layout.buildDirectory.dir("sourcesSets/$it.name") + it.output.resourcesDir = dir + it.java.destinationDirectory = dir +} + +publishing { + publications { + mavenForge(MavenPublication) { + artifactId = "${rootProject.archivesBaseName}-${project.name}" + from components.java + } + } +} \ No newline at end of file diff --git a/forge/gradle.properties b/forge/gradle.properties new file mode 100644 index 0000000..32f842a --- /dev/null +++ b/forge/gradle.properties @@ -0,0 +1 @@ +loom.platform=forge \ No newline at end of file diff --git a/Forge/src/main/java/com/sunekaer/yeetusexperimentus/YeetusExperimentusForge.java b/forge/src/main/java/com/sunekaer/yeetusexperimentus/forge/YeetusExperimentusForge.java similarity index 54% rename from Forge/src/main/java/com/sunekaer/yeetusexperimentus/YeetusExperimentusForge.java rename to forge/src/main/java/com/sunekaer/yeetusexperimentus/forge/YeetusExperimentusForge.java index ae54713..25726f1 100644 --- a/Forge/src/main/java/com/sunekaer/yeetusexperimentus/YeetusExperimentusForge.java +++ b/forge/src/main/java/com/sunekaer/yeetusexperimentus/forge/YeetusExperimentusForge.java @@ -1,10 +1,12 @@ -package com.sunekaer.yeetusexperimentus; +package com.sunekaer.yeetusexperimentus.forge; +import com.sunekaer.yeetusexperimentus.YeetusExperimentus; import net.minecraftforge.fml.common.Mod; @Mod(YeetusExperimentus.MOD_ID) public class YeetusExperimentusForge { public YeetusExperimentusForge() { + YeetusExperimentus.init(); } } \ No newline at end of file diff --git a/Forge/src/main/resources/META-INF/mods.toml b/forge/src/main/resources/META-INF/mods.toml similarity index 83% rename from Forge/src/main/resources/META-INF/mods.toml rename to forge/src/main/resources/META-INF/mods.toml index 48c3509..e95b2bb 100644 --- a/Forge/src/main/resources/META-INF/mods.toml +++ b/forge/src/main/resources/META-INF/mods.toml @@ -1,9 +1,9 @@ modLoader="javafml" -loaderVersion="[44,)" +loaderVersion="[48,)" license="All Rights Reserved" [[mods]] modId="yeetusexperimentus" -version="${file.jarVersion}" +version="${version}" displayName="Yeetus Experimentus" logoFile="yeetusexperimentus-logo.png" authors="Sunekaer" @@ -13,12 +13,12 @@ Disables the Experimental Settings popup, which appears when you create or load [[dependencies.yeetusexperimentus]] modId="forge" mandatory=true -versionRange="[44,)" +versionRange="[48,)" ordering="NONE" side="BOTH" [[dependencies.yeetusexperimentus]] modId="minecraft" mandatory=true -versionRange="[1.20,)" +versionRange="[1.20.2,)" ordering="NONE" side="BOTH" diff --git a/forge/src/main/resources/pack.mcmeta b/forge/src/main/resources/pack.mcmeta new file mode 100644 index 0000000..52854ec --- /dev/null +++ b/forge/src/main/resources/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "description": "${mod_name}", + "pack_format": 8 + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index ef4af84..f911577 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,28 +1,34 @@ +org.gradle.jvmargs=-Xmx8G +org.gradle.daemon=false + +enabled_platforms=fabric,neoforge,forge + # Project -mod_version=82.0.0 +mod_version=82.0.1 maven_group=com.sunekaer.mods mod_name=YeetusExperimentus mod_author=Sunekaer mod_id=yeetusexperimentus +archives_base_name=yeetusexperimentus # Publishing curseforge_id=635427 modrinth_id=HaaH232J -maven_url=https://maven.nanite.dev/ # Common minecraft_version=1.20.2 # Forge forge_version=48.1.0 +forge_gradle_version=6.0.18 + +# Neo neoforge_version=20.2.88 +neoforge_gradle_version=7.0.80 # Fabric -fabric_version=0.91.2+1.20.2 +fabric_api_version=0.91.2+1.20.2 fabric_loader_version=0.15.3 -# Gradle -org.gradle.jvmargs=-Xmx3G -org.gradle.daemon=false modmenu_version=8.0.1 diff --git a/neoforge/build.gradle b/neoforge/build.gradle new file mode 100644 index 0000000..9cf716a --- /dev/null +++ b/neoforge/build.gradle @@ -0,0 +1,84 @@ +plugins { + id "com.github.johnrengelman.shadow" version "7.1.2" +} + +architectury { + platformSetupLoomIde() + neoForge() +} + +repositories { + maven { + url "https://maven.saps.dev/mirror" + } +} + +loom { + accessWidenerPath = project(":common").loom.accessWidenerPath + + // neoForge {} +} + +configurations { + common + shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this. + compileClasspath.extendsFrom common + runtimeClasspath.extendsFrom common + developmentNeoForge.extendsFrom common +} + +dependencies { + neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}" + + common(project(path: ":common", configuration: "namedElements")) { transitive false } + shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive = false } +} + +processResources { + duplicatesStrategy(DuplicatesStrategy.EXCLUDE) + inputs.property "version", project.version + + filesMatching("META-INF/mods.toml") { + expand "version": project.version + } +} + +shadowJar { + exclude "fabric.mod.json" + exclude "architectury.common.json" + + configurations = [project.configurations.shadowCommon] + setArchiveClassifier "dev-shadow" +} + +remapJar { + input.set shadowJar.archiveFile + dependsOn shadowJar + archiveBaseName.set "${rootProject.archives_base_name}-${project.name}" + setArchiveClassifier(null) +} + +jar { + setArchiveClassifier("dev") +} + +sourcesJar { + def commonSources = project(":common").sourcesJar + dependsOn commonSources + from commonSources.archiveFile.map { zipTree(it) } +} + +components.java { + withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { + skip() + } +} + +publishing { + publications { + mavenNeoForge(MavenPublication) { + artifactId = "${rootProject.archivesBaseName}-${project.name}" + from components.java + } + } +} \ No newline at end of file diff --git a/neoforge/gradle.properties b/neoforge/gradle.properties new file mode 100644 index 0000000..2914393 --- /dev/null +++ b/neoforge/gradle.properties @@ -0,0 +1 @@ +loom.platform=neoforge \ No newline at end of file diff --git a/Neoforge/src/main/java/com/sunekaer/yeetusexperimentus/YeetusExperimentusNeoForge.java b/neoforge/src/main/java/com/sunekaer/yeetusexperimentus/neo/YeetusExperimentusNeoForge.java similarity index 53% rename from Neoforge/src/main/java/com/sunekaer/yeetusexperimentus/YeetusExperimentusNeoForge.java rename to neoforge/src/main/java/com/sunekaer/yeetusexperimentus/neo/YeetusExperimentusNeoForge.java index 80f0153..84a0ea6 100644 --- a/Neoforge/src/main/java/com/sunekaer/yeetusexperimentus/YeetusExperimentusNeoForge.java +++ b/neoforge/src/main/java/com/sunekaer/yeetusexperimentus/neo/YeetusExperimentusNeoForge.java @@ -1,10 +1,11 @@ -package com.sunekaer.yeetusexperimentus; +package com.sunekaer.yeetusexperimentus.neo; +import com.sunekaer.yeetusexperimentus.YeetusExperimentus; import net.neoforged.fml.common.Mod; @Mod(YeetusExperimentus.MOD_ID) public class YeetusExperimentusNeoForge { - public YeetusExperimentusNeoForge() { + YeetusExperimentus.init(); } } diff --git a/Neoforge/src/main/resources/META-INF/mods.toml b/neoforge/src/main/resources/META-INF/mods.toml similarity index 86% rename from Neoforge/src/main/resources/META-INF/mods.toml rename to neoforge/src/main/resources/META-INF/mods.toml index e426e64..7b1c86d 100644 --- a/Neoforge/src/main/resources/META-INF/mods.toml +++ b/neoforge/src/main/resources/META-INF/mods.toml @@ -1,24 +1,30 @@ modLoader="javafml" loaderVersion="[1,)" license="All Rights Reserved" + [[mods]] modId="yeetusexperimentus" -version="${file.jarVersion}" +version="${version}" displayName="Yeetus Experimentus" logoFile="yeetusexperimentus-logo.png" authors="Sunekaer" description=''' Disables the Experimental Settings popup, which appears when you create or load world. ''' + [[dependencies.yeetusexperimentus]] modId="neoforge" mandatory=true versionRange="[20.2,)" ordering="NONE" side="BOTH" + [[dependencies.yeetusexperimentus]] modId="minecraft" mandatory=true versionRange="[1.20,)" ordering="NONE" side="BOTH" + +[[mixins]] +config = "yeetusexperimentus-common.mixins.json" \ No newline at end of file diff --git a/neoforge/src/main/resources/pack.mcmeta b/neoforge/src/main/resources/pack.mcmeta new file mode 100644 index 0000000..52854ec --- /dev/null +++ b/neoforge/src/main/resources/pack.mcmeta @@ -0,0 +1,6 @@ +{ + "pack": { + "description": "${mod_name}", + "pack_format": 8 + } +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index efb54c6..1313737 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,30 +1,13 @@ pluginManagement { repositories { - mavenLocal() + maven { url "https://maven.neoforged.net/releases" } + maven { url "https://maven.creeperhost.net/" } + maven { url "https://maven.fabricmc.net/" } + maven { url "https://maven.architectury.dev/" } + maven { url "https://maven.minecraftforge.net/" } gradlePluginPortal() - maven { url = 'https://maven.neoforged.net/releases' } - maven { - name = 'Creeperhost' - url = 'https://maven.creeperhost.net/' - } - maven { - name = 'Forge' - url = 'https://maven.minecraftforge.net/' - } - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net/' - } - maven { - name = 'Sponge Snapshots' - url = 'https://repo.spongepowered.org/repository/maven-public/' - } } } -plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.5.0' -} - rootProject.name = 'YeetusExperimentus' -include("Common", "Fabric", "Forge", "Neoforge") +include("common", "fabric", "forge", "neoforge")