Skip to content

Commit 7812990

Browse files
rb: 🩹 fix: 修复配置验证错误消息的准确性
- 修正replace_pairs验证逻辑中的变量引用错误 - 改进错误消息描述,明确指示缺失参数的具体位置 - 将"缺少参数"改为"replace_pairs中缺少参数"等更精确的描述
1 parent fc0cda8 commit 7812990

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

ReplaceBlock/data/replace_block/function/api/check_config.mcfunction

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ execute store result score check_config.replace_with rb.temp \
5050
if data storage replace_block:data settings.replace_pairs[].replace_with
5151

5252
# 验证替换对数组完整性
53-
execute unless score check_config.replace_pairs rb.temp = check_config.replace_pairs rb.temp run \
53+
execute unless score check_config.replace_pairs rb.temp = check_config.target_block rb.temp run \
5454
function #unif.logger:logger/v1/error \
55-
{"msg":'缺少参数 replace_pairs',"namespace":"ReplaceBlock"}
55+
{"msg":'replace_pairs 中缺少参数 target_block',"namespace":"ReplaceBlock"}
5656
execute unless score check_config.replace_pairs rb.temp = check_config.replace_with rb.temp run \
5757
function #unif.logger:logger/v1/error \
58-
{"msg":'缺少参数 replace_with',"namespace":"ReplaceBlock"}
58+
{"msg":'replace_pairs 中缺少参数 replace_with',"namespace":"ReplaceBlock"}
5959
execute unless score check_config.replace_pairs rb.temp = check_config.replace_pairs rb.temp run \
6060
scoreboard players set check.fail rb.return 1
6161
execute unless score check_config.replace_pairs rb.temp = check_config.replace_with rb.temp run \
@@ -75,13 +75,13 @@ execute store result score check_config.max_y rb.temp \
7575
# 验证维度配置完整性
7676
execute unless score check_config.dimensions rb.temp = check_config.dimension rb.temp run \
7777
function #unif.logger:logger/v1/error \
78-
{"msg":'缺少参数 dimension',"namespace":"ReplaceBlock"}
78+
{"msg":'dimensions 中缺少参数 dimension',"namespace":"ReplaceBlock"}
7979
execute unless score check_config.dimensions rb.temp = check_config.min_y rb.temp run \
8080
function #unif.logger:logger/v1/error \
81-
{"msg":'缺少参数 min_y',"namespace":"ReplaceBlock"}
81+
{"msg":'dimensions 中缺少参数 min_y',"namespace":"ReplaceBlock"}
8282
execute unless score check_config.dimensions rb.temp = check_config.max_y rb.temp run \
8383
function #unif.logger:logger/v1/error \
84-
{"msg":'缺少参数 max_y',"namespace":"ReplaceBlock"}
84+
{"msg":'dimensions 中缺少参数 max_y',"namespace":"ReplaceBlock"}
8585
execute unless score check_config.dimensions rb.temp = check_config.dimension rb.temp run \
8686
scoreboard players set check.fail rb.return 1
8787
execute unless score check_config.dimensions rb.temp = check_config.min_y rb.temp run \

0 commit comments

Comments
 (0)