From 2cf4894f1a3cf9283cc130d8c89a71d60c35e47c Mon Sep 17 00:00:00 2001 From: Pumpkin7266 Date: Thu, 19 Dec 2024 06:44:03 +0000 Subject: [PATCH] Fix incorrect time display on `/medicalcondition query` (#2575) --- src/generated/resources/assets/gtceu/lang/en_ud.json | 4 ++-- src/generated/resources/assets/gtceu/lang/en_us.json | 4 ++-- .../gtceu/common/commands/MedicalConditionCommands.java | 3 ++- .../java/com/gregtechceu/gtceu/data/lang/LangHandler.java | 5 +++-- src/main/resources/assets/gtceu/lang/ja_jp.json | 4 ++-- src/main/resources/assets/gtceu/lang/ru_ru.json | 4 ++-- src/main/resources/assets/gtceu/lang/zh_cn.json | 4 ++-- src/main/resources/assets/gtceu/lang/zh_tw.json | 4 ++-- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/generated/resources/assets/gtceu/lang/en_ud.json b/src/generated/resources/assets/gtceu/lang/en_ud.json index a32a877c05..ed0f62ed20 100644 --- a/src/generated/resources/assets/gtceu/lang/en_ud.json +++ b/src/generated/resources/assets/gtceu/lang/en_ud.json @@ -1706,8 +1706,8 @@ "button.gtceu.toggle_waypoint.name": "ʇuıodʎɐM ǝןbbo⟘", "command.gtceu.dump_data.success": "%s oʇ %s ʎɹʇsıbǝɹ ɯoɹɟ sǝɔɹnosǝɹ %s pǝdɯnᗡ", "command.gtceu.medical_condition.get": ":suoıʇıpuoɔ ןɐɔıpǝɯ ǝsǝɥʇ sɐɥ %s ɹǝʎɐןԀ", - "command.gtceu.medical_condition.get.element": "spuoɔǝs %s :ɹ§%s uoıʇıpuoƆ", - "command.gtceu.medical_condition.get.element.permanent": ")ʇuǝuɐɯɹǝd( spuoɔǝs %s :ɹ§%s uoıʇıpuoƆ", + "command.gtceu.medical_condition.get.element": "spuoɔǝs %s sǝʇnuıɯ %s :ɹ§%s uoıʇıpuoƆ", + "command.gtceu.medical_condition.get.element.permanent": ")ʇuǝuɐɯɹǝd( spuoɔǝs %s sǝʇnuıɯ %s :ɹ§%s uoıʇıpuoƆ", "command.gtceu.medical_condition.get.empty": "˙suoıʇıpuoɔ ןɐɔıpǝɯ ou sɐɥ %s ɹǝʎɐןԀ", "command.gtceu.place_vein.failure": "%s uoıʇısod ʇɐ %s uıǝʌ ǝɔɐןd oʇ pǝןıɐℲ", "command.gtceu.place_vein.success": "%s uoıʇısod ʇɐ %s uıǝʌ pǝɔɐןԀ", diff --git a/src/generated/resources/assets/gtceu/lang/en_us.json b/src/generated/resources/assets/gtceu/lang/en_us.json index 34e6d217d2..ae2cce5ea1 100644 --- a/src/generated/resources/assets/gtceu/lang/en_us.json +++ b/src/generated/resources/assets/gtceu/lang/en_us.json @@ -1706,8 +1706,8 @@ "button.gtceu.toggle_waypoint.name": "Toggle Waypoint", "command.gtceu.dump_data.success": "Dumped %s resources from registry %s to %s", "command.gtceu.medical_condition.get": "Player %s has these medical conditions:", - "command.gtceu.medical_condition.get.element": "Condition %s§r: %s seconds", - "command.gtceu.medical_condition.get.element.permanent": "Condition %s§r: %s seconds (permanent)", + "command.gtceu.medical_condition.get.element": "Condition %s§r: %s minutes %s seconds", + "command.gtceu.medical_condition.get.element.permanent": "Condition %s§r: %s minutes %s seconds (permanent)", "command.gtceu.medical_condition.get.empty": "Player %s has no medical conditions.", "command.gtceu.place_vein.failure": "Failed to place vein %s at position %s", "command.gtceu.place_vein.success": "Placed vein %s at position %s", diff --git a/src/main/java/com/gregtechceu/gtceu/common/commands/MedicalConditionCommands.java b/src/main/java/com/gregtechceu/gtceu/common/commands/MedicalConditionCommands.java index 10feb462a7..e9bcf7321a 100644 --- a/src/main/java/com/gregtechceu/gtceu/common/commands/MedicalConditionCommands.java +++ b/src/main/java/com/gregtechceu/gtceu/common/commands/MedicalConditionCommands.java @@ -102,10 +102,11 @@ private static int queryMedicalConditions(ServerPlayer target) throws CommandSyn entry.getKey().canBePermanent) { langKey = "command.gtceu.medical_condition.get.element.permanent"; } + float time = entry.getFloatValue(); target.sendSystemMessage( Component.translatable(langKey, Component.translatable("gtceu.medical_condition." + entry.getKey().name), - entry.getFloatValue() / 20f)); + (int) (time / 60), (int) (time % 60))); } return count; } diff --git a/src/main/java/com/gregtechceu/gtceu/data/lang/LangHandler.java b/src/main/java/com/gregtechceu/gtceu/data/lang/LangHandler.java index e48df37415..ecd18e26a5 100644 --- a/src/main/java/com/gregtechceu/gtceu/data/lang/LangHandler.java +++ b/src/main/java/com/gregtechceu/gtceu/data/lang/LangHandler.java @@ -121,8 +121,9 @@ public static void init(RegistrateLangProvider provider) { provider.add("command.gtceu.medical_condition.get", "Player %s has these medical conditions:"); provider.add("command.gtceu.medical_condition.get.empty", "Player %s has no medical conditions."); - provider.add("command.gtceu.medical_condition.get.element", "Condition %s§r: %s seconds"); - provider.add("command.gtceu.medical_condition.get.element.permanent", "Condition %s§r: %s seconds (permanent)"); + provider.add("command.gtceu.medical_condition.get.element", "Condition %s§r: %s minutes %s seconds"); + provider.add("command.gtceu.medical_condition.get.element.permanent", + "Condition %s§r: %s minutes %s seconds (permanent)"); provider.add("command.gtceu.dump_data.success", "Dumped %s resources from registry %s to %s"); provider.add("command.gtceu.place_vein.failure", "Failed to place vein %s at position %s"); provider.add("command.gtceu.place_vein.success", "Placed vein %s at position %s"); diff --git a/src/main/resources/assets/gtceu/lang/ja_jp.json b/src/main/resources/assets/gtceu/lang/ja_jp.json index 75e33e53bb..6928e2c6ef 100644 --- a/src/main/resources/assets/gtceu/lang/ja_jp.json +++ b/src/main/resources/assets/gtceu/lang/ja_jp.json @@ -1706,8 +1706,8 @@ "button.gtceu.toggle_waypoint.name": "ウェイポイントを切り替え", "command.gtceu.dump_data.success": "レジストリ %2$s から %1$s リソースを %3$s にダンプしました。", "command.gtceu.medical_condition.get": "プレイヤー%sは以下のような健康状態にです。:", - "command.gtceu.medical_condition.get.element": "コンディション %s§r: %s 秒", - "command.gtceu.medical_condition.get.element.permanent": "コンディション %s§r: %s 秒(永続的)", + "command.gtceu.medical_condition.get.element": "コンディション %s§r: %s 分 %s 秒", + "command.gtceu.medical_condition.get.element.permanent": "コンディション %s§r: %s 分 %s 秒(永続的)", "command.gtceu.medical_condition.get.empty": "プレイヤー%sは全て健康です。", "command.gtceu.place_vein.failure": "鉱脈 %1$s を位置 %2$s に配置できませんでした。", "command.gtceu.place_vein.success": "鉱脈 %s を位置 %s に配置しました。", diff --git a/src/main/resources/assets/gtceu/lang/ru_ru.json b/src/main/resources/assets/gtceu/lang/ru_ru.json index 0d6456d777..2bfc56bc23 100644 --- a/src/main/resources/assets/gtceu/lang/ru_ru.json +++ b/src/main/resources/assets/gtceu/lang/ru_ru.json @@ -7039,8 +7039,8 @@ "block.gtceu.green_borderless_lamp": "Зеленая лампа (Без границ)", "block.gtceu.lamp.tooltip.no_bloom": "Без блика", "block.gtceu.lamp.tooltip.no_light": "Без Света", - "command.gtceu.medical_condition.get.element.permanent": "%s§r: %s сек. (Постоянно)", - "command.gtceu.medical_condition.get.element": "%s§r: %s сек.", + "command.gtceu.medical_condition.get.element.permanent": "%s§r: %s мин %s сек. (Постоянно)", + "command.gtceu.medical_condition.get.element": "%s§r: %s мин %s сек.", "command.gtceu.medical_condition.get.empty": "У игрока %s нет никаких заболеваний.", "material.gtceu.calcium_hydroxide": "Гидроксид кальция", "material.gtceu.dichloroethane": "Дихлорэтан", diff --git a/src/main/resources/assets/gtceu/lang/zh_cn.json b/src/main/resources/assets/gtceu/lang/zh_cn.json index 888abd6716..6399062787 100644 --- a/src/main/resources/assets/gtceu/lang/zh_cn.json +++ b/src/main/resources/assets/gtceu/lang/zh_cn.json @@ -1752,8 +1752,8 @@ "button.gtceu.toggle_waypoint.name":"切换路径点", "command.gtceu.dump_data.success":"已将注册表%2$s中的%1$s个资源转储到%3$s", "command.gtceu.medical_condition.get":"玩家%s有以下疾病:", - "command.gtceu.medical_condition.get.element":"症状:%s§r %s秒", - "command.gtceu.medical_condition.get.element.permanent":"症状:%s§r %s秒(永久)", + "command.gtceu.medical_condition.get.element":"症状:%s§r %s分 %s秒", + "command.gtceu.medical_condition.get.element.permanent":"症状:%s§r %s分 %s秒(永久)", "command.gtceu.medical_condition.get.empty":"玩家%s没有疾病。", "command.gtceu.place_vein.failure":"无法放置%s矿脉于%s", "command.gtceu.place_vein.success":"成功放置%s矿脉于%s", diff --git a/src/main/resources/assets/gtceu/lang/zh_tw.json b/src/main/resources/assets/gtceu/lang/zh_tw.json index 81645b9f25..8ac6d5b26f 100644 --- a/src/main/resources/assets/gtceu/lang/zh_tw.json +++ b/src/main/resources/assets/gtceu/lang/zh_tw.json @@ -1737,8 +1737,8 @@ "button.gtceu.toggle_waypoint.name":"切換路徑點", "command.gtceu.dump_data.success":"已將登錄檔%2$s中的%1$s個資源轉儲到%3$s", "command.gtceu.medical_condition.get":"玩家%s有以下疾病:", - "command.gtceu.medical_condition.get.element":"症狀:%s§r %s秒", - "command.gtceu.medical_condition.get.element.permanent":"症狀:%s§r %s秒(永久)", + "command.gtceu.medical_condition.get.element":"症狀:%s§r %s分 %s秒", + "command.gtceu.medical_condition.get.element.permanent":"症狀:%s§r %s分 %s秒(永久)", "command.gtceu.medical_condition.get.empty":"玩家%s沒有疾病。", "command.gtceu.place_vein.failure":"無法放置%s礦脈於%s", "command.gtceu.place_vein.success":"成功放置%s礦脈於%s",