From 2e8ec06dd6a97c82b5d6ceebcf23c99088edc11a Mon Sep 17 00:00:00 2001 From: l3126596029 Date: Sun, 13 Sep 2026 03:54:25 +0800 Subject: [PATCH] style: share without copy button, name+hover only (26.9.8) --- 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",