规范了事件系统,完成了实现计分板赋值逻辑

This commit is contained in:
延皓
2022-07-07 07:39:01 +08:00
parent 171b19c93a
commit 4665599abb
173 changed files with 1374 additions and 276 deletions
@@ -1,3 +1,5 @@
function #fz:module/config/reset_trigger
##
@@ -1,7 +1,7 @@
# 调用者:fz:module/config/trigger
## 0
execute as @a if score @s fz.module.config.trigger matches 1.. run function #fz:module/config/on_click
execute as @a if score @s fz.module.config.trigger matches 1.. run function #fz:event/module/config/on_click
execute as @a if score @s fz.module.config.trigger matches 1.. run function #fz:module/config/reset_trigger
schedule function fz:module/config/loop 1t replace
@@ -4,8 +4,7 @@
##
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "玩家"}, {"selector": "@s"}, {"text": "触发了配置功能"}]
## schedule是为了避免1tick内执行两次
schedule function fz:module/config/loop 0t replace
function fz:module/config/loop
##
function #fz:module/config/display
@@ -1,3 +0,0 @@
# 源计分板
##
scoreboard objectives add fz.module.scoreboard.assign.general dummy
@@ -1,3 +1,3 @@
# 调用者:#fz:module/scoreboard/config/display/buttons
tellraw @s [[{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"text": "", "color": "dark_red"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1000"}}, {"text": "", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.carousel", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1010"}}, {"nbt": "fz.scoreboard.text.carousel", "interpret": true, "storage": "fz:module"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.general", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1020"}}, {"nbt": "fz.scoreboard.text.general", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.activation", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1030"}}, {"nbt": "fz.scoreboard.text.activation", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.aviating_distance", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1040"}}, {"nbt": "fz.scoreboard.text.aviating_distance", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.damage_taken", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1050"}}, {"nbt": "fz.scoreboard.text.damage_taken", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.death_count", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1060"}}, {"nbt": "fz.scoreboard.text.death_count", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.dig_count", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1070"}}, {"nbt": "fz.scoreboard.text.dig_count", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.fishing_count", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1080"}}, {"nbt": "fz.scoreboard.text.fishing_count", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.kill_count", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1090"}}, {"nbt": "fz.scoreboard.text.kill_count", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.trade_count", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1100"}}, {"nbt": "fz.scoreboard.text.trade_count", "interpret": true, "storage": "fz:module"}, {"text": "]"}]]
tellraw @s [[{"text": "[", "color": "dark_gray", "hoverEvent": {"action": "show_text", "contents": {"text": "", "color": "dark_red"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1000"}}, {"text": "", "color": "dark_red"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.carousel", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1010"}}, {"nbt": "fz.scoreboard.text.carousel", "interpret": true, "storage": "fz:module"}, {"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.general", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1020"}}, {"nbt": "fz.scoreboard.text.general", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.activation", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1030"}}, {"nbt": "fz.scoreboard.text.activation", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.aviating_distance", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1040"}}, {"nbt": "fz.scoreboard.text.aviating_distance", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.damage_taken", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1050"}}, {"nbt": "fz.scoreboard.text.damage_taken", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.death_count", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1060"}}, {"nbt": "fz.scoreboard.text.death_count", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.dig_count", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1070"}}, {"nbt": "fz.scoreboard.text.dig_count", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.fishing_count", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1080"}}, {"nbt": "fz.scoreboard.text.fishing_count", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.kill_count", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1090"}}, {"nbt": "fz.scoreboard.text.kill_count", "interpret": true, "storage": "fz:module"},{"text": "]"}], [{"text": "[", "hoverEvent": {"action": "show_text", "contents": {"nbt": "fz.scoreboard.text.trade_count", "interpret": true, "storage": "fz:module"}}, "clickEvent": {"action": "run_command", "value": "/trigger fz.module.config.trigger set 1100"}}, {"nbt": "fz.scoreboard.text.trade_count", "interpret": true, "storage": "fz:module"}, {"text": "]"}]]
@@ -1,46 +0,0 @@
##
###
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.placement_count dummy
team add fz.module.scoreboard.display.placement_count
###
scoreboard objectives add fz.module.scoreboard.display.trade_count dummy
team add fz.module.scoreboard.display.trade_count
@@ -1,9 +1,55 @@
# 调用者:#fz:module/scoreboard/install
##
function fz:module/scoreboard/assign/create_scoreboards
##
function fz:module/scoreboard/display/create_scoreboards
###
scoreboard objectives add fz.module.scoreboard.assign.general dummy
##
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.placement_count dummy
team add fz.module.scoreboard.display.placement_count
###
scoreboard objectives add fz.module.scoreboard.display.trade_count dummy
team add fz.module.scoreboard.display.trade_count
##
data modify storage fz:install_manager fz.module.scoreboard set value 1b
@@ -1,7 +1,7 @@
# 调用者:#fz:module/scoreboard/uninstall
##
schedule clear #fz:module/scoreboard/display/carousel_controller/loop
schedule clear fz:module/scoreboard/display/carousel/loop
##
###