添加假人前缀开关

This commit is contained in:
Harvey_Husky
2024-08-24 22:12:24 +08:00
parent 1bf367ce12
commit bdb5c0a8da
9 changed files with 35 additions and 10 deletions
+2 -1
View File
@@ -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": "]"}]]]
@@ -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
@@ -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
+2 -1
View File
@@ -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": "]"}]]]
@@ -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
@@ -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
@@ -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
@@ -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
+15 -4
View File
@@ -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'), '↓挂机');
)