This commit is contained in:
延皓 2022-06-23 20:06:15 +08:00
parent ff5d951fd1
commit 5c75fa4127
56 changed files with 200 additions and 37 deletions

View File

@ -0,0 +1,3 @@
{
}

View File

@ -1,2 +1,14 @@
# 调用者#fz:install
function #fz:logger/install
## 整数类型
scoreboard objectives add fz.variable.integer dummy
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": "安装完成!"}]

View File

@ -0,0 +1,5 @@
# 调用者#fz:load
function #fz:module/try_load
tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "加载完成!"}]

View File

@ -0,0 +1 @@
data modify storage fz:logger fz.debug set value 0b

View File

@ -0,0 +1 @@
data modify storage fz:logger fz.debug set value 1b

View File

@ -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

View File

@ -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": "模块在未安装时被加载:"}]'

View File

@ -0,0 +1,3 @@
## 调用者#fz:logger/uninstall
data remove storage fz:logger fz

View File

@ -1,4 +0,0 @@
## 调用者fz:uninstall
data remove storage fz:logger log
data remove storage fz:logger exception

View File

@ -1,3 +1,3 @@
# 调用者
# 调用者fz:module/scoreboard/config/on_click
team join fz.module.scoreboard.display.activation @s

View File

@ -1,3 +1,3 @@
# 调用者
# 调用者fz:module/scoreboard/config/on_click
team join fz.module.scoreboard.display.aviating_distance @s

View File

@ -1,3 +1,3 @@
# 调用者
# 调用者fz:module/scoreboard/config/on_click
team join fz.module.scoreboard.display.carousel @s

View File

@ -1,3 +1,3 @@
# 调用者
# 调用者fz:module/scoreboard/config/on_click
team join fz.module.scoreboard.display.damage_taken @s

View File

@ -1,3 +1,3 @@
# 调用者
# 调用者fz:module/scoreboard/config/on_click
team join fz.module.scoreboard.display.death_count @s

View File

@ -1,3 +1,3 @@
# 调用者
# 调用者fz:module/scoreboard/config/on_click
team join fz.module.scoreboard.display.dig_count @s

View File

@ -1,3 +1,3 @@
# 调用者
# 调用者fz:module/scoreboard/config/on_click
team join fz.module.scoreboard.display.fishing_count @s

View File

@ -1,3 +1,3 @@
# 调用者
# 调用者fz:module/scoreboard/config/on_click
team join fz.module.scoreboard.display.general @s

View File

@ -1,3 +1,3 @@
# 调用者
# 调用者fz:module/scoreboard/config/on_click
team join fz.module.scoreboard.display.kill_count @s

View File

@ -1,3 +1,3 @@
# 调用者
# 调用者fz:module/scoreboard/config/on_click
team leave @s

View File

@ -1,3 +1,3 @@
# 调用者
# 调用者fz:module/scoreboard/config/on_click
team join fz.module.scoreboard.display.trade_count @s

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者fz:entry",
"replace": false,
"values": [
"fz:install"
]
}

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者fz:entry",
"replace": false,
"values": [
"fz:load"
]
}

View File

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"fz:logger/install"
]
}

View File

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"fz:logger/uninstall"
]
}

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者:#fz:module/install",
"replace": false,
"values": [
"fz:config/install"
]
}

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者fz:module/try_load",
"replace": false,
"values": [
"fz:config/load"
]
}

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者:#fz:module/uninstall",
"replace": false,
"values": [
"fz:config/uninstall"
]
}

View File

@ -0,0 +1,9 @@
{
"__comment": "调用者fz:install",
"replace": false,
"values": [
"#fz:module/config/install",
"#fz:module/scoreboard/install",
"#fz:module/sweeper/install"
]
}

View File

@ -1,4 +1,5 @@
{
"__comment": "调用者fz:module:scoreboard/uninstall",
"replace": false,
"values": [
"fz:module/scoreboard/clear_data"

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者:#fz:module/install",
"replace": false,
"values": [
"fz:module/scoreboard/install"
]
}

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者fz:module/try_load",
"replace": false,
"values": [
"fz:module/scoreboard/load"
]
}

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者:#fz:module/uninstall",
"replace": false,
"values": [
"fz:module/scoreboard/uninstall"
]
}

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者:#fz:module/install",
"replace": false,
"values": [
"fz:module/sweeper/install"
]
}

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者fz:module/try_load",
"replace": false,
"values": [
"fz:module/sweeper/load"
]
}

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者:#fz:module/uninstall",
"replace": false,
"values": [
"fz:module/sweeper/uninstall"
]
}

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者fz:load",
"replace": false,
"values": [
"fz:module/try_load"
]
}

View File

@ -0,0 +1,9 @@
{
"__comment": "调用者fz:uninstall",
"replace": false,
"values": [
"#fz:module/config/uninstall",
"#fz:module/scoreboard/uninstall",
"#fz:module/sweeper/uninstall"
]
}

View File

@ -0,0 +1,7 @@
{
"__comment": "调用者fz:entry",
"replace": false,
"values": [
"fz:uninstall"
]
}