From c9dd8a83b91b20f86d466ce481630d1b8a9a1ba3 Mon Sep 17 00:00:00 2001 From: l3126596029 Date: Sun, 13 Sep 2026 03:54:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=EF=BC=9A!!share=20=E5=8E=BB?= =?UTF-8?q?=E6=8E=89=E5=A4=8D=E5=88=B6=E6=8C=89=E9=92=AE=EF=BC=8C=E4=BB=85?= =?UTF-8?q?=E4=BF=9D=E7=95=99=E7=89=A9=E5=93=81=E5=90=8D=E4=B8=8E=E6=82=AC?= =?UTF-8?q?=E5=81=9C=20(26.9.8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +++++ README.md | 2 +- iridium/share.py | 24 ------------------------ mcdreforged.plugin.json | 2 +- 4 files changed, 7 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f46510..f07944a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ 本文件记录 Iridium 的重要变更。 +## [26.9.8] - 2026-09-13 + +### Changed +- `!!share`:去掉「点击复制完整数据」,仅保留物品名 + 悬停预览(与 ShowIt 风格一致) + ## [26.9.7] - 2026-09-13 ### Fixed diff --git a/README.md b/README.md index 79d5d2a..394bdfe 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ MCDReforged 插件:物品展示 / 戴头 / 获取头颅 / 游戏内计算器 / | | | |---|---| -| 版本 | **26.9.7** | +| 版本 | **26.9.8** | | 作者 | 云镜之端/SKYMirror | | 许可 | 保留所有权益(All Rights Reserved) | | 前置 | MCDReforged `>= 2.6.0` | diff --git a/iridium/share.py b/iridium/share.py index 90f1b3b..4ebdeb9 100644 --- a/iridium/share.py +++ b/iridium/share.py @@ -127,45 +127,21 @@ def _build_tellraw(player: str, item_snbt: str, version: Version) -> str: # Truncate pathological NBT (huge books etc.) so the command stays valid if len(item_snbt) > MAX_SNBT_LEN: item_snbt = item_snbt[:MAX_SNBT_LEN] + "..." - snbt = _json_str(item_snbt) - player_js = _json_str(sanitize_name(player) or player) if is_at_least(version, "1.21.5"): hover = {"action": "show_item", "contents": item_snbt} else: hover = {"action": "show_item", "value": item_snbt} - if is_at_least(version, "1.16"): - click = {"action": "copy_to_clipboard", "value": item_snbt} - click_label = tr("click_copy") - else: - safe_player = sanitize_name(player) - if is_at_least(version, "1.13"): - suggest = f"/data get entity {safe_player} SelectedItem" - else: - suggest = f"/entitydata {safe_player} {{}}" - click = {"action": "suggest_command", "value": suggest} - click_label = tr("click_suggest") - display = json.loads(_display_json(item_snbt)) display["color"] = "aqua" display["hoverEvent"] = hover - click_comp = { - "text": f" [{click_label}]", - "color": "aqua", - "bold": True, - "underlined": True, - "hoverEvent": hover, - "clickEvent": click, - } - payload = [ {"text": "[Iridium] ", "color": "gray"}, {"text": sanitize_name(player) or player, "color": "yellow"}, {"text": f" {tr('share_showing')} "}, display, - click_comp, ] return "tellraw @a " + json.dumps(payload, ensure_ascii=False, separators=(",", ":")) diff --git a/mcdreforged.plugin.json b/mcdreforged.plugin.json index f6ce96a..2f8c2b4 100644 --- a/mcdreforged.plugin.json +++ b/mcdreforged.plugin.json @@ -1,6 +1,6 @@ { "id": "iridium", - "version": "26.9.7", + "version": "26.9.8", "name": "Iridium", "description": { "zh_cn": "物品展示 / 戴头 / 获取头颅 / 游戏内计算器 / 进服 MOTD",