diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e3fe6d9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +[.java] +indent_style = tab +indent_size = 4 + +[.json] +indent_style = tab +indent_size = 2 \ No newline at end of file diff --git a/.github/workflows/build_status.yml b/.github/workflows/build_status.yml index 61ccfa4..0a800ff 100644 --- a/.github/workflows/build_status.yml +++ b/.github/workflows/build_status.yml @@ -1,52 +1,52 @@ name: Build Status on: - push: - branches: - - '*' - pull_request: + push: + branches: + - '*' + pull_request: jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 21 - uses: actions/setup-java@v4 - with: - distribution: 'microsoft' - java-version: 21 - cache: 'gradle' - - name: Validate Gradle Wrapper - uses: gradle/actions/wrapper-validation@v4 - - name: Grant execute permission for gradlew - run: chmod +x ./gradlew - - name: Build with Gradle - run: ./gradlew build - env: - GRADLE_BUILD_CACHE_USER: ${{ secrets.GRADLE_BUILD_CACHE_USER }} - GRADLE_BUILD_CACHE_TOKEN: ${{ secrets.GRADLE_BUILD_CACHE_TOKEN }} - - name: Upload build artifacts (Common) - continue-on-error: true - uses: actions/upload-artifact@v4 - with: - name: ${{ github.event.repository.name }}-Common-${{ github.sha }} - path: | - Common/build/libs/*.jar - !Common/build/libs/*-dev.jar - - name: Upload build artifacts (Fabric) - continue-on-error: true - uses: actions/upload-artifact@v4 - with: - name: ${{ github.event.repository.name }}-Fabric-${{ github.sha }} - path: | - Fabric/build/libs/*.jar - !Fabric/build/libs/*-dev.jar - - name: Upload build artifacts (NeoForge) - continue-on-error: true - uses: actions/upload-artifact@v4 - with: - name: ${{ github.event.repository.name }}-NeoForge-${{ github.sha }} - path: | - NeoForge/build/libs/*.jar - !NeoForge/build/libs/*-dev.jar + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: 'microsoft' + java-version: 21 + cache: 'gradle' + - name: Validate Gradle Wrapper + uses: gradle/actions/wrapper-validation@v4 + - name: Grant execute permission for gradlew + run: chmod +x ./gradlew + - name: Build with Gradle + run: ./gradlew build + env: + GRADLE_BUILD_CACHE_USER: ${{ secrets.GRADLE_BUILD_CACHE_USER }} + GRADLE_BUILD_CACHE_TOKEN: ${{ secrets.GRADLE_BUILD_CACHE_TOKEN }} + - name: Upload build artifacts (Common) + continue-on-error: true + uses: actions/upload-artifact@v4 + with: + name: ${{ github.event.repository.name }}-Common-${{ github.sha }} + path: | + Common/build/libs/*.jar + !Common/build/libs/*-dev.jar + - name: Upload build artifacts (Fabric) + continue-on-error: true + uses: actions/upload-artifact@v4 + with: + name: ${{ github.event.repository.name }}-Fabric-${{ github.sha }} + path: | + Fabric/build/libs/*.jar + !Fabric/build/libs/*-dev.jar + - name: Upload build artifacts (NeoForge) + continue-on-error: true + uses: actions/upload-artifact@v4 + with: + name: ${{ github.event.repository.name }}-NeoForge-${{ github.sha }} + path: | + NeoForge/build/libs/*.jar + !NeoForge/build/libs/*-dev.jar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c4d57e..f7d89dc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,80 +1,80 @@ name: Upload Release Artifacts on: - push: - tags: - - '*' + push: + tags: + - '*' jobs: - publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 21 - uses: actions/setup-java@v4 - with: - distribution: 'microsoft' - java-version: 21 - cache: 'gradle' - - name: Validate Gradle Wrapper - uses: gradle/actions/wrapper-validation@v4 - - name: Grant execute permission for gradlew - run: chmod +x ./gradlew - - name: Get current time - uses: srfrnk/current-time@5a4163ad035ccd9a407ec9e519c3b6ba1b633d1e - id: current_time - with: - format: YYYYMMDDHHmmss - - name: Setup ENV - run: echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV - - name: Copy Maven Upload URL - id: extract_maven_upload_url - run: echo "maven_upload_url=${{secrets.MAVEN_UPLOAD_URL}}" >> $GITHUB_OUTPUT - - name: Build with Gradle - env: - BUILD_TIME: ${{ steps.current_time.outputs.formattedTime }} - BUILD_NUMBER: ${{ github.run_number }} - run: ./gradlew assemble - - name: Maven Release - if: steps.extract_maven_upload_url.outputs.maven_upload_url - env: - BUILD_TIME: ${{ steps.current_time.outputs.formattedTime }} - BUILD_NUMBER: ${{ github.run_number }} - MAVEN_UPLOAD_URL: ${{ secrets.MAVEN_UPLOAD_URL }} - MAVEN_UPLOAD_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }} - MAVEN_UPLOAD_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }} - run: ./gradlew publish - - name: Publish (GitHub Releases) - uses: Kir-Antipov/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659 - with: - github-token: ${{ github.token }} - files: | - **/build/libs/!(*-@(dev|sources|javadoc|slim)).jar - **/build/libs/*-@(sources|javadoc).jar - - name: Publish (Fabric) - id: publish_fabric - uses: Kir-Antipov/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659 - with: - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - version: ${{ github.ref_name }}+Fabric - version-type: beta - files: | - Fabric/build/libs/!(*-@(dev|sources|javadoc|slim)).jar - Fabric/build/libs/*-@(sources|javadoc).jar - - name: Publish (NeoForge) - uses: Kir-Antipov/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659 - with: - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - version: ${{ github.ref_name }}+NeoForge - files: | - NeoForge/build/libs/!(*-@(dev|sources|javadoc|slim)).jar - NeoForge/build/libs/*-@(sources|javadoc).jar - - name: Notify Discord - uses: Up-Mods/action-discord-release@main - with: - version: ${{ github.ref_name }} - webhook-url: ${{ secrets.ANNOUNCEMENT_WEBHOOK_URL }} - curseforge-project-id: ${{ steps.publish_fabric.outputs.curseforge-id }} - modrinth-project-id: ${{ steps.publish_fabric.outputs.modrinth-id }} + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: 'microsoft' + java-version: 21 + cache: 'gradle' + - name: Validate Gradle Wrapper + uses: gradle/actions/wrapper-validation@v4 + - name: Grant execute permission for gradlew + run: chmod +x ./gradlew + - name: Get current time + uses: srfrnk/current-time@5a4163ad035ccd9a407ec9e519c3b6ba1b633d1e + id: current_time + with: + format: YYYYMMDDHHmmss + - name: Setup ENV + run: echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV + - name: Copy Maven Upload URL + id: extract_maven_upload_url + run: echo "maven_upload_url=${{secrets.MAVEN_UPLOAD_URL}}" >> $GITHUB_OUTPUT + - name: Build with Gradle + env: + BUILD_TIME: ${{ steps.current_time.outputs.formattedTime }} + BUILD_NUMBER: ${{ github.run_number }} + run: ./gradlew assemble + - name: Maven Release + if: steps.extract_maven_upload_url.outputs.maven_upload_url + env: + BUILD_TIME: ${{ steps.current_time.outputs.formattedTime }} + BUILD_NUMBER: ${{ github.run_number }} + MAVEN_UPLOAD_URL: ${{ secrets.MAVEN_UPLOAD_URL }} + MAVEN_UPLOAD_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }} + MAVEN_UPLOAD_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }} + run: ./gradlew publish + - name: Publish (GitHub Releases) + uses: Kir-Antipov/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659 + with: + github-token: ${{ github.token }} + files: | + **/build/libs/!(*-@(dev|sources|javadoc|slim)).jar + **/build/libs/*-@(sources|javadoc).jar + - name: Publish (Fabric) + id: publish_fabric + uses: Kir-Antipov/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659 + with: + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + version: ${{ github.ref_name }}+Fabric + version-type: beta + files: | + Fabric/build/libs/!(*-@(dev|sources|javadoc|slim)).jar + Fabric/build/libs/*-@(sources|javadoc).jar + - name: Publish (NeoForge) + uses: Kir-Antipov/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659 + with: + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} + version: ${{ github.ref_name }}+NeoForge + files: | + NeoForge/build/libs/!(*-@(dev|sources|javadoc|slim)).jar + NeoForge/build/libs/*-@(sources|javadoc).jar + - name: Notify Discord + uses: Up-Mods/action-discord-release@main + with: + version: ${{ github.ref_name }} + webhook-url: ${{ secrets.ANNOUNCEMENT_WEBHOOK_URL }} + curseforge-project-id: ${{ steps.publish_fabric.outputs.curseforge-id }} + modrinth-project-id: ${{ steps.publish_fabric.outputs.modrinth-id }} diff --git a/Common/interfaces.json b/Common/interfaces.json index 0db3279..2c63c08 100644 --- a/Common/interfaces.json +++ b/Common/interfaces.json @@ -1,3 +1,2 @@ { - } diff --git a/Common/src/main/java/dev/upcraft/examplemod/ExampleMod.java b/Common/src/main/java/dev/upcraft/examplemod/ExampleMod.java index 206c27b..5c4ccc4 100644 --- a/Common/src/main/java/dev/upcraft/examplemod/ExampleMod.java +++ b/Common/src/main/java/dev/upcraft/examplemod/ExampleMod.java @@ -1,6 +1,13 @@ package dev.upcraft.examplemod; -public class ExampleMod { +import dev.upcraft.sparkweave.api.entrypoint.MainEntryPoint; +import dev.upcraft.sparkweave.api.platform.ModContainer; - public static final String MODID = "examplemod"; +public class ExampleMod implements MainEntryPoint { + public static final String MOD_ID = "examplemod"; + + @Override + public void onInitialize(ModContainer mod) { + + } } diff --git a/Common/src/main/java/dev/upcraft/examplemod/package-info.java b/Common/src/main/java/dev/upcraft/examplemod/package-info.java index 2ec229f..79e1f4b 100644 --- a/Common/src/main/java/dev/upcraft/examplemod/package-info.java +++ b/Common/src/main/java/dev/upcraft/examplemod/package-info.java @@ -1,4 +1,4 @@ -@Mod.Context(ExampleMod.MODID) +@Mod.Context(ExampleMod.MOD_ID) package dev.upcraft.examplemod; import dev.upcraft.sparkweave.api.annotation.Mod; diff --git a/Common/src/main/resources/examplemod.mixins.json b/Common/src/main/resources/examplemod.mixins.json index b5a83d8..030eb5b 100644 --- a/Common/src/main/resources/examplemod.mixins.json +++ b/Common/src/main/resources/examplemod.mixins.json @@ -1,14 +1,14 @@ { - "required": true, - "minVersion": "0.8", - "package": "dev.upcraft.examplemod.mixin", - "refmap": "${mod_id}.refmap.json", - "compatibilityLevel": "JAVA_21", - "mixins": [ - ], - "client": [ - ], - "injectors": { - "defaultRequire": 1 + "required": true, + "minVersion": "0.8", + "package": "dev.upcraft.examplemod.mixin", + "refmap": "${mod_id}.refmap.json", + "compatibilityLevel": "JAVA_21", + "mixins": [ + ], + "client": [ + ], + "injectors": { + "defaultRequire": 1 } } diff --git a/Fabric/build.gradle b/Fabric/build.gradle index 57c5e59..dd924c7 100644 --- a/Fabric/build.gradle +++ b/Fabric/build.gradle @@ -1,135 +1,135 @@ plugins { - alias fabric.plugins.loom + alias fabric.plugins.loom } dependencies { - minecraft libs.minecraft - mappings(loom.layered { - it.officialMojangMappings() - it.parchment("org.parchmentmc.data:parchment-${libs.versions.parchment.minecraft.get()}:${libs.versions.parchment.mappings.get()}@zip") - }) - compileOnly project(":Common") + minecraft libs.minecraft + mappings(loom.layered { + it.officialMojangMappings() + it.parchment("org.parchmentmc.data:parchment-${libs.versions.parchment.minecraft.get()}:${libs.versions.parchment.mappings.get()}@zip") + }) + compileOnly project(":Common") - modImplementation fabric.fabric.loader - modImplementation fabric.fabric.api + modImplementation fabric.fabric.loader + modImplementation fabric.fabric.api - modImplementation libs.sparkweave.fabric - modImplementation libs.resourcefulconfig.fabric + modImplementation libs.sparkweave.fabric + modImplementation libs.resourcefulconfig.fabric - modCompileOnly fabric.modmenu - modLocalRuntime fabric.modmenu + modCompileOnly fabric.modmenu + modLocalRuntime fabric.modmenu - modCompileOnly "${libs.emi.fabric.get()}:api" - modLocalRuntime libs.emi.fabric + modCompileOnly "${libs.emi.fabric.get()}:api" + modLocalRuntime libs.emi.fabric } repositories { - mavenCentral() - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net' - } - maven { - name = 'NeoForge' - url = 'https://maven.neoforged.net/releases' - } - maven { - name = "Sponge" - url = "https://repo.spongepowered.org/repository/maven-public" - content { - includeGroupAndSubgroups "org.spongepowered" - } - } - maven { - name = "ParchmentMC" - url = "https://maven.parchmentmc.org" - content { - includeGroupAndSubgroups "org.parchmentmc" - } - } - maven { - name = "Up-Mods" - url = "https://maven.uuid.gg/releases" - } - maven { - name = "TeamResourceful" - url = "https://maven.teamresourceful.com/repository/maven-releases" - } - maven { - name "TerraformersMC" - url "https://maven.terraformersmc.com/releases" - } - maven { - name "Modrinth" - url "https://api.modrinth.com/maven" - content { - includeGroup "maven.modrinth" - } - } - maven { - name = "CurseMaven" - url = "https://www.cursemaven.com" - content { - includeGroup "curse.maven" - } - } + mavenCentral() + maven { + name = 'Fabric' + url = 'https://maven.fabricmc.net' + } + maven { + name = 'NeoForge' + url = 'https://maven.neoforged.net/releases' + } + maven { + name = "Sponge" + url = "https://repo.spongepowered.org/repository/maven-public" + content { + includeGroupAndSubgroups "org.spongepowered" + } + } + maven { + name = "ParchmentMC" + url = "https://maven.parchmentmc.org" + content { + includeGroupAndSubgroups "org.parchmentmc" + } + } + maven { + name = "Up-Mods" + url = "https://maven.uuid.gg/releases" + } + maven { + name = "TeamResourceful" + url = "https://maven.teamresourceful.com/repository/maven-releases" + } + maven { + name "TerraformersMC" + url "https://maven.terraformersmc.com/releases" + } + maven { + name "Modrinth" + url "https://api.modrinth.com/maven" + content { + includeGroup "maven.modrinth" + } + } + maven { + name = "CurseMaven" + url = "https://www.cursemaven.com" + content { + includeGroup "curse.maven" + } + } } loom { - mods { - "${mod_id}" { - sourceSet("main") - project(":Common").sourceSets.main - } - } - - accessWidenerPath.set(file("src/main/resources/${mod_id}.accesswidener")) - - mixin { - defaultRefmapName.set("${mod_id}.refmap.json") - } - - runs { - client { - client() - setConfigName("Fabric Client") - ideConfigGenerated(true) - runDir("run") - - if (rootProject.hasProperty('mc_uuid')) { - programArgs("--uuid", rootProject.mc_uuid) - } - - if (rootProject.hasProperty('mc_username')) { - programArgs("--username", rootProject.mc_username) - } - - if (rootProject.hasProperty('mc_java_agent_path')) { - vmArg("-javaagent:${rootProject.mc_java_agent_path}") - } - } - - server { - server() - setConfigName("Fabric Server") - ideConfigGenerated(true) - runDir("run/server") - } - } + mods { + "${mod_id}" { + sourceSet("main") + project(":Common").sourceSets.main + } + } + + accessWidenerPath.set(file("src/main/resources/${mod_id}.accesswidener")) + + mixin { + defaultRefmapName.set("${mod_id}.refmap.json") + } + + runs { + client { + client() + setConfigName("Fabric Client") + ideConfigGenerated(true) + runDir("run") + + if (rootProject.hasProperty('mc_uuid')) { + programArgs("--uuid", rootProject.mc_uuid) + } + + if (rootProject.hasProperty('mc_username')) { + programArgs("--username", rootProject.mc_username) + } + + if (rootProject.hasProperty('mc_java_agent_path')) { + vmArg("-javaagent:${rootProject.mc_java_agent_path}") + } + } + + server { + server() + setConfigName("Fabric Server") + ideConfigGenerated(true) + runDir("run/server") + } + } } tasks.named("compileJava", JavaCompile) { - source(project(":Common").sourceSets.main.allJava) + source(project(":Common").sourceSets.main.allJava) } tasks.named("javadoc", Javadoc) { - source(project(":Common").sourceSets.main.allJava) + source(project(":Common").sourceSets.main.allJava) } tasks.named("sourcesJar", Jar) { - from(project(":Common").sourceSets.main.allSource) + from(project(":Common").sourceSets.main.allSource) } processResources { - from project(":Common").sourceSets.main.resources + from project(":Common").sourceSets.main.resources } diff --git a/Fabric/src/main/java/dev/upcraft/examplemod/fabric/entrypoints/Client.java b/Fabric/src/main/java/dev/upcraft/examplemod/fabric/entrypoints/Client.java index 084ba60..69d4ea5 100644 --- a/Fabric/src/main/java/dev/upcraft/examplemod/fabric/entrypoints/Client.java +++ b/Fabric/src/main/java/dev/upcraft/examplemod/fabric/entrypoints/Client.java @@ -6,8 +6,8 @@ @CalledByReflection public class Client implements ClientModInitializer { - @Override - public void onInitializeClient() { + @Override + public void onInitializeClient() { - } + } } diff --git a/Fabric/src/main/java/dev/upcraft/examplemod/fabric/entrypoints/Main.java b/Fabric/src/main/java/dev/upcraft/examplemod/fabric/entrypoints/Main.java index 3166425..3e2e08e 100644 --- a/Fabric/src/main/java/dev/upcraft/examplemod/fabric/entrypoints/Main.java +++ b/Fabric/src/main/java/dev/upcraft/examplemod/fabric/entrypoints/Main.java @@ -6,8 +6,8 @@ @CalledByReflection public class Main implements ModInitializer { - @Override - public void onInitialize() { + @Override + public void onInitialize() { - } + } } diff --git a/Fabric/src/main/java/dev/upcraft/examplemod/fabric/package-info.java b/Fabric/src/main/java/dev/upcraft/examplemod/fabric/package-info.java index 37ae71e..bf9cc26 100644 --- a/Fabric/src/main/java/dev/upcraft/examplemod/fabric/package-info.java +++ b/Fabric/src/main/java/dev/upcraft/examplemod/fabric/package-info.java @@ -1,4 +1,4 @@ -@Mod.Context(ExampleMod.MODID) +@Mod.Context(ExampleMod.MOD_ID) package dev.upcraft.examplemod.fabric; import dev.upcraft.examplemod.ExampleMod; diff --git a/Fabric/src/main/resources/examplemod.fabric.mixins.json b/Fabric/src/main/resources/examplemod.fabric.mixins.json index 819c800..74e4326 100644 --- a/Fabric/src/main/resources/examplemod.fabric.mixins.json +++ b/Fabric/src/main/resources/examplemod.fabric.mixins.json @@ -1,14 +1,14 @@ { - "required": true, - "minVersion": "0.8", - "package": "dev.upcraft.examplemod.fabric.mixin", - "refmap": "${mod_id}.refmap.json", - "compatibilityLevel": "JAVA_21", - "mixins": [ - ], - "client": [ - ], - "injectors": { - "defaultRequire": 1 + "required": true, + "minVersion": "0.8", + "package": "dev.upcraft.examplemod.fabric.mixin", + "refmap": "${mod_id}.refmap.json", + "compatibilityLevel": "JAVA_21", + "mixins": [ + ], + "client": [ + ], + "injectors": { + "defaultRequire": 1 } } diff --git a/Fabric/src/main/resources/fabric.mod.json b/Fabric/src/main/resources/fabric.mod.json index a7dc5eb..89d765f 100644 --- a/Fabric/src/main/resources/fabric.mod.json +++ b/Fabric/src/main/resources/fabric.mod.json @@ -1,51 +1,55 @@ { - "schemaVersion": 1, - "id": "${mod_id}", - "version": "${version}", - "name": "${mod_display_name}", - "description": "${mod_description}", - "authors": [ - "Up" - ], - "contributors": [], - "contact": { - "homepage": "${homepage_url}", - "sources": "${sources_url}", - "issues": "${issues_url}" - }, - "license": "${license_url}", - "icon": "icon.png", - "entrypoints": { - "main": ["dev.upcraft.examplemod.fabric.entrypoints.Main"], - "client": ["dev.upcraft.examplemod.fabric.entrypoints.Client"] - }, - "custom": { - "mc-publish": { - "curseforge": "${curseforge_id}", - "modrinth": "${modrinth_id}", - "loaders": [ - "fabric", - "quilt" - ], - "dependencies": [ - "fabric-api(required){curseforge:306612}{modrinth:P7dR8mSH}", - "sparkweave(required){curseforge:911456}{modrinth:nf68xfAw}", - "resourcefulconfig(required){curseforge:714059}{modrinth:M1953qlQ}" - ] - } - }, - "depends": { - "fabricloader": ">=${fabric_loader_version}", - "java": ">=${java_version}", - "minecraft": "=${minecraft_version}", - "fabric-api": "*", - "sparkweave": "*", - "resourcefulconfig": "*" - }, - "environment": "*", - "accessWidener": "${mod_id}.accesswidener", - "mixins": [ - "${mod_id}.mixins.json", - "${mod_id}.fabric.mixins.json" - ] + "schemaVersion": 1, + "id": "${mod_id}", + "version": "${version}", + "name": "${mod_display_name}", + "description": "${mod_description}", + "authors": [ + "Up" + ], + "contributors": [], + "contact": { + "homepage": "${homepage_url}", + "sources": "${sources_url}", + "issues": "${issues_url}" + }, + "license": "${license_url}", + "icon": "icon.png", + "entrypoints": { + "main": [ + "dev.upcraft.examplemod.fabric.entrypoints.Main" + ], + "client": [ + "dev.upcraft.examplemod.fabric.entrypoints.Client" + ] + }, + "custom": { + "mc-publish": { + "curseforge": "${curseforge_id}", + "modrinth": "${modrinth_id}", + "loaders": [ + "fabric", + "quilt" + ], + "dependencies": [ + "fabric-api(required){curseforge:306612}{modrinth:P7dR8mSH}", + "sparkweave(required){curseforge:911456}{modrinth:nf68xfAw}", + "resourcefulconfig(required){curseforge:714059}{modrinth:M1953qlQ}" + ] + } + }, + "depends": { + "fabricloader": ">=${fabric_loader_version}", + "java": ">=${java_version}", + "minecraft": "=${minecraft_version}", + "fabric-api": "*", + "sparkweave": "*", + "resourcefulconfig": "*" + }, + "environment": "*", + "accessWidener": "${mod_id}.accesswidener", + "mixins": [ + "${mod_id}.mixins.json", + "${mod_id}.fabric.mixins.json" + ] } diff --git a/LICENSE.md b/LICENSE.md index 0e259d4..cb9b058 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -38,84 +38,84 @@ terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights. 1. Copyright and Related Rights. A Work made available under CC0 may be -protected by copyright and related or neighboring rights ("Copyright and -Related Rights"). Copyright and Related Rights include, but are not -limited to, the following: + protected by copyright and related or neighboring rights ("Copyright and + Related Rights"). Copyright and Related Rights include, but are not + limited to, the following: - i. the right to reproduce, adapt, distribute, perform, display, - communicate, and translate a Work; - ii. moral rights retained by the original author(s) and/or performer(s); +i. the right to reproduce, adapt, distribute, perform, display, +communicate, and translate a Work; +ii. moral rights retained by the original author(s) and/or performer(s); iii. publicity and privacy rights pertaining to a person's image or - likeness depicted in a Work; - iv. rights protecting against unfair competition in regards to a Work, - subject to the limitations in paragraph 4(a), below; - v. rights protecting the extraction, dissemination, use and reuse of data - in a Work; - vi. database rights (such as those arising under Directive 96/9/EC of the - European Parliament and of the Council of 11 March 1996 on the legal - protection of databases, and under any national implementation - thereof, including any amended or successor version of such - directive); and +likeness depicted in a Work; +iv. rights protecting against unfair competition in regards to a Work, +subject to the limitations in paragraph 4(a), below; +v. rights protecting the extraction, dissemination, use and reuse of data +in a Work; +vi. database rights (such as those arising under Directive 96/9/EC of the +European Parliament and of the Council of 11 March 1996 on the legal +protection of databases, and under any national implementation +thereof, including any amended or successor version of such +directive); and vii. other similar, equivalent or corresponding rights throughout the - world based on applicable law or treaty, and any national - implementations thereof. +world based on applicable law or treaty, and any national +implementations thereof. 2. Waiver. To the greatest extent permitted by, but not in contravention -of, applicable law, Affirmer hereby overtly, fully, permanently, -irrevocably and unconditionally waives, abandons, and surrenders all of -Affirmer's Copyright and Related Rights and associated claims and causes -of action, whether now known or unknown (including existing as well as -future claims and causes of action), in the Work (i) in all territories -worldwide, (ii) for the maximum duration provided by applicable law or -treaty (including future time extensions), (iii) in any current or future -medium and for any number of copies, and (iv) for any purpose whatsoever, -including without limitation commercial, advertising or promotional -purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each -member of the public at large and to the detriment of Affirmer's heirs and -successors, fully intending that such Waiver shall not be subject to -revocation, rescission, cancellation, termination, or any other legal or -equitable action to disrupt the quiet enjoyment of the Work by the public -as contemplated by Affirmer's express Statement of Purpose. + of, applicable law, Affirmer hereby overtly, fully, permanently, + irrevocably and unconditionally waives, abandons, and surrenders all of + Affirmer's Copyright and Related Rights and associated claims and causes + of action, whether now known or unknown (including existing as well as + future claims and causes of action), in the Work (i) in all territories + worldwide, (ii) for the maximum duration provided by applicable law or + treaty (including future time extensions), (iii) in any current or future + medium and for any number of copies, and (iv) for any purpose whatsoever, + including without limitation commercial, advertising or promotional + purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each + member of the public at large and to the detriment of Affirmer's heirs and + successors, fully intending that such Waiver shall not be subject to + revocation, rescission, cancellation, termination, or any other legal or + equitable action to disrupt the quiet enjoyment of the Work by the public + as contemplated by Affirmer's express Statement of Purpose. 3. Public License Fallback. Should any part of the Waiver for any reason -be judged legally invalid or ineffective under applicable law, then the -Waiver shall be preserved to the maximum extent permitted taking into -account Affirmer's express Statement of Purpose. In addition, to the -extent the Waiver is so judged Affirmer hereby grants to each affected -person a royalty-free, non transferable, non sublicensable, non exclusive, -irrevocable and unconditional license to exercise Affirmer's Copyright and -Related Rights in the Work (i) in all territories worldwide, (ii) for the -maximum duration provided by applicable law or treaty (including future -time extensions), (iii) in any current or future medium and for any number -of copies, and (iv) for any purpose whatsoever, including without -limitation commercial, advertising or promotional purposes (the -"License"). The License shall be deemed effective as of the date CC0 was -applied by Affirmer to the Work. Should any part of the License for any -reason be judged legally invalid or ineffective under applicable law, such -partial invalidity or ineffectiveness shall not invalidate the remainder -of the License, and in such case Affirmer hereby affirms that he or she -will not (i) exercise any of his or her remaining Copyright and Related -Rights in the Work or (ii) assert any associated claims and causes of -action with respect to the Work, in either case contrary to Affirmer's -express Statement of Purpose. + be judged legally invalid or ineffective under applicable law, then the + Waiver shall be preserved to the maximum extent permitted taking into + account Affirmer's express Statement of Purpose. In addition, to the + extent the Waiver is so judged Affirmer hereby grants to each affected + person a royalty-free, non transferable, non sublicensable, non exclusive, + irrevocable and unconditional license to exercise Affirmer's Copyright and + Related Rights in the Work (i) in all territories worldwide, (ii) for the + maximum duration provided by applicable law or treaty (including future + time extensions), (iii) in any current or future medium and for any number + of copies, and (iv) for any purpose whatsoever, including without + limitation commercial, advertising or promotional purposes (the + "License"). The License shall be deemed effective as of the date CC0 was + applied by Affirmer to the Work. Should any part of the License for any + reason be judged legally invalid or ineffective under applicable law, such + partial invalidity or ineffectiveness shall not invalidate the remainder + of the License, and in such case Affirmer hereby affirms that he or she + will not (i) exercise any of his or her remaining Copyright and Related + Rights in the Work or (ii) assert any associated claims and causes of + action with respect to the Work, in either case contrary to Affirmer's + express Statement of Purpose. 4. Limitations and Disclaimers. - a. No trademark or patent rights held by Affirmer are waived, abandoned, - surrendered, licensed or otherwise affected by this document. - b. Affirmer offers the Work as-is and makes no representations or - warranties of any kind concerning the Work, express, implied, - statutory or otherwise, including without limitation warranties of - title, merchantability, fitness for a particular purpose, non - infringement, or the absence of latent or other defects, accuracy, or - the present or absence of errors, whether or not discoverable, all to - the greatest extent permissible under applicable law. - c. Affirmer disclaims responsibility for clearing rights of other persons - that may apply to the Work or any use thereof, including without - limitation any person's Copyright and Related Rights in the Work. - Further, Affirmer disclaims responsibility for obtaining any necessary - consents, permissions or other rights required for any use of the - Work. - d. Affirmer understands and acknowledges that Creative Commons is not a - party to this document and has no duty or obligation with respect to - this CC0 or use of the Work. +a. No trademark or patent rights held by Affirmer are waived, abandoned, +surrendered, licensed or otherwise affected by this document. +b. Affirmer offers the Work as-is and makes no representations or +warranties of any kind concerning the Work, express, implied, +statutory or otherwise, including without limitation warranties of +title, merchantability, fitness for a particular purpose, non +infringement, or the absence of latent or other defects, accuracy, or +the present or absence of errors, whether or not discoverable, all to +the greatest extent permissible under applicable law. +c. Affirmer disclaims responsibility for clearing rights of other persons +that may apply to the Work or any use thereof, including without +limitation any person's Copyright and Related Rights in the Work. +Further, Affirmer disclaims responsibility for obtaining any necessary +consents, permissions or other rights required for any use of the +Work. +d. Affirmer understands and acknowledges that Creative Commons is not a +party to this document and has no duty or obligation with respect to +this CC0 or use of the Work. diff --git a/NeoForge/build.gradle b/NeoForge/build.gradle index ff89c17..9c6e243 100644 --- a/NeoForge/build.gradle +++ b/NeoForge/build.gradle @@ -1,151 +1,151 @@ plugins { - id 'net.neoforged.moddev' - id 'net.neoforged.moddev.repositories' + id 'net.neoforged.moddev' + id 'net.neoforged.moddev.repositories' } configurations { - runtimeClasspath.extendsFrom localRuntime + runtimeClasspath.extendsFrom localRuntime } dependencies { - compileOnly project(":Common") + compileOnly project(":Common") - implementation libs.sparkweave.neoforge - implementation libs.resourcefulconfig.neoforge + implementation libs.sparkweave.neoforge + implementation libs.resourcefulconfig.neoforge - compileOnly "${libs.emi.neoforge.get()}:api" - localRuntime libs.emi.neoforge + compileOnly "${libs.emi.neoforge.get()}:api" + localRuntime libs.emi.neoforge } repositories { - mavenCentral() - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net' - } - maven { - name = 'NeoForge' - url = 'https://maven.neoforged.net/releases' - } - maven { - name = "Sponge" - url = "https://repo.spongepowered.org/repository/maven-public" - content { - includeGroupAndSubgroups "org.spongepowered" - } - } - maven { - name = "ParchmentMC" - url = "https://maven.parchmentmc.org" - content { - includeGroupAndSubgroups "org.parchmentmc" - } - } - maven { - name = "Up-Mods" - url = "https://maven.uuid.gg/releases" - } - maven { - name = "TeamResourceful" - url = "https://maven.teamresourceful.com/repository/maven-releases" - } - maven { - name "TerraformersMC" - url "https://maven.terraformersmc.com/releases" - } - maven { - name "Modrinth" - url "https://api.modrinth.com/maven" - content { - includeGroup "maven.modrinth" - } - } - maven { - name = "CurseMaven" - url = "https://www.cursemaven.com" - content { - includeGroup "curse.maven" - } - } + mavenCentral() + maven { + name = 'Fabric' + url = 'https://maven.fabricmc.net' + } + maven { + name = 'NeoForge' + url = 'https://maven.neoforged.net/releases' + } + maven { + name = "Sponge" + url = "https://repo.spongepowered.org/repository/maven-public" + content { + includeGroupAndSubgroups "org.spongepowered" + } + } + maven { + name = "ParchmentMC" + url = "https://maven.parchmentmc.org" + content { + includeGroupAndSubgroups "org.parchmentmc" + } + } + maven { + name = "Up-Mods" + url = "https://maven.uuid.gg/releases" + } + maven { + name = "TeamResourceful" + url = "https://maven.teamresourceful.com/repository/maven-releases" + } + maven { + name "TerraformersMC" + url "https://maven.terraformersmc.com/releases" + } + maven { + name "Modrinth" + url "https://api.modrinth.com/maven" + content { + includeGroup "maven.modrinth" + } + } + maven { + name = "CurseMaven" + url = "https://www.cursemaven.com" + content { + includeGroup "curse.maven" + } + } } neoForge { - version = neoforge.versions.neoforge.get() - - parchment { - minecraftVersion = libs.versions.parchment.minecraft.get() - mappingsVersion = libs.versions.parchment.mappings.get() - } - - accessTransformers { - def atFile = project(":Common").file("src/main/resources/META-INF/accesstransformer.cfg") - from atFile - publish atFile - } - - interfaceInjectionData { - def itfFile = project(":Common").file("interfaces.json") - from itfFile - publish itfFile - } - - mods { - "${project.mod_id}" { - sourceSet sourceSets.main - sourceSet project(":Common").sourceSets.main - } - } - - runs { - configureEach { - logLevel = org.slf4j.event.Level.DEBUG - - systemProperty 'forge.logging.markers', 'REGISTRIES' - - gameDirectory = project.file('run') - } - client { - client() - systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id - - if (rootProject.hasProperty('mc_uuid')) { - programArgument "--uuid=${rootProject.mc_uuid}" - } - - if (rootProject.hasProperty('mc_username')) { - programArgument "--username=${rootProject.mc_username}" - } - - if (rootProject.hasProperty('mc_java_agent_path')) { - jvmArgument "-javaagent:${rootProject.mc_java_agent_path}" - } - } - - server { - server() - systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id - programArgument '--nogui' - } - - data { - data() - programArguments.addAll('--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').absolutePath, '--existing', file('src/main/resources/').absolutePath) - } - } + version = neoforge.versions.neoforge.get() + + parchment { + minecraftVersion = libs.versions.parchment.minecraft.get() + mappingsVersion = libs.versions.parchment.mappings.get() + } + + accessTransformers { + def atFile = project(":Common").file("src/main/resources/META-INF/accesstransformer.cfg") + from atFile + publish atFile + } + + interfaceInjectionData { + def itfFile = project(":Common").file("interfaces.json") + from itfFile + publish itfFile + } + + mods { + "${project.mod_id}" { + sourceSet sourceSets.main + sourceSet project(":Common").sourceSets.main + } + } + + runs { + configureEach { + logLevel = org.slf4j.event.Level.DEBUG + + systemProperty 'forge.logging.markers', 'REGISTRIES' + + gameDirectory = project.file('run') + } + client { + client() + systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id + + if (rootProject.hasProperty('mc_uuid')) { + programArgument "--uuid=${rootProject.mc_uuid}" + } + + if (rootProject.hasProperty('mc_username')) { + programArgument "--username=${rootProject.mc_username}" + } + + if (rootProject.hasProperty('mc_java_agent_path')) { + jvmArgument "-javaagent:${rootProject.mc_java_agent_path}" + } + } + + server { + server() + systemProperty 'neoforge.enabledGameTestNamespaces', project.mod_id + programArgument '--nogui' + } + + data { + data() + programArguments.addAll('--mod', project.mod_id, '--all', '--output', file('src/generated/resources/').absolutePath, '--existing', file('src/main/resources/').absolutePath) + } + } } tasks.named("compileJava", JavaCompile) { - source(project(":Common").sourceSets.main.allJava) + source(project(":Common").sourceSets.main.allJava) } tasks.named("javadoc", Javadoc) { - source(project(":Common").sourceSets.main.allJava) + source(project(":Common").sourceSets.main.allJava) } tasks.named("sourcesJar", Jar) { - from(project(":Common").sourceSets.main.allSource) + from(project(":Common").sourceSets.main.allSource) } processResources { - from project(":Common").sourceSets.main.resources + from project(":Common").sourceSets.main.resources } diff --git a/NeoForge/src/main/java/dev/upcraft/examplemod/neoforge/entrypoints/Main.java b/NeoForge/src/main/java/dev/upcraft/examplemod/neoforge/entrypoints/Main.java index 6ad1bcd..cb494a2 100644 --- a/NeoForge/src/main/java/dev/upcraft/examplemod/neoforge/entrypoints/Main.java +++ b/NeoForge/src/main/java/dev/upcraft/examplemod/neoforge/entrypoints/Main.java @@ -4,10 +4,10 @@ import net.neoforged.bus.api.IEventBus; import net.neoforged.fml.common.Mod; -@Mod(ExampleMod.MODID) +@Mod(ExampleMod.MOD_ID) public class Main { - public Main(IEventBus modBus) { + public Main(IEventBus modBus) { - } + } } diff --git a/NeoForge/src/main/java/dev/upcraft/examplemod/neoforge/package-info.java b/NeoForge/src/main/java/dev/upcraft/examplemod/neoforge/package-info.java index 90c1f8a..a5c33a5 100644 --- a/NeoForge/src/main/java/dev/upcraft/examplemod/neoforge/package-info.java +++ b/NeoForge/src/main/java/dev/upcraft/examplemod/neoforge/package-info.java @@ -1,4 +1,4 @@ -@Mod.Context(ExampleMod.MODID) +@Mod.Context(ExampleMod.MOD_ID) package dev.upcraft.examplemod.neoforge; import dev.upcraft.examplemod.ExampleMod; diff --git a/NeoForge/src/main/resources/META-INF/neoforge.mods.toml b/NeoForge/src/main/resources/META-INF/neoforge.mods.toml index bd76d09..cc6d773 100644 --- a/NeoForge/src/main/resources/META-INF/neoforge.mods.toml +++ b/NeoForge/src/main/resources/META-INF/neoforge.mods.toml @@ -22,21 +22,21 @@ config = "${mod_id}.neoforge.mixins.json" # https://docs.neoforged.net/docs/gettingstarted/modfiles#dependency-configurations [dependencies] - "${mod_id}" = [ - { modId = "neoforge", type = "required", versionRange = "*", ordering = "NONE", side = "BOTH", mc-publish = { ignore = true } }, - { modId = "minecraft", type = "required", versionRange = "[${minecraft_version}]", ordering = "NONE", side = "BOTH" }, - { modId = "sparkweave", type = "required", versionRange = "*", ordering = "NONE", side = "BOTH", mc-publish = { curseforge = "911456", modrinth = "nf68xfAw" } }, - { modId = "resourcefulconfig", type = "required", versionRange = "*", ordering = "NONE", side = "BOTH", mc-publish = { curseforge = "714059", modrinth = "M1953qlQ" } }, - ] +"${mod_id}" = [ + { modId = "neoforge", type = "required", versionRange = "*", ordering = "NONE", side = "BOTH", mc-publish = { ignore = true } }, + { modId = "minecraft", type = "required", versionRange = "[${minecraft_version}]", ordering = "NONE", side = "BOTH" }, + { modId = "sparkweave", type = "required", versionRange = "*", ordering = "NONE", side = "BOTH", mc-publish = { curseforge = "911456", modrinth = "nf68xfAw" } }, + { modId = "resourcefulconfig", type = "required", versionRange = "*", ordering = "NONE", side = "BOTH", mc-publish = { curseforge = "714059", modrinth = "M1953qlQ" } }, +] # Features are specific properties of the game environment, that you may want to declare you require. This example declares # that your mod requires GL version 3.2 or higher. Other features will be added. They are side aware so declaring this won't # stop your mod loading on the server for example. -[features.${mod_id}] +[features.${ mod_id }] #openGLVersion="[3.2,)" javaVersion = "[${java_version},)" [mc-publish] - curseforge = "${curseforge_id}" - modrinth = "${modrinth_id}" - loaders = ["neoforge"] +curseforge = "${curseforge_id}" +modrinth = "${modrinth_id}" +loaders = ["neoforge"] diff --git a/NeoForge/src/main/resources/examplemod.neoforge.mixins.json b/NeoForge/src/main/resources/examplemod.neoforge.mixins.json index 9d7de95..9629eff 100644 --- a/NeoForge/src/main/resources/examplemod.neoforge.mixins.json +++ b/NeoForge/src/main/resources/examplemod.neoforge.mixins.json @@ -1,11 +1,11 @@ { - "required": true, - "minVersion": "0.8", - "package": "dev.upcraft.examplemod.neoforge.mixin", - "compatibilityLevel": "JAVA_21", - "mixins": [ - ], - "injectors": { - "defaultRequire": 1 + "required": true, + "minVersion": "0.8", + "package": "dev.upcraft.examplemod.neoforge.mixin", + "compatibilityLevel": "JAVA_21", + "mixins": [ + ], + "injectors": { + "defaultRequire": 1 } } diff --git a/build.gradle b/build.gradle index bebeead..ca3a57b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { - id 'idea' - id 'maven-publish' + id 'idea' + id 'maven-publish' } def javaVersion = 21 @@ -24,22 +24,22 @@ subprojects { project.group = rootProject.group project.version = rootProject.version - java { - toolchain { - languageVersion = JavaLanguageVersion.of(javaVersion) - vendor = JvmVendorSpec.MICROSOFT - } - withSourcesJar() - withJavadocJar() - } + java { + toolchain { + languageVersion = JavaLanguageVersion.of(javaVersion) + vendor = JvmVendorSpec.MICROSOFT + } + withSourcesJar() + withJavadocJar() + } javadoc { options.tags = ["reason"] } - base { - archivesName = "${rootProject.name}-${project.name}" - } + base { + archivesName = "${rootProject.name}-${project.name}" + } jar { from(rootProject.file("LICENSE.md")) { @@ -47,15 +47,15 @@ subprojects { } manifest { attributes([ - 'Specification-Title' : rootProject.name, - 'Specification-Version' : project.version, - 'Implementation-Title' : "${rootProject.name}-${project.name}", - 'Maven-Artifact' : "${maven_group_id}:${rootProject.name}-${project.name}:${project.version}", - 'Implementation-Version' : project.version, - 'Implementation-Timestamp' : NOW.format("yyyy-MM-dd'T'HH:mm:ssZ"), - 'Timestamp' : NOW.toInstant().toEpochMilli(), - 'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})", - 'Built-On-Minecraft' : libs.versions.minecraft.get() + 'Specification-Title' : rootProject.name, + 'Specification-Version' : project.version, + 'Implementation-Title' : "${rootProject.name}-${project.name}", + 'Maven-Artifact' : "${maven_group_id}:${rootProject.name}-${project.name}:${project.version}", + 'Implementation-Version' : project.version, + 'Implementation-Timestamp': NOW.format("yyyy-MM-dd'T'HH:mm:ssZ"), + 'Timestamp' : NOW.toInstant().toEpochMilli(), + 'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})", + 'Built-On-Minecraft' : libs.versions.minecraft.get() ]) } } @@ -72,25 +72,25 @@ subprojects { } processResources { - filteringCharset "UTF-8" + filteringCharset "UTF-8" def expandProps = [ - "version" : version, - "maven_group_id" : maven_group_id, - "mod_id" : mod_id, - "mod_display_name" : mod_display_name, - "mod_description" : mod_description, - "sources_url" : sources_url, - "issues_url" : issues_url, - "license_url" : license_url, - "discord_url" : discord_url, - "homepage_url" : homepage_url, - "minecraft_version" : libs.versions.minecraft.get(), - "curseforge_id" : curseforge_id, - "modrinth_id" : modrinth_id, - - "fabric_loader_version" : fabric.versions.fabric.loader.get(), - "java_version" : javaVersion + "version" : version, + "maven_group_id" : maven_group_id, + "mod_id" : mod_id, + "mod_display_name" : mod_display_name, + "mod_description" : mod_description, + "sources_url" : sources_url, + "issues_url" : issues_url, + "license_url" : license_url, + "discord_url" : discord_url, + "homepage_url" : homepage_url, + "minecraft_version" : libs.versions.minecraft.get(), + "curseforge_id" : curseforge_id, + "modrinth_id" : modrinth_id, + + "fabric_loader_version": fabric.versions.fabric.loader.get(), + "java_version" : javaVersion ] filesMatching(['pack.mcmeta', '*.mod.json', 'META-INF/*mods.toml', '*.mixins.json']) { @@ -99,14 +99,14 @@ subprojects { inputs.properties(expandProps) } - publishing { - publications { - "mavenJava${project.name}"(MavenPublication) { + publishing { + publications { + "mavenJava${project.name}"(MavenPublication) { artifactId "${rootProject.name}-${project.name}" from components.java } - } - } + } + } // IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior. idea { @@ -118,17 +118,17 @@ subprojects { } publishing { - repositories { - if (ENV.MAVEN_UPLOAD_URL) { - maven { - url = ENV.MAVEN_UPLOAD_URL - credentials { - username = ENV.MAVEN_UPLOAD_USERNAME - password = ENV.MAVEN_UPLOAD_PASSWORD - } - } - } - } + repositories { + if (ENV.MAVEN_UPLOAD_URL) { + maven { + url = ENV.MAVEN_UPLOAD_URL + credentials { + username = ENV.MAVEN_UPLOAD_USERNAME + password = ENV.MAVEN_UPLOAD_PASSWORD + } + } + } + } } // IDEA no longer automatically downloads sources/javadoc jars for dependencies, so we need to explicitly enable the behavior. diff --git a/gradle.properties b/gradle.properties index ee34bce..b5115bd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,6 @@ org.gradle.jvmargs=-Xmx3G org.gradle.configuration-cache=true # enable the remote build cache org.gradle.caching=true - # Metadata mod_id=examplemod mod_description=Template Mod. @@ -14,7 +13,6 @@ issues_url=https://github.com/Up-Mods/multiloader-template/issues license_url=https://github.com/Up-Mods/multiloader-template/blob/HEAD/LICENSE.md discord_url=https://mods.upcraft.dev/discord homepage_url=https://github.com/Up-Mods/multiloader-template - # Publishing maven_group_id=dev.upcraft.examplemod curseforge_id=0 diff --git a/settings.gradle b/settings.gradle index 4f06fb9..f6a4731 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,103 +1,103 @@ pluginManagement { - repositories { - gradlePluginPortal() - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net' - } - maven { - name = 'NeoForge' - url = 'https://maven.neoforged.net/releases' - } - mavenCentral() - } + repositories { + gradlePluginPortal() + maven { + name = 'Fabric' + url = 'https://maven.fabricmc.net' + } + maven { + name = 'NeoForge' + url = 'https://maven.neoforged.net/releases' + } + mavenCentral() + } } plugins { - id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' - id 'net.neoforged.moddev.repositories' version '2.0.34-beta' + id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' + id 'net.neoforged.moddev.repositories' version '2.0.34-beta' } rootProject.name = 'ExampleMod' include 'Common', 'Fabric', 'NeoForge' dependencyResolutionManagement { - repositories { - mavenCentral() - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net' - } - maven { - name = 'NeoForge' - url = 'https://maven.neoforged.net/releases' - } - maven { - name = "Sponge" - url = "https://repo.spongepowered.org/repository/maven-public" - content { - includeGroupAndSubgroups "org.spongepowered" - } - } - maven { - name = "ParchmentMC" - url = "https://maven.parchmentmc.org" - content { - includeGroupAndSubgroups "org.parchmentmc" - } - } - maven { - name = "Up-Mods" - url = "https://maven.uuid.gg/releases" - } - maven { - name = "TeamResourceful" - url = "https://maven.teamresourceful.com/repository/maven-releases" - } - maven { - name "TerraformersMC" - url "https://maven.terraformersmc.com/releases" - } - maven { - name "Modrinth" - url "https://api.modrinth.com/maven" - content { - includeGroup "maven.modrinth" - } - } - maven { - name = "CurseMaven" - url = "https://www.cursemaven.com" - content { - includeGroup "curse.maven" - } - } - } + repositories { + mavenCentral() + maven { + name = 'Fabric' + url = 'https://maven.fabricmc.net' + } + maven { + name = 'NeoForge' + url = 'https://maven.neoforged.net/releases' + } + maven { + name = "Sponge" + url = "https://repo.spongepowered.org/repository/maven-public" + content { + includeGroupAndSubgroups "org.spongepowered" + } + } + maven { + name = "ParchmentMC" + url = "https://maven.parchmentmc.org" + content { + includeGroupAndSubgroups "org.parchmentmc" + } + } + maven { + name = "Up-Mods" + url = "https://maven.uuid.gg/releases" + } + maven { + name = "TeamResourceful" + url = "https://maven.teamresourceful.com/repository/maven-releases" + } + maven { + name "TerraformersMC" + url "https://maven.terraformersmc.com/releases" + } + maven { + name "Modrinth" + url "https://api.modrinth.com/maven" + content { + includeGroup "maven.modrinth" + } + } + maven { + name = "CurseMaven" + url = "https://www.cursemaven.com" + content { + includeGroup "curse.maven" + } + } + } - versionCatalogs { - libs { - from(files("Common/libs.versions.toml")) - } - fabric { - from(files("Fabric/libs.versions.toml")) - } - neoforge { - from(files("NeoForge/libs.versions.toml")) - } - } + versionCatalogs { + libs { + from(files("Common/libs.versions.toml")) + } + fabric { + from(files("Fabric/libs.versions.toml")) + } + neoforge { + from(files("NeoForge/libs.versions.toml")) + } + } } def ENV = System.getenv() buildCache { - remote(HttpBuildCache) { - url = "https://ci-cache.uuid.gg/cache" - if (ENV.CI && ENV.GRADLE_BUILD_CACHE_USER && ENV.GRADLE_BUILD_CACHE_TOKEN) { - push = true - credentials { - username = ENV.GRADLE_BUILD_CACHE_USER - password = ENV.GRADLE_BUILD_CACHE_TOKEN - } - } - } + remote(HttpBuildCache) { + url = "https://ci-cache.uuid.gg/cache" + if (ENV.CI && ENV.GRADLE_BUILD_CACHE_USER && ENV.GRADLE_BUILD_CACHE_TOKEN) { + push = true + credentials { + username = ENV.GRADLE_BUILD_CACHE_USER + password = ENV.GRADLE_BUILD_CACHE_TOKEN + } + } + } }