From bdb5c0a8da251222bfaab2f482a5cc1a7105295f Mon Sep 17 00:00:00 2001 From: Harvey_Husky Date: Sat, 24 Aug 2024 22:12:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=81=87=E4=BA=BA=E5=89=8D?= =?UTF-8?q?=E7=BC=80=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/admin.fzsd/function/admin.mcfunction | 3 ++- .../module/fake_player_prefix/off.mcfunction | 3 +++ .../module/fake_player_prefix/on.mcfunction | 3 +++ data/admin.fzsd/functions/admin.mcfunction | 3 ++- .../module/fake_player_prefix/off.mcfunction | 3 +++ .../module/fake_player_prefix/on.mcfunction | 3 +++ .../module/scoreboard/install.mcfunction | 4 ++-- .../module/scoreboard/install.mcfunction | 4 ++-- scripts/fzsd_score.sc | 19 +++++++++++++++---- 9 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 data/admin.fzsd/function/module/fake_player_prefix/off.mcfunction create mode 100644 data/admin.fzsd/function/module/fake_player_prefix/on.mcfunction create mode 100644 data/admin.fzsd/functions/module/fake_player_prefix/off.mcfunction create mode 100644 data/admin.fzsd/functions/module/fake_player_prefix/on.mcfunction diff --git a/data/admin.fzsd/function/admin.mcfunction b/data/admin.fzsd/function/admin.mcfunction index 1b3aca7..e486313 100644 --- a/data/admin.fzsd/function/admin.mcfunction +++ b/data/admin.fzsd/function/admin.mcfunction @@ -1,8 +1,9 @@ tellraw @s {"text": "管理员页面:", "color": "red"} -tellraw @s [{"text": "全局:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/reload"}, "hoverEvent": {"action": "show_text", "contents": {"text": "重载", "color": "yellow"}}}, {"text": "重载", "color": "yellow"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:install"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "安装:", "color": "dark_green"}, {"text": "仅安装上次卸载前已安装的模块", "color": "red"}]}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:uninstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "卸载:", "color": "dark_red"}, {"text": "将保留模块安装记录", "color": "red"}]}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:reinstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "重装:", "color": "gold"}, {"text": "可能可以修复一些奇怪问题,", "color": "white"}, {"text": "将保留模块安装记录", "color": "red"}]}}, {"text": "重装", "color": "gold"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_install"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度安装:", "color": "dark_green"}, {"text": "将安装所有模块", "color": "red"}]}}, {"text": "深度安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_uninstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度卸载:", "color": "dark_red"}, {"text": "将清除模块安装记录", "color": "red"}]}}, {"text": "深度卸载", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_reinstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度重装:", "color": "gold"}, {"text": "可能可以修复一些奇怪问题,", "color": "white"}, {"text": "将清除模块安装记录", "color": "red"}]}}, {"text": "深度重装", "color": "gold"}, {"text": "]"}]]] +tellraw @s [{"text": "数据包:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/reload"}, "hoverEvent": {"action": "show_text", "contents": {"text": "重载", "color": "yellow"}}}, {"text": "重载", "color": "yellow"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:install"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "安装:", "color": "dark_green"}, {"text": "仅安装上次卸载前已安装的模块", "color": "red"}]}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:uninstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "卸载:", "color": "dark_red"}, {"text": "将保留模块安装记录", "color": "red"}]}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:reinstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "重装:", "color": "gold"}, {"text": "可能可以修复一些奇怪问题,", "color": "white"}, {"text": "将保留模块安装记录", "color": "red"}]}}, {"text": "重装", "color": "gold"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_install"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度安装:", "color": "dark_green"}, {"text": "将安装所有模块", "color": "red"}]}}, {"text": "深度安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_uninstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度卸载:", "color": "dark_red"}, {"text": "将清除模块安装记录", "color": "red"}]}}, {"text": "深度卸载", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_reinstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度重装:", "color": "gold"}, {"text": "可能可以修复一些奇怪问题,", "color": "white"}, {"text": "将清除模块安装记录", "color": "red"}]}}, {"text": "深度重装", "color": "gold"}, {"text": "]"}]]] +tellraw @s [{"text": "假人前缀:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function admin.fzsd:module/fake_player_prefix/on"}, "hoverEvent": {"action": "show_text", "contents": {"text": "启用假人前缀", "color": "green"}}}, {"text": "启用", "color": "green"}, {"text": "]"}],[{"text": "[", "clickEvent": {"action": "run_command", "value": "/function admin.fzsd:module/fake_player_prefix/off"}, "hoverEvent": {"action": "show_text", "contents": {"text": "禁用假人前缀", "color": "dark_red"}}}, {"text": "禁用", "color": "dark_red"}, {"text": "]"}]]] tellraw @s [{"text": "日志等级:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function fzsd:logger/level/fine"}, "hoverEvent": {"action": "show_text", "contents": {"text": "详细", "color": "gray"}}}, {"text": "详细", "color": "gray"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function fzsd:logger/level/debug"}, "hoverEvent": {"action": "show_text", "contents": {"text": "调试", "color": "dark_aqua"}}}, {"text": "调试", "color": "dark_aqua"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function fzsd:logger/level/info"}, "hoverEvent": {"action": "show_text", "contents": {"text": "信息", "color": "green"}}}, {"text": "信息", "color": "green"}, {"text": "]"}]]] diff --git a/data/admin.fzsd/function/module/fake_player_prefix/off.mcfunction b/data/admin.fzsd/function/module/fake_player_prefix/off.mcfunction new file mode 100644 index 0000000..f220ef2 --- /dev/null +++ b/data/admin.fzsd/function/module/fake_player_prefix/off.mcfunction @@ -0,0 +1,3 @@ +team modify fzsd.module.scoreboard.fake prefix "" +team modify fzsd.module.scoreboard.shadow prefix "" +data modify storage fzsd:config fzsd.module.scoreboard.fake_player_prefix set value false \ No newline at end of file diff --git a/data/admin.fzsd/function/module/fake_player_prefix/on.mcfunction b/data/admin.fzsd/function/module/fake_player_prefix/on.mcfunction new file mode 100644 index 0000000..e84472e --- /dev/null +++ b/data/admin.fzsd/function/module/fake_player_prefix/on.mcfunction @@ -0,0 +1,3 @@ +team modify fzsd.module.scoreboard.fake prefix "假的" +team modify fzsd.module.scoreboard.shadow prefix "挂机" +data modify storage fzsd:config fzsd.module.scoreboard.fake_player_prefix set value true \ No newline at end of file diff --git a/data/admin.fzsd/functions/admin.mcfunction b/data/admin.fzsd/functions/admin.mcfunction index 1b3aca7..e486313 100644 --- a/data/admin.fzsd/functions/admin.mcfunction +++ b/data/admin.fzsd/functions/admin.mcfunction @@ -1,8 +1,9 @@ tellraw @s {"text": "管理员页面:", "color": "red"} -tellraw @s [{"text": "全局:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/reload"}, "hoverEvent": {"action": "show_text", "contents": {"text": "重载", "color": "yellow"}}}, {"text": "重载", "color": "yellow"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:install"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "安装:", "color": "dark_green"}, {"text": "仅安装上次卸载前已安装的模块", "color": "red"}]}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:uninstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "卸载:", "color": "dark_red"}, {"text": "将保留模块安装记录", "color": "red"}]}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:reinstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "重装:", "color": "gold"}, {"text": "可能可以修复一些奇怪问题,", "color": "white"}, {"text": "将保留模块安装记录", "color": "red"}]}}, {"text": "重装", "color": "gold"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_install"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度安装:", "color": "dark_green"}, {"text": "将安装所有模块", "color": "red"}]}}, {"text": "深度安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_uninstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度卸载:", "color": "dark_red"}, {"text": "将清除模块安装记录", "color": "red"}]}}, {"text": "深度卸载", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_reinstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度重装:", "color": "gold"}, {"text": "可能可以修复一些奇怪问题,", "color": "white"}, {"text": "将清除模块安装记录", "color": "red"}]}}, {"text": "深度重装", "color": "gold"}, {"text": "]"}]]] +tellraw @s [{"text": "数据包:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/reload"}, "hoverEvent": {"action": "show_text", "contents": {"text": "重载", "color": "yellow"}}}, {"text": "重载", "color": "yellow"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:install"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "安装:", "color": "dark_green"}, {"text": "仅安装上次卸载前已安装的模块", "color": "red"}]}}, {"text": "安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:uninstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "卸载:", "color": "dark_red"}, {"text": "将保留模块安装记录", "color": "red"}]}}, {"text": "卸载", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:reinstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "重装:", "color": "gold"}, {"text": "可能可以修复一些奇怪问题,", "color": "white"}, {"text": "将保留模块安装记录", "color": "red"}]}}, {"text": "重装", "color": "gold"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_install"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度安装:", "color": "dark_green"}, {"text": "将安装所有模块", "color": "red"}]}}, {"text": "深度安装", "color": "dark_green"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_uninstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度卸载:", "color": "dark_red"}, {"text": "将清除模块安装记录", "color": "red"}]}}, {"text": "深度卸载", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function #fzsd:deep_reinstall"}, "hoverEvent": {"action": "show_text", "contents": [{"text": "深度重装:", "color": "gold"}, {"text": "可能可以修复一些奇怪问题,", "color": "white"}, {"text": "将清除模块安装记录", "color": "red"}]}}, {"text": "深度重装", "color": "gold"}, {"text": "]"}]]] +tellraw @s [{"text": "假人前缀:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function admin.fzsd:module/fake_player_prefix/on"}, "hoverEvent": {"action": "show_text", "contents": {"text": "启用假人前缀", "color": "green"}}}, {"text": "启用", "color": "green"}, {"text": "]"}],[{"text": "[", "clickEvent": {"action": "run_command", "value": "/function admin.fzsd:module/fake_player_prefix/off"}, "hoverEvent": {"action": "show_text", "contents": {"text": "禁用假人前缀", "color": "dark_red"}}}, {"text": "禁用", "color": "dark_red"}, {"text": "]"}]]] tellraw @s [{"text": "日志等级:"}, [{"text": "", "color": "dark_gray"}, [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function fzsd:logger/level/fine"}, "hoverEvent": {"action": "show_text", "contents": {"text": "详细", "color": "gray"}}}, {"text": "详细", "color": "gray"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function fzsd:logger/level/debug"}, "hoverEvent": {"action": "show_text", "contents": {"text": "调试", "color": "dark_aqua"}}}, {"text": "调试", "color": "dark_aqua"}, {"text": "]"}], [{"text": "[", "clickEvent": {"action": "run_command", "value": "/function fzsd:logger/level/info"}, "hoverEvent": {"action": "show_text", "contents": {"text": "信息", "color": "green"}}}, {"text": "信息", "color": "green"}, {"text": "]"}]]] diff --git a/data/admin.fzsd/functions/module/fake_player_prefix/off.mcfunction b/data/admin.fzsd/functions/module/fake_player_prefix/off.mcfunction new file mode 100644 index 0000000..6636170 --- /dev/null +++ b/data/admin.fzsd/functions/module/fake_player_prefix/off.mcfunction @@ -0,0 +1,3 @@ +team modify fzsd.module.scoreboard.fake prefix "" +team modify fzsd.module.scoreboard.shadow prefix "" +data modify storage fzsd:config fzsd.module.scoreboard.fake_player_prefix set value true \ No newline at end of file diff --git a/data/admin.fzsd/functions/module/fake_player_prefix/on.mcfunction b/data/admin.fzsd/functions/module/fake_player_prefix/on.mcfunction new file mode 100644 index 0000000..f220ef2 --- /dev/null +++ b/data/admin.fzsd/functions/module/fake_player_prefix/on.mcfunction @@ -0,0 +1,3 @@ +team modify fzsd.module.scoreboard.fake prefix "" +team modify fzsd.module.scoreboard.shadow prefix "" +data modify storage fzsd:config fzsd.module.scoreboard.fake_player_prefix set value false \ No newline at end of file diff --git a/data/fzsd/function/module/scoreboard/install.mcfunction b/data/fzsd/function/module/scoreboard/install.mcfunction index 32cbf4d..d1cbb34 100644 --- a/data/fzsd/function/module/scoreboard/install.mcfunction +++ b/data/fzsd/function/module/scoreboard/install.mcfunction @@ -53,8 +53,8 @@ team add fzsd.module.scoreboard.display.trade_count team add fzsd.module.scoreboard.fake team add fzsd.module.scoreboard.shadow -team modify fzsd.module.scoreboard.fake prefix {"text": "假的"} -team modify fzsd.module.scoreboard.shadow prefix {"text": "挂机"} +execute unless data storage fzsd:config fzsd.module.scoreboard{fake_player_prefix:false} run team modify fzsd.module.scoreboard.fake prefix {"text": "假的"} +execute unless data storage fzsd:config fzsd.module.scoreboard{fake_player_prefix:false} run team modify fzsd.module.scoreboard.shadow prefix {"text": "挂机"} ## 标记为已安装 data modify storage fzsd:install fzsd.module.scoreboard set value 1b diff --git a/data/fzsd/functions/module/scoreboard/install.mcfunction b/data/fzsd/functions/module/scoreboard/install.mcfunction index 32cbf4d..d1cbb34 100644 --- a/data/fzsd/functions/module/scoreboard/install.mcfunction +++ b/data/fzsd/functions/module/scoreboard/install.mcfunction @@ -53,8 +53,8 @@ team add fzsd.module.scoreboard.display.trade_count team add fzsd.module.scoreboard.fake team add fzsd.module.scoreboard.shadow -team modify fzsd.module.scoreboard.fake prefix {"text": "假的"} -team modify fzsd.module.scoreboard.shadow prefix {"text": "挂机"} +execute unless data storage fzsd:config fzsd.module.scoreboard{fake_player_prefix:false} run team modify fzsd.module.scoreboard.fake prefix {"text": "假的"} +execute unless data storage fzsd:config fzsd.module.scoreboard{fake_player_prefix:false} run team modify fzsd.module.scoreboard.shadow prefix {"text": "挂机"} ## 标记为已安装 data modify storage fzsd:install fzsd.module.scoreboard set value 1b diff --git a/scripts/fzsd_score.sc b/scripts/fzsd_score.sc index 6aa590e..8bdaf1e 100644 --- a/scripts/fzsd_score.sc +++ b/scripts/fzsd_score.sc @@ -149,7 +149,10 @@ __on_player_connects(player) -> ( global_team_cache:player_name = player_team; ); team_add('fzsd.module.scoreboard.fake', player); - print(player('all'), '↑假的'); + if(nbt_storage('fzsd:config'):'fzsd':'module':'scoreboard':'fake_player_prefix' + || nbt_storage('fzsd:config'):'fzsd':'module':'scoreboard':'fake_player_prefix' == null, + print(player('all'), '↑假的'); + ); ), player_type == 'shadow', ( @@ -159,7 +162,10 @@ __on_player_connects(player) -> ( global_team_cache:player_name = player_team; ); team_add('fzsd.module.scoreboard.shadow', player); - print(player('all'), '↑挂机'); + if(nbt_storage('fzsd:config'):'fzsd':'module':'scoreboard':'fake_player_prefix' + || nbt_storage('fzsd:config'):'fzsd':'module':'scoreboard':'fake_player_prefix' == null, + print(player('all'), '↑挂机'); + ); ), try_restore_team_from_cache(player); ); @@ -167,11 +173,16 @@ __on_player_connects(player) -> ( __on_player_disconnects(player, reason) -> ( player_type = player ~ 'player_type'; - if(player_type == 'fake' && player_team != 'fzsd.module.scoreboard.fake', + if(player_type == 'fake' + && player_team != 'fzsd.module.scoreboard.fake' + && (nbt_storage('fzsd:config'):'fzsd':'module':'scoreboard':'fake_player_prefix' + || nbt_storage('fzsd:config'):'fzsd':'module':'scoreboard':'fake_player_prefix' == null), ( print(player('all'), '↓假的'); ), - player_type == 'shadow' && player_team != 'fzsd.module.scoreboard.shadow', + player_type == 'shadow' && player_team != 'fzsd.module.scoreboard.shadow' + && (nbt_storage('fzsd:config'):'fzsd':'module':'scoreboard':'fake_player_prefix' + || nbt_storage('fzsd:config'):'fzsd':'module':'scoreboard':'fake_player_prefix' == null), ( print(player('all'), '↓挂机'); )