feat: log command operations to server console (26.9.4)

This commit is contained in:
SKYMirror committed 2026-09-13 03:31:29 +08:00
1 parent b464b5ba5e
commit 080b1054b7
7 files changed
+12 -2

No files matched your search

+5
View File
@@ -2,6 +2,11 @@
本文件记录 Iridium 的重要变更。
## [26.9.4] - 2026-09-13
### Added
- 操作日志:`!!share` / `!!hat` / `!!head` / `!!c` 成功时写入 MCDR 控制台(`[Iridium] ...`)
## [26.9.3] - 2026-09-13
### Fixed
+1 -1
View File
@@ -4,7 +4,7 @@ MCDReforged 插件:物品展示 / 戴头 / 获取头颅 / 游戏内计算器 /
| | |
|---|---|
| 版本 | **26.9.3** |
| 版本 | **26.9.4** |
| 作者 | 云镜之端/SKYMirror |
| 许可 | 保留所有权益(All Rights Reserved) |
| 前置 | MCDReforged `>= 2.6.0` |
+2
View File
@@ -92,6 +92,8 @@ def do_calc(server: PluginServerInterface, src: CommandSource, context: dict) ->
return
out = _format_result(result)
who = src.get_info().player if src.is_player else "console"
server.logger.info(f"[Iridium] !!c: {who} {expression} = {out}")
# Private reply to avoid flooding public chat
src.reply(
RTextList(
+1
View File
@@ -329,6 +329,7 @@ def do_hat(server: PluginServerInterface, src: CommandSource) -> None:
if _do_swap(server, src, player, version):
mark_cooldown(player, "hat")
server.logger.info(f"[Iridium] !!hat: {player} swapped hand/head gear")
def register(server: PluginServerInterface) -> None:
+1
View File
@@ -40,6 +40,7 @@ def do_head(server: PluginServerInterface, src: CommandSource, context: dict) ->
safe_execute(server, _give_head_command(player, safe_target, version))
mark_cooldown(player, "head")
server.logger.info(f"[Iridium] !!head: {player} -> head of {safe_target}")
src.reply(RText(tr("head_success", safe_target), RColor.green))
+1
View File
@@ -118,6 +118,7 @@ def _send_share(
safe_execute(server, _build_tellraw(player, item_snbt, version))
if config.share_sound:
safe_execute(server, _sound_command(version))
server.logger.info(f"[Iridium] !!share: {player} shared an item ({len(item_snbt)} chars)")
src.reply(RText(tr("share_done"), RColor.green))
return True
+1 -1
View File
@@ -1,6 +1,6 @@
{
"id": "iridium",
"version": "26.9.3",
"version": "26.9.4",
"name": "Iridium",
"description": {
"zh_cn": "物品展示 / 戴头 / 获取头颅 / 游戏内计算器 / 进服 MOTD",