完善计分板、开发文档

This commit is contained in:
延皓 2022-06-27 19:33:43 +08:00
parent 460b39698a
commit b925dfa464
No known key found for this signature in database
GPG Key ID: B1350BD0352AB941
24 changed files with 99 additions and 137 deletions

View File

@ -64,9 +64,18 @@
#### 自定义计分板颜色 #### 自定义计分板颜色
- 数据包提供了所有计分板的全部16色命名函数 - 数据包提供了所有计分板的全部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`标签中

View File

@ -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 需要穷举暂不考虑

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,50 +1,6 @@
# 调用者#fz:module/scoreboard/install # 调用者#fz:module/scoreboard/install
function #fz:module/scoreboard/display/create
## 主计分板
###### 判据均为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 需要穷举暂不考虑
## 标记为已安装 ## 标记为已安装
data modify storage fz:install_manager fz.module.scoreboard set value 1b data modify storage fz:install_manager fz.module.scoreboard set value 1b

View File

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"fz:module/scoreboard/display/create"
]
}

View File

@ -5,14 +5,6 @@
], ],
"replace": false, "replace": false,
"values": [ "values": [
"#fz:module/scoreboard/display/register_id/activation", "fz:module/scoreboard/display/register_id"
"#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"
] ]
} }

View File

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"fz:module/scoreboard/display/register_id/activation"
]
}

View File

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"fz:module/scoreboard/display/register_id/aviating_distance"
]
}

View File

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"fz:module/scoreboard/display/register_id/damage_taken"
]
}

View File

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"fz:module/scoreboard/display/register_id/death_count"
]
}

View File

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"fz:module/scoreboard/display/register_id/dig_count"
]
}

View File

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"fz:module/scoreboard/display/register_id/fishing_count"
]
}

View File

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"fz:module/scoreboard/display/register_id/general"
]
}

View File

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"fz:module/scoreboard/display/register_id/kill_count"
]
}

View File

@ -1,6 +0,0 @@
{
"replace": false,
"values": [
"fz:module/scoreboard/display/register_id/trade_count"
]
}