From 0a206609a1ca5c750f626af0bc4315760f10abb9 Mon Sep 17 00:00:00 2001 From: sisby-folk Date: Tue, 13 Aug 2024 10:25:50 +1000 Subject: [PATCH 1/2] de escalate warnings, fix #191 --- .../folk/sisby/antique_atlas/reloader/BiomeTileProviders.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/folk/sisby/antique_atlas/reloader/BiomeTileProviders.java b/src/main/java/folk/sisby/antique_atlas/reloader/BiomeTileProviders.java index 58428ea9..7543022c 100644 --- a/src/main/java/folk/sisby/antique_atlas/reloader/BiomeTileProviders.java +++ b/src/main/java/folk/sisby/antique_atlas/reloader/BiomeTileProviders.java @@ -64,11 +64,11 @@ public void registerFallbacks(Registry biomeRegistry) { Identifier fallbackBiome = getFallbackBiome(biomeRegistry.getEntry(biome)); if (fallbackBiome != null && tileProviders.containsKey(fallbackBiome)) { biomeFallbacks.put(biomeId, fallbackBiome); - AntiqueAtlas.LOGGER.warn("[Antique Atlas] Set fallback biome for {} to {}. You can set a more fitting texture using a resource pack!", biomeId, fallbackBiome); + AntiqueAtlas.LOGGER.info("[Antique Atlas] Set fallback biome for {} to {}. You can set a more fitting texture using a resource pack!", biomeId, fallbackBiome); } else if (fallbackBiome != null) { AntiqueAtlas.LOGGER.error("[Antique Atlas] Fallback biome for {} is {}, which has no defined tile provider.", biomeId, fallbackBiome); } else { - AntiqueAtlas.LOGGER.error("[Antique Atlas] No fallback could be found for {}. This shouldn't happen! This means the biome is not in ANY conventional or vanilla tag on the client!", biomeId); + AntiqueAtlas.LOGGER.warn("[Antique Atlas] No fallback could be found for {}. This shouldn't happen! This means the biome is not in ANY conventional or vanilla tag on the client!", biomeId); if (AntiqueAtlas.CONFIG.fallbackFailHandling == AntiqueAtlasConfig.FallbackHandling.CRASH) throw new IllegalStateException("Antique Atlas fallback biome registration failed! Fix the missing biome or change fallbackFailHandling in antique_atlas.toml"); } } From 5f296ff0752ccc652f037aa9941f24ec0fb9f486 Mon Sep 17 00:00:00 2001 From: sisby-folk Date: Fri, 23 Aug 2024 22:46:33 +1000 Subject: [PATCH 2/2] new buildscripts --- .editorconfig | 11 +- .github/workflows/build.yml | 33 ++++++ credits.txt => CREDITS | 0 README.md | 2 +- build.gradle | 139 +++++++++++--------------- gradle.properties | 26 +++-- libs.versions.toml | 10 +- settings.gradle | 2 +- src/main/resources/META-INF/mods.toml | 44 ++++++++ src/main/resources/fabric.mod.json | 40 +++----- src/main/resources/mods.toml | 33 ------ 11 files changed, 188 insertions(+), 152 deletions(-) create mode 100644 .github/workflows/build.yml rename credits.txt => CREDITS (100%) create mode 100644 src/main/resources/META-INF/mods.toml delete mode 100644 src/main/resources/mods.toml diff --git a/.editorconfig b/.editorconfig index 7bbc42f2..6d7dcc0a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,19 +1,24 @@ [*] indent_size = 4 -indent_style = space +indent_style = tab tab_width = 4 +insert_final_newline = true + +[*.yml] +indent_size = 2 +indent_style = space [*.java] ij_java_block_brace_style = end_of_line ij_java_lambda_brace_style = end_of_line ij_java_method_brace_style = end_of_line +ij_java_names_count_to_use_import_on_demand = 999 -[{*.gant,*.groovy,*.gy}] +[{*.gant,*.groovy,*.gy,*.gradle}] ij_groovy_block_brace_style = end_of_line ij_groovy_class_brace_style = end_of_line ij_groovy_lambda_brace_style = end_of_line ij_groovy_method_brace_style = end_of_line [{*.har,*.json,*.png.mcmeta,mcmod.info,pack.mcmeta}] -indent_size = 2 ij_json_array_wrapping = split_into_lines diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..3829c8f6 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: Build + +on: [ push, pull_request ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup jdk + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: 'temurin' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + validate-wrappers: true + + - name: Run datagen with Gradle + run: ./gradlew runDatagen + + - name: Build with Gradle + run: ./gradlew build + + - name: capture build artifacts + uses: actions/upload-artifact@v4 + with: + name: Artifacts + path: build/libs/ diff --git a/credits.txt b/CREDITS similarity index 100% rename from credits.txt rename to CREDITS diff --git a/README.md b/README.md index bd42ede9..43bc3b3c 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Drag the map to pan, scroll to zoom, and use the bookmark buttons to create and If you need an equally distraction-free compass to substitute a minimap, try [PicoHUD](https://modrinth.com/mod/picohud)! -## **Mixed-Side Features** +## Mixed-Side Features _These work in singleplayer, or on servers with [Surveyor](https://modrinth.com/mod/surveyor) installed._ diff --git a/build.gradle b/build.gradle index bd7c62d0..505b6354 100644 --- a/build.gradle +++ b/build.gradle @@ -1,54 +1,53 @@ //file:noinspection GroovyAssignabilityCheck //file:noinspection GroovyAccessibility -buildscript { - dependencies { - classpath "com.modrinth.minotaur:Minotaur:${libs.versions.minotaur.get()}" - classpath "com.github.breadmoirai:github-release:${libs.versions.githubRelease.get()}" - } -} - - plugins { - id 'maven-publish' + id "maven-publish" alias libs.plugins.loom + alias libs.plugins.githubRelease + alias libs.plugins.minotaur } -version = "$project.baseVersion+$project.branch" -archivesBaseName = project.name -group = 'folk.sisby' +version = "$baseVersion+$branch" +archivesBaseName = project.slug repositories { - maven { url 'https://repo.sleeping.town/' } // Kaleido - mavenLocal() + maven { url "https://repo.sleeping.town/" } } dependencies { + implementation libs.kaleidoConfig + minecraft libs.mc mappings variantOf(libs.yarn) { classifier "v2" } modImplementation libs.fl + modImplementation libs.fapi - implementation libs.kaleidoConfig - modImplementation libs.surveyor + modImplementation libs.surveyor include libs.surveyor } processResources { - final Map map = [ - "version" : version.toString(), - "mc" : libs.versions.mc.get(), - "fl" : libs.versions.fl.get(), - "fapi" : libs.versions.fapi.get(), - "surveyor": libs.versions.surveyor.get() + final Map meta = [ + version : version, + modId : modId, + modName : modName, + modDescription: modDescription, + homepage : "https://modrinth.com/mod/${slug}", + issues : "https://github.com/${user}/${slug}/issues", + sources : "https://github.com/${user}/${slug}", + license : license, + authors : authors.split(", ").join("\",\n \""), + contributors : contributors.split(", ").join("\",\n \""), + members : "${authors}. Contributions by ${contributors}", + mc : compatibleVersions.split(", ")[0], + fl : libs.versions.fl.get(), + fapi : libs.versions.fapi.get(), + surveyor : libs.versions.surveyor.get(), ] - - inputs.properties(map) - filesMatching('*.mod.json') { expand(map) } - filesMatching('mods.toml') { expand(map) } - - from("src/main/resources/mods.toml") { - rename { "META-INF/mods.toml" } - } + inputs.properties(meta) + filesMatching("*.mod.json") { expand(meta) } + filesMatching("META-INF/*mods.toml") { expand(meta) } } tasks.withType(JavaCompile).configureEach { @@ -58,66 +57,46 @@ tasks.withType(JavaCompile).configureEach { java { withSourcesJar() + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } jar { - from("LICENSE.txt") { + from("LICENSE") { rename { "${it}_${archivesBaseName}" } } } -publishing { - publications { - mavenJava(MavenPublication) { - from components.java - } - } -} - -if (System.getenv("MODRINTH_TOKEN")) { - apply plugin: "com.modrinth.minotaur" - modrinth { - token = System.getenv("MODRINTH_TOKEN") - projectId = 'antique-atlas-4' - versionNumber = project.version - versionName = baseVersion - versionType = 'release' - uploadFile = remapJar - gameVersions = [libs.versions.mc.get()] - loaders = ['quilt', 'fabric', 'forge'] - detectLoaders = false - dependencies { - required.version libs.fapi.get().getName(), libs.versions.fapi.get() - embedded.version libs.surveyor.get().getName(), libs.versions.surveyor.get() - } - changelog = rootProject.file("CHANGELOG.md").text + "\n\nChangelog: https://github.com/sisby-folk/antique-atlas/releases/tag/v$baseVersion" - syncBodyFrom = rootProject.file("README.md").text - } +githubRelease { + token = System.getenv("GITHUB_TOKEN") + owner = project.user + repo = slug + tagName = "v${baseVersion}+${tagBranch}" + targetCommitish = tagBranch + releaseAssets = remapJar + releaseName = "v${baseVersion}" + allowUploadToExisting = true + generateReleaseNotes = true + body = !file("CHANGELOG.md").exists() ? "" : rootProject.file("CHANGELOG.md").text } -if (System.getenv("GITHUB_TOKEN")) { - apply plugin: "com.github.breadmoirai.github-release" - githubRelease { - token System.getenv("GITHUB_TOKEN") - owner "sisby-folk" - repo "antique-atlas" - tagName "v$baseVersion" - releaseName baseVersion - targetCommitish defaultBranch - draft false - prerelease false - releaseAssets remapJar.archiveFile - allowUploadToExisting true - generateReleaseNotes true - body rootProject.file("CHANGELOG.md").text + "\n" +modrinth { + token = System.getenv("MODRINTH_TOKEN") + projectId = modrinthSlug + versionNumber = project.version + uploadFile = remapJar + gameVersions = compatibleVersions.split(", ").toList() + loaders = compatibleLoaders.split(", ").toList() + changelog = !file("CHANGELOG.md").exists() ? "" : rootProject.file("CHANGELOG.md").text + "\n\nChangelog: https://github.com/${user}/${slug}/releases/tag/v${baseVersion}+${tagBranch}" + syncBodyFrom = rootProject.file("README.md").text + dependencies { + required.version libs.fapi.get().getName(), libs.versions.fapi.get() + embedded.version libs.surveyor.get().getName(), libs.versions.surveyor.get() } - tasks.githubRelease.dependsOn remapJar } -if (System.getenv("MODRINTH_TOKEN") && System.getenv("GITHUB_TOKEN")) { - tasks.register("fullRelease") { - group "publishing" - dependsOn "githubRelease" - dependsOn "modrinth" - } +tasks.register("fullRelease") { + group "publishing" + dependsOn "githubRelease" + dependsOn "modrinth" } diff --git a/gradle.properties b/gradle.properties index bc316f28..dd5fd6e5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,12 +1,26 @@ -# Gradle Properties +# Gradle org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 org.gradle.caching=true org.gradle.parallel=true org.gradle.caching.debug=false org.gradle.configureondemand=true -# Enable advanced multi-module optimizations (share tiny-remaper instance between projects) +# Loom fabric.loom.multiProjectOptimisation=true -# Mod Properties -baseVersion = 2.9.13 -defaultBranch = 1.20 -branch = 1.20 +# Mod Metadata +group=folk.sisby +user=sisby-folk +slug=antique-atlas +modrinthSlug=antique-atlas-4 +modId=antique_atlas +modName=Antique Atlas +modDescription=A hand-drawn world map with biomes, structures, waypoints, and less! +authors=Hunternif, tyra314, Sisby folk +contributors=Kenkron, asiekierka, Haven King, TheCodeWarrior, osipxd, coolAlias, TehNut, lumiscosity, frodolon +license=LGPL-3.0-or-later +# Mod Version +baseVersion=2.9.14 +# Branch Metadata +branch=1.20 +tagBranch=1.20 +compatibleVersions=1.20.1 +compatibleLoaders=fabric, quilt, forge diff --git a/libs.versions.toml b/libs.versions.toml index 8d8a8159..f481df92 100644 --- a/libs.versions.toml +++ b/libs.versions.toml @@ -1,13 +1,15 @@ [versions] loom = "1.7.+" githubRelease = "2.4.1" -minotaur = "2.6.0" +minotaur = "2.+" + +kaleidoConfig = "0.3.1+1.3.2" mc = "1.20.1" fl = "0.15.0" yarn = "1.20.1+build.10" fapi = "0.83.0+1.20.1" -kaleidoConfig = "0.3.1+1.3.1" + surveyor = "0.6.21+1.20" [plugins] @@ -16,9 +18,11 @@ githubRelease = { id = "com.github.breadmoirai.github-release", version.ref = "g minotaur = { id = "com.modrinth.minotaur", version.ref = "minotaur" } [libraries] +kaleidoConfig = { group = "folk.sisby", name = "kaleido-config", version.ref = "kaleidoConfig" } + mc = { group = "mojang", name = "minecraft", version.ref = "mc" } fl = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fl" } yarn = { group = "net.fabricmc", name = "yarn", version.ref = "yarn" } fapi = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fapi" } -kaleidoConfig = { group = "folk.sisby", name = "kaleido-config", version.ref = "kaleidoConfig" } + surveyor = { group = "folk.sisby", name = "surveyor", version.ref = "surveyor" } diff --git a/settings.gradle b/settings.gradle index 1a4767f6..6780accc 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,6 +1,6 @@ pluginManagement { repositories { - maven { url 'https://maven.fabricmc.net/'} + maven { url "https://maven.fabricmc.net/" } gradlePluginPortal() } } diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml new file mode 100644 index 00000000..ae514fad --- /dev/null +++ b/src/main/resources/META-INF/mods.toml @@ -0,0 +1,44 @@ +modLoader = "javafml" +loaderVersion = "[4,)" +license = "${license}" +issueTrackerURL = "${issues}" + +[[mods]] +modId = "${modId}" +version = "${version}" +displayName = "${modName}" +description = '''${modDescription}''' +authors = "${members}" +displayURL = "${homepage}" +logoFile = "assets/${modId}/icon.png" + +[properties] +"connector:placeholder" = true + +[[dependencies.${ modId }]] +modId = "connectormod" +mandatory = true +versionRange = "*" +ordering = "NONE" +side = "BOTH" + +[[dependencies.${ modId }]] +modId = "forge" +mandatory = true +versionRange = "*" +ordering = "NONE" +side = "BOTH" + +[[dependencies.${ modId }]] +modId = "minecraft" +mandatory = true +versionRange = "[${mc},)" +ordering = "NONE" +side = "BOTH" + +[[dependencies.${ modId }]] +modId = "fabric_api" +mandatory = true +versionRange = "[${fapi},)" +ordering = "NONE" +side = "BOTH" diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 23752466..d8035877 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,41 +1,31 @@ { "schemaVersion": 1, - "id": "antique-atlas", + "id": "${modId}", "version": "${version}", - "name": "Antique Atlas", - "description": "An always-accessible abstract world map.", + "name": "${modName}", + "description": "${modDescription}", "authors": [ - "Hunternif", - "tyra314", - "Sisby folk" + "${authors}" ], "contributors": [ - "Kenkron", - "asiekierka", - "Haven-King", - "TheCodeWarrior", - "osipxd", - "coolAlias", - "TehNut", - "lumiscosity", - "frodolon" + "${contributors}" ], "contact": { - "homepage": "https://modrinth.com/mod/antique-atlas-4", - "issues": "https://github.com/sisby-folk/antique-atlas/issues", - "sources": "https://github.com/sisby-folk/antique-atlas" - }, - "icon": "assets/antique_atlas/icon.png", - "license": "LGPL-3.0-only", - "entrypoints": { - "client": [ - "folk.sisby.antique_atlas.AntiqueAtlas" - ] + "homepage": "${homepage}", + "issues": "${issues}", + "sources": "${sources}" }, + "license": "${license}", + "icon": "assets/${modId}/icon.png", "depends": { "minecraft": ">=${mc}", "fabricloader": ">=${fl}", "fabric-api": ">=${fapi}", "surveyor": ">=${surveyor}" + }, + "entrypoints": { + "client": [ + "folk.sisby.antique_atlas.AntiqueAtlas" + ] } } diff --git a/src/main/resources/mods.toml b/src/main/resources/mods.toml deleted file mode 100644 index 7b5988da..00000000 --- a/src/main/resources/mods.toml +++ /dev/null @@ -1,33 +0,0 @@ -modLoader = 'javafml' -loaderVersion = '[40,)' -license = 'LGPL-3.0-only' -logoFile = 'assets/antique_atlas/icon.png' - -[properties] -"connector:placeholder"=true - -[[mods]] -modId = 'antique_atlas' -version = '${version}' -displayName = 'Antique Atlas' -description = 'An always-accessible abstract world map.' -authors = 'Sisby folk' -displayURL = 'https://modrinth.com/mod/antique-atlas-4' - -[[dependencies.antique_atlas]] -modId = "minecraft" -mandatory = true -versionRange = "[${mc},)" -ordering = "NONE" -side = "BOTH" - -[[dependencies.antique_atlas]] -modId = "connectormod" -mandatory = true -versionRange = "*" - - -[[dependencies.antique_atlas]] -modId = "fabric_api" -mandatory = true -versionRange = "[${fapi},)"