完善here、last_death

This commit is contained in:
延皓
2022-07-09 13:06:56 +08:00
parent 596ebd9d64
commit 4a69d7d927
58 changed files with 198 additions and 85 deletions
@@ -1,6 +1,5 @@
function #fz:module/config/reset_trigger
schedule clear fz:module/config/loop
execute as @a run function #fz:module/config/reset_trigger
##
execute if score fz.logger.level fz.variable.integer matches ..500 run tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "已加载组件:配置"}]
@@ -1,7 +1,6 @@
# 调用者: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:module/config/reset_trigger
execute as @a if score @s fz.module.config.trigger matches 1.. run function #fz:module/config/on_click/on_click
schedule function fz:module/config/loop 1t replace
@@ -1,10 +1,4 @@
# 调用者:#fz:module/config/on_click
#####
##
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": "点击了配置按钮,触发器分数为:"}, {"score": {"name": "@s", "objective": "fz.module.config.trigger"}}]
execute if score @s fz.module.config.trigger matches 1000..1999 run function #fz:module/scoreboard/config/on_click
##
function #fz:module/config/display
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": "点击了配置按钮,触发器分数为:"}, {"score": {"name": "@s", "objective": "fz.module.config.trigger"}}]
@@ -1,13 +1,2 @@
# 调用者:#fz:module/config/on_config
#####
##
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": "触发了配置功能"}]
function fz:module/config/loop
##
function #fz:module/config/display
##
schedule function #fz:module/config/timeout 300s replace
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": "触发了配置页面"}]
@@ -0,0 +1,2 @@
##
schedule function #fz:module/config/timeout 300s replace
@@ -1,4 +1,3 @@
function #fz:module/health/set_health_name
execute unless data storage fz:config fz.module.health.display{below_name: 0b} run scoreboard objectives setdisplay belowName fz.module.health
execute if data storage fz:config fz.module.health.display{below_name: 0b} run scoreboard objectives setdisplay belowName
execute unless data storage fz:config fz.module.health.display{list: 0b} run scoreboard objectives setdisplay list fz.module.health
@@ -1 +0,0 @@
execute if data storage fz:data_viewer fz.here.cache{dimension:"minecraft:overworld"} run function fz:module/here/custom_dimension_message/if_in_overworld
@@ -1 +0,0 @@
execute if data storage fz:data_viewer fz.here.cache{dimension:"minecraft:the_nether"} run function fz:module/here/custom_dimension_message/if_in_the_nether
@@ -2,5 +2,4 @@ data modify storage fz:here fz.cache.nether_pos set value [0, 0]
execute store result storage fz:here fz.cache.nether_pos[0] int 0.125 run data get entity @s Pos[0]
execute store result storage fz:here fz.cache.nether_pos[1] int 0.125 run data get entity @s Pos[2]
data modify storage fz:here fz.cache.message[0] set value '{"text": "主世界", "color": "dark_green"}'
data modify storage fz:here fz.cache.message[2] set value '[{"text": ",对应", "color": "white"}, {"text": "下届", "color": "dark_red"}, {"text": ""}, [{"text": "[", "color": "green"}, {"nbt": "fz.cache.nether_pos[0]", "storage": "fz:here"}, {"text": ", "}, {"nbt": "fz.cache.nether_pos[1]", "storage": "fz:here"}, {"text": "]"}]]'
@@ -2,5 +2,4 @@ data modify storage fz:here fz.cache.overworld_pos set value [0, 0]
execute store result storage fz:here fz.cache.overworld_pos[0] int 8 run data get entity @s Pos[0]
execute store result storage fz:here fz.cache.overworld_pos[1] int 8 run data get entity @s Pos[2]
data modify storage fz:here fz.cache.message[0] set value '{"text": "下届", "color": "dark_red"}'
data modify storage fz:here fz.cache.message[2] set value '[{"text": ",对应", "color": "white"}, {"text": "主世界", "color": "dark_green"}, {"text": ""}, [{"text": "[", "color": "green"}, {"nbt": "fz.cache.overworld_pos[0]", "storage": "fz:here"}, {"text": ", "}, {"nbt": "fz.cache.overworld_pos[1]", "storage": "fz:here"}, {"text": "]"}]]'
@@ -0,0 +1 @@
execute if data storage fz:global fz.cache.dimension{id:"minecraft:overworld"} run function fz:module/here/get_dimension_message/if_overworld
@@ -0,0 +1 @@
execute if data storage fz:global fz.cache.dimension{id:"minecraft:the_nether"} run function fz:module/here/get_dimension_message/if_the_nether
@@ -1,9 +1,8 @@
data modify storage fz:here fz.cache.dimension set from entity @s Dimension
data modify storage fz:here fz.cache.pos set value [0, 0, 0]
## fz.cache.pos已在install中初始化
execute store result storage fz:here fz.cache.pos[0] int 1 run data get entity @s Pos[0]
execute store result storage fz:here fz.cache.pos[1] int 1 run data get entity @s Pos[1]
execute store result storage fz:here fz.cache.pos[2] int 1 run data get entity @s Pos[2]
data modify storage fz:here fz.cache.message set value ["", "", ""]
data modify storage fz:here fz.cache.message[0] set value '{"nbt": "fz.cache.dimension", "storage": "fz:here"}'
data modify storage fz:here fz.cache.message[1] set value '[{"text": "[", "color": "green"}, {"nbt": "fz.cache.pos[0]", "storage": "fz:here"}, {"text": ", "}, {"nbt": "fz.cache.pos[1]", "storage": "fz:here"}, {"text": ", "}, {"nbt": "fz.cache.pos[2]", "storage": "fz:here"}, {"text": "]"}]'
function #fz:module/here/custom_message
data modify storage fz:here fz.cache.message set value ['{"nbt": "fz.cache.dimension.name", "interpret": true, "storage": "fz:global"}', '[{"text": "[", "color": "green"}, {"nbt": "fz.cache.pos[0]", "storage": "fz:here"}, {"text": ", "}, {"nbt": "fz.cache.pos[1]", "storage": "fz:here"}, {"text": ", "}, {"nbt": "fz.cache.pos[2]", "storage": "fz:here"}, {"text": "]"}]', '']
##
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": "获取了位置信息"}]
@@ -1,3 +1 @@
function fz:module/here/get_message
tellraw @a [{"text": "", "color": "white"}, {"selector": "@s"}, {"text": "说:"}, {"text": "我在"}, {"nbt": "fz.cache.message[0]", "interpret": true, "storage": "fz:here"}, {"nbt": "fz.cache.message[1]", "interpret": true, "storage": "fz:here"}, {"nbt": "fz.cache.message[2]", "interpret": true, "storage": "fz:here"}]
@@ -0,0 +1,7 @@
data modify storage fz:here fz.cache.pos set value [0, 0, 0]
##
data modify storage fz:installed fz.module.here set value 1b
##
execute if score fz.logger.level fz.variable.integer matches ..500 run tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "已安装组件:here"}]
@@ -1,3 +1 @@
function fz:module/here/get_message
tellraw @s [{"text": "你在", "color": "white"}, {"nbt": "fz.cache.message[0]", "interpret": true, "storage": "fz:here"}, {"nbt": "fz.cache.message[1]", "interpret": true, "storage": "fz:here"}, {"nbt": "fz.cache.message[2]", "interpret": true, "storage": "fz:here"}]
@@ -1 +1,7 @@
data remove storage fz:here fz
data remove storage fz:here fz
##
data modify storage fz:installed fz.module.here set value 0b
##
execute if score fz.logger.level fz.variable.integer matches ..500 run tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "已卸载组件:here"}]
@@ -0,0 +1,9 @@
data modify storage fz:global fz.cache.dimension.id set from entity @s LastDeathLocation.dimension
data modify storage fz:global fz.cache.dimension.name set from entity @s LastDeathLocation.dimension
## fz.cache.pos已在install中初始化
execute store result storage fz:last_death fz.cache.pos[0] int 1 run data get entity @s LastDeathLocation.pos[0]
execute store result storage fz:last_death fz.cache.pos[1] int 1 run data get entity @s LastDeathLocation.pos[1]
execute store result storage fz:last_death fz.cache.pos[2] int 1 run data get entity @s LastDeathLocation.pos[2]
##
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": "获取了死亡点"}]
@@ -0,0 +1,7 @@
data modify storage fz:last_death fz.cache.pos set value [0, 0, 0]
##
data modify storage fz:installed fz.module.last_death set value 1b
##
execute if score fz.logger.level fz.variable.integer matches ..500 run tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "已安装组件:死亡点"}]
@@ -0,0 +1 @@
tellraw @s [{"text": "你的上次死亡位于"}, {"nbt": "fz.cache.dimension.name", "interpret": true, "storage": "fz:global"}, [{"text": "[", "color": "green"}, {"nbt": "fz.cache.pos[0]", "storage": "fz:last_death"}, {"text": ", "}, {"nbt": "fz.cache.pos[1]", "storage": "fz:last_death"}, {"text": ", "}, {"nbt": "fz.cache.pos[2]", "storage": "fz:last_death"}, {"text": "]"}]]
@@ -0,0 +1,7 @@
data remove storage fz:last_death fz
##
data modify storage fz:installed fz.module.last_death set value 0b
##
execute if score fz.logger.level fz.variable.integer matches ..500 run tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "已卸载组件:死亡点"}]
@@ -0,0 +1,4 @@
## id计数
scoreboard players set fz.module.scoreboard.display.highest_id fz.variable.integer -1
### ID
scoreboard players set fz.module.scoreboard.display.current_id fz.variable.integer 0
@@ -1,8 +1,5 @@
# 调用者:#fz:module/scoreboard/load
##
execute unless data storage fz:install_manager fz.module{scoreboard: 1b} run tellraw @a [{"nbt": "fz.exception.load_without_install_exception", "interpret": true, "storage": "fz:logger"}, {"text": "计分板"}]
##
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "计分板显示文本已设为:"}]
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"text": "", "color": "green"}, {"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "fz.module.scoreboard.display.general - "}, {"nbt": "fz.scoreboard.text.general", "interpret": true, "storage": "fz:module"}]
@@ -15,17 +12,5 @@ execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"text": "", "color": "green"}, {"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "fz.module.scoreboard.display.kill_count - "}, {"nbt": "fz.scoreboard.text.kill_count", "interpret": true, "storage": "fz:module"}]
execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"text": "", "color": "green"}, {"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "fz.module.scoreboard.display.trade_count - "}, {"nbt": "fz.scoreboard.text.trade_count", "interpret": true, "storage": "fz:module"}]
##
### id计数
scoreboard players set fz.module.scoreboard.display.highest_id fz.variable.integer -1
###
function #fz:module/scoreboard/display/set_text
### idid数
function fz:module/scoreboard/display/register_id
### ID
scoreboard players set fz.module.scoreboard.display.current_id fz.variable.integer 0
###
function fz:module/scoreboard/display/carousel/loop
##
execute if score fz.logger.level fz.variable.integer matches ..500 run tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "已加载组件:计分板"}]
@@ -25,6 +25,24 @@ team remove fz.module.scoreboard.display.kill_count
###
team remove fz.module.scoreboard.display.trade_count
##
scoreboard objectives setdisplay sidebar.team.aqua
scoreboard objectives setdisplay sidebar.team.black
scoreboard objectives setdisplay sidebar.team.blue
scoreboard objectives setdisplay sidebar.team.dark_aqua
scoreboard objectives setdisplay sidebar.team.dark_blue
scoreboard objectives setdisplay sidebar.team.dark_gray
scoreboard objectives setdisplay sidebar.team.dark_green
scoreboard objectives setdisplay sidebar.team.dark_purple
scoreboard objectives setdisplay sidebar.team.dark_red
scoreboard objectives setdisplay sidebar.team.gold
scoreboard objectives setdisplay sidebar.team.gray
scoreboard objectives setdisplay sidebar.team.green
scoreboard objectives setdisplay sidebar.team.light_purple
scoreboard objectives setdisplay sidebar.team.red
scoreboard objectives setdisplay sidebar.team.white
scoreboard objectives setdisplay sidebar.team.yellow
##
execute if score fz.logger.level fz.variable.integer matches ..600 run tellraw @s [{"nbt": "fz.level.alert", "interpret": true, "storage": "fz:logger"}, {"text": "您要删除计分板数据吗,它将会永久失去!(真的很久!)"}, {"text": "[确定]", "color": "dark_red", "clickEvent": {"action": "suggest_command", "value": "/function #fz:module/scoreboard/clear_data"}, "hoverEvent": {"action": "show_text", "contents": {"text": "将命令填入聊天框"}}}]
@@ -1,5 +0,0 @@
# 调用者:#fz:module/try_load
##
execute unless data storage fz:installed fz.module.config run function #fz:module/config/install
execute unless data storage fz:installed fz.module.scoreboard run function #fz:module/scoreboard/install