脚本:避免历史遗留的负分玩家污染计分板

This commit is contained in:
Harvey_Husky 2024-01-11 19:04:25 +08:00
parent 51c667c392
commit 39711d3e01
2 changed files with 4 additions and 11 deletions

View File

@ -1,14 +1,7 @@
# 留言
因病一段时间内不再添加新功能。
1.21以后函数允许入参,可以搞很多骚操作,但是得等有心思的时候再说了。
# FZ生存数据包 # FZ生存数据包
为FZ服务器写的Minecraft生存辅助数据包 为FZ服务器写的Minecraft生存辅助数据包
#### @Author: Harvey_Husky
#### Copyright (C) 2019-2023 Harvey_Husky
## 安装教程 ## 安装教程
1. 兼容性 1. 兼容性

View File

@ -128,7 +128,7 @@ __on_close() -> (
write_file('team_cache', 'json', global_team_cache); write_file('team_cache', 'json', global_team_cache);
); );
if(require_version('1.4.999'), // 等待新功能支持 if(require_version('1.4.112'), // 新功能支持
__on_player_command(player, command) -> ( __on_player_command(player, command) -> (
l = length(command); l = length(command);
if(l > 13 if(l > 13
@ -199,8 +199,8 @@ reload_configs() -> (
global_config:'config_version' = '1.0.0'; // 占位用无实际作用 global_config:'config_version' = '1.0.0'; // 占位用无实际作用
config_changed = true; config_changed = true;
); );
// 等待新功能支持 // 新功能支持
if(require_version('1.4.999') && !contains(global_config, 'allow_spawn_whitelist_player'), if(require_version('1.4.112') && !contains(global_config, 'allow_spawn_whitelist_player'),
global_config:'allow_spawn_whitelist_player' = false; global_config:'allow_spawn_whitelist_player' = false;
config_changed = true; config_changed = true;
); );
@ -428,7 +428,7 @@ command_recalculate_total_score(scoreboard) -> (
for(scoreboard(scoreboard), for(scoreboard(scoreboard),
if(_ != total_score_name_new, if(_ != total_score_name_new,
current_player_score = scoreboard(scoreboard, _); current_player_score = scoreboard(scoreboard, _);
if(current_player_score < 0, // 避免溢出 if(current_player_score < -1000000000, // 避免溢出
current_player_score = 2147483647; current_player_score = 2147483647;
scoreboard(scoreboard, _, 2147483647); scoreboard(scoreboard, _, 2147483647);
); );