style: share without copy button, name+hover only (26.9.8)
This commit is contained in:
1 parent
dab8cae84c
commit
2e8ec06dd6
4 files changed
+7
-26
No files matched your search
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
本文件记录 Iridium 的重要变更。
|
本文件记录 Iridium 的重要变更。
|
||||||
|
|
||||||
|
## [26.9.8] - 2026-09-13
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- `!!share`:去掉「点击复制完整数据」,仅保留物品名 + 悬停预览(与 ShowIt 风格一致)
|
||||||
|
|
||||||
## [26.9.7] - 2026-09-13
|
## [26.9.7] - 2026-09-13
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ MCDReforged 插件:物品展示 / 戴头 / 获取头颅 / 游戏内计算器 /
|
|||||||
|
|
||||||
| | |
|
| | |
|
||||||
|---|---|
|
|---|---|
|
||||||
| 版本 | **26.9.7** |
|
| 版本 | **26.9.8** |
|
||||||
| 作者 | 云镜之端/SKYMirror |
|
| 作者 | 云镜之端/SKYMirror |
|
||||||
| 许可 | 保留所有权益(All Rights Reserved) |
|
| 许可 | 保留所有权益(All Rights Reserved) |
|
||||||
| 前置 | MCDReforged `>= 2.6.0` |
|
| 前置 | MCDReforged `>= 2.6.0` |
|
||||||
|
|||||||
@@ -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
|
# Truncate pathological NBT (huge books etc.) so the command stays valid
|
||||||
if len(item_snbt) > MAX_SNBT_LEN:
|
if len(item_snbt) > MAX_SNBT_LEN:
|
||||||
item_snbt = 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"):
|
if is_at_least(version, "1.21.5"):
|
||||||
hover = {"action": "show_item", "contents": item_snbt}
|
hover = {"action": "show_item", "contents": item_snbt}
|
||||||
else:
|
else:
|
||||||
hover = {"action": "show_item", "value": item_snbt}
|
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 = json.loads(_display_json(item_snbt))
|
||||||
display["color"] = "aqua"
|
display["color"] = "aqua"
|
||||||
display["hoverEvent"] = hover
|
display["hoverEvent"] = hover
|
||||||
|
|
||||||
click_comp = {
|
|
||||||
"text": f" [{click_label}]",
|
|
||||||
"color": "aqua",
|
|
||||||
"bold": True,
|
|
||||||
"underlined": True,
|
|
||||||
"hoverEvent": hover,
|
|
||||||
"clickEvent": click,
|
|
||||||
}
|
|
||||||
|
|
||||||
payload = [
|
payload = [
|
||||||
{"text": "[Iridium] ", "color": "gray"},
|
{"text": "[Iridium] ", "color": "gray"},
|
||||||
{"text": sanitize_name(player) or player, "color": "yellow"},
|
{"text": sanitize_name(player) or player, "color": "yellow"},
|
||||||
{"text": f" {tr('share_showing')} "},
|
{"text": f" {tr('share_showing')} "},
|
||||||
display,
|
display,
|
||||||
click_comp,
|
|
||||||
]
|
]
|
||||||
return "tellraw @a " + json.dumps(payload, ensure_ascii=False, separators=(",", ":"))
|
return "tellraw @a " + json.dumps(payload, ensure_ascii=False, separators=(",", ":"))
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"id": "iridium",
|
"id": "iridium",
|
||||||
"version": "26.9.7",
|
"version": "26.9.8",
|
||||||
"name": "Iridium",
|
"name": "Iridium",
|
||||||
"description": {
|
"description": {
|
||||||
"zh_cn": "物品展示 / 戴头 / 获取头颅 / 游戏内计算器 / 进服 MOTD",
|
"zh_cn": "物品展示 / 戴头 / 获取头颅 / 游戏内计算器 / 进服 MOTD",
|
||||||
|
|||||||
Reference in new issue
Block a user