调整:!!share 去掉复制按钮,仅保留物品名与悬停 (26.9.8)

This commit is contained in:
SKYMirror committed 2026-09-13 03:54:25 +08:00
1 parent e1ab8ec1fe
commit c9dd8a83b9
4 files changed
+7 -26

No files matched your search

+5
View File
@@ -2,6 +2,11 @@
本文件记录 Iridium 的重要变更。
## [26.9.8] - 2026-09-13
### Changed
- `!!share`:去掉「点击复制完整数据」,仅保留物品名 + 悬停预览(与 ShowIt 风格一致)
## [26.9.7] - 2026-09-13
### Fixed
+1 -1
View File
@@ -4,7 +4,7 @@ MCDReforged 插件:物品展示 / 戴头 / 获取头颅 / 游戏内计算器 /
| | |
|---|---|
| 版本 | **26.9.7** |
| 版本 | **26.9.8** |
| 作者 | 云镜之端/SKYMirror |
| 许可 | 保留所有权益(All Rights Reserved) |
| 前置 | MCDReforged `>= 2.6.0` |
-24
View File
@@ -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=(",", ":"))
+1 -1
View File
@@ -1,6 +1,6 @@
{
"id": "iridium",
"version": "26.9.7",
"version": "26.9.8",
"name": "Iridium",
"description": {
"zh_cn": "物品展示 / 戴头 / 获取头颅 / 游戏内计算器 / 进服 MOTD",