mirror of
https://github.com/Lucaslah/WeatherChanger.git
synced 2026-01-10 13:07:52 +00:00
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
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
import io.github.themrmilchmann.gradle.publish.curseforge.ChangelogFormat
|
import io.github.themrmilchmann.gradle.publish.curseforge.ChangelogFormat
|
||||||
import io.github.themrmilchmann.gradle.publish.curseforge.GameVersion
|
import io.github.themrmilchmann.gradle.publish.curseforge.GameVersion
|
||||||
import io.github.themrmilchmann.gradle.publish.curseforge.ReleaseType
|
import io.github.themrmilchmann.gradle.publish.curseforge.ReleaseType
|
||||||
|
import net.fabricmc.loom.task.RemapJarTask
|
||||||
|
import net.fabricmc.loom.task.RemapSourcesJarTask
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("architectury-plugin") version "3.4-SNAPSHOT"
|
id("architectury-plugin") version "3.4.+"
|
||||||
id ("dev.architectury.loom") version "1.4-SNAPSHOT" apply false
|
id ("dev.architectury.loom") version "1.5.+" apply false
|
||||||
id("com.modrinth.minotaur") version "2.+"
|
id("com.modrinth.minotaur") version "2.+"
|
||||||
id("io.github.themrmilchmann.curseforge-publish") version "0.6.1"
|
id("io.github.themrmilchmann.curseforge-publish") version "0.6.1"
|
||||||
}
|
}
|
||||||
@@ -15,18 +17,35 @@ architectury {
|
|||||||
}
|
}
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
|
apply(plugin = "java")
|
||||||
|
apply(plugin = "architectury-plugin")
|
||||||
apply(plugin = "dev.architectury.loom")
|
apply(plugin = "dev.architectury.loom")
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
"minecraft"("com.mojang:minecraft:${properties["minecraft_version"]}")
|
"minecraft"("com.mojang:minecraft:${properties["minecraft_version"]}")
|
||||||
"mappings"("net.fabricmc:yarn:${rootProject.properties["yarn_mappings"]}:v2")
|
"mappings"("net.fabricmc:yarn:${rootProject.properties["yarn_mappings"]}:v2")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType<JavaCompile> {
|
||||||
|
options.encoding = "UTF-8"
|
||||||
|
options.release.set(17)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<Jar> {
|
||||||
|
archiveBaseName.set(properties["archives_base_name"].toString() + "-${project.name}")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<RemapJarTask> {
|
||||||
|
archiveBaseName.set(properties["archives_base_name"].toString() + "-${project.name}")
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType<RemapSourcesJarTask> {
|
||||||
|
archiveBaseName.set(properties["archives_base_name"].toString() + "-${project.name}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
apply(plugin = "java")
|
|
||||||
apply(plugin = "maven-publish")
|
apply(plugin = "maven-publish")
|
||||||
apply(plugin = "architectury-plugin")
|
|
||||||
|
|
||||||
version = if (System.getenv("CI_DEV_BUILD")?.toBoolean() == true) {
|
version = if (System.getenv("CI_DEV_BUILD")?.toBoolean() == true) {
|
||||||
System.getenv("BUILD_NUMBER") ?: properties["mod_version"].toString()
|
System.getenv("BUILD_NUMBER") ?: properties["mod_version"].toString()
|
||||||
@@ -35,15 +54,6 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = properties["maven_group"].toString()
|
group = properties["maven_group"].toString()
|
||||||
|
|
||||||
tasks.withType<JavaCompile> {
|
|
||||||
options.encoding = "UTF-8"
|
|
||||||
options.release.set(17)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.withType<Jar> {
|
|
||||||
archiveBaseName.set(properties["archives_base_name"].toString())
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
modrinth {
|
modrinth {
|
||||||
|
|||||||
@@ -2,12 +2,10 @@ package me.lucaslah.weatherchanger.commands;
|
|||||||
|
|
||||||
import com.mojang.brigadier.CommandDispatcher;
|
import com.mojang.brigadier.CommandDispatcher;
|
||||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||||
import com.mojang.brigadier.tree.CommandNode;
|
|
||||||
import com.mojang.brigadier.tree.LiteralCommandNode;
|
import com.mojang.brigadier.tree.LiteralCommandNode;
|
||||||
import me.lucaslah.weatherchanger.WeatherChanger;
|
import me.lucaslah.weatherchanger.WeatherChanger;
|
||||||
import me.lucaslah.weatherchanger.command.Command;
|
import me.lucaslah.weatherchanger.command.Command;
|
||||||
import me.lucaslah.weatherchanger.config.WcMode;
|
import me.lucaslah.weatherchanger.config.WcMode;
|
||||||
import net.minecraft.client.resource.language.I18n;
|
|
||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
@@ -16,7 +14,7 @@ import static me.lucaslah.weatherchanger.WeatherChanger.sendClientMessage;
|
|||||||
public class WeatherChangerCommand extends Command {
|
public class WeatherChangerCommand extends Command {
|
||||||
@Override
|
@Override
|
||||||
public <T> void register(CommandDispatcher<T> dispatcher) {
|
public <T> void register(CommandDispatcher<T> dispatcher) {
|
||||||
LiteralArgumentBuilder<T> command = LiteralArgumentBuilder.<T>literal("clientweather");
|
LiteralArgumentBuilder<T> command = LiteralArgumentBuilder.literal("clientweather");
|
||||||
|
|
||||||
command.then(LiteralArgumentBuilder.<T>literal("off")
|
command.then(LiteralArgumentBuilder.<T>literal("off")
|
||||||
.executes(context -> {
|
.executes(context -> {
|
||||||
@@ -51,7 +49,7 @@ public class WeatherChangerCommand extends Command {
|
|||||||
);
|
);
|
||||||
|
|
||||||
LiteralCommandNode<T> node = dispatcher.register(command);
|
LiteralCommandNode<T> node = dispatcher.register(command);
|
||||||
dispatcher.register((LiteralArgumentBuilder<T>) LiteralArgumentBuilder.literal("cweather").redirect((CommandNode<Object>) node));
|
dispatcher.register(LiteralArgumentBuilder.<T>literal("cweather").redirect(node));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user