Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdAurora committed Aug 7, 2023
1 parent bfc7649 commit a40b605
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 15 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@

### 1.0.0-beta.13

- \[1.20] Changed item for brush action on blackboards to the new brush item.
- \[1.20] Changed painter's palette recipe to use the new brush item.
- \[1.20] Added custom models for the bamboo pile.
- \[1.19.4] Reorganized creative tab injection of Aurora's Decorations items to match the new tabs.
- \[1.19.4+] Reorganized creative tab injection of Aurora's Decorations items to match the new tabs.
- Fixed Lavender Plains replacing Flower Forest biomes sometimes.
- Improved Painter's Palette texture.
- Switched ModelLoaderMixin to new Model API usage.

[EMI]: https://modrinth.com/mod/emi "EMI Modrinth page"
16 changes: 9 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
}

group = project.maven_group
version = "${project.mod_version}+${MINECRAFT_VERSION}"
version = "${project.mod_version}+${MINECRAFT_VERSION.version()}"
archivesBaseName = project.archives_base_name

if (!(System.getenv("CURSEFORGE_TOKEN") || System.getenv("MODRINTH_TOKEN"))) {
Expand All @@ -17,8 +17,8 @@ if (!(System.getenv("CURSEFORGE_TOKEN") || System.getenv("MODRINTH_TOKEN"))) {
logger.lifecycle("Preparing version ${version}...")

boolean isMCVersionNonRelease() {
return MINECRAFT_VERSION.matches('^\\d\\dw\\d\\d[a-z]$')
|| MINECRAFT_VERSION.matches('\\d+\\.\\d+-(pre|rc)(\\d+)')
return MINECRAFT_VERSION.version().matches('^\\d\\dw\\d\\d[a-z]$')
|| MINECRAFT_VERSION.version().matches('\\d+\\.\\d+-(pre|rc)(\\d+)')
}

String parseReadme() {
Expand Down Expand Up @@ -103,8 +103,8 @@ jar {

modrinth {
projectId = project.modrinth_id
versionName = "Aurora's Decorations ${project.mod_version} (${MINECRAFT_VERSION})"
gameVersions = [MINECRAFT_VERSION]
versionName = "Aurora's Decorations ${project.mod_version} (${MINECRAFT_VERSION.version()})"
gameVersions = MINECRAFT_VERSION.all()
loaders = ["quilt"]
versionType = this.getVersionType()
uploadFile = tasks.remapJar
Expand Down Expand Up @@ -137,7 +137,9 @@ curseforge {
project {
id = project.curseforge_id
releaseType = this.getVersionType()
addGameVersion MINECRAFT_VERSION
MINECRAFT_VERSION.all().forEach {
addGameVersion it
}
addGameVersion "Quilt"
addGameVersion "Java 17"
addGameVersion "Java 18"
Expand All @@ -155,7 +157,7 @@ curseforge {
}

mainArtifact(remapJar) {
displayName = "Aurora's Decorations ${project.mod_version} (${MINECRAFT_VERSION})"
displayName = "Aurora's Decorations ${project.mod_version} (${MINECRAFT_VERSION.version()})"

relations {
requiredDependency "qsl"
Expand Down
6 changes: 3 additions & 3 deletions build_logic/src/main/groovy/aurorasdeco.common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ repositories {
}

dependencies {
minecraft "com.mojang:minecraft:${Constants.MINECRAFT_VERSION}"
mappings "org.quiltmc:quilt-mappings:${Constants.MINECRAFT_VERSION}+build.${Constants.MAPPINGS}:intermediary-v2"
minecraft "com.mojang:minecraft:${Constants.MINECRAFT_VERSION.version()}"
mappings "org.quiltmc:quilt-mappings:${Constants.MINECRAFT_VERSION.version()}+build.${Constants.MAPPINGS}:intermediary-v2"
modImplementation "org.quiltmc:quilt-loader:${Constants.LOADER_VERSION}"

modImplementation("org.quiltmc.quilted-fabric-api:quilted-fabric-api:${Constants.QFAPI_VERSION}-${Constants.MINECRAFT_VERSION}")
modImplementation("org.quiltmc.quilted-fabric-api:quilted-fabric-api:${Constants.QFAPI_VERSION}-${Constants.MINECRAFT_VERSION.version()}")
include(modImplementation("com.terraformersmc.terraform-api:terraform-wood-api-v1:${Constants.TERRAFORM_WOOD_API_VERSION}") {
exclude group: 'net.fabricmc'
exclude group: 'net.fabricmc.fabric-api'
Expand Down
2 changes: 1 addition & 1 deletion build_logic/src/main/groovy/aurorasdeco/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public final class Constants {

/* VERSIONS */

public static final String MINECRAFT_VERSION = "1.20.1";
public static final MinecraftVersions MINECRAFT_VERSION = new MinecraftVersions("1.20.1", "1.20");
public static final int MAPPINGS = 19;
public static final String LOADER_VERSION = "0.19.1";
public static final String QFAPI_VERSION = "7.1.0+0.86.1";
Expand Down
17 changes: 17 additions & 0 deletions build_logic/src/main/groovy/aurorasdeco/MinecraftVersions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package aurorasdeco;

import java.util.ArrayList;
import java.util.List;

public record MinecraftVersions(String version, List<String> supported) {
public MinecraftVersions(String version, String... supported) {
this(version, List.of(supported));
}

public List<String> all() {
var versions = new ArrayList<String>();
versions.add(this.version);
versions.addAll(this.supported);
return versions;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public void finalizeConfiguration() {

new aurorasdeco.DependencyAppenderUtil("emi", "dev.emi:emi-fabric:" + Constants.EMI_VERSION).apply(this.project);
new aurorasdeco.DependencyAppenderUtil("emi",
"org.quiltmc.quilted-fabric-api:quilted-fabric-api-deprecated:" + Constants.QFAPI_VERSION + "-" + Constants.MINECRAFT_VERSION
"org.quiltmc.quilted-fabric-api:quilted-fabric-api-deprecated:"
+ Constants.QFAPI_VERSION + "-" + Constants.MINECRAFT_VERSION.version()
).apply(this.project);

this.project.getDependencies().add("emiImplementation", sourceSets.getByName("main").getOutput());
Expand Down
16 changes: 14 additions & 2 deletions build_logic/src/main/groovy/aurorasdeco/task/GenerateQmjTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,20 @@ public void generateQmj() throws IOException {
{
writer.beginObject()
.name("id").value("minecraft")
.name("versions").value(Constants.MINECRAFT_VERSION)
.endObject();
.name("versions");
if (Constants.MINECRAFT_VERSION.supported().isEmpty()) {
writer.value(Constants.MINECRAFT_VERSION.version());
} else {
writer.beginObject()
.name("any").beginArray();
for (var version : Constants.MINECRAFT_VERSION.all()) {
writer.value("=" + version);
}
writer.endArray()
.endObject();
}
writer.endObject();

writer.beginObject()
.name("id").value("quilt_loader")
.name("versions").value(">=" + Constants.LOADER_VERSION)
Expand Down

0 comments on commit a40b605

Please sign in to comment.