From 5c75fa41273eafe1ff637f6fdc34f51f9fedab50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=B6=E7=9A=93?= <1214946206@qq.com> Date: Thu, 23 Jun 2022 20:06:15 +0800 Subject: [PATCH] . --- data/fz/advancements/config/sneak.json | 3 +++ .../if_install.mcfunction} | 0 .../if_load.mcfunction} | 0 .../if_update.mcfunction} | 0 .../install_or_else.mcfunction} | 0 .../load_or_else.mcfunction} | 0 .../update_or_else.mcfunction} | 0 data/fz/functions/install.mcfunction | 14 +++++++++++++- data/fz/functions/load.mcfunction | 5 +++++ data/fz/functions/logger/debug/false.mcfunction | 1 + data/fz/functions/logger/debug/true.mcfunction | 1 + data/fz/functions/logger/install.mcfunction | 17 +++++++++++++++++ data/fz/functions/logger/load.mcfunction | 14 -------------- data/fz/functions/logger/uninstall.mcfunction | 3 +++ data/fz/functions/logger/unload.mcfunction | 4 ---- .../functions/module/config/buttons.mcfunction | 0 .../functions/module/config/install.mcfunction | 0 data/fz/functions/module/config/load.mcfunction | 0 .../functions/module/config/on_click.mcfunction | 0 .../functions/module/config/trigger.mcfunction | 0 .../module/config/uninstall.mcfunction | 0 .../config/subscribe/activation.mcfunction | 2 +- .../subscribe/aviating_distance.mcfunction | 2 +- .../config/subscribe/carousel.mcfunction | 2 +- .../config/subscribe/damage_taken.mcfunction | 2 +- .../config/subscribe/death_count.mcfunction | 2 +- .../config/subscribe/dig_count.mcfunction | 2 +- .../config/subscribe/fisning_count.mcfunction | 2 +- .../config/subscribe/general.mcfunction | 2 +- .../config/subscribe/kill_count.mcfunction | 2 +- .../scoreboard/config/subscribe/off.mcfunction | 2 +- .../config/subscribe/trade_count.mcfunction | 2 +- .../module/scoreboard/install.mcfunction | 4 ++-- .../functions/module/scoreboard/load.mcfunction | 3 +-- .../module/scoreboard/uninstall.mcfunction | 6 +++--- .../fz/functions/module/sweeper/load.mcfunction | 0 data/fz/functions/module/try_load.mcfunction | 6 ++++++ data/fz/functions/uninstall.mcfunction | 12 ++++++++++++ data/fz/tags/functions/install.json | 7 +++++++ data/fz/tags/functions/load.json | 7 +++++++ data/fz/tags/functions/logger/install.json | 6 ++++++ data/fz/tags/functions/logger/uninstall.json | 6 ++++++ .../tags/functions/module/config/install.json | 7 +++++++ data/fz/tags/functions/module/config/load.json | 7 +++++++ .../tags/functions/module/config/uninstall.json | 7 +++++++ data/fz/tags/functions/module/install.json | 9 +++++++++ .../functions/module/scoreboard/clear_data.json | 1 + .../functions/module/scoreboard/install.json | 7 +++++++ .../tags/functions/module/scoreboard/load.json | 7 +++++++ .../functions/module/scoreboard/uninstall.json | 7 +++++++ .../tags/functions/module/sweeper/install.json | 7 +++++++ data/fz/tags/functions/module/sweeper/load.json | 7 +++++++ .../functions/module/sweeper/uninstall.json | 7 +++++++ data/fz/tags/functions/module/try_load.json | 7 +++++++ data/fz/tags/functions/module/uninstall.json | 9 +++++++++ data/fz/tags/functions/uninstall.json | 7 +++++++ 56 files changed, 200 insertions(+), 37 deletions(-) create mode 100644 data/fz/advancements/config/sneak.json rename data/fz/functions/{config/buttons.mcfunction => boot_manager/if_install.mcfunction} (100%) rename data/fz/functions/{config/load.mcfunction => boot_manager/if_load.mcfunction} (100%) rename data/fz/functions/{config/on_click.mcfunction => boot_manager/if_update.mcfunction} (100%) rename data/fz/functions/{config/trigger.mcfunction => boot_manager/install_or_else.mcfunction} (100%) rename data/fz/functions/{config/uninstall.mcfunction => boot_manager/load_or_else.mcfunction} (100%) rename data/fz/functions/{config/unload.mcfunction => boot_manager/update_or_else.mcfunction} (100%) create mode 100644 data/fz/functions/logger/install.mcfunction delete mode 100644 data/fz/functions/logger/load.mcfunction create mode 100644 data/fz/functions/logger/uninstall.mcfunction delete mode 100644 data/fz/functions/logger/unload.mcfunction create mode 100644 data/fz/functions/module/config/buttons.mcfunction create mode 100644 data/fz/functions/module/config/install.mcfunction create mode 100644 data/fz/functions/module/config/load.mcfunction create mode 100644 data/fz/functions/module/config/on_click.mcfunction create mode 100644 data/fz/functions/module/config/trigger.mcfunction create mode 100644 data/fz/functions/module/config/uninstall.mcfunction create mode 100644 data/fz/functions/module/sweeper/load.mcfunction create mode 100644 data/fz/functions/module/try_load.mcfunction create mode 100644 data/fz/tags/functions/install.json create mode 100644 data/fz/tags/functions/load.json create mode 100644 data/fz/tags/functions/logger/install.json create mode 100644 data/fz/tags/functions/logger/uninstall.json create mode 100644 data/fz/tags/functions/module/config/install.json create mode 100644 data/fz/tags/functions/module/config/load.json create mode 100644 data/fz/tags/functions/module/config/uninstall.json create mode 100644 data/fz/tags/functions/module/install.json create mode 100644 data/fz/tags/functions/module/scoreboard/install.json create mode 100644 data/fz/tags/functions/module/scoreboard/load.json create mode 100644 data/fz/tags/functions/module/scoreboard/uninstall.json create mode 100644 data/fz/tags/functions/module/sweeper/install.json create mode 100644 data/fz/tags/functions/module/sweeper/load.json create mode 100644 data/fz/tags/functions/module/sweeper/uninstall.json create mode 100644 data/fz/tags/functions/module/try_load.json create mode 100644 data/fz/tags/functions/module/uninstall.json create mode 100644 data/fz/tags/functions/uninstall.json diff --git a/data/fz/advancements/config/sneak.json b/data/fz/advancements/config/sneak.json new file mode 100644 index 0000000..544b7b4 --- /dev/null +++ b/data/fz/advancements/config/sneak.json @@ -0,0 +1,3 @@ +{ + +} \ No newline at end of file diff --git a/data/fz/functions/config/buttons.mcfunction b/data/fz/functions/boot_manager/if_install.mcfunction similarity index 100% rename from data/fz/functions/config/buttons.mcfunction rename to data/fz/functions/boot_manager/if_install.mcfunction diff --git a/data/fz/functions/config/load.mcfunction b/data/fz/functions/boot_manager/if_load.mcfunction similarity index 100% rename from data/fz/functions/config/load.mcfunction rename to data/fz/functions/boot_manager/if_load.mcfunction diff --git a/data/fz/functions/config/on_click.mcfunction b/data/fz/functions/boot_manager/if_update.mcfunction similarity index 100% rename from data/fz/functions/config/on_click.mcfunction rename to data/fz/functions/boot_manager/if_update.mcfunction diff --git a/data/fz/functions/config/trigger.mcfunction b/data/fz/functions/boot_manager/install_or_else.mcfunction similarity index 100% rename from data/fz/functions/config/trigger.mcfunction rename to data/fz/functions/boot_manager/install_or_else.mcfunction diff --git a/data/fz/functions/config/uninstall.mcfunction b/data/fz/functions/boot_manager/load_or_else.mcfunction similarity index 100% rename from data/fz/functions/config/uninstall.mcfunction rename to data/fz/functions/boot_manager/load_or_else.mcfunction diff --git a/data/fz/functions/config/unload.mcfunction b/data/fz/functions/boot_manager/update_or_else.mcfunction similarity index 100% rename from data/fz/functions/config/unload.mcfunction rename to data/fz/functions/boot_manager/update_or_else.mcfunction diff --git a/data/fz/functions/install.mcfunction b/data/fz/functions/install.mcfunction index ac399ce..f1f735c 100644 --- a/data/fz/functions/install.mcfunction +++ b/data/fz/functions/install.mcfunction @@ -1,2 +1,14 @@ +# 调用者:#fz:install + +function #fz:logger/install + ## 整数类型 -scoreboard objectives add fz.variable.integer dummy \ No newline at end of file +scoreboard objectives add fz.variable.integer dummy + +## 安装模块 +function #fz:module/install + +## 标记为已安装 +data modify storage fz:install_manager fz.global set value 1b + +tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "安装完成!"}] \ No newline at end of file diff --git a/data/fz/functions/load.mcfunction b/data/fz/functions/load.mcfunction index e69de29..134f6a5 100644 --- a/data/fz/functions/load.mcfunction +++ b/data/fz/functions/load.mcfunction @@ -0,0 +1,5 @@ +# 调用者:#fz:load + +function #fz:module/try_load + +tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "加载完成!"}] \ No newline at end of file diff --git a/data/fz/functions/logger/debug/false.mcfunction b/data/fz/functions/logger/debug/false.mcfunction index e69de29..eaf2acc 100644 --- a/data/fz/functions/logger/debug/false.mcfunction +++ b/data/fz/functions/logger/debug/false.mcfunction @@ -0,0 +1 @@ +data modify storage fz:logger fz.debug set value 0b \ No newline at end of file diff --git a/data/fz/functions/logger/debug/true.mcfunction b/data/fz/functions/logger/debug/true.mcfunction index e69de29..71a6fee 100644 --- a/data/fz/functions/logger/debug/true.mcfunction +++ b/data/fz/functions/logger/debug/true.mcfunction @@ -0,0 +1 @@ +data modify storage fz:logger fz.debug set value 1b \ No newline at end of file diff --git a/data/fz/functions/logger/install.mcfunction b/data/fz/functions/logger/install.mcfunction new file mode 100644 index 0000000..2fa83a9 --- /dev/null +++ b/data/fz/functions/logger/install.mcfunction @@ -0,0 +1,17 @@ +# 调用者:#fz:logger/install +##### 使用方式,形如:tellraw @a [{"nbt": "fz.exception.load_without_install_exception", "interpret": true, "storage": "fz:logger"}, {"text": "计分板"}] + +## 前缀 +### 根 +data modify storage fz:logger fz.root set value '[{"text": "", "color": "white"}, {"text": "[", "color": "dark_gray"}, {"text": "FZD", "color": "gold"}, {"text": "]", "color": "dark_gray"}]' +### 不同日志等级 +data modify storage fz:logger fz.level.debug set value '[{"text": "", "color": "dark_aqua"}, {"nbt": "fz.root", "interpret": true, "storage": "fz:logger"}, {"text": "[调试]"}]' +data modify storage fz:logger fz.level.info set value '[{"text": "", "color": "green"}, {"nbt": "fz.root", "interpret": true, "storage": "fz:logger"}, {"text": "[信息]"}]' +data modify storage fz:logger fz.level.warn set value '[{"text": "", "color": "yellow"}, {"nbt": "fz.root", "interpret": true, "storage": "fz:logger"}, {"text": "[警告]"}]' +data modify storage fz:logger fz.level.error set value '[{"text": "", "color": "red"}, {"nbt": "root", "interpret": true, "storage": "fz:logger"}, {"text": "[错误]"}]' + +## 异常 +data modify storage fz:logger fz.exception.load_without_install_exception set value '[{"nbt": "fz.level.error", "interpret": true, "storage": "fz:logger"}, {"text": "模块在未安装时被加载:"}]' + +## 默认关闭调试 +execute unless data storage fz:logger fz.debug run data modify storage fz:logger fz.debug set value 0b \ No newline at end of file diff --git a/data/fz/functions/logger/load.mcfunction b/data/fz/functions/logger/load.mcfunction deleted file mode 100644 index 8ca15a5..0000000 --- a/data/fz/functions/logger/load.mcfunction +++ /dev/null @@ -1,14 +0,0 @@ -# 调用者:#fz:logger/load -##### 使用方式,形如:tellraw @a [{"nbt": "exception.load_without_install_exception", "interpret": true, "storage": "fz:logger"}, {"text": "计分板"}] - -## 前缀 -### 根 -data modify storage fz:logger root set value '[{"text": "", "color": "white"}, {"text": "[", "color": "dark_gray"}, {"text": "FZD", "color": "gold"}, {"text": "]", "color": "dark_gray"}]' -### 不同日志等级 -data modify storage fz:logger level.debug set value '[{"text": "", "color": "dark_aqua"}, {"nbt": "root", "interpret": true, "storage": "fz:logger"}, {"text": "[调试]"}]' -data modify storage fz:logger level.info set value '[{"text": "", "color": "green"}, {"nbt": "root", "interpret": true, "storage": "fz:logger"}, {"text": "[信息]"}]' -data modify storage fz:logger level.warn set value '[{"text": "", "color": "yellow"}, {"nbt": "root", "interpret": true, "storage": "fz:logger"}, {"text": "[警告]"}]' -data modify storage fz:logger level.error set value '[{"text": "", "color": "red"}, {"nbt": "root", "interpret": true, "storage": "fz:logger"}, {"text": "[错误]"}]' - -## 异常 -data modify storage fz:logger exception.load_without_install_exception set value '[{"nbt": "log.error", "interpret": true, "storage": "fz:logger"}, {"text": "模块在未安装时被加载:"}]' \ No newline at end of file diff --git a/data/fz/functions/logger/uninstall.mcfunction b/data/fz/functions/logger/uninstall.mcfunction new file mode 100644 index 0000000..e7f17b9 --- /dev/null +++ b/data/fz/functions/logger/uninstall.mcfunction @@ -0,0 +1,3 @@ +## 调用者:#fz:logger/uninstall + +data remove storage fz:logger fz \ No newline at end of file diff --git a/data/fz/functions/logger/unload.mcfunction b/data/fz/functions/logger/unload.mcfunction deleted file mode 100644 index bdf6d31..0000000 --- a/data/fz/functions/logger/unload.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -## 调用者:fz:uninstall - -data remove storage fz:logger log -data remove storage fz:logger exception \ No newline at end of file diff --git a/data/fz/functions/module/config/buttons.mcfunction b/data/fz/functions/module/config/buttons.mcfunction new file mode 100644 index 0000000..e69de29 diff --git a/data/fz/functions/module/config/install.mcfunction b/data/fz/functions/module/config/install.mcfunction new file mode 100644 index 0000000..e69de29 diff --git a/data/fz/functions/module/config/load.mcfunction b/data/fz/functions/module/config/load.mcfunction new file mode 100644 index 0000000..e69de29 diff --git a/data/fz/functions/module/config/on_click.mcfunction b/data/fz/functions/module/config/on_click.mcfunction new file mode 100644 index 0000000..e69de29 diff --git a/data/fz/functions/module/config/trigger.mcfunction b/data/fz/functions/module/config/trigger.mcfunction new file mode 100644 index 0000000..e69de29 diff --git a/data/fz/functions/module/config/uninstall.mcfunction b/data/fz/functions/module/config/uninstall.mcfunction new file mode 100644 index 0000000..e69de29 diff --git a/data/fz/functions/module/scoreboard/config/subscribe/activation.mcfunction b/data/fz/functions/module/scoreboard/config/subscribe/activation.mcfunction index 600c97d..e57792d 100644 --- a/data/fz/functions/module/scoreboard/config/subscribe/activation.mcfunction +++ b/data/fz/functions/module/scoreboard/config/subscribe/activation.mcfunction @@ -1,3 +1,3 @@ -# 调用者: +# 调用者:fz:module/scoreboard/config/on_click team join fz.module.scoreboard.display.activation @s \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/config/subscribe/aviating_distance.mcfunction b/data/fz/functions/module/scoreboard/config/subscribe/aviating_distance.mcfunction index 6b07410..04415cc 100644 --- a/data/fz/functions/module/scoreboard/config/subscribe/aviating_distance.mcfunction +++ b/data/fz/functions/module/scoreboard/config/subscribe/aviating_distance.mcfunction @@ -1,3 +1,3 @@ -# 调用者: +# 调用者:fz:module/scoreboard/config/on_click team join fz.module.scoreboard.display.aviating_distance @s \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/config/subscribe/carousel.mcfunction b/data/fz/functions/module/scoreboard/config/subscribe/carousel.mcfunction index dc7c41d..714faa4 100644 --- a/data/fz/functions/module/scoreboard/config/subscribe/carousel.mcfunction +++ b/data/fz/functions/module/scoreboard/config/subscribe/carousel.mcfunction @@ -1,3 +1,3 @@ -# 调用者: +# 调用者:fz:module/scoreboard/config/on_click team join fz.module.scoreboard.display.carousel @s \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/config/subscribe/damage_taken.mcfunction b/data/fz/functions/module/scoreboard/config/subscribe/damage_taken.mcfunction index 40415a2..a680993 100644 --- a/data/fz/functions/module/scoreboard/config/subscribe/damage_taken.mcfunction +++ b/data/fz/functions/module/scoreboard/config/subscribe/damage_taken.mcfunction @@ -1,3 +1,3 @@ -# 调用者: +# 调用者:fz:module/scoreboard/config/on_click team join fz.module.scoreboard.display.damage_taken @s \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/config/subscribe/death_count.mcfunction b/data/fz/functions/module/scoreboard/config/subscribe/death_count.mcfunction index 75148be..6062546 100644 --- a/data/fz/functions/module/scoreboard/config/subscribe/death_count.mcfunction +++ b/data/fz/functions/module/scoreboard/config/subscribe/death_count.mcfunction @@ -1,3 +1,3 @@ -# 调用者: +# 调用者:fz:module/scoreboard/config/on_click team join fz.module.scoreboard.display.death_count @s \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/config/subscribe/dig_count.mcfunction b/data/fz/functions/module/scoreboard/config/subscribe/dig_count.mcfunction index d16d42d..7a73796 100644 --- a/data/fz/functions/module/scoreboard/config/subscribe/dig_count.mcfunction +++ b/data/fz/functions/module/scoreboard/config/subscribe/dig_count.mcfunction @@ -1,3 +1,3 @@ -# 调用者: +# 调用者:fz:module/scoreboard/config/on_click team join fz.module.scoreboard.display.dig_count @s \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/config/subscribe/fisning_count.mcfunction b/data/fz/functions/module/scoreboard/config/subscribe/fisning_count.mcfunction index ba81feb..01b4848 100644 --- a/data/fz/functions/module/scoreboard/config/subscribe/fisning_count.mcfunction +++ b/data/fz/functions/module/scoreboard/config/subscribe/fisning_count.mcfunction @@ -1,3 +1,3 @@ -# 调用者: +# 调用者:fz:module/scoreboard/config/on_click team join fz.module.scoreboard.display.fishing_count @s \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/config/subscribe/general.mcfunction b/data/fz/functions/module/scoreboard/config/subscribe/general.mcfunction index e60d982..bec1aed 100644 --- a/data/fz/functions/module/scoreboard/config/subscribe/general.mcfunction +++ b/data/fz/functions/module/scoreboard/config/subscribe/general.mcfunction @@ -1,3 +1,3 @@ -# 调用者: +# 调用者:fz:module/scoreboard/config/on_click team join fz.module.scoreboard.display.general @s \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/config/subscribe/kill_count.mcfunction b/data/fz/functions/module/scoreboard/config/subscribe/kill_count.mcfunction index ee5f96a..e9d62c2 100644 --- a/data/fz/functions/module/scoreboard/config/subscribe/kill_count.mcfunction +++ b/data/fz/functions/module/scoreboard/config/subscribe/kill_count.mcfunction @@ -1,3 +1,3 @@ -# 调用者: +# 调用者:fz:module/scoreboard/config/on_click team join fz.module.scoreboard.display.kill_count @s \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/config/subscribe/off.mcfunction b/data/fz/functions/module/scoreboard/config/subscribe/off.mcfunction index 2c28afb..e90df64 100644 --- a/data/fz/functions/module/scoreboard/config/subscribe/off.mcfunction +++ b/data/fz/functions/module/scoreboard/config/subscribe/off.mcfunction @@ -1,3 +1,3 @@ -# 调用者: +# 调用者:fz:module/scoreboard/config/on_click team leave @s \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/config/subscribe/trade_count.mcfunction b/data/fz/functions/module/scoreboard/config/subscribe/trade_count.mcfunction index 94b6651..e82feda 100644 --- a/data/fz/functions/module/scoreboard/config/subscribe/trade_count.mcfunction +++ b/data/fz/functions/module/scoreboard/config/subscribe/trade_count.mcfunction @@ -1,3 +1,3 @@ -# 调用者: +# 调用者:fz:module/scoreboard/config/on_click team join fz.module.scoreboard.display.trade_count @s \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/install.mcfunction b/data/fz/functions/module/scoreboard/install.mcfunction index 0cc1e8a..9b508d5 100644 --- a/data/fz/functions/module/scoreboard/install.mcfunction +++ b/data/fz/functions/module/scoreboard/install.mcfunction @@ -1,4 +1,4 @@ -# 调用者:fz:install +# 调用者:#fz:module/scoreboard/install ## 主计分板 ###### 判据均为dummy,便于升级维护! @@ -46,4 +46,4 @@ team add fz.module.scoreboard.display.trade_count ##### scoreboard objectives add fz.module.scoreboard.placement_count 需要穷举,暂不考虑 # 标记为已安装 -data modify storage fz:module scoreboard.installed set value 1b +data modify storage fz:install_manager fz.module.scoreboard set value 1b diff --git a/data/fz/functions/module/scoreboard/load.mcfunction b/data/fz/functions/module/scoreboard/load.mcfunction index 613e231..125fb50 100644 --- a/data/fz/functions/module/scoreboard/load.mcfunction +++ b/data/fz/functions/module/scoreboard/load.mcfunction @@ -1,8 +1,7 @@ # 调用者:#fz:module/scoreboard/load ## 异常检测 -execute if data storage fz:storage module.scoreboard{installed: 1b} run tellraw @a [{"nbt": "exception.load_without_install_exception", "interpret": true, "storage": "fz:logger"}, {"text": "计分板"}] -execute unless data storage fz:storage module.scoreboard.installed run tellraw @a [{"nbt": "exception.load_without_install_exception", "interpret": true, "storage": "fz:logger"}, {"text": "计分板"}] +execute unless data storage fz:install_manager fz.module{scoreboard: 1b} run tellraw @a [{"nbt": "fz.exception.load_without_install_exception", "interpret": true, "storage": "fz:logger"}, {"text": "计分板"}] ## 设置显示颜色 function #fz:module/scoreboard/display/set_all_colors diff --git a/data/fz/functions/module/scoreboard/uninstall.mcfunction b/data/fz/functions/module/scoreboard/uninstall.mcfunction index 4530ccd..f5ca309 100644 --- a/data/fz/functions/module/scoreboard/uninstall.mcfunction +++ b/data/fz/functions/module/scoreboard/uninstall.mcfunction @@ -1,4 +1,4 @@ -# 调用者:fz:uninstall +# 调用者:#fz:module/scoreboard/uninstall ## 关闭轮播循环 schedule clear #fz:module/scoreboard/display/carousel_controller/loop @@ -28,8 +28,8 @@ team remove fz.module.scoreboard.display.trade_count ## 日志 tellraw @a [{"nbt": "level.info", "interpret": true, "storage": "fz:logger"}, {"text": "计分板已卸载!"}] -## 询问是否清除数据function +## 询问是否清除数据 tellraw @s [{"nbt": "level.warn", "interpret": true, "storage": "fz:logger"}, {"text": "您要删除计分板数据吗,它将会永久失去!(真的很久!)"}, {"text": "[确定]","clickEvent": {"action": "run_command", "value": "/function #fz:module/scoreboard/clear_data"}, "hoverEvent": {"action": "show_text", "contents": {"text": "删除计分板,它将会永久失去!(真的很久!)", "color": "red"}}}] # 标记为已卸载 -data modify storage fz:module scoreboard.installed set value 0b +data modify storage fz:install_manager fz.module.scoreboard set value 0b diff --git a/data/fz/functions/module/sweeper/load.mcfunction b/data/fz/functions/module/sweeper/load.mcfunction new file mode 100644 index 0000000..e69de29 diff --git a/data/fz/functions/module/try_load.mcfunction b/data/fz/functions/module/try_load.mcfunction new file mode 100644 index 0000000..d1d5239 --- /dev/null +++ b/data/fz/functions/module/try_load.mcfunction @@ -0,0 +1,6 @@ +# 调用者:#fz:module/try_load + +## 判断是否安装,如果安装则加载 +execute if data storage fz:install_manager fz.module{config:1b} run function #fz:module/config/load +execute if data storage fz:install_manager fz.module{scoreboard:1b} run function #fz:module/scoreboard/load +execute if data storage fz:install_manager fz.module{sweeper:1b} run function #fz:module/sweeper/load diff --git a/data/fz/functions/uninstall.mcfunction b/data/fz/functions/uninstall.mcfunction index e69de29..2d22df8 100644 --- a/data/fz/functions/uninstall.mcfunction +++ b/data/fz/functions/uninstall.mcfunction @@ -0,0 +1,12 @@ +# 调用者:#fz:uninstall + +function #fz:module/uninstall + +## 整数类型 +scoreboard objectives remove fz.variable.integer + +## 卸载日志,为避免扩展数据包在卸载时无法使用日志,故延迟1tick卸载 +schedule function #fz:logger/uninstall 1t replace + +## 标记为已卸载 +data modify storage fz:install_manager fz.global set value 0b \ No newline at end of file diff --git a/data/fz/tags/functions/install.json b/data/fz/tags/functions/install.json new file mode 100644 index 0000000..e9fc9c3 --- /dev/null +++ b/data/fz/tags/functions/install.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:fz:entry", + "replace": false, + "values": [ + "fz:install" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/load.json b/data/fz/tags/functions/load.json new file mode 100644 index 0000000..730de65 --- /dev/null +++ b/data/fz/tags/functions/load.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:fz:entry", + "replace": false, + "values": [ + "fz:load" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/logger/install.json b/data/fz/tags/functions/logger/install.json new file mode 100644 index 0000000..16a724b --- /dev/null +++ b/data/fz/tags/functions/logger/install.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:logger/install" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/logger/uninstall.json b/data/fz/tags/functions/logger/uninstall.json new file mode 100644 index 0000000..8cbb61b --- /dev/null +++ b/data/fz/tags/functions/logger/uninstall.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:logger/uninstall" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/config/install.json b/data/fz/tags/functions/module/config/install.json new file mode 100644 index 0000000..344aca7 --- /dev/null +++ b/data/fz/tags/functions/module/config/install.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:#fz:module/install", + "replace": false, + "values": [ + "fz:config/install" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/config/load.json b/data/fz/tags/functions/module/config/load.json new file mode 100644 index 0000000..17fc863 --- /dev/null +++ b/data/fz/tags/functions/module/config/load.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:fz:module/try_load", + "replace": false, + "values": [ + "fz:config/load" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/config/uninstall.json b/data/fz/tags/functions/module/config/uninstall.json new file mode 100644 index 0000000..b71840f --- /dev/null +++ b/data/fz/tags/functions/module/config/uninstall.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:#fz:module/uninstall", + "replace": false, + "values": [ + "fz:config/uninstall" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/install.json b/data/fz/tags/functions/module/install.json new file mode 100644 index 0000000..b74c5bc --- /dev/null +++ b/data/fz/tags/functions/module/install.json @@ -0,0 +1,9 @@ +{ + "__comment": "调用者:fz:install", + "replace": false, + "values": [ + "#fz:module/config/install", + "#fz:module/scoreboard/install", + "#fz:module/sweeper/install" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/clear_data.json b/data/fz/tags/functions/module/scoreboard/clear_data.json index 3c33858..3915f94 100644 --- a/data/fz/tags/functions/module/scoreboard/clear_data.json +++ b/data/fz/tags/functions/module/scoreboard/clear_data.json @@ -1,4 +1,5 @@ { + "__comment": "调用者:fz:module:scoreboard/uninstall", "replace": false, "values": [ "fz:module/scoreboard/clear_data" diff --git a/data/fz/tags/functions/module/scoreboard/install.json b/data/fz/tags/functions/module/scoreboard/install.json new file mode 100644 index 0000000..69def0f --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/install.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:#fz:module/install", + "replace": false, + "values": [ + "fz:module/scoreboard/install" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/load.json b/data/fz/tags/functions/module/scoreboard/load.json new file mode 100644 index 0000000..40eb41e --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/load.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:fz:module/try_load", + "replace": false, + "values": [ + "fz:module/scoreboard/load" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/uninstall.json b/data/fz/tags/functions/module/scoreboard/uninstall.json new file mode 100644 index 0000000..f5bdad4 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/uninstall.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:#fz:module/uninstall", + "replace": false, + "values": [ + "fz:module/scoreboard/uninstall" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/sweeper/install.json b/data/fz/tags/functions/module/sweeper/install.json new file mode 100644 index 0000000..943cb08 --- /dev/null +++ b/data/fz/tags/functions/module/sweeper/install.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:#fz:module/install", + "replace": false, + "values": [ + "fz:module/sweeper/install" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/sweeper/load.json b/data/fz/tags/functions/module/sweeper/load.json new file mode 100644 index 0000000..769beed --- /dev/null +++ b/data/fz/tags/functions/module/sweeper/load.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:fz:module/try_load", + "replace": false, + "values": [ + "fz:module/sweeper/load" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/sweeper/uninstall.json b/data/fz/tags/functions/module/sweeper/uninstall.json new file mode 100644 index 0000000..a92a242 --- /dev/null +++ b/data/fz/tags/functions/module/sweeper/uninstall.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:#fz:module/uninstall", + "replace": false, + "values": [ + "fz:module/sweeper/uninstall" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/try_load.json b/data/fz/tags/functions/module/try_load.json new file mode 100644 index 0000000..3f730aa --- /dev/null +++ b/data/fz/tags/functions/module/try_load.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:fz:load", + "replace": false, + "values": [ + "fz:module/try_load" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/uninstall.json b/data/fz/tags/functions/module/uninstall.json new file mode 100644 index 0000000..9ea7622 --- /dev/null +++ b/data/fz/tags/functions/module/uninstall.json @@ -0,0 +1,9 @@ +{ + "__comment": "调用者:fz:uninstall", + "replace": false, + "values": [ + "#fz:module/config/uninstall", + "#fz:module/scoreboard/uninstall", + "#fz:module/sweeper/uninstall" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/uninstall.json b/data/fz/tags/functions/uninstall.json new file mode 100644 index 0000000..777f5b9 --- /dev/null +++ b/data/fz/tags/functions/uninstall.json @@ -0,0 +1,7 @@ +{ + "__comment": "调用者:fz:entry", + "replace": false, + "values": [ + "fz:uninstall" + ] +} \ No newline at end of file