From d13d33040b2505227e627f9e0d884326e8cfcfdd Mon Sep 17 00:00:00 2001 From: Sukikui Date: Sat, 13 Dec 2025 13:31:43 +0100 Subject: [PATCH 1/3] version: set MC to `1.21.11` --- build.gradle | 17 +++++++++++++++-- gradle.properties | 13 +++++++------ gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle | 10 +++++++++- src/main/resources/fabric.mod.json | 12 ++++++------ 5 files changed, 38 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index bfe6869..2a93628 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '1.10-SNAPSHOT' + id 'fabric-loom' id 'maven-publish' } @@ -54,10 +54,23 @@ dependencies { } processResources { + // Keep fabric.mod.json versions in sync with gradle.properties inputs.property "version", project.version + inputs.property "loader_version", project.loader_version + inputs.property "minecraft_version", project.minecraft_version + inputs.property "fabric_version", project.fabric_version + inputs.property "cloth_config_version", project.cloth_config_version + inputs.property "modmenu_version", project.modmenu_version filesMatching("fabric.mod.json") { - expand "version": inputs.properties.version + expand( + "version": inputs.properties.version, + "loader_version": inputs.properties.loader_version, + "minecraft_version": inputs.properties.minecraft_version, + "fabric_version": inputs.properties.fabric_version, + "cloth_config_version": inputs.properties.cloth_config_version, + "modmenu_version": inputs.properties.modmenu_version + ) } } diff --git a/gradle.properties b/gradle.properties index c88d110..957f8fa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,10 @@ org.gradle.parallel=true # Fabric Properties # check these on https://fabricmc.net/develop -minecraft_version=1.21.8 -yarn_mappings=1.21.8+build.1 -loader_version=0.16.14 +minecraft_version=1.21.11 +yarn_mappings=1.21.11+build.3 +loader_version=0.18.2 +loom_version=1.14-SNAPSHOT # Mod Properties mod_version=0.1.4 @@ -13,6 +14,6 @@ maven_group=fr.sukikui.playercoordsapi archives_base_name=playercoordsapi # Dependencies -fabric_version=0.129.0+1.21.8 -modmenu_version=9.0.0 -cloth_config_version=13.0.121 +fabric_version=0.139.5+1.21.11 +modmenu_version=15.0.0 +cloth_config_version=21.11.151 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e18bc25..23449a2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.2.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle b/settings.gradle index 75c4d72..098ca7c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,9 @@ pluginManagement { + def loomVersion = providers.gradleProperty("loom_version").orElse(null) + if (loomVersion == null) { + throw new GradleException("Missing 'loom_version' in gradle.properties") + } + repositories { maven { name = 'Fabric' @@ -7,4 +12,7 @@ pluginManagement { mavenCentral() gradlePluginPortal() } -} \ No newline at end of file + plugins { + id "fabric-loom" version loomVersion + } +} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 8ae1d7f..dc385d9 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -34,16 +34,16 @@ } ], "depends": { - "fabricloader": ">=0.16.14", - "minecraft": "~1.21.8", + "fabricloader": ">=${loader_version}", + "minecraft": "~${minecraft_version}", "java": ">=21", - "fabric-api": "*", - "cloth-config": ">=13.0.0" + "fabric-api": ">=${fabric_version}", + "cloth-config": ">=${cloth_config_version}" }, "recommends": { - "modmenu": ">=9.0.0" + "modmenu": ">=${modmenu_version}" }, "suggests": { "another-mod": "*" } -} \ No newline at end of file +} From 6053cb688904c86aa31f4243371bc82b515d2250 Mon Sep 17 00:00:00 2001 From: Sukikui Date: Sat, 13 Dec 2025 13:33:10 +0100 Subject: [PATCH 2/3] fix: adapt chore code to Fabrics API `1.21.11` --- .../fr/sukikui/playercoordsapi/PlayerCoordsAPIClient.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/java/fr/sukikui/playercoordsapi/PlayerCoordsAPIClient.java b/src/client/java/fr/sukikui/playercoordsapi/PlayerCoordsAPIClient.java index 52a7a32..f580bc7 100644 --- a/src/client/java/fr/sukikui/playercoordsapi/PlayerCoordsAPIClient.java +++ b/src/client/java/fr/sukikui/playercoordsapi/PlayerCoordsAPIClient.java @@ -5,6 +5,7 @@ import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.world.ClientWorld; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.world.biome.Biome; @@ -98,16 +99,17 @@ private void handleCoordsRequest(HttpExchange exchange) throws IOException { // Get player coordinates MinecraftClient client = MinecraftClient.getInstance(); PlayerEntity player = client.player; + ClientWorld worldObj = client.world; String responseText; - if (player != null) { + if (player != null && worldObj != null) { double x = player.getX(); double y = player.getY(); double z = player.getZ(); - String world = player.getWorld().getRegistryKey().getValue().toString(); + String world = worldObj.getRegistryKey().getValue().toString(); // Get biome information - RegistryEntry biomeEntry = player.getWorld().getBiome(player.getBlockPos()); + RegistryEntry biomeEntry = worldObj.getBiome(player.getBlockPos()); String biome = biomeEntry.getKey().orElseThrow().getValue().toString(); // Get player UUID and username From 9b2bbffa5f9aacaf5ff179e0b20f79ae4cb03be5 Mon Sep 17 00:00:00 2001 From: Sukikui Date: Sat, 13 Dec 2025 13:33:23 +0100 Subject: [PATCH 3/3] feat: add langs --- src/main/resources/assets/playercoordsapi/lang/de_de.json | 5 +++++ src/main/resources/assets/playercoordsapi/lang/es_es.json | 5 +++++ src/main/resources/assets/playercoordsapi/lang/it_it.json | 5 +++++ src/main/resources/assets/playercoordsapi/lang/ja_jp.json | 5 +++++ src/main/resources/assets/playercoordsapi/lang/pt_br.json | 5 +++++ src/main/resources/assets/playercoordsapi/lang/ru_ru.json | 5 +++++ src/main/resources/assets/playercoordsapi/lang/zh_cn.json | 5 +++++ 7 files changed, 35 insertions(+) create mode 100644 src/main/resources/assets/playercoordsapi/lang/de_de.json create mode 100644 src/main/resources/assets/playercoordsapi/lang/es_es.json create mode 100644 src/main/resources/assets/playercoordsapi/lang/it_it.json create mode 100644 src/main/resources/assets/playercoordsapi/lang/ja_jp.json create mode 100644 src/main/resources/assets/playercoordsapi/lang/pt_br.json create mode 100644 src/main/resources/assets/playercoordsapi/lang/ru_ru.json create mode 100644 src/main/resources/assets/playercoordsapi/lang/zh_cn.json diff --git a/src/main/resources/assets/playercoordsapi/lang/de_de.json b/src/main/resources/assets/playercoordsapi/lang/de_de.json new file mode 100644 index 0000000..33c5a4f --- /dev/null +++ b/src/main/resources/assets/playercoordsapi/lang/de_de.json @@ -0,0 +1,5 @@ +{ + "text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI", + "text.autoconfig.playercoordsapi.option.enabled": "Mod aktivieren", + "text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "PlayerCoordsAPI aktivieren oder deaktivieren" +} diff --git a/src/main/resources/assets/playercoordsapi/lang/es_es.json b/src/main/resources/assets/playercoordsapi/lang/es_es.json new file mode 100644 index 0000000..be3f4e9 --- /dev/null +++ b/src/main/resources/assets/playercoordsapi/lang/es_es.json @@ -0,0 +1,5 @@ +{ + "text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI", + "text.autoconfig.playercoordsapi.option.enabled": "Activar el mod", + "text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "Activar o desactivar PlayerCoordsAPI" +} diff --git a/src/main/resources/assets/playercoordsapi/lang/it_it.json b/src/main/resources/assets/playercoordsapi/lang/it_it.json new file mode 100644 index 0000000..061b234 --- /dev/null +++ b/src/main/resources/assets/playercoordsapi/lang/it_it.json @@ -0,0 +1,5 @@ +{ + "text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI", + "text.autoconfig.playercoordsapi.option.enabled": "Abilita mod", + "text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "Abilita o disabilita PlayerCoordsAPI" +} diff --git a/src/main/resources/assets/playercoordsapi/lang/ja_jp.json b/src/main/resources/assets/playercoordsapi/lang/ja_jp.json new file mode 100644 index 0000000..f8dca9c --- /dev/null +++ b/src/main/resources/assets/playercoordsapi/lang/ja_jp.json @@ -0,0 +1,5 @@ +{ + "text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI", + "text.autoconfig.playercoordsapi.option.enabled": "Modを有効にする", + "text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "PlayerCoordsAPIを有効または無効にします" +} diff --git a/src/main/resources/assets/playercoordsapi/lang/pt_br.json b/src/main/resources/assets/playercoordsapi/lang/pt_br.json new file mode 100644 index 0000000..94ec953 --- /dev/null +++ b/src/main/resources/assets/playercoordsapi/lang/pt_br.json @@ -0,0 +1,5 @@ +{ + "text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI", + "text.autoconfig.playercoordsapi.option.enabled": "Ativar o mod", + "text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "Ativar ou desativar o PlayerCoordsAPI" +} diff --git a/src/main/resources/assets/playercoordsapi/lang/ru_ru.json b/src/main/resources/assets/playercoordsapi/lang/ru_ru.json new file mode 100644 index 0000000..af62526 --- /dev/null +++ b/src/main/resources/assets/playercoordsapi/lang/ru_ru.json @@ -0,0 +1,5 @@ +{ + "text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI", + "text.autoconfig.playercoordsapi.option.enabled": "Включить мод", + "text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "Включить или отключить PlayerCoordsAPI" +} diff --git a/src/main/resources/assets/playercoordsapi/lang/zh_cn.json b/src/main/resources/assets/playercoordsapi/lang/zh_cn.json new file mode 100644 index 0000000..ae503c8 --- /dev/null +++ b/src/main/resources/assets/playercoordsapi/lang/zh_cn.json @@ -0,0 +1,5 @@ +{ + "text.autoconfig.playercoordsapi.title": "PlayerCoordsAPI", + "text.autoconfig.playercoordsapi.option.enabled": "启用模组", + "text.autoconfig.playercoordsapi.option.enabled.@Tooltip": "启用或禁用 PlayerCoordsAPI" +}