diff --git a/DEVDOC.md b/DEVDOC.md index d184cfe..4646f88 100644 --- a/DEVDOC.md +++ b/DEVDOC.md @@ -1,6 +1,14 @@ -1. 主要逻辑和模块逻辑分离 -2. 细化版本管理,提供不同版本之间的升级函数,由`update_manager`控制。*务必仔细测试再发布,一旦升级无法降级!* -3. 函数由两个以上的函数调用,或由不同包下的函数调用,或需要作为接口开放给下游数据包时,应改用标签调用! +# 开发文档 + + +## 基本要求 + +- 主要逻辑和模块逻辑分离 +- 函数由两个以上的函数调用,或由不同包下的函数调用,或需要作为接口开放给下游数据包时,应改用标签调用! + + +## 未来计划 +- 细化版本管理,提供不同版本之间的升级函数,由`update_manager`控制。*务必仔细测试再发布,一旦升级无法降级!* ## 系统模块 @@ -8,11 +16,11 @@ ### 频繁使用的计算单元 - 位于`tags/functions/calculation`目录下的标签通常被用来进行简单重复的计算任务 -### 事件 +### 事件模块 - 通常由**进度**触发,触发后调用同名的事件标签 - 将需要调用的函数填入`tags/functions/event/<事件名称>`标签即可 -### 日志 +### 日志模块 - 仓库中提供了日志相关的代码片段,位于`.vscode/settings.json` - 暂时没有找到方法在控制台记录日志 @@ -42,7 +50,7 @@ ## 功能模块 -### 配置 +### 配置模块 - 标签`tags/functions/module/config/timeout`:注册超时时的操作 - 标签`tags/functions/module/config/reset_trigger`:用于重置玩家`@s`的触发器计分板 @@ -52,7 +60,13 @@ 3. 定义一个点击按钮时执行的函数,使用形如`execute if score @s fz.module.config.trigger matches .. run ...`的指令判断玩家的触发器分数,并执行你的操作 4. 在`tags/functions/module/config/on_click`标签中注册上述函数 -### 计分板 +### 计分板模块 + #### 自定义计分板颜色 +- 数据包提供了所有计分板的全部16色命名函数 +- 使用方法:***覆盖***`tags/functions/module/scoreboard/` + #### 自定义计分板名称 + + #### 扩展自己的计分板 diff --git a/data/fz/functions/module/scoreboard/load.mcfunction b/data/fz/functions/module/scoreboard/load.mcfunction index 002c9f2..43b29c3 100644 --- a/data/fz/functions/module/scoreboard/load.mcfunction +++ b/data/fz/functions/module/scoreboard/load.mcfunction @@ -18,8 +18,10 @@ execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @ ## 初始化计分板 ### 重置计分板最大id计数 scoreboard players set fz.module.scoreboard.display.highest_id fz.variable.integer -1 -### 设置颜色、名称、运行时数字id,同时会计算最大id数 -function #fz:module/scoreboard/display/init +### 设置颜色、名称 +function #fz:module/scoreboard/display/set_text +### 设置运行时计分板id,同时会计算最大id数 +function #fz:module/scoreboard/display/register_id ## 重置轮播计分板ID scoreboard players set fz.module.scoreboard.display.current_id fz.variable.integer 0 diff --git a/data/fz/tags/functions/module/scoreboard/display/init.json b/data/fz/tags/functions/module/scoreboard/display/init.json deleted file mode 100644 index b5a51e7..0000000 --- a/data/fz/tags/functions/module/scoreboard/display/init.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "__comments": [ - "调用者:fz:module/scoreboard/load", - "用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!", - "建议不要直接修改本文件,可编写扩展数据包并覆写本标签!" - ], - "replace": false, - "values": [ - "#fz:module/scoreboard/display/init/carousel", - "#fz:module/scoreboard/display/init/activation", - "#fz:module/scoreboard/display/init/aviating_distance", - "#fz:module/scoreboard/display/init/damage_taken", - "#fz:module/scoreboard/display/init/death_count", - "#fz:module/scoreboard/display/init/dig_count", - "#fz:module/scoreboard/display/init/fishing_count", - "#fz:module/scoreboard/display/init/general", - "#fz:module/scoreboard/display/init/kill_count", - "#fz:module/scoreboard/display/init/trade_count" - ] -} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/register_id.json b/data/fz/tags/functions/module/scoreboard/display/register_id.json new file mode 100644 index 0000000..b3bbed0 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/display/register_id.json @@ -0,0 +1,18 @@ +{ + "__comments": [ + "调用者:fz:module/scoreboard/load", + "用于在加载注册计分板的运行时ID" + ], + "replace": false, + "values": [ + "#fz:module/scoreboard/display/register_id/activation", + "#fz:module/scoreboard/display/register_id/aviating_distance", + "#fz:module/scoreboard/display/register_id/damage_taken", + "#fz:module/scoreboard/display/register_id/death_count", + "#fz:module/scoreboard/display/register_id/dig_count", + "#fz:module/scoreboard/display/register_id/fishing_count", + "#fz:module/scoreboard/display/register_id/general", + "#fz:module/scoreboard/display/register_id/kill_count", + "#fz:module/scoreboard/display/register_id/trade_count" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/register_id/activation.json b/data/fz/tags/functions/module/scoreboard/display/register_id/activation.json new file mode 100644 index 0000000..79e1793 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/display/register_id/activation.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/display/register_id/activation" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/register_id/aviating_distance.json b/data/fz/tags/functions/module/scoreboard/display/register_id/aviating_distance.json new file mode 100644 index 0000000..0a0d5b3 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/display/register_id/aviating_distance.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/display/register_id/aviating_distance" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/register_id/damage_taken.json b/data/fz/tags/functions/module/scoreboard/display/register_id/damage_taken.json new file mode 100644 index 0000000..52e81ec --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/display/register_id/damage_taken.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/display/register_id/damage_taken" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/register_id/death_count.json b/data/fz/tags/functions/module/scoreboard/display/register_id/death_count.json new file mode 100644 index 0000000..911b700 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/display/register_id/death_count.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/display/register_id/death_count" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/register_id/dig_count.json b/data/fz/tags/functions/module/scoreboard/display/register_id/dig_count.json new file mode 100644 index 0000000..84e95d2 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/display/register_id/dig_count.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/display/register_id/dig_count" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/register_id/fishing_count.json b/data/fz/tags/functions/module/scoreboard/display/register_id/fishing_count.json new file mode 100644 index 0000000..c2bace5 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/display/register_id/fishing_count.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/display/register_id/fishing_count" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/register_id/general.json b/data/fz/tags/functions/module/scoreboard/display/register_id/general.json new file mode 100644 index 0000000..26596be --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/display/register_id/general.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/display/register_id/general" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/register_id/kill_count.json b/data/fz/tags/functions/module/scoreboard/display/register_id/kill_count.json new file mode 100644 index 0000000..30f7081 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/display/register_id/kill_count.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/display/register_id/kill_count" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/register_id/trade_count.json b/data/fz/tags/functions/module/scoreboard/display/register_id/trade_count.json new file mode 100644 index 0000000..e834fd1 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/display/register_id/trade_count.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/display/register_id/trade_count" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/set_text.json b/data/fz/tags/functions/module/scoreboard/display/set_text.json new file mode 100644 index 0000000..4fbe06a --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/display/set_text.json @@ -0,0 +1,19 @@ +{ + "__comments": [ + "调用者:fz:module/scoreboard/load", + "用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!" + ], + "replace": false, + "values": [ + "#fz:module/scoreboard/display/set_text/carousel", + "#fz:module/scoreboard/display/set_text/activation", + "#fz:module/scoreboard/display/set_text/aviating_distance", + "#fz:module/scoreboard/display/set_text/damage_taken", + "#fz:module/scoreboard/display/set_text/death_count", + "#fz:module/scoreboard/display/set_text/dig_count", + "#fz:module/scoreboard/display/set_text/fishing_count", + "#fz:module/scoreboard/display/set_text/general", + "#fz:module/scoreboard/display/set_text/kill_count", + "#fz:module/scoreboard/display/set_text/trade_count" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/init/activation.json b/data/fz/tags/functions/module/scoreboard/display/set_text/activation.json similarity index 62% rename from data/fz/tags/functions/module/scoreboard/display/init/activation.json rename to data/fz/tags/functions/module/scoreboard/display/set_text/activation.json index 6bee3f7..ee6d902 100644 --- a/data/fz/tags/functions/module/scoreboard/display/init/activation.json +++ b/data/fz/tags/functions/module/scoreboard/display/set_text/activation.json @@ -1,13 +1,13 @@ { "__comments": [ - "调用者:#fz:module/scoreboard/display/init", + "调用者:#fz:module/scoreboard/display/set_text", "用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!", "建议不要直接修改本文件,可编写扩展数据包并覆写本标签!" ], "__comment_replace": "编写扩展数据包时必须为true", "replace": false, + "__comment_values": "此处只能填写一个函数!", "values": [ - "fz:module/scoreboard/display/set_text/activation/aqua", - "fz:module/scoreboard/display/register_id/activation" + "fz:module/scoreboard/display/set_text/activation/aqua" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/init/aviating_distance.json b/data/fz/tags/functions/module/scoreboard/display/set_text/aviating_distance.json similarity index 71% rename from data/fz/tags/functions/module/scoreboard/display/init/aviating_distance.json rename to data/fz/tags/functions/module/scoreboard/display/set_text/aviating_distance.json index e7f3fa1..560ff44 100644 --- a/data/fz/tags/functions/module/scoreboard/display/init/aviating_distance.json +++ b/data/fz/tags/functions/module/scoreboard/display/set_text/aviating_distance.json @@ -1,13 +1,13 @@ { "__comments": [ - "调用者:#fz:module/scoreboard/display/init", + "调用者:#fz:module/scoreboard/display/set_text", "用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!", "建议不要直接修改本文件,可编写扩展数据包并覆写本标签!" ], "__comment_replace": "编写扩展数据包时必须为true", "replace": false, + "__comment_values": "此处只能填写一个函数!", "values": [ - "fz:module/scoreboard/display/set_text/aviating_distance/light_purple", - "fz:module/scoreboard/display/register_id/aviating_distance" + "fz:module/scoreboard/display/set_text/aviating_distance/light_purple" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/init/carousel.json b/data/fz/tags/functions/module/scoreboard/display/set_text/carousel.json similarity index 74% rename from data/fz/tags/functions/module/scoreboard/display/init/carousel.json rename to data/fz/tags/functions/module/scoreboard/display/set_text/carousel.json index 66e7306..4648091 100644 --- a/data/fz/tags/functions/module/scoreboard/display/init/carousel.json +++ b/data/fz/tags/functions/module/scoreboard/display/set_text/carousel.json @@ -1,11 +1,12 @@ { "__comments": [ - "调用者:#fz:module/scoreboard/display/init", + "调用者:#fz:module/scoreboard/display/set_text", "用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!", "建议不要直接修改本文件,可编写扩展数据包并覆写本标签!" ], "__comment_replace": "编写扩展数据包时必须为true", "replace": false, + "__comment_values": "此处只能填写一个函数!", "values": [ "fz:module/scoreboard/display/set_text/carousel/gold" ] diff --git a/data/fz/tags/functions/module/scoreboard/display/init/damage_taken.json b/data/fz/tags/functions/module/scoreboard/display/set_text/damage_taken.json similarity index 73% rename from data/fz/tags/functions/module/scoreboard/display/init/damage_taken.json rename to data/fz/tags/functions/module/scoreboard/display/set_text/damage_taken.json index b915bc0..38c0718 100644 --- a/data/fz/tags/functions/module/scoreboard/display/init/damage_taken.json +++ b/data/fz/tags/functions/module/scoreboard/display/set_text/damage_taken.json @@ -1,13 +1,13 @@ { "__comments": [ - "调用者:#fz:module/scoreboard/display/init", + "调用者:#fz:module/scoreboard/display/set_text", "用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!", "建议不要直接修改本文件,可编写扩展数据包并覆写本标签!" ], "__comment_replace": "编写扩展数据包时必须为true", "replace": false, + "__comment_values": "此处只能填写一个函数!", "values": [ - "fz:module/scoreboard/display/set_text/damage_taken/yellow", - "fz:module/scoreboard/display/register_id/damage_taken" + "fz:module/scoreboard/display/set_text/damage_taken/yellow" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/init/death_count.json b/data/fz/tags/functions/module/scoreboard/display/set_text/death_count.json similarity index 73% rename from data/fz/tags/functions/module/scoreboard/display/init/death_count.json rename to data/fz/tags/functions/module/scoreboard/display/set_text/death_count.json index f22f472..1c26c4b 100644 --- a/data/fz/tags/functions/module/scoreboard/display/init/death_count.json +++ b/data/fz/tags/functions/module/scoreboard/display/set_text/death_count.json @@ -1,13 +1,13 @@ { "__comments": [ - "调用者:#fz:module/scoreboard/display/init", + "调用者:#fz:module/scoreboard/display/set_text", "用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!", "建议不要直接修改本文件,可编写扩展数据包并覆写本标签!" ], "__comment_replace": "编写扩展数据包时必须为true", "replace": false, + "__comment_values": "此处只能填写一个函数!", "values": [ - "fz:module/scoreboard/display/set_text/death_count/dark_red", - "fz:module/scoreboard/display/register_id/death_count" + "fz:module/scoreboard/display/set_text/death_count/dark_red" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/init/dig_count.json b/data/fz/tags/functions/module/scoreboard/display/set_text/dig_count.json similarity index 62% rename from data/fz/tags/functions/module/scoreboard/display/init/dig_count.json rename to data/fz/tags/functions/module/scoreboard/display/set_text/dig_count.json index 728838b..b9178df 100644 --- a/data/fz/tags/functions/module/scoreboard/display/init/dig_count.json +++ b/data/fz/tags/functions/module/scoreboard/display/set_text/dig_count.json @@ -1,13 +1,13 @@ { "__comments": [ - "调用者:#fz:module/scoreboard/display/init", + "调用者:#fz:module/scoreboard/display/set_text", "用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!", "建议不要直接修改本文件,可编写扩展数据包并覆写本标签!" ], "__comment_replace": "编写扩展数据包时必须为true", "replace": false, + "__comment_values": "此处只能填写一个函数!", "values": [ - "fz:module/scoreboard/display/set_text/dig_count/gray", - "fz:module/scoreboard/display/register_id/dig_count" + "fz:module/scoreboard/display/set_text/dig_count/gray" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/init/fishing_count.json b/data/fz/tags/functions/module/scoreboard/display/set_text/fishing_count.json similarity index 73% rename from data/fz/tags/functions/module/scoreboard/display/init/fishing_count.json rename to data/fz/tags/functions/module/scoreboard/display/set_text/fishing_count.json index c5f2e2e..b10a7aa 100644 --- a/data/fz/tags/functions/module/scoreboard/display/init/fishing_count.json +++ b/data/fz/tags/functions/module/scoreboard/display/set_text/fishing_count.json @@ -1,13 +1,13 @@ { "__comments": [ - "调用者:#fz:module/scoreboard/display/init", + "调用者:#fz:module/scoreboard/display/set_text", "用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!", "建议不要直接修改本文件,可编写扩展数据包并覆写本标签!" ], "__comment_replace": "编写扩展数据包时必须为true", "replace": false, + "__comment_values": "此处只能填写一个函数!", "values": [ - "fz:module/scoreboard/display/set_text/fishing_count/blue", - "fz:module/scoreboard/display/register_id/fishing_count" + "fz:module/scoreboard/display/set_text/fishing_count/blue" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/init/general.json b/data/fz/tags/functions/module/scoreboard/display/set_text/general.json similarity index 74% rename from data/fz/tags/functions/module/scoreboard/display/init/general.json rename to data/fz/tags/functions/module/scoreboard/display/set_text/general.json index 53272fe..9d6fb41 100644 --- a/data/fz/tags/functions/module/scoreboard/display/init/general.json +++ b/data/fz/tags/functions/module/scoreboard/display/set_text/general.json @@ -1,13 +1,13 @@ { "__comments": [ - "调用者:#fz:module/scoreboard/display/init", + "调用者:#fz:module/scoreboard/display/set_text", "用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!", "建议不要直接修改本文件,可编写扩展数据包并覆写本标签!" ], "__comment_replace": "编写扩展数据包时必须为true", "replace": false, + "__comment_values": "此处只能填写一个函数!", "values": [ - "fz:module/scoreboard/display/set_text/general/dark_aqua", - "fz:module/scoreboard/display/register_id/general" + "fz:module/scoreboard/display/set_text/general/dark_aqua" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/init/kill_count.json b/data/fz/tags/functions/module/scoreboard/display/set_text/kill_count.json similarity index 62% rename from data/fz/tags/functions/module/scoreboard/display/init/kill_count.json rename to data/fz/tags/functions/module/scoreboard/display/set_text/kill_count.json index 028d3af..a238da7 100644 --- a/data/fz/tags/functions/module/scoreboard/display/init/kill_count.json +++ b/data/fz/tags/functions/module/scoreboard/display/set_text/kill_count.json @@ -1,13 +1,13 @@ { "__comments": [ - "调用者:#fz:module/scoreboard/display/init", + "调用者:#fz:module/scoreboard/display/set_text", "用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!", "建议不要直接修改本文件,可编写扩展数据包并覆写本标签!" ], "__comment_replace": "编写扩展数据包时必须为true", "replace": false, + "__comment_values": "此处只能填写一个函数!", "values": [ - "fz:module/scoreboard/display/set_text/kill_count/red", - "fz:module/scoreboard/display/register_id/kill_count" + "fz:module/scoreboard/display/set_text/kill_count/red" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/display/init/trade_count.json b/data/fz/tags/functions/module/scoreboard/display/set_text/trade_count.json similarity index 74% rename from data/fz/tags/functions/module/scoreboard/display/init/trade_count.json rename to data/fz/tags/functions/module/scoreboard/display/set_text/trade_count.json index 92ebbb6..86200e0 100644 --- a/data/fz/tags/functions/module/scoreboard/display/init/trade_count.json +++ b/data/fz/tags/functions/module/scoreboard/display/set_text/trade_count.json @@ -1,13 +1,13 @@ { "__comments": [ - "调用者:#fz:module/scoreboard/display/init", + "调用者:#fz:module/scoreboard/display/set_text", "用于在加载时储存计分板颜色,不同计分板不得使用同一颜色!", "建议不要直接修改本文件,可编写扩展数据包并覆写本标签!" ], "__comment_replace": "编写扩展数据包时必须为true", "replace": false, + "__comment_values": "此处只能填写一个函数!", "values": [ - "fz:module/scoreboard/display/set_text/trade_count/green", - "fz:module/scoreboard/display/register_id/trade_count" + "fz:module/scoreboard/display/set_text/trade_count/green" ] } \ No newline at end of file