From 90155651abeddc7b0fb05c6532351fc7a2de087d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=B6=E7=9A=93?= <1214946206@qq.com> Date: Tue, 30 Aug 2022 03:25:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 12 +++---- DEVDOC.md | 30 +++++++++------- data/admin.fzsd/functions/admin.mcfunction | 35 +++++++++++++++++++ .../functions/deep_install.mcfunction | 1 - .../functions/deep_reinstall.mcfunction | 1 - .../functions/deep_uninstall.mcfunction | 1 - data/admin.fzsd/functions/install.mcfunction | 1 - data/admin.fzsd/functions/load.mcfunction | 1 - .../functions/log_level/debug.mcfunction | 1 - .../functions/log_level/fine.mcfunction | 1 - .../functions/log_level/info.mcfunction | 1 - .../health/below_name/off.mcfunction | 3 +- .../health/below_name/on.mcfunction | 3 +- .../{ => module}/health/list/off.mcfunction | 3 +- .../{ => module}/health/list/on.mcfunction | 3 +- .../admin.fzsd/functions/reinstall.mcfunction | 1 - .../admin.fzsd/functions/uninstall.mcfunction | 1 - data/fzsd/functions/boot.mcfunction | 2 +- .../functions/module/health/load.mcfunction | 5 ++- .../module/health/try_load.mcfunction | 2 ++ .../module/interactor/try_load.mcfunction | 2 ++ .../module/scoreboard/clear_data.mcfunction | 1 + .../module/scoreboard/try_load.mcfunction | 2 ++ .../fzsd/functions/module/try_load.mcfunction | 6 ---- .../functions/module/health/try_load.json | 6 ++++ .../functions/module/interactor/try_load.json | 6 ++++ .../functions/module/scoreboard/load.json | 2 +- .../functions/module/scoreboard/try_load.json | 6 ++++ data/fzsd/tags/functions/module/try_load.json | 4 ++- scripts/fzsd_score.sc | 1 + 30 files changed, 101 insertions(+), 43 deletions(-) create mode 100644 data/admin.fzsd/functions/admin.mcfunction delete mode 100644 data/admin.fzsd/functions/deep_install.mcfunction delete mode 100644 data/admin.fzsd/functions/deep_reinstall.mcfunction delete mode 100644 data/admin.fzsd/functions/deep_uninstall.mcfunction delete mode 100644 data/admin.fzsd/functions/install.mcfunction delete mode 100644 data/admin.fzsd/functions/load.mcfunction delete mode 100644 data/admin.fzsd/functions/log_level/debug.mcfunction delete mode 100644 data/admin.fzsd/functions/log_level/fine.mcfunction delete mode 100644 data/admin.fzsd/functions/log_level/info.mcfunction rename data/admin.fzsd/functions/{ => module}/health/below_name/off.mcfunction (53%) rename data/admin.fzsd/functions/{ => module}/health/below_name/on.mcfunction (53%) rename data/admin.fzsd/functions/{ => module}/health/list/off.mcfunction (56%) rename data/admin.fzsd/functions/{ => module}/health/list/on.mcfunction (56%) delete mode 100644 data/admin.fzsd/functions/reinstall.mcfunction delete mode 100644 data/admin.fzsd/functions/uninstall.mcfunction create mode 100644 data/fzsd/functions/module/health/try_load.mcfunction create mode 100644 data/fzsd/functions/module/interactor/try_load.mcfunction create mode 100644 data/fzsd/functions/module/scoreboard/try_load.mcfunction delete mode 100644 data/fzsd/functions/module/try_load.mcfunction create mode 100644 data/fzsd/tags/functions/module/health/try_load.json create mode 100644 data/fzsd/tags/functions/module/interactor/try_load.json create mode 100644 data/fzsd/tags/functions/module/scoreboard/try_load.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 82fea75..34c531a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,14 +8,14 @@ "tagRemove": "tag ${1:target} remove ${2:tag}", "dataModifyStorageFromSelf": "data modify storage ${1:id} ${2:path} set from entity @s ${3:path}", "summonAec": "summon minecraft:area_effect_cloud ~ ~ ~ {Age: -2147483648, Duration: -1, WaitTime: -2147483648, Tags: [\"${1:tag}\"]}", - "logFine": "execute if score fz.logger.level fz.variable.integer matches ..300 run tellraw @a [{\"nbt\": \"fz.level.fine\", \"interpret\": true, \"storage\": \"fz:logger\"}, {\"text\": \"${log_fine}\"}", - "logDebug": "execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{\"nbt\": \"fz.level.debug\", \"interpret\": true, \"storage\": \"fz:logger\"}, {\"text\": \"${1:log_debug}\"}]", - "logInfo": "execute if score fz.logger.level fz.variable.integer matches ..500 run tellraw @a [{\"nbt\": \"fz.level.info\", \"interpret\": true, \"storage\": \"fz:logger\"}, {\"text\": \"${1:log_info}\"}]", - "logAlert": "execute if score fz.logger.level fz.variable.integer matches ..600 run tellraw @a [{\"nbt\": \"fz.level.alert\", \"interpret\": true, \"storage\": \"fz:logger\"}, {\"text\": \"${1:log_alert}\"}]", - "logError": "execute if score fz.logger.level fz.variable.integer matches ..800 run tellraw @a [{\"nbt\": \"fz.level.error\", \"interpret\": true, \"storage\": \"fz:logger\"}, {\"text\": \"${1:log_error}\"}]", + "logFine": "execute if score fzsd.logger.level fzsd.variable.integer matches ..300 run tellraw @a [{\"nbt\": \"fzsd.level.fine\", \"interpret\": true, \"storage\": \"fzsd:logger\"}, {\"text\": \"${log_fine}\"}", + "logDebug": "execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{\"nbt\": \"fzsd.level.debug\", \"interpret\": true, \"storage\": \"fzsd:logger\"}, {\"text\": \"${1:log_debug}\"}]", + "logInfo": "execute if score fzsd.logger.level fzsd.variable.integer matches ..500 run tellraw @a [{\"nbt\": \"fzsd.level.info\", \"interpret\": true, \"storage\": \"fzsd:logger\"}, {\"text\": \"${1:log_info}\"}]", + "logAlert": "execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a [{\"nbt\": \"fzsd.level.alert\", \"interpret\": true, \"storage\": \"fzsd:logger\"}, {\"text\": \"${1:log_alert}\"}]", + "logError": "execute if score fzsd.logger.level fzsd.variable.integer matches ..800 run tellraw @a [{\"nbt\": \"fzsd.level.error\", \"interpret\": true, \"storage\": \"fzsd:logger\"}, {\"text\": \"${1:log_error}\"}]", "TEXT": "{\"text\": \"${1:TEXT}\", \"color\": \"${2:COLOR}\"}", "storageText": "{\"nbt\": \"${1:NBT}\", \"interpret\": true, \"storage\": \"${2:A namespaced ID}\"}", - "ifInstalled": "execute if data storage fz:installed fz.module{${1:module_name}:1b} run ${tellraw}" + "ifInstalled": "execute if data storage fzsd:installed fzsd.module{${1:module_name}:1b} run ${tellraw}" }, "datapack.env.cmdVersion": "1.19", "datapack.env.jsonVersion": "1.19", diff --git a/DEVDOC.md b/DEVDOC.md index c66ab31..d9cf107 100644 --- a/DEVDOC.md +++ b/DEVDOC.md @@ -5,19 +5,19 @@ - `函数`,指数据包`<命名空间>/functions`目录下的`.mcfunction`文件 - `标签`,指数据包`<命名空间>/tags`目录下的`.json`文件 - `覆盖标签并填入函数`时,`replace`为`true` - ``` json - { - "replace": true, - "values": ... - } - ``` + ``` json + { + "replace": true, + "values": ... + } + ``` - `向标签中注册函数`时,`replace`为`false` - ``` json - { - "replace": false, - "values": ... - } - ``` + ``` json + { + "replace": false, + "values": ... + } + ``` ## 基本要求 @@ -60,7 +60,7 @@ - 使用方法:`execute if score fzsd.logger.level fzsd.variable.integer matches ..600 run tellraw @a [{"nbt": "fzsd.level.alert", "interpret": true, "storage": "fzsd:logger"}, {"text": "你的日志"}` #### 意外 Exception -###### 暂不提供 +- 暂不提供 #### 错误 Error - 等级:800 @@ -106,6 +106,10 @@ ## 自定义模块 +### 排除假人 +- 如果您不想对假人执行您的命令,请将以下语句添加在您要执行的命令之前: +
execute if predicate fzsd:is_real_player
+ #### 注册安装、卸载、加载函数 - 在下列标签中注册你的安装、卸载、加载函数: - [`#fzsd:system/install/module`](data/fzsd/tags/functions/system/install/module.json) diff --git a/data/admin.fzsd/functions/admin.mcfunction b/data/admin.fzsd/functions/admin.mcfunction new file mode 100644 index 0000000..ee556a3 --- /dev/null +++ b/data/admin.fzsd/functions/admin.mcfunction @@ -0,0 +1,35 @@ +tellraw @s {"text": "管理员页面:", "color": "red"} + + +tellraw @s [{"text": "全局:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/reload"}, "hoverEvent": {"action": "show_text", "contents": {"text": "重载", "color": "yellow"}}}, {"text": "重载", "color": "yellow"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:install"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "安装:", "color": "dark_green"}, {"text": "仅安装上次卸载前已安装的模块", "color": "red"}]}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:uninstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "卸载:", "color": "dark_red"}, {"text": "将保留模块安装记录", "color": "red"}]}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:reinstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "重装:", "color": "gold"}, {"text": "可能可以修复一些奇怪问题,", "color": "white"}, {"text": "将保留模块安装记录", "color": "red"}]}}, {"text": "重装", "color": "gold"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_install"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度安装:", "color": "dark_green"}, {"text": "将安装所有模块", "color": "red"}]}}, {"text": "深度安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_uninstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度卸载:", "color": "dark_red"}, {"text": "将清除模块安装记录", "color": "red"}]}}, {"text": "深度卸载", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_reinstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度重装:", "color": "gold"}, {"text": "可能可以修复一些奇怪问题,", "color": "white"}, {"text": "将清除模块安装记录", "color": "red"}]}}, {"text": "深度重装", "color": "gold"}, {"text": "]"}]]] + + +tellraw @s [{"text": "日志等级:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function fzsd:logger/level/fine"}, "hoverEvent": {"action": "show_text", "contents": {"text": "详细", "color": "gray"}}}, {"text": "详细", "color": "gray"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function fzsd:logger/level/debug"}, "hoverEvent": {"action": "show_text", "contents": {"text": "调试", "color": "dark_aqua"}}}, {"text": "调试", "color": "dark_aqua"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function fzsd:logger/level/info"}, "hoverEvent": {"action": "show_text", "contents": {"text": "信息", "color": "green"}}}, {"text": "信息", "color": "green"}, {"text": "]"}]]] + + +tellraw @s [{"text": "血量显示:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/health/install"}, "hoverEvent": {"action": "show_text", "contents": {"text": "安装", "color": "dark_green"}}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/health/uninstall"}, "hoverEvent": {"action": "show_text", "contents": {"text": "卸载", "color": "dark_red"}}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}]]] + +tellraw @s [{"text": "- 名牌下方:", "color": "gray"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function admin.fzsd:module/health/below_name/on"}, "hoverEvent": {"action": "show_text", "contents": {"text": "显示", "color": "dark_green"}}}, {"text": "显示", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function admin.fzsd:module/health/below_name/off"}, "hoverEvent": {"action": "show_text", "contents": {"text": "隐藏", "color": "dark_red"}}}, {"text": "隐藏", "color": "dark_red"}, {"text": "]"}]]] + +tellraw @s [{"text": "- 玩家列表内:", "color": "gray"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function admin.fzsd:module/health/list/on"}, "hoverEvent": {"action": "show_text", "contents": {"text": "显示", "color": "dark_green"}}}, {"text": "显示", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function admin.fzsd:module/health/list/off"}, "hoverEvent": {"action": "show_text", "contents": {"text": "隐藏", "color": "dark_red"}}}, {"text": "隐藏", "color": "dark_red"}, {"text": "]"}]]] + + +tellraw @s [{"text": "玩家位置:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/here/install"}, "hoverEvent": {"action": "show_text", "contents": {"text": "安装", "color": "dark_green"}}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/here/uninstall"}, "hoverEvent": {"action": "show_text", "contents": {"text": "卸载", "color": "dark_red"}}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}]]] + + +tellraw @s [{"text": "交互器:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/interactor/install"}, "hoverEvent": {"action": "show_text", "contents": {"text": "安装", "color": "dark_green"}}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/interactor/uninstall"}, "hoverEvent": {"action": "show_text", "contents": {"text": "卸载", "color": "dark_red"}}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}]]] + + +tellraw @s [{"text": "登录消息:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/join_message/install"}, "hoverEvent": {"action": "show_text", "contents": {"text": "安装", "color": "dark_green"}}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/join_message/uninstall"}, "hoverEvent": {"action": "show_text", "contents": {"text": "卸载", "color": "dark_red"}}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}]]] + + +tellraw @s [{"text": "上一死亡点:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/last_death/install"}, "hoverEvent": {"action": "show_text", "contents": {"text": "安装", "color": "dark_green"}}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/last_death/uninstall"}, "hoverEvent": {"action": "show_text", "contents": {"text": "卸载", "color": "dark_red"}}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}]]] + + +tellraw @s [{"text": "上次穿出的下界传送门:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/last_nether_portal/install"}, "hoverEvent": {"action": "show_text", "contents": {"text": "安装", "color": "dark_green"}}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/last_nether_portal/uninstall"}, "hoverEvent": {"action": "show_text", "contents": {"text": "卸载", "color": "dark_red"}}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}]]] + + +tellraw @s [{"text": "上一出生点:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/last_spawn_point/install"}, "hoverEvent": {"action": "show_text", "contents": {"text": "安装", "color": "dark_green"}}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/last_spawn_point/uninstall"}, "hoverEvent": {"action": "show_text", "contents": {"text": "卸载", "color": "dark_red"}}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}]]] + + +tellraw @s [{"text": "计分板:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/scoreboard/install"}, "hoverEvent": {"action": "show_text", "contents": {"text": "安装", "color": "dark_green"}}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:module/scoreboard/uninstall"}, "hoverEvent": {"action": "show_text", "contents": {"text": "卸载", "color": "dark_red"}}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}]]] \ No newline at end of file diff --git a/data/admin.fzsd/functions/deep_install.mcfunction b/data/admin.fzsd/functions/deep_install.mcfunction deleted file mode 100644 index c4295c7..0000000 --- a/data/admin.fzsd/functions/deep_install.mcfunction +++ /dev/null @@ -1 +0,0 @@ -function #fzsd:deep_install \ No newline at end of file diff --git a/data/admin.fzsd/functions/deep_reinstall.mcfunction b/data/admin.fzsd/functions/deep_reinstall.mcfunction deleted file mode 100644 index bd3920e..0000000 --- a/data/admin.fzsd/functions/deep_reinstall.mcfunction +++ /dev/null @@ -1 +0,0 @@ -function #fzsd:deep_reinstall \ No newline at end of file diff --git a/data/admin.fzsd/functions/deep_uninstall.mcfunction b/data/admin.fzsd/functions/deep_uninstall.mcfunction deleted file mode 100644 index dc0f0dd..0000000 --- a/data/admin.fzsd/functions/deep_uninstall.mcfunction +++ /dev/null @@ -1 +0,0 @@ -function #fzsd:deep_uninstall \ No newline at end of file diff --git a/data/admin.fzsd/functions/install.mcfunction b/data/admin.fzsd/functions/install.mcfunction deleted file mode 100644 index 0b7f47e..0000000 --- a/data/admin.fzsd/functions/install.mcfunction +++ /dev/null @@ -1 +0,0 @@ -function #fzsd:install \ No newline at end of file diff --git a/data/admin.fzsd/functions/load.mcfunction b/data/admin.fzsd/functions/load.mcfunction deleted file mode 100644 index eb03a30..0000000 --- a/data/admin.fzsd/functions/load.mcfunction +++ /dev/null @@ -1 +0,0 @@ -function #fzsd:load \ No newline at end of file diff --git a/data/admin.fzsd/functions/log_level/debug.mcfunction b/data/admin.fzsd/functions/log_level/debug.mcfunction deleted file mode 100644 index 2511e0b..0000000 --- a/data/admin.fzsd/functions/log_level/debug.mcfunction +++ /dev/null @@ -1 +0,0 @@ -function fzsd:logger/level/debug \ No newline at end of file diff --git a/data/admin.fzsd/functions/log_level/fine.mcfunction b/data/admin.fzsd/functions/log_level/fine.mcfunction deleted file mode 100644 index 045cdb1..0000000 --- a/data/admin.fzsd/functions/log_level/fine.mcfunction +++ /dev/null @@ -1 +0,0 @@ -function fzsd:logger/level/fine \ No newline at end of file diff --git a/data/admin.fzsd/functions/log_level/info.mcfunction b/data/admin.fzsd/functions/log_level/info.mcfunction deleted file mode 100644 index 6536ceb..0000000 --- a/data/admin.fzsd/functions/log_level/info.mcfunction +++ /dev/null @@ -1 +0,0 @@ -function fzsd:logger/level/info \ No newline at end of file diff --git a/data/admin.fzsd/functions/health/below_name/off.mcfunction b/data/admin.fzsd/functions/module/health/below_name/off.mcfunction similarity index 53% rename from data/admin.fzsd/functions/health/below_name/off.mcfunction rename to data/admin.fzsd/functions/module/health/below_name/off.mcfunction index fa69e51..3ab94fd 100644 --- a/data/admin.fzsd/functions/health/below_name/off.mcfunction +++ b/data/admin.fzsd/functions/module/health/below_name/off.mcfunction @@ -1 +1,2 @@ -data modify storage fzsd:config fzsd.module.health.display.below_name set value 0b \ No newline at end of file +data modify storage fzsd:config fzsd.module.health.display.below_name set value 0b +function #fzsd:module/health/try_load \ No newline at end of file diff --git a/data/admin.fzsd/functions/health/below_name/on.mcfunction b/data/admin.fzsd/functions/module/health/below_name/on.mcfunction similarity index 53% rename from data/admin.fzsd/functions/health/below_name/on.mcfunction rename to data/admin.fzsd/functions/module/health/below_name/on.mcfunction index d6ab4c7..d46860b 100644 --- a/data/admin.fzsd/functions/health/below_name/on.mcfunction +++ b/data/admin.fzsd/functions/module/health/below_name/on.mcfunction @@ -1 +1,2 @@ -data modify storage fzsd:config fzsd.module.health.display.below_name set value 1b \ No newline at end of file +data modify storage fzsd:config fzsd.module.health.display.below_name set value 1b +function #fzsd:module/health/try_load \ No newline at end of file diff --git a/data/admin.fzsd/functions/health/list/off.mcfunction b/data/admin.fzsd/functions/module/health/list/off.mcfunction similarity index 56% rename from data/admin.fzsd/functions/health/list/off.mcfunction rename to data/admin.fzsd/functions/module/health/list/off.mcfunction index 5cd872a..602d8ab 100644 --- a/data/admin.fzsd/functions/health/list/off.mcfunction +++ b/data/admin.fzsd/functions/module/health/list/off.mcfunction @@ -1 +1,2 @@ -data modify storage fzsd:config fzsd.module.health.display.list set value 0b \ No newline at end of file +data modify storage fzsd:config fzsd.module.health.display.list set value 0b +function #fzsd:module/health/try_load \ No newline at end of file diff --git a/data/admin.fzsd/functions/health/list/on.mcfunction b/data/admin.fzsd/functions/module/health/list/on.mcfunction similarity index 56% rename from data/admin.fzsd/functions/health/list/on.mcfunction rename to data/admin.fzsd/functions/module/health/list/on.mcfunction index a848936..5970a98 100644 --- a/data/admin.fzsd/functions/health/list/on.mcfunction +++ b/data/admin.fzsd/functions/module/health/list/on.mcfunction @@ -1 +1,2 @@ -data modify storage fzsd:config fzsd.module.health.display.list set value 1b \ No newline at end of file +data modify storage fzsd:config fzsd.module.health.display.list set value 1b +function #fzsd:module/health/try_load \ No newline at end of file diff --git a/data/admin.fzsd/functions/reinstall.mcfunction b/data/admin.fzsd/functions/reinstall.mcfunction deleted file mode 100644 index ecfd0fd..0000000 --- a/data/admin.fzsd/functions/reinstall.mcfunction +++ /dev/null @@ -1 +0,0 @@ -function #fzsd:reinstall \ No newline at end of file diff --git a/data/admin.fzsd/functions/uninstall.mcfunction b/data/admin.fzsd/functions/uninstall.mcfunction deleted file mode 100644 index b93eff7..0000000 --- a/data/admin.fzsd/functions/uninstall.mcfunction +++ /dev/null @@ -1 +0,0 @@ -function #fzsd:uninstall \ No newline at end of file diff --git a/data/fzsd/functions/boot.mcfunction b/data/fzsd/functions/boot.mcfunction index 8acc445..325bace 100644 --- a/data/fzsd/functions/boot.mcfunction +++ b/data/fzsd/functions/boot.mcfunction @@ -1,4 +1,4 @@ -execute store success storage fzsd:version fzsd.need_update int 1 run data merge storage fzsd:version {fzsd: {version: '3.0.0-beta.8'}} +execute store success storage fzsd:version fzsd.need_update int 1 run data merge storage fzsd:version {fzsd: {version: '3.0.0-beta.9'}} execute if data storage fzsd:version fzsd{need_update: 1} run function fzsd:system/update function fzsd:system/carpet/try_load_fzsd_score function #fzsd:load diff --git a/data/fzsd/functions/module/health/load.mcfunction b/data/fzsd/functions/module/health/load.mcfunction index 1bc1863..bbd6e7c 100644 --- a/data/fzsd/functions/module/health/load.mcfunction +++ b/data/fzsd/functions/module/health/load.mcfunction @@ -1,4 +1,7 @@ execute unless data storage fzsd:config fzsd.module.health.display{below_name: 0b} run scoreboard objectives setdisplay belowName fzsd.module.health execute if data storage fzsd:config fzsd.module.health.display{below_name: 0b} run scoreboard objectives setdisplay belowName execute unless data storage fzsd:config fzsd.module.health.display{list: 0b} run scoreboard objectives setdisplay list fzsd.module.health -execute if data storage fzsd:config fzsd.module.health.display{list: 0b} run scoreboard objectives setdisplay list \ No newline at end of file +execute if data storage fzsd:config fzsd.module.health.display{list: 0b} run scoreboard objectives setdisplay list + +## 日志 +execute if score fzsd.logger.level fzsd.variable.integer matches ..500 run tellraw @a [{"nbt": "fzsd.level.info", "interpret": true, "storage": "fzsd:logger"}, {"text": "已加载组件:玩家血量显示"}] \ No newline at end of file diff --git a/data/fzsd/functions/module/health/try_load.mcfunction b/data/fzsd/functions/module/health/try_load.mcfunction new file mode 100644 index 0000000..1095699 --- /dev/null +++ b/data/fzsd/functions/module/health/try_load.mcfunction @@ -0,0 +1,2 @@ +## 判断是否安装,如果安装则加载 +execute if data storage fzsd:install fzsd.module{health:1b} run function #fzsd:module/health/load \ No newline at end of file diff --git a/data/fzsd/functions/module/interactor/try_load.mcfunction b/data/fzsd/functions/module/interactor/try_load.mcfunction new file mode 100644 index 0000000..a86a1b4 --- /dev/null +++ b/data/fzsd/functions/module/interactor/try_load.mcfunction @@ -0,0 +1,2 @@ +## 判断是否安装,如果安装则加载 +execute if data storage fzsd:install fzsd.module{interactor:1b} run function #fzsd:module/interactor/load \ No newline at end of file diff --git a/data/fzsd/functions/module/scoreboard/clear_data.mcfunction b/data/fzsd/functions/module/scoreboard/clear_data.mcfunction index b4f7e2b..f38e604 100644 --- a/data/fzsd/functions/module/scoreboard/clear_data.mcfunction +++ b/data/fzsd/functions/module/scoreboard/clear_data.mcfunction @@ -2,6 +2,7 @@ ## 删除计分板 ### 总榜 +scoreboard objectives remove fzsd.module.scoreboard.assign.general scoreboard objectives remove fzsd.module.scoreboard.display.general ### 活跃度 scoreboard objectives remove fzsd.module.scoreboard.display.activation diff --git a/data/fzsd/functions/module/scoreboard/try_load.mcfunction b/data/fzsd/functions/module/scoreboard/try_load.mcfunction new file mode 100644 index 0000000..f5c60bd --- /dev/null +++ b/data/fzsd/functions/module/scoreboard/try_load.mcfunction @@ -0,0 +1,2 @@ +## 判断是否安装,如果安装则加载 +execute if data storage fzsd:install fzsd.module{scoreboard:1b} run function #fzsd:module/scoreboard/load \ No newline at end of file diff --git a/data/fzsd/functions/module/try_load.mcfunction b/data/fzsd/functions/module/try_load.mcfunction deleted file mode 100644 index 48b411c..0000000 --- a/data/fzsd/functions/module/try_load.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -# 调用者:#fzsd:module/try_load - -## 判断是否安装,如果安装则加载 -execute if data storage fzsd:install fzsd.module{health:1b} run function #fzsd:module/health/load -execute if data storage fzsd:install fzsd.module{interactor:1b} run function #fzsd:module/interactor/load -execute if data storage fzsd:install fzsd.module{scoreboard:1b} run function #fzsd:module/scoreboard/load diff --git a/data/fzsd/tags/functions/module/health/try_load.json b/data/fzsd/tags/functions/module/health/try_load.json new file mode 100644 index 0000000..717bae1 --- /dev/null +++ b/data/fzsd/tags/functions/module/health/try_load.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fzsd:module/health/try_load" + ] +} \ No newline at end of file diff --git a/data/fzsd/tags/functions/module/interactor/try_load.json b/data/fzsd/tags/functions/module/interactor/try_load.json new file mode 100644 index 0000000..13eca8f --- /dev/null +++ b/data/fzsd/tags/functions/module/interactor/try_load.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fzsd:module/interactor/try_load" + ] +} \ No newline at end of file diff --git a/data/fzsd/tags/functions/module/scoreboard/load.json b/data/fzsd/tags/functions/module/scoreboard/load.json index cfd72cf..c963f2f 100644 --- a/data/fzsd/tags/functions/module/scoreboard/load.json +++ b/data/fzsd/tags/functions/module/scoreboard/load.json @@ -3,7 +3,7 @@ "replace": false, "values": [ "fzsd:module/scoreboard/display/reset_id", - "fzsd:module/scoreboard/display/register_id", + "#fzsd:module/scoreboard/display/register_id", "#fzsd:module/scoreboard/display/set_text", "fzsd:module/scoreboard/display/carousel/loop", "fzsd:module/scoreboard/load" diff --git a/data/fzsd/tags/functions/module/scoreboard/try_load.json b/data/fzsd/tags/functions/module/scoreboard/try_load.json new file mode 100644 index 0000000..0236037 --- /dev/null +++ b/data/fzsd/tags/functions/module/scoreboard/try_load.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fzsd:module/scoreboard/try_load" + ] +} \ No newline at end of file diff --git a/data/fzsd/tags/functions/module/try_load.json b/data/fzsd/tags/functions/module/try_load.json index 19142d7..53a3ee1 100644 --- a/data/fzsd/tags/functions/module/try_load.json +++ b/data/fzsd/tags/functions/module/try_load.json @@ -2,6 +2,8 @@ "__comment": "调用者:fzsd:load", "replace": false, "values": [ - "fzsd:module/try_load" + "#fzsd:module/health/try_load", + "#fzsd:module/interactor/try_load", + "#fzsd:module/scoreboard/try_load" ] } \ No newline at end of file diff --git a/scripts/fzsd_score.sc b/scripts/fzsd_score.sc index d4919ca..97fd57e 100644 --- a/scripts/fzsd_score.sc +++ b/scripts/fzsd_score.sc @@ -123,6 +123,7 @@ update_from(fzsd_version) -> ( ['tradingCounter', 'fzsd.module.scoreboard.display.trade_count'], ['bedrockBreaked', 'fzsd.module.scoreboard.display.bedrock_broke_count'], ['fz.aviate1m', 'fzsd.module.scoreboard.display.aviating_distance'] + ['fz.bbl', 'fzsd.extra.bbl.display'] ] ), fzsd_version == '3.0-beta.4',