From 604d98ac1343303068d77246e1e656559684f375 Mon Sep 17 00:00:00 2001 From: Lucas Petrino Date: Tue, 30 Apr 2024 12:01:12 +1200 Subject: [PATCH] fix: update architectury + add base archive name to build - [bug] add base archive name to build artifacts - [deps] update architectury loom from 1.4-SNAPSHOT -> 1.5 - [deps] update architectury plugin to non snapshot build - [bug] fixes an unchecked cast warning during the build --- build.gradle.kts | 36 ++++++++++++------- .../commands/WeatherChangerCommand.java | 6 ++-- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b696fc4..ab5f871 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,10 +1,12 @@ import io.github.themrmilchmann.gradle.publish.curseforge.ChangelogFormat import io.github.themrmilchmann.gradle.publish.curseforge.GameVersion import io.github.themrmilchmann.gradle.publish.curseforge.ReleaseType +import net.fabricmc.loom.task.RemapJarTask +import net.fabricmc.loom.task.RemapSourcesJarTask plugins { - id("architectury-plugin") version "3.4-SNAPSHOT" - id ("dev.architectury.loom") version "1.4-SNAPSHOT" apply false + id("architectury-plugin") version "3.4.+" + id ("dev.architectury.loom") version "1.5.+" apply false id("com.modrinth.minotaur") version "2.+" id("io.github.themrmilchmann.curseforge-publish") version "0.6.1" } @@ -15,18 +17,35 @@ architectury { } subprojects { + apply(plugin = "java") + apply(plugin = "architectury-plugin") apply(plugin = "dev.architectury.loom") dependencies { "minecraft"("com.mojang:minecraft:${properties["minecraft_version"]}") "mappings"("net.fabricmc:yarn:${rootProject.properties["yarn_mappings"]}:v2") } + + tasks.withType { + options.encoding = "UTF-8" + options.release.set(17) + } + + tasks.withType { + archiveBaseName.set(properties["archives_base_name"].toString() + "-${project.name}") + } + + tasks.withType { + archiveBaseName.set(properties["archives_base_name"].toString() + "-${project.name}") + } + + tasks.withType { + archiveBaseName.set(properties["archives_base_name"].toString() + "-${project.name}") + } } allprojects { - apply(plugin = "java") apply(plugin = "maven-publish") - apply(plugin = "architectury-plugin") version = if (System.getenv("CI_DEV_BUILD")?.toBoolean() == true) { System.getenv("BUILD_NUMBER") ?: properties["mod_version"].toString() @@ -35,15 +54,6 @@ allprojects { } group = properties["maven_group"].toString() - - tasks.withType { - options.encoding = "UTF-8" - options.release.set(17) - } - - tasks.withType { - archiveBaseName.set(properties["archives_base_name"].toString()) - } } modrinth { diff --git a/common/src/main/java/me/lucaslah/weatherchanger/commands/WeatherChangerCommand.java b/common/src/main/java/me/lucaslah/weatherchanger/commands/WeatherChangerCommand.java index 205ce98..1362bd8 100644 --- a/common/src/main/java/me/lucaslah/weatherchanger/commands/WeatherChangerCommand.java +++ b/common/src/main/java/me/lucaslah/weatherchanger/commands/WeatherChangerCommand.java @@ -2,12 +2,10 @@ package me.lucaslah.weatherchanger.commands; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.builder.LiteralArgumentBuilder; -import com.mojang.brigadier.tree.CommandNode; import com.mojang.brigadier.tree.LiteralCommandNode; import me.lucaslah.weatherchanger.WeatherChanger; import me.lucaslah.weatherchanger.command.Command; import me.lucaslah.weatherchanger.config.WcMode; -import net.minecraft.client.resource.language.I18n; import net.minecraft.text.Text; import net.minecraft.util.Identifier; @@ -16,7 +14,7 @@ import static me.lucaslah.weatherchanger.WeatherChanger.sendClientMessage; public class WeatherChangerCommand extends Command { @Override public void register(CommandDispatcher dispatcher) { - LiteralArgumentBuilder command = LiteralArgumentBuilder.literal("clientweather"); + LiteralArgumentBuilder command = LiteralArgumentBuilder.literal("clientweather"); command.then(LiteralArgumentBuilder.literal("off") .executes(context -> { @@ -51,7 +49,7 @@ public class WeatherChangerCommand extends Command { ); LiteralCommandNode node = dispatcher.register(command); - dispatcher.register((LiteralArgumentBuilder) LiteralArgumentBuilder.literal("cweather").redirect((CommandNode) node)); + dispatcher.register(LiteralArgumentBuilder.literal("cweather").redirect(node)); } @Override