diff --git a/DEVDOC.md b/DEVDOC.md index 4646f88..6797ea8 100644 --- a/DEVDOC.md +++ b/DEVDOC.md @@ -64,9 +64,18 @@ #### 自定义计分板颜色 - 数据包提供了所有计分板的全部16色命名函数 -- 使用方法:***覆盖***`tags/functions/module/scoreboard/` +- 使用方法:**覆盖**`tags/functions/module/scoreboard/display/set_text/<计分板名称>`标签,填入`functions/module/scoreboard/display/set_text/<计分板名称>/<颜色名称>`函数 #### 自定义计分板名称 - +1. 定义一个设置计分板颜色、文本的函数,格式可以参考`functions/module/scoreboard/display/set_text/general/aqua`函数 +2. **覆盖**`tags/functions/module/scoreboard/display/set_text/<计分板名称>`标签,填入上述函数 #### 扩展自己的计分板 +1. 定义一个创建计分板的函数,参考`functions/module/scoreboard/display/create`函数 +2. 在`tags/functions/module/scoreboard/display/create`标签中注册该函数 +3. 按照“自定义计分板颜色”和“自定义计分板名称”中的操作,定义你的计分板颜色和名称 +4. 定义一个生成计分板运行时id的函数,参考`functions/module/scoreboard/display/register_id` +5. 在`tags/functions/module/scoreboard/display/register_id`标签中注册该函数 +6. 定义一个用来在轮播时显示你的计分板的函数,参考`functions/module/scoreboard/display/carousel/set_display/*` +7. 定义一个用来判断在轮播时是否轮到你的计分板的函数,在判断后调用上一条中的函数,参考`functions/module/scoreboard/display/carousel/try_display/*` +8. 将该函数注册到`tags/functions/module/scoreboard/display/try_display`标签中 diff --git a/data/fz/functions/module/scoreboard/display/create.mcfunction b/data/fz/functions/module/scoreboard/display/create.mcfunction new file mode 100644 index 0000000..9d3df25 --- /dev/null +++ b/data/fz/functions/module/scoreboard/display/create.mcfunction @@ -0,0 +1,45 @@ +## 创建显示计分板 +### 轮播 +team add fz.module.scoreboard.display.carousel + +## 主计分板 +###### 判据均为dummy,便于升级维护! + +### 总榜 +scoreboard objectives add fz.module.scoreboard.display.general dummy +team add fz.module.scoreboard.display.general + +### 活跃度 +scoreboard objectives add fz.module.scoreboard.display.activation dummy +team add fz.module.scoreboard.display.activation + +### 飞行距离 +scoreboard objectives add fz.module.scoreboard.display.aviating_distance dummy +team add fz.module.scoreboard.display.aviating_distance + +### 抖M榜 +scoreboard objectives add fz.module.scoreboard.display.damage_taken dummy +team add fz.module.scoreboard.display.damage_taken + +### 死亡榜 +scoreboard objectives add fz.module.scoreboard.display.death_count dummy +team add fz.module.scoreboard.display.death_count + +### 挖掘榜 +scoreboard objectives add fz.module.scoreboard.display.dig_count dummy +team add fz.module.scoreboard.display.dig_count + +### 钓鱼榜 +scoreboard objectives add fz.module.scoreboard.display.fishing_count dummy +team add fz.module.scoreboard.display.fishing_count + +### 击杀榜 +scoreboard objectives add fz.module.scoreboard.display.kill_count dummy +team add fz.module.scoreboard.display.kill_count + +### 交易榜 +scoreboard objectives add fz.module.scoreboard.display.trade_count dummy +team add fz.module.scoreboard.display.trade_count + +### 放置榜 +##### scoreboard objectives add fz.module.scoreboard.placement_count 需要穷举,暂不考虑 \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/display/register_id.mcfunction b/data/fz/functions/module/scoreboard/display/register_id.mcfunction new file mode 100644 index 0000000..e2db4d7 --- /dev/null +++ b/data/fz/functions/module/scoreboard/display/register_id.mcfunction @@ -0,0 +1,35 @@ +#### 注册活跃度计分板id +function #fz:calculation/highest_id_add_1 +scoreboard players operation fz.module.scoreboard.display.id.activation fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer + +#### 注册飞行距离计分板id +function #fz:calculation/highest_id_add_1 +scoreboard players operation fz.module.scoreboard.display.id.aviating_distance fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer + +#### 注册抖M榜计分板id +function #fz:calculation/highest_id_add_1 +scoreboard players operation fz.module.scoreboard.display.id.damage_taken fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer + +#### 注册死亡榜计分板id +function #fz:calculation/highest_id_add_1 +scoreboard players operation fz.module.scoreboard.display.id.death_count fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer + +#### 注册挖掘榜计分板id +function #fz:calculation/highest_id_add_1 +scoreboard players operation fz.module.scoreboard.display.id.dig_count fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer + +#### 注册钓鱼榜计分板id +function #fz:calculation/highest_id_add_1 +scoreboard players operation fz.module.scoreboard.display.id.fishing_count fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer + +#### 注册总榜计分板id +function #fz:calculation/highest_id_add_1 +scoreboard players operation fz.module.scoreboard.display.id.general fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer + +#### 注册击杀榜计分板id +function #fz:calculation/highest_id_add_1 +scoreboard players operation fz.module.scoreboard.display.id.kill_count fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer + +#### 注册交易榜计分板id +function #fz:calculation/highest_id_add_1 +scoreboard players operation fz.module.scoreboard.display.id.trade_count fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/display/register_id/activation.mcfunction b/data/fz/functions/module/scoreboard/display/register_id/activation.mcfunction deleted file mode 100644 index 6145569..0000000 --- a/data/fz/functions/module/scoreboard/display/register_id/activation.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -#### 注册计分板id -function #fz:calculation/highest_id_add_1 -scoreboard players operation fz.module.scoreboard.display.id.activation fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/display/register_id/aviating_distance.mcfunction b/data/fz/functions/module/scoreboard/display/register_id/aviating_distance.mcfunction deleted file mode 100644 index 6d56785..0000000 --- a/data/fz/functions/module/scoreboard/display/register_id/aviating_distance.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -#### 注册计分板id -function #fz:calculation/highest_id_add_1 -scoreboard players operation fz.module.scoreboard.display.id.aviating_distance fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/display/register_id/damage_taken.mcfunction b/data/fz/functions/module/scoreboard/display/register_id/damage_taken.mcfunction deleted file mode 100644 index c9dc5cf..0000000 --- a/data/fz/functions/module/scoreboard/display/register_id/damage_taken.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -#### 注册计分板id -function #fz:calculation/highest_id_add_1 -scoreboard players operation fz.module.scoreboard.display.id.damage_taken fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/display/register_id/death_count.mcfunction b/data/fz/functions/module/scoreboard/display/register_id/death_count.mcfunction deleted file mode 100644 index c1645a8..0000000 --- a/data/fz/functions/module/scoreboard/display/register_id/death_count.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -#### 注册计分板id -function #fz:calculation/highest_id_add_1 -scoreboard players operation fz.module.scoreboard.display.id.death_count fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/display/register_id/dig_count.mcfunction b/data/fz/functions/module/scoreboard/display/register_id/dig_count.mcfunction deleted file mode 100644 index cd5a6e3..0000000 --- a/data/fz/functions/module/scoreboard/display/register_id/dig_count.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -#### 注册计分板id -function #fz:calculation/highest_id_add_1 -scoreboard players operation fz.module.scoreboard.display.id.dig_count fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/display/register_id/fishing_count.mcfunction b/data/fz/functions/module/scoreboard/display/register_id/fishing_count.mcfunction deleted file mode 100644 index 86b42b1..0000000 --- a/data/fz/functions/module/scoreboard/display/register_id/fishing_count.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -#### 注册计分板id -function #fz:calculation/highest_id_add_1 -scoreboard players operation fz.module.scoreboard.display.id.fishing_count fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/display/register_id/general.mcfunction b/data/fz/functions/module/scoreboard/display/register_id/general.mcfunction deleted file mode 100644 index 7238295..0000000 --- a/data/fz/functions/module/scoreboard/display/register_id/general.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -#### 注册计分板id -function #fz:calculation/highest_id_add_1 -scoreboard players operation fz.module.scoreboard.display.id.general fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/display/register_id/kill_count.mcfunction b/data/fz/functions/module/scoreboard/display/register_id/kill_count.mcfunction deleted file mode 100644 index 1584399..0000000 --- a/data/fz/functions/module/scoreboard/display/register_id/kill_count.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -#### 注册计分板id -function #fz:calculation/highest_id_add_1 -scoreboard players operation fz.module.scoreboard.display.id.kill_count fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/display/register_id/trade_count.mcfunction b/data/fz/functions/module/scoreboard/display/register_id/trade_count.mcfunction deleted file mode 100644 index 015217c..0000000 --- a/data/fz/functions/module/scoreboard/display/register_id/trade_count.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -#### 注册计分板id -function #fz:calculation/highest_id_add_1 -scoreboard players operation fz.module.scoreboard.display.id.trade_count fz.variable.integer = fz.module.scoreboard.display.highest_id fz.variable.integer \ 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 ba3b769..4b39308 100644 --- a/data/fz/functions/module/scoreboard/install.mcfunction +++ b/data/fz/functions/module/scoreboard/install.mcfunction @@ -1,50 +1,6 @@ # 调用者:#fz:module/scoreboard/install - -## 主计分板 -###### 判据均为dummy,便于升级维护! - -### 轮播 -team add fz.module.scoreboard.display.carousel - -### 总榜 -scoreboard objectives add fz.module.scoreboard.display.general dummy -team add fz.module.scoreboard.display.general - -### 活跃度 -scoreboard objectives add fz.module.scoreboard.display.activation dummy -team add fz.module.scoreboard.display.activation - -### 飞行距离 -scoreboard objectives add fz.module.scoreboard.display.aviating_distance dummy -team add fz.module.scoreboard.display.aviating_distance - -### 抖M榜 -scoreboard objectives add fz.module.scoreboard.display.damage_taken dummy -team add fz.module.scoreboard.display.damage_taken - -### 死亡榜 -scoreboard objectives add fz.module.scoreboard.display.death_count dummy -team add fz.module.scoreboard.display.death_count - -### 挖掘榜 -scoreboard objectives add fz.module.scoreboard.display.dig_count dummy -team add fz.module.scoreboard.display.dig_count - -### 钓鱼榜 -scoreboard objectives add fz.module.scoreboard.display.fishing_count dummy -team add fz.module.scoreboard.display.fishing_count - -### 击杀榜 -scoreboard objectives add fz.module.scoreboard.display.kill_count dummy -team add fz.module.scoreboard.display.kill_count - -### 交易榜 -scoreboard objectives add fz.module.scoreboard.display.trade_count dummy -team add fz.module.scoreboard.display.trade_count - -### 放置榜 -##### scoreboard objectives add fz.module.scoreboard.placement_count 需要穷举,暂不考虑 +function #fz:module/scoreboard/display/create ## 标记为已安装 data modify storage fz:install_manager fz.module.scoreboard set value 1b diff --git a/data/fz/tags/functions/module/scoreboard/display/create.json b/data/fz/tags/functions/module/scoreboard/display/create.json new file mode 100644 index 0000000..88bca84 --- /dev/null +++ b/data/fz/tags/functions/module/scoreboard/display/create.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/scoreboard/display/create" + ] +} \ 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 index b3bbed0..d5f2dca 100644 --- a/data/fz/tags/functions/module/scoreboard/display/register_id.json +++ b/data/fz/tags/functions/module/scoreboard/display/register_id.json @@ -5,14 +5,6 @@ ], "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" + "fz:module/scoreboard/display/register_id" ] } \ 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 deleted file mode 100644 index 79e1793..0000000 --- a/data/fz/tags/functions/module/scoreboard/display/register_id/activation.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 0a0d5b3..0000000 --- a/data/fz/tags/functions/module/scoreboard/display/register_id/aviating_distance.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 52e81ec..0000000 --- a/data/fz/tags/functions/module/scoreboard/display/register_id/damage_taken.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 911b700..0000000 --- a/data/fz/tags/functions/module/scoreboard/display/register_id/death_count.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 84e95d2..0000000 --- a/data/fz/tags/functions/module/scoreboard/display/register_id/dig_count.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index c2bace5..0000000 --- a/data/fz/tags/functions/module/scoreboard/display/register_id/fishing_count.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 26596be..0000000 --- a/data/fz/tags/functions/module/scoreboard/display/register_id/general.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index 30f7081..0000000 --- a/data/fz/tags/functions/module/scoreboard/display/register_id/kill_count.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "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 deleted file mode 100644 index e834fd1..0000000 --- a/data/fz/tags/functions/module/scoreboard/display/register_id/trade_count.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "replace": false, - "values": [ - "fz:module/scoreboard/display/register_id/trade_count" - ] -} \ No newline at end of file