Skip to content

Commit

Permalink
Merge branch 'refs/heads/1.20' into 1.21
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle
#	gradle.properties
#	libs.versions.toml
  • Loading branch information
sisby-folk committed Aug 23, 2024
2 parents 523655b + 5f296ff commit 537b615
Show file tree
Hide file tree
Showing 12 changed files with 193 additions and 157 deletions.
11 changes: 8 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
33 changes: 33 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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/
File renamed without changes.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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._

Expand Down
139 changes: 59 additions & 80 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -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<String, String> 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<String, String> 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 {
Expand All @@ -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']
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"
}
26 changes: 20 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -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.21
# 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.21
compatibleVersions=1.21, 1.21.1
compatibleLoaders=fabric, quilt, neoforge
16 changes: 10 additions & 6 deletions libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
[versions]
loom = "1.7.+"
githubRelease = "2.4.1"
minotaur = "2.6.0"
minotaur = "2.+"

kaleidoConfig = "0.3.1+1.3.2"

mc = "1.21"
fl = "0.15.11"
yarn = "1.21+build.2"
fapi = "0.100.3+1.21"
kaleidoConfig = "0.3.1+1.3.1"
surveyor = "0.6.21+1.21"
yarn = "1.21+build.9"
fapi = "0.102.0+1.21"

surveyor = "0.6.22+1.21"

[plugins]
loom = { id = "fabric-loom", version.ref = "loom" }
githubRelease = { id = "com.github.breadmoirai.github-release", version.ref = "githubRelease" }
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" }
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pluginManagement {
repositories {
maven { url 'https://maven.fabricmc.net/'}
maven { url "https://maven.fabricmc.net/" }
gradlePluginPortal()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ public void registerFallbacks(Registry<Biome> 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");
}
}
Expand Down
44 changes: 44 additions & 0 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
@@ -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"
Loading

0 comments on commit 537b615

Please sign in to comment.