From becad4e18415b4366d593f8f441ec285d16dc2f1 Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Sun, 6 Oct 2024 22:13:08 -0700 Subject: [PATCH 1/5] move common gradle project configuration to conventions plugin --- build.gradle.kts | 122 +++--------------- buildSrc/build.gradle.kts | 18 +++ .../xaeroplus-all.conventions.gradle.kts | 42 ++++++ .../xaeroplus-platform.conventions.gradle.kts | 49 +++++++ common/build.gradle.kts | 16 ++- fabric/build.gradle.kts | 5 + forge/build.gradle.kts | 10 ++ settings.gradle.kts | 2 - 8 files changed, 156 insertions(+), 108 deletions(-) create mode 100644 buildSrc/build.gradle.kts create mode 100644 buildSrc/src/main/kotlin/xaeroplus-all.conventions.gradle.kts create mode 100644 buildSrc/src/main/kotlin/xaeroplus-platform.conventions.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts index 852b17ca..04433472 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,124 +1,44 @@ -import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar -import net.fabricmc.loom.api.LoomGradleExtensionAPI - plugins { - id("architectury-plugin") version "3.4-SNAPSHOT" - id("dev.architectury.loom") version "1.7-SNAPSHOT" apply false - id("com.gradleup.shadow") version "8.3.2" apply false + id("xaeroplus-all.conventions") idea } val minecraft_version: String by gradle.extra -val mc = libs.minecraft.get() -val parchment = libs.parchment.get() architectury { minecraft = minecraft_version } -subprojects { - apply(plugin = "dev.architectury.loom") - apply(plugin = "com.gradleup.shadow") - - configure { - silentMojangMappingsLicense() - runs { - getByName("client") { - programArgs("--username", "rfresh2") - } - } - } - - dependencies { - "minecraft"(mc) - "mappings"((project.extensions.getByType(LoomGradleExtensionAPI::class)).layered { - officialMojangMappings() - parchment(parchment) - }) - } - - tasks { - getByName("shadowJar") { - archiveClassifier.set("shadow") - exclude("com/google/**") - exclude("org/objectweb/**") - exclude("org/checkerframework/**") - exclude("org/rfresh/sqlite/native/FreeBSD/**") - exclude("org/rfresh/sqlite/native/Linux-Android/**") - exclude("org/rfresh/sqlite/native/Linux-Musl/**") - exclude("org/rfresh/sqlite/native/Linux/arm/**") - exclude("org/rfresh/sqlite/native/Linux/aarch64/**") - exclude("org/rfresh/sqlite/native/Linux/armv6/**") - exclude("org/rfresh/sqlite/native/Linux/x86/**") - exclude("org/rfresh/sqlite/native/Linux/armv7/**") - exclude("org/rfresh/sqlite/native/Linux/ppc64/**") - exclude("org/rfresh/sqlite/native/Linux/riscv64/**") - exclude("org/rfresh/sqlite/native/Windows/armv7/**") - exclude("org/rfresh/sqlite/native/Windows/aarch64/**") - exclude("org/rfresh/sqlite/native/Windows/armv7/**") - exclude("org/slf4j/**") - } - } -} - -allprojects { - apply(plugin = "java") - apply(plugin = "architectury-plugin") - apply(plugin = "maven-publish") - - configure { - archivesName = gradle.extra.get("archives_base_name").toString() - } - - version = gradle.extra.get("mod_version").toString() - group = gradle.extra.get("maven_group").toString() - - repositories { - maven("https://api.modrinth.com/maven") { - name = "Modrinth" - } - maven("https://maven.2b2t.vc/releases") { - name = "maven.2b2t.vc" - } - maven("https://maven.parchmentmc.org") { - name = "ParchmentMC" - } - maven("https://maven.lenni0451.net/releases") { - name = "Lenni0451" - } - maven("https://maven.shedaniel.me/") - maven("https://maven.terraformersmc.com/releases/") - mavenLocal() - } - - tasks { - withType { - options.encoding = "UTF-8" - options.release = 17 - } - } - - configure { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 - } -} - tasks { register("printWorldMapVersionFabric") { - println(gradle.extra.get("worldmap_version_fabric")) + doLast { + println(gradle.extra.get("worldmap_version_fabric")) + } + outputs.upToDateWhen { false } } register("printMinimapVersionFabric") { - println(gradle.extra.get("minimap_version_fabric")) + doLast { + println(gradle.extra.get("minimap_version_fabric")) + } + outputs.upToDateWhen { false } } register("printWorldMapVersionForge") { - println(gradle.extra.get("worldmap_version_forge")) + doLast { + println(gradle.extra.get("worldmap_version_forge")) + } + outputs.upToDateWhen { false } } register("printMinimapVersionForge") { - println(gradle.extra.get("minimap_version_forge")) + doLast { + println(gradle.extra.get("minimap_version_forge")) + } + outputs.upToDateWhen { false } } register("printXaeroPlusVersion") { - println(version) + doLast { + println(version) + } + outputs.upToDateWhen { false } } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 00000000..6e42c039 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + `kotlin-dsl` +} + +repositories { + maven("https://maven.fabricmc.net/") { name = "Fabric" } + maven("https://maven.architectury.dev/") + maven("https://files.minecraftforge.net/maven/") + mavenCentral() + gradlePluginPortal() +} + +dependencies { + implementation("architectury-plugin:architectury-plugin.gradle.plugin:3.4-SNAPSHOT") + implementation("dev.architectury:architectury-loom:1.7-SNAPSHOT") + implementation("com.gradleup.shadow:shadow-gradle-plugin:8.3.3") +} + diff --git a/buildSrc/src/main/kotlin/xaeroplus-all.conventions.gradle.kts b/buildSrc/src/main/kotlin/xaeroplus-all.conventions.gradle.kts new file mode 100644 index 00000000..8b82d19a --- /dev/null +++ b/buildSrc/src/main/kotlin/xaeroplus-all.conventions.gradle.kts @@ -0,0 +1,42 @@ +plugins { + java + id("maven-publish") + id("architectury-plugin") +} + +configure { + archivesName = "XaeroPlus" +} + +version = gradle.extra.get("mod_version").toString() +group = gradle.extra.get("maven_group").toString() + +repositories { + maven("https://api.modrinth.com/maven") { + name = "Modrinth" + } + maven("https://maven.2b2t.vc/releases") { + name = "maven.2b2t.vc" + } + maven("https://maven.parchmentmc.org") { + name = "ParchmentMC" + } + maven("https://maven.lenni0451.net/releases") { + name = "Lenni0451" + } + maven("https://maven.shedaniel.me/") + maven("https://maven.terraformersmc.com/releases/") + mavenLocal() +} + +tasks { + withType { + options.encoding = "UTF-8" + options.release = 17 + } +} + +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} diff --git a/buildSrc/src/main/kotlin/xaeroplus-platform.conventions.gradle.kts b/buildSrc/src/main/kotlin/xaeroplus-platform.conventions.gradle.kts new file mode 100644 index 00000000..49a83aed --- /dev/null +++ b/buildSrc/src/main/kotlin/xaeroplus-platform.conventions.gradle.kts @@ -0,0 +1,49 @@ +plugins { + id("dev.architectury.loom") + id("com.gradleup.shadow") +} + +loom { + silentMojangMappingsLicense() + runs { + getByName("client") { + programArgs("--username", "rfresh2") + } + } +} + +val minecraft_version: String by gradle.extra +val parchment_version: String by gradle.extra +val mc = "com.mojang:minecraft:${minecraft_version}" +val parchment = "org.parchmentmc.data:parchment-${minecraft_version}:${parchment_version}" + +dependencies { + minecraft(mc) + mappings(loom.layered { + officialMojangMappings() + parchment(parchment) + }) +} + +tasks { + shadowJar { + archiveClassifier.set("shadow") + exclude("com/google/**") + exclude("org/objectweb/**") + exclude("org/checkerframework/**") + exclude("org/rfresh/sqlite/native/FreeBSD/**") + exclude("org/rfresh/sqlite/native/Linux-Android/**") + exclude("org/rfresh/sqlite/native/Linux-Musl/**") + exclude("org/rfresh/sqlite/native/Linux/arm/**") + exclude("org/rfresh/sqlite/native/Linux/aarch64/**") + exclude("org/rfresh/sqlite/native/Linux/armv6/**") + exclude("org/rfresh/sqlite/native/Linux/x86/**") + exclude("org/rfresh/sqlite/native/Linux/armv7/**") + exclude("org/rfresh/sqlite/native/Linux/ppc64/**") + exclude("org/rfresh/sqlite/native/Linux/riscv64/**") + exclude("org/rfresh/sqlite/native/Windows/armv7/**") + exclude("org/rfresh/sqlite/native/Windows/aarch64/**") + exclude("org/rfresh/sqlite/native/Windows/armv7/**") + exclude("org/slf4j/**") + } +} diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 396612d6..32d3c226 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -1,3 +1,10 @@ +import kotlin.streams.asStream + +plugins { + id("xaeroplus-all.conventions") + id("xaeroplus-platform.conventions") +} + architectury { common(rootProject.properties["enabled_platforms"].toString().split(",")) } @@ -22,14 +29,14 @@ dependencies { } tasks { - val remapForgeTask = register("remapForge") { + register("remapForge") { group = "build" description = "Remap the source files, replacing fabric-specific strings with forge-specific strings." + val remapDir = project.layout.buildDirectory.dir("remappedSources/forge").get().asFile doLast { - val remapDir = file("build/remappedSources/forge") // clear directory if it exists if (remapDir.exists()) { - remapDir.delete() + remapDir.deleteRecursively() } remapDir.mkdirs() // create sourceset directory structure @@ -62,7 +69,7 @@ tasks { } // exec remap on every source file - remapDir.walk().forEach { file -> + remapDir.walk().asStream().parallel().forEach { file -> if (file.isFile && (file.extension == "java" || file.extension == "json")) { var text = file.readText() remap.forEach { (fabric, forge) -> @@ -73,6 +80,5 @@ tasks { } } } - compileJava.get().dependsOn(remapForgeTask) } diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts index c948e8db..d5e0205e 100644 --- a/fabric/build.gradle.kts +++ b/fabric/build.gradle.kts @@ -1,3 +1,8 @@ +plugins { + id("xaeroplus-all.conventions") + id("xaeroplus-platform.conventions") +} + architectury { platformSetupLoomIde() fabric() diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts index d5f63cb4..dceaf779 100644 --- a/forge/build.gradle.kts +++ b/forge/build.gradle.kts @@ -4,6 +4,11 @@ import dev.architectury.transformer.transformers.FixForgeMixin import dev.architectury.transformer.transformers.TransformForgeAnnotations import dev.architectury.transformer.transformers.TransformForgeEnvironment +plugins { + id("xaeroplus-all.conventions") + id("xaeroplus-platform.conventions") +} + architectury { platformSetupLoomIde() forge() @@ -57,6 +62,7 @@ dependencies { tasks { processResources { + dependsOn(common.tasks.getByName("remapForge")) filesMatching("META-INF/mods.toml") { expand(mapOf( "version" to project.version, @@ -89,4 +95,8 @@ tasks { archiveVersion = destArchiveVersion archiveClassifier = destArchiveClassifier } + + compileJava { + dependsOn(common.tasks.getByName("remapForge")) + } } diff --git a/settings.gradle.kts b/settings.gradle.kts index d43c84fb..02f7d72c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -25,11 +25,9 @@ gradle.extra.apply { dependencyResolutionManagement { versionCatalogs { create("libs") { - library("minecraft", "com.mojang:minecraft:${gradle.extra.get("minecraft_version")}") library("fabric-loader", "net.fabricmc:fabric-loader:${gradle.extra.get("fabric_loader_version")}") library("forge", "net.minecraftforge:forge:${gradle.extra.get("minecraft_version")}-${gradle.extra.get("forge_loader_version")}") library("fabric-api", "net.fabricmc.fabric-api:fabric-api:${gradle.extra.get("fabric_api_version")}") - library("parchment", "org.parchmentmc.data:parchment-${gradle.extra.get("minecraft_version")}:${gradle.extra.get("parchment_version")}") library("worldmap-fabric", "maven.modrinth:xaeros-world-map:${gradle.extra.get("worldmap_version_fabric")}_Fabric_1.20") library("worldmap-forge", "maven.modrinth:xaeros-world-map:${gradle.extra.get("worldmap_version_forge")}_Forge_1.20") library("minimap-fabric", "maven.modrinth:xaeros-minimap:${gradle.extra.get("minimap_version_fabric")}_Fabric_1.20") From 8e52dd9b2cd8613cab0d27e7751858700597b07c Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:54:55 -0700 Subject: [PATCH 2/5] copy coordinates right click option --- .../xaeroplus/mixin/client/MixinGuiMap.java | 29 ++++++++++--------- .../mixin/client/MixinWaypointReader.java | 19 ++++++++---- .../assets/xaeroplus/lang/en_us.json | 1 + .../assets/xaeroplus/lang/es_ar.json | 1 + .../assets/xaeroplus/lang/fr_ca.json | 1 + .../assets/xaeroplus/lang/fr_fr.json | 1 + .../assets/xaeroplus/lang/ja_jp.json | 3 +- .../assets/xaeroplus/lang/pl_pl.json | 1 + .../assets/xaeroplus/lang/pt_pt.json | 1 + .../assets/xaeroplus/lang/ru_ru.json | 1 + .../assets/xaeroplus/lang/vi_vn.json | 1 + .../assets/xaeroplus/lang/zh_cn.json | 1 + .../assets/xaeroplus/lang/zh_tw.json | 1 + 13 files changed, 41 insertions(+), 20 deletions(-) diff --git a/common/src/main/java/xaeroplus/mixin/client/MixinGuiMap.java b/common/src/main/java/xaeroplus/mixin/client/MixinGuiMap.java index 0f76197b..8e193cc5 100644 --- a/common/src/main/java/xaeroplus/mixin/client/MixinGuiMap.java +++ b/common/src/main/java/xaeroplus/mixin/client/MixinGuiMap.java @@ -58,7 +58,6 @@ import java.util.List; import java.util.stream.Collectors; -import static java.util.Arrays.asList; import static java.util.Objects.isNull; import static net.minecraft.world.level.Level.*; import static org.lwjgl.glfw.GLFW.*; @@ -96,6 +95,7 @@ public abstract class MixinGuiMap extends ScreenBase implements IRightClickableE @Shadow private Button keybindingsButton; @Shadow private Button dimensionToggleButton; @Shadow private int rightClickX; + @Shadow private int rightClickY; @Shadow private int rightClickZ; @Shadow private int mouseBlockPosX; @Shadow private int mouseBlockPosZ; @@ -538,38 +538,41 @@ public void onInputPress(final int code, final int scanCode, final int modifiers @Inject(method = "getRightClickOptions", at = @At(value = "RETURN"), remap = false) public void getRightClickOptionsInject(final CallbackInfoReturnable> cir) { + final ArrayList options = cir.getReturnValue(); + int index = 3; + options.add(index++, new RightClickOption("xaeroplus.gui.world_map.copy_coordinates", options.size(), this) { + @Override + public void onAction(final Screen screen) { + Minecraft.getInstance().keyboardHandler.setClipboard(rightClickX + " " + rightClickY + " " + rightClickZ); + } + }); if (BaritoneHelper.isBaritonePresent()) { - final ArrayList options = cir.getReturnValue(); int goalX = rightClickX; int goalZ = rightClickZ; - options.addAll(3, asList( - new RightClickOption("xaeroplus.gui.world_map.baritone_goal_here", options.size(), this) { + options.add(index++, new RightClickOption("xaeroplus.gui.world_map.baritone_goal_here", options.size(), this) { @Override public void onAction(Screen screen) { BaritoneExecutor.goal(goalX, goalZ); } - }.setNameFormatArgs(Misc.getKeyName(Settings.REGISTRY.worldMapBaritoneGoalHereKeybindSetting.getKeyBinding())), - new RightClickOption("xaeroplus.gui.world_map.baritone_path_here", options.size(), this) { + }.setNameFormatArgs(Misc.getKeyName(Settings.REGISTRY.worldMapBaritoneGoalHereKeybindSetting.getKeyBinding()))); + options.add(index++, new RightClickOption("xaeroplus.gui.world_map.baritone_path_here", options.size(), this) { @Override public void onAction(Screen screen) { BaritoneExecutor.path(goalX, goalZ); } - }.setNameFormatArgs(Misc.getKeyName(Settings.REGISTRY.worldMapBaritonePathHereKeybindSetting.getKeyBinding())) - )); + }.setNameFormatArgs(Misc.getKeyName(Settings.REGISTRY.worldMapBaritonePathHereKeybindSetting.getKeyBinding()))); if (BaritoneHelper.isBaritoneElytraPresent()) { - options.addAll(5, asList( - new RightClickOption("xaeroplus.gui.world_map.baritone_elytra_here", options.size(), this) { + options.add(index++, new RightClickOption("xaeroplus.gui.world_map.baritone_elytra_here", options.size(), this) { @Override public void onAction(Screen screen) { BaritoneExecutor.elytra(goalX, goalZ); } - }.setNameFormatArgs(Misc.getKeyName(Settings.REGISTRY.worldMapBaritoneElytraHereKeybindSetting.getKeyBinding())) - )); + }.setNameFormatArgs(Misc.getKeyName(Settings.REGISTRY.worldMapBaritoneElytraHereKeybindSetting.getKeyBinding()))); } } if (Settings.REGISTRY.disableWaypointSharing.get()) { - cir.getReturnValue().removeIf(option -> ((AccessorRightClickOption) option).getName().equals("gui.xaero_right_click_map_share_location")); + options.removeIf(option -> ((AccessorRightClickOption) option).getName().equals("gui.xaero_right_click_map_share_location")); } } diff --git a/common/src/main/java/xaeroplus/mixin/client/MixinWaypointReader.java b/common/src/main/java/xaeroplus/mixin/client/MixinWaypointReader.java index 7aa63f4d..7a18f659 100644 --- a/common/src/main/java/xaeroplus/mixin/client/MixinWaypointReader.java +++ b/common/src/main/java/xaeroplus/mixin/client/MixinWaypointReader.java @@ -1,5 +1,6 @@ package xaeroplus.mixin.client; +import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screens.Screen; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -24,24 +25,30 @@ public class MixinWaypointReader { @Inject(method = "getRightClickOptions(Lxaero/map/mods/gui/Waypoint;Lxaero/map/gui/IRightClickableElement;)Ljava/util/ArrayList;", at = @At("RETURN")) public void getRightClickOptionsReturn(final Waypoint element, final IRightClickableElement target, final CallbackInfoReturnable> cir) { + final ArrayList options = cir.getReturnValue(); + int index = 3; + options.add(index++, new RightClickOption("xaeroplus.gui.world_map.copy_coordinates", options.size(), target) { + @Override + public void onAction(final Screen screen) { + Minecraft.getInstance().keyboardHandler.setClipboard(element.getX() + " " + element.getY() + " " + element.getZ()); + } + }); if (BaritoneHelper.isBaritonePresent()) { - final ArrayList options = cir.getReturnValue(); int goalX = element.getX(); int goalZ = element.getZ(); - options.addAll(3, asList( + options.add(index++, new RightClickOption("xaeroplus.gui.world_map.baritone_goal_here", options.size(), target) { @Override public void onAction(Screen screen) { BaritoneExecutor.goal(goalX, goalZ); } - }.setNameFormatArgs(Misc.getKeyName(Settings.REGISTRY.worldMapBaritoneGoalHereKeybindSetting.getKeyBinding())), - new RightClickOption("xaeroplus.gui.world_map.baritone_path_here", options.size(), target) { + }.setNameFormatArgs(Misc.getKeyName(Settings.REGISTRY.worldMapBaritoneGoalHereKeybindSetting.getKeyBinding()))); + options.add(index++, new RightClickOption("xaeroplus.gui.world_map.baritone_path_here", options.size(), target) { @Override public void onAction(Screen screen) { BaritoneExecutor.path(goalX, goalZ); } - }.setNameFormatArgs(Misc.getKeyName(Settings.REGISTRY.worldMapBaritonePathHereKeybindSetting.getKeyBinding())) - )); + }.setNameFormatArgs(Misc.getKeyName(Settings.REGISTRY.worldMapBaritonePathHereKeybindSetting.getKeyBinding()))); if (BaritoneHelper.isBaritoneElytraPresent()) { options.addAll(5, asList( new RightClickOption("xaeroplus.gui.world_map.baritone_elytra_here", options.size(), target) { diff --git a/common/src/main/resources/assets/xaeroplus/lang/en_us.json b/common/src/main/resources/assets/xaeroplus/lang/en_us.json index f1f60914..15f6510d 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/en_us.json +++ b/common/src/main/resources/assets/xaeroplus/lang/en_us.json @@ -191,6 +191,7 @@ "xaeroplus.gui.minimap_incompatible.required_version": "Required Version: ", "xaeroplus.gui.minimap_incompatible.download_minimap": "Download Xaero's Minimap", "xaeroplus.gui.minimap_incompatible.exit": "Exit", + "xaeroplus.gui.world_map.copy_coordinates": "Copy Coordinates", "xaeroplus.gui.world_map.go_to_coordinates": "Go to Coordinates", "xaeroplus.gui.world_map.baritone_goal_here": "§2%s§r Baritone Goal Here", "xaeroplus.gui.world_map.baritone_path_here": "§2%s§r Baritone Path Here", diff --git a/common/src/main/resources/assets/xaeroplus/lang/es_ar.json b/common/src/main/resources/assets/xaeroplus/lang/es_ar.json index 59fb6c88..3c33c5ba 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/es_ar.json +++ b/common/src/main/resources/assets/xaeroplus/lang/es_ar.json @@ -191,6 +191,7 @@ "xaeroplus.gui.minimap_incompatible.required_version": "Versión Requerida: ", "xaeroplus.gui.minimap_incompatible.download_minimap": "Descargar Xaero's Minimap", "xaeroplus.gui.minimap_incompatible.exit": "Salir", + "xaeroplus.gui.world_map.copy_coordinates": "Copiar coordenadas", "xaeroplus.gui.world_map.go_to_coordinates": "Ir a Coordenadas", "xaeroplus.gui.world_map.baritone_goal_here": "§2%s§r Objetivo Baritone Aca", "xaeroplus.gui.world_map.baritone_path_here": "§2%s§r Camino Baritone Aca", diff --git a/common/src/main/resources/assets/xaeroplus/lang/fr_ca.json b/common/src/main/resources/assets/xaeroplus/lang/fr_ca.json index d177e246..4d71f15f 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/fr_ca.json +++ b/common/src/main/resources/assets/xaeroplus/lang/fr_ca.json @@ -191,6 +191,7 @@ "xaeroplus.gui.minimap_incompatible.required_version": "Version requise: ", "xaeroplus.gui.minimap_incompatible.download_minimap": "Téléchargez la mini-carte de Xaero", "xaeroplus.gui.minimap_incompatible.exit": "Sortie", + "xaeroplus.gui.world_map.copy_coordinates": "Copier les coordonnées", "xaeroplus.gui.world_map.go_to_coordinates": "Aller aux coordonnées", "xaeroplus.gui.world_map.baritone_goal_here": "§2%s§r Baryton Ciblez ici", "xaeroplus.gui.world_map.baritone_path_here": "§2%s§r Chemin du baryton ici", diff --git a/common/src/main/resources/assets/xaeroplus/lang/fr_fr.json b/common/src/main/resources/assets/xaeroplus/lang/fr_fr.json index d177e246..4d71f15f 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/fr_fr.json +++ b/common/src/main/resources/assets/xaeroplus/lang/fr_fr.json @@ -191,6 +191,7 @@ "xaeroplus.gui.minimap_incompatible.required_version": "Version requise: ", "xaeroplus.gui.minimap_incompatible.download_minimap": "Téléchargez la mini-carte de Xaero", "xaeroplus.gui.minimap_incompatible.exit": "Sortie", + "xaeroplus.gui.world_map.copy_coordinates": "Copier les coordonnées", "xaeroplus.gui.world_map.go_to_coordinates": "Aller aux coordonnées", "xaeroplus.gui.world_map.baritone_goal_here": "§2%s§r Baryton Ciblez ici", "xaeroplus.gui.world_map.baritone_path_here": "§2%s§r Chemin du baryton ici", diff --git a/common/src/main/resources/assets/xaeroplus/lang/ja_jp.json b/common/src/main/resources/assets/xaeroplus/lang/ja_jp.json index 2dea9c20..cc445429 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/ja_jp.json +++ b/common/src/main/resources/assets/xaeroplus/lang/ja_jp.json @@ -188,7 +188,8 @@ "xaeroplus.gui.minimap_incompatible.currently_installed_version": "現在のバージョン: ", "xaeroplus.gui.minimap_incompatible.required_version": "必要なバージョン: ", "xaeroplus.gui.minimap_incompatible.download_minimap": "Xaero's Minimapをダウンロード", - "xaeroplus.gui.minimap_incompatible.exit": "Exit", + "xaeroplus.gui.minimap_incompatible.exit": "出口", + "xaeroplus.gui.world_map.copy_coordinates": "座標をコピー", "xaeroplus.gui.world_map.go_to_coordinates": "この座標に行く", "xaeroplus.gui.world_map.baritone_goal_here": "§2%s§r Baritoneのゴール", "xaeroplus.gui.world_map.baritone_path_here": "§2%s§r Baritoneのルート", diff --git a/common/src/main/resources/assets/xaeroplus/lang/pl_pl.json b/common/src/main/resources/assets/xaeroplus/lang/pl_pl.json index 5029a448..fb77179d 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/pl_pl.json +++ b/common/src/main/resources/assets/xaeroplus/lang/pl_pl.json @@ -191,6 +191,7 @@ "xaeroplus.gui.minimap_incompatible.required_version": "Wymagana wersja: ", "xaeroplus.gui.minimap_incompatible.download_minimap": "Pobierz minimapę Xaero", "xaeroplus.gui.minimap_incompatible.exit": "Wyjście", + "xaeroplus.gui.world_map.copy_coordinates": "Kopiuj współrzędne", "xaeroplus.gui.world_map.go_to_coordinates": "Idź na Koordynaty", "xaeroplus.gui.world_map.baritone_goal_here": "§2%s§r Cel Baritone Tutaj", "xaeroplus.gui.world_map.baritone_path_here": "§2%s§r Ścieżka Baritone Tutaj", diff --git a/common/src/main/resources/assets/xaeroplus/lang/pt_pt.json b/common/src/main/resources/assets/xaeroplus/lang/pt_pt.json index 7cd84d24..cf472d1d 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/pt_pt.json +++ b/common/src/main/resources/assets/xaeroplus/lang/pt_pt.json @@ -191,6 +191,7 @@ "xaeroplus.gui.minimap_incompatible.required_version": "Versão Necessária: ", "xaeroplus.gui.minimap_incompatible.download_minimap": "Transferir Xaero's Minimap", "xaeroplus.gui.minimap_incompatible.exit": "Sair", + "xaeroplus.gui.world_map.copy_coordinates": "Copiar coordenadas", "xaeroplus.gui.world_map.go_to_coordinates": "Ir para Coordenadas", "xaeroplus.gui.world_map.baritone_goal_here": "§2%s§r Destino Baritone Aqui", "xaeroplus.gui.world_map.baritone_path_here": "§2%s§r Caminho Baritone Aqui", diff --git a/common/src/main/resources/assets/xaeroplus/lang/ru_ru.json b/common/src/main/resources/assets/xaeroplus/lang/ru_ru.json index a8646af6..10b31b5c 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/ru_ru.json +++ b/common/src/main/resources/assets/xaeroplus/lang/ru_ru.json @@ -191,6 +191,7 @@ "xaeroplus.gui.minimap_incompatible.required_version": "Требуемая версия: ", "xaeroplus.gui.minimap_incompatible.download_minimap": "Скачать миникарту Xaero", "xaeroplus.gui.minimap_incompatible.exit": "Выход", + "xaeroplus.gui.world_map.copy_coordinates": "Копировать координаты", "xaeroplus.gui.world_map.go_to_coordinates": "Идти на координаты", "xaeroplus.gui.world_map.baritone_goal_here": "§2%s§r Baritone Цель тут", "xaeroplus.gui.world_map.baritone_path_here": "§2%s§r Baritone Путь тут", diff --git a/common/src/main/resources/assets/xaeroplus/lang/vi_vn.json b/common/src/main/resources/assets/xaeroplus/lang/vi_vn.json index 77f57d9a..22a08afc 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/vi_vn.json +++ b/common/src/main/resources/assets/xaeroplus/lang/vi_vn.json @@ -191,6 +191,7 @@ "xaeroplus.gui.minimap_incompatible.required_version": "Phiên Bản Yêu Cầu: ", "xaeroplus.gui.minimap_incompatible.download_minimap": "Tải Xuống Xaero's Minimap", "xaeroplus.gui.minimap_incompatible.exit": "Thoát", + "xaeroplus.gui.world_map.copy_coordinates": "Sao chép tọa độ", "xaeroplus.gui.world_map.go_to_coordinates": "Đi Đến Tọa Độ", "xaeroplus.gui.world_map.baritone_goal_here": "§2%s§r Mục Tiêu Baritone Tại Đây", "xaeroplus.gui.world_map.baritone_path_here": "§2%s§r Đường Đi Baritone Tại Đây", diff --git a/common/src/main/resources/assets/xaeroplus/lang/zh_cn.json b/common/src/main/resources/assets/xaeroplus/lang/zh_cn.json index 96ed933b..5ffb84e5 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/zh_cn.json +++ b/common/src/main/resources/assets/xaeroplus/lang/zh_cn.json @@ -191,6 +191,7 @@ "xaeroplus.gui.minimap_incompatible.required_version": "所需版本:", "xaeroplus.gui.minimap_incompatible.download_minimap": "下载 Xaero 的小地图", "xaeroplus.gui.minimap_incompatible.exit": "出口", + "xaeroplus.gui.world_map.copy_coordinates": "复制坐标", "xaeroplus.gui.world_map.go_to_coordinates": "转到坐标", "xaeroplus.gui.world_map.baritone_goal_here": "§2%s§r 设置 Baritone 目标点", "xaeroplus.gui.world_map.baritone_path_here": "§2%s§r 通过 Baritone 寻路至此处", diff --git a/common/src/main/resources/assets/xaeroplus/lang/zh_tw.json b/common/src/main/resources/assets/xaeroplus/lang/zh_tw.json index 9170a0d0..14d6d40a 100644 --- a/common/src/main/resources/assets/xaeroplus/lang/zh_tw.json +++ b/common/src/main/resources/assets/xaeroplus/lang/zh_tw.json @@ -191,6 +191,7 @@ "xaeroplus.gui.minimap_incompatible.required_version": "需要的版本:", "xaeroplus.gui.minimap_incompatible.download_minimap": "下載 Xaero 的小地圖", "xaeroplus.gui.minimap_incompatible.exit": "退出", + "xaeroplus.gui.world_map.copy_coordinates": "複製座標", "xaeroplus.gui.world_map.go_to_coordinates": "前往座標", "xaeroplus.gui.world_map.baritone_goal_here": "§2%s§r Baritone 行動目標到此處", "xaeroplus.gui.world_map.baritone_path_here": "§2%s§r Baritone 尋路到此處", From c92469ceff3d61def352c630ac50016e71aeafa7 Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:57:23 -0700 Subject: [PATCH 3/5] bump version --- .../kotlin/xaeroplus-all.conventions.gradle.kts | 2 +- settings.gradle.kts | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/buildSrc/src/main/kotlin/xaeroplus-all.conventions.gradle.kts b/buildSrc/src/main/kotlin/xaeroplus-all.conventions.gradle.kts index 8b82d19a..9502e68d 100644 --- a/buildSrc/src/main/kotlin/xaeroplus-all.conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/xaeroplus-all.conventions.gradle.kts @@ -9,7 +9,7 @@ configure { } version = gradle.extra.get("mod_version").toString() -group = gradle.extra.get("maven_group").toString() +group = "xaeroplus" repositories { maven("https://api.modrinth.com/maven") { diff --git a/settings.gradle.kts b/settings.gradle.kts index 02f7d72c..3993e3ba 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -8,14 +8,9 @@ pluginManagement { } } gradle.extra.apply { - set("mod_version", "2.24.3") - set("maven_group", "xaeroplus") - set("archives_base_name", "XaeroPlus") + set("mod_version", "2.24.4") set("minecraft_version", "1.20.1") set("parchment_version", "2023.09.03") - set("fabric_loader_version", "0.15.11") - set("fabric_api_version", "0.92.2+1.20.1") - set("forge_loader_version", "47.3.5") set("worldmap_version_fabric", "1.39.0") set("minimap_version_fabric", "24.5.0") set("worldmap_version_forge", "1.39.0") @@ -25,15 +20,15 @@ gradle.extra.apply { dependencyResolutionManagement { versionCatalogs { create("libs") { - library("fabric-loader", "net.fabricmc:fabric-loader:${gradle.extra.get("fabric_loader_version")}") - library("forge", "net.minecraftforge:forge:${gradle.extra.get("minecraft_version")}-${gradle.extra.get("forge_loader_version")}") - library("fabric-api", "net.fabricmc.fabric-api:fabric-api:${gradle.extra.get("fabric_api_version")}") + library("fabric-loader", "net.fabricmc:fabric-loader:0.15.11") + library("forge", "net.minecraftforge:forge:${gradle.extra.get("minecraft_version")}-47.3.5") + library("fabric-api", "net.fabricmc.fabric-api:fabric-api:0.92.2+${gradle.extra.get("minecraft_version")}") library("worldmap-fabric", "maven.modrinth:xaeros-world-map:${gradle.extra.get("worldmap_version_fabric")}_Fabric_1.20") library("worldmap-forge", "maven.modrinth:xaeros-world-map:${gradle.extra.get("worldmap_version_forge")}_Forge_1.20") library("minimap-fabric", "maven.modrinth:xaeros-minimap:${gradle.extra.get("minimap_version_fabric")}_Fabric_1.20") library("minimap-forge", "maven.modrinth:xaeros-minimap:${gradle.extra.get("minimap_version_forge")}_Forge_1.20") - library("mixinextras-common", "io.github.llamalad7:mixinextras-common:0.4.0") - library("mixinextras-forge", "io.github.llamalad7:mixinextras-forge:0.4.0") + library("mixinextras-common", "io.github.llamalad7:mixinextras-common:0.4.1") + library("mixinextras-forge", "io.github.llamalad7:mixinextras-forge:0.4.1") library("caffeine", "com.github.ben-manes.caffeine:caffeine:3.1.8") library("lambdaEvents", "net.lenni0451:LambdaEvents:2.4.2") library("waystones-fabric", "maven.modrinth:waystones:14.1.4+fabric-1.20") From db31700751fc021d4b7ca31d663a62affb07dbc3 Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:32:37 -0700 Subject: [PATCH 4/5] ensure io exceptions caught --- .../java/xaeroplus/mixin/client/MixinMapSaveLoad.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/xaeroplus/mixin/client/MixinMapSaveLoad.java b/common/src/main/java/xaeroplus/mixin/client/MixinMapSaveLoad.java index c5410adc..1959512d 100644 --- a/common/src/main/java/xaeroplus/mixin/client/MixinMapSaveLoad.java +++ b/common/src/main/java/xaeroplus/mixin/client/MixinMapSaveLoad.java @@ -68,7 +68,15 @@ public void closeZipOutputStream(final MapRegion region, final int extraAttempts @Share("zipOutShare") final LocalRef zipOutShare ) throws IOException { if (!Settings.REGISTRY.fastZipWrite.get()) return; - zipOutShare.get().close(); + try { + zipOutShare.get().close(); + } catch (final IOException e) { + throw e; + } catch (final Exception e) { + // Deflator ensureOpen can throw a NPE in certain cases + // and the saveRegion method only catches IOExceptions + throw new IOException(e); + } } @Redirect(method = "run", at = @At(value = "INVOKE", target = "Lxaero/map/region/LeveledRegion;isAllCachePrepared()Z", ordinal = 0)) From 10534e5f57a119a4a8bb0a7e0fcdea4e1ba7feb2 Mon Sep 17 00:00:00 2001 From: rfresh2 <89827146+rfresh2@users.noreply.github.com> Date: Mon, 14 Oct 2024 22:01:18 -0700 Subject: [PATCH 5/5] fix default waypoint set id for waystone sync --- common/src/main/java/xaeroplus/module/impl/WaystoneSync.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/xaeroplus/module/impl/WaystoneSync.java b/common/src/main/java/xaeroplus/module/impl/WaystoneSync.java index b05dcc63..3bacd458 100644 --- a/common/src/main/java/xaeroplus/module/impl/WaystoneSync.java +++ b/common/src/main/java/xaeroplus/module/impl/WaystoneSync.java @@ -144,7 +144,7 @@ private void waypointsListSync(final Waystone waystone, final WaypointSet waypoi } private WaypointSet getWaypointSet(final Waystone waystone, final MinimapSession minimapSession) { - final String waypointSetName = this.separateWaypointSet ? "Waystones" : "xaeroplus.gui.xaero_default"; + final String waypointSetName = this.separateWaypointSet ? "Waystones" : "gui.xaero_default"; final MinimapWorld waypointWorld = getWaypointWorldForWaystone(waystone, minimapSession); WaypointSet waypointSet = waypointWorld.getWaypointSet(waypointSetName); if (waypointSet == null) {