From 4a69d7d9277c8047e80fcb6ea688a25de8f91be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=B6=E7=9A=93?= <1214946206@qq.com> Date: Sat, 9 Jul 2022 13:06:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84here=E3=80=81last=5Fdeath?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/fz/functions/api/get_dimension.mcfunction | 2 ++ .../get_dimension_name/overworld.mcfunction | 1 + .../get_dimension_name/the_nether.mcfunction | 1 + data/fz/functions/entry.mcfunction | 11 +++++++++-- .../fz/functions/game_event/install.mcfunction | 2 +- data/fz/functions/game_event/load.mcfunction | 4 ++++ .../functions/game_event/uninstall.mcfunction | 2 +- data/fz/functions/logger/install.mcfunction | 5 ++++- data/fz/functions/logger/load.mcfunction | 2 +- data/fz/functions/logger/uninstall.mcfunction | 2 +- .../fz/functions/module/config/load.mcfunction | 5 ++--- .../fz/functions/module/config/loop.mcfunction | 3 +-- .../module/config/on_click.mcfunction | 8 +------- .../module/config/on_config.mcfunction | 13 +------------ .../module/config/reset_timeout.mcfunction | 2 ++ .../fz/functions/module/health/load.mcfunction | 1 - .../overworld.mcfunction | 1 - .../the_nether.mcfunction | 1 - .../if_overworld.mcfunction} | 1 - .../if_the_nether.mcfunction} | 1 - .../get_dimension_message/overworld.mcfunction | 1 + .../the_nether.mcfunction | 1 + .../module/here/get_message.mcfunction | 11 +++++------ .../module/here/global_message.mcfunction | 2 -- .../functions/module/here/install.mcfunction | 7 +++++++ .../module/here/private_message.mcfunction | 2 -- .../functions/module/here/uninstall.mcfunction | 8 +++++++- .../last_death/get_death_point.mcfunction | 9 +++++++++ .../module/last_death/install.mcfunction | 7 +++++++ .../last_death/private_message.mcfunction | 1 + .../module/last_death/uninstall.mcfunction | 7 +++++++ .../scoreboard/display/reset_id.mcfunction | 4 ++++ .../module/scoreboard/load.mcfunction | 15 --------------- .../module/scoreboard/uninstall.mcfunction | 18 ++++++++++++++++++ .../fz/functions/module/try_install.mcfunction | 5 ----- .../fz/functions/system/uninstalled.mcfunction | 1 + data/fz/tags/functions/api/get_dimension.json | 7 +++++++ .../tags/functions/api/get_dimension_name.json | 7 +++++++ .../tags/functions/module/config/on_click.json | 1 + .../module/config/on_click/on_click.json | 7 +++++++ .../functions/module/config/on_config.json | 3 ++- data/fz/tags/functions/module/health/load.json | 1 + .../module/here/custom_dimension_message.json | 7 ------- .../module/here/get_dimension_message.json | 7 +++++++ .../functions/module/here/get_message.json | 8 ++++++++ .../functions/module/here/global_message.json | 7 +++++++ .../fz/tags/functions/module/here/install.json | 6 ++++++ .../functions/module/here/private_message.json | 7 +++++++ .../module/last_death/get_death_point.json | 7 +++++++ .../functions/module/last_death/install.json | 6 ++++++ .../module/last_death/private_message.json | 7 +++++++ .../functions/module/last_death/uninstall.json | 6 ++++++ .../tags/functions/module/scoreboard/load.json | 4 ++++ data/fz/tags/functions/module/try_install.json | 7 ------- .../tags/functions/system/install/module.json | 6 +++++- .../tags/functions/system/install/system.json | 1 - data/fz/tags/functions/system/load/system.json | 3 ++- .../functions/system/uninstall/module.json | 1 + 58 files changed, 198 insertions(+), 85 deletions(-) create mode 100644 data/fz/functions/api/get_dimension.mcfunction create mode 100644 data/fz/functions/api/get_dimension_name/overworld.mcfunction create mode 100644 data/fz/functions/api/get_dimension_name/the_nether.mcfunction create mode 100644 data/fz/functions/game_event/load.mcfunction create mode 100644 data/fz/functions/module/config/reset_timeout.mcfunction delete mode 100644 data/fz/functions/module/here/custom_dimension_message/overworld.mcfunction delete mode 100644 data/fz/functions/module/here/custom_dimension_message/the_nether.mcfunction rename data/fz/functions/module/here/{custom_dimension_message/if_in_overworld.mcfunction => get_dimension_message/if_overworld.mcfunction} (85%) rename data/fz/functions/module/here/{custom_dimension_message/if_in_the_nether.mcfunction => get_dimension_message/if_the_nether.mcfunction} (86%) create mode 100644 data/fz/functions/module/here/get_dimension_message/overworld.mcfunction create mode 100644 data/fz/functions/module/here/get_dimension_message/the_nether.mcfunction create mode 100644 data/fz/functions/module/here/install.mcfunction create mode 100644 data/fz/functions/module/last_death/get_death_point.mcfunction create mode 100644 data/fz/functions/module/last_death/install.mcfunction create mode 100644 data/fz/functions/module/last_death/private_message.mcfunction create mode 100644 data/fz/functions/module/last_death/uninstall.mcfunction create mode 100644 data/fz/functions/module/scoreboard/display/reset_id.mcfunction delete mode 100644 data/fz/functions/module/try_install.mcfunction create mode 100644 data/fz/tags/functions/api/get_dimension.json create mode 100644 data/fz/tags/functions/api/get_dimension_name.json create mode 100644 data/fz/tags/functions/module/config/on_click/on_click.json delete mode 100644 data/fz/tags/functions/module/here/custom_dimension_message.json create mode 100644 data/fz/tags/functions/module/here/get_dimension_message.json create mode 100644 data/fz/tags/functions/module/here/get_message.json create mode 100644 data/fz/tags/functions/module/here/global_message.json create mode 100644 data/fz/tags/functions/module/here/install.json create mode 100644 data/fz/tags/functions/module/here/private_message.json create mode 100644 data/fz/tags/functions/module/last_death/get_death_point.json create mode 100644 data/fz/tags/functions/module/last_death/install.json create mode 100644 data/fz/tags/functions/module/last_death/private_message.json create mode 100644 data/fz/tags/functions/module/last_death/uninstall.json delete mode 100644 data/fz/tags/functions/module/try_install.json diff --git a/data/fz/functions/api/get_dimension.mcfunction b/data/fz/functions/api/get_dimension.mcfunction new file mode 100644 index 0000000..914ce42 --- /dev/null +++ b/data/fz/functions/api/get_dimension.mcfunction @@ -0,0 +1,2 @@ +data modify storage fz:global fz.cache.dimension.id set from entity @s Dimension +data modify storage fz:global fz.cache.dimension.name set value '{"nbt": "fz.cache.dimension.id", "storage": "fz:global"}' \ No newline at end of file diff --git a/data/fz/functions/api/get_dimension_name/overworld.mcfunction b/data/fz/functions/api/get_dimension_name/overworld.mcfunction new file mode 100644 index 0000000..55549e6 --- /dev/null +++ b/data/fz/functions/api/get_dimension_name/overworld.mcfunction @@ -0,0 +1 @@ +execute if data storage fz:global fz.cache.dimension{id:'minecraft:overworld'} run data modify storage fz:global fz.cache.dimension.name set value '{"text": "主世界", "color": "dark_green"}' \ No newline at end of file diff --git a/data/fz/functions/api/get_dimension_name/the_nether.mcfunction b/data/fz/functions/api/get_dimension_name/the_nether.mcfunction new file mode 100644 index 0000000..0ce4a5e --- /dev/null +++ b/data/fz/functions/api/get_dimension_name/the_nether.mcfunction @@ -0,0 +1 @@ +execute if data storage fz:global fz.cache.dimension{id:'minecraft:the_nether'} run data modify storage fz:global fz.cache.dimension.name set value '{"text": "下届", "color": "dark_red"}' \ No newline at end of file diff --git a/data/fz/functions/entry.mcfunction b/data/fz/functions/entry.mcfunction index 37d5b72..f46e475 100644 --- a/data/fz/functions/entry.mcfunction +++ b/data/fz/functions/entry.mcfunction @@ -1,2 +1,9 @@ -execute unless data storage fz:installed fz.global run function #fz:install -execute if data storage fz:installed fz{global:1b} run function #fz:load \ No newline at end of file + + +function #fz:install +function #fz:load + + + +# execute unless data storage fz:installed fz.global run function #fz:install +# execute if data storage fz:installed fz{global:1b} run function #fz:load \ No newline at end of file diff --git a/data/fz/functions/game_event/install.mcfunction b/data/fz/functions/game_event/install.mcfunction index a5c1491..562c5df 100644 --- a/data/fz/functions/game_event/install.mcfunction +++ b/data/fz/functions/game_event/install.mcfunction @@ -44,4 +44,4 @@ scoreboard objectives add fz.event.used_tool.netherite_sword minecraft.used:neth data modify storage fz:installed fz.event 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": "已安装系统组件:事件"}] \ No newline at end of file +execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "已安装系统组件:游戏事件"}] \ No newline at end of file diff --git a/data/fz/functions/game_event/load.mcfunction b/data/fz/functions/game_event/load.mcfunction new file mode 100644 index 0000000..8a46354 --- /dev/null +++ b/data/fz/functions/game_event/load.mcfunction @@ -0,0 +1,4 @@ +execute as @a run function #fz:game_event/reset_all + +## 调试 +execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "已加载系统组件:游戏事件"}] \ No newline at end of file diff --git a/data/fz/functions/game_event/uninstall.mcfunction b/data/fz/functions/game_event/uninstall.mcfunction index 40261f7..3221720 100644 --- a/data/fz/functions/game_event/uninstall.mcfunction +++ b/data/fz/functions/game_event/uninstall.mcfunction @@ -44,4 +44,4 @@ scoreboard objectives remove fz.event.used_tool.netherite_sword data remove storage fz:installed fz.event ## 调试 -execute if score fz.logger.level fz.variable.integer matches ..500 run tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "已卸载系统组件:事件"}] \ No newline at end of file +execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "已卸载系统组件:游戏事件"}] \ No newline at end of file diff --git a/data/fz/functions/logger/install.mcfunction b/data/fz/functions/logger/install.mcfunction index aebde52..05b87a1 100644 --- a/data/fz/functions/logger/install.mcfunction +++ b/data/fz/functions/logger/install.mcfunction @@ -21,8 +21,11 @@ data modify storage fz:logger fz.exception.load_without_install_exception set va ## 首次安装时日志等级默认为一般消息 execute unless data storage fz:logger fz.levels.current run data modify storage fz:logger fz.levels.current set value 500 +## 读取日志等级存入缓存 +execute store result score fz.logger.level fz.variable.integer run data get storage fz:logger fz.levels.current + ## 标记为已安装 data modify storage fz:installed fz.logger 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": "已安装系统组件:日志"}] \ No newline at end of file +execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "已安装系统组件:日志"}] \ No newline at end of file diff --git a/data/fz/functions/logger/load.mcfunction b/data/fz/functions/logger/load.mcfunction index baa24b2..f5730cb 100644 --- a/data/fz/functions/logger/load.mcfunction +++ b/data/fz/functions/logger/load.mcfunction @@ -4,4 +4,4 @@ execute store result score fz.logger.level fz.variable.integer run data get storage fz:logger fz.levels.current ## 调试 -execute if score fz.logger.level fz.variable.integer matches ..500 run tellraw @a [{"nbt": "fz.level.info", "interpret": true, "storage": "fz:logger"}, {"text": "已加载系统组件:日志"}] \ No newline at end of file +execute if score fz.logger.level fz.variable.integer matches ..400 run tellraw @a [{"nbt": "fz.level.debug", "interpret": true, "storage": "fz:logger"}, {"text": "已加载系统组件:日志"}] \ No newline at end of file diff --git a/data/fz/functions/logger/uninstall.mcfunction b/data/fz/functions/logger/uninstall.mcfunction index 6bd709c..220d086 100644 --- a/data/fz/functions/logger/uninstall.mcfunction +++ b/data/fz/functions/logger/uninstall.mcfunction @@ -4,7 +4,7 @@ data remove storage fz:installed fz.logger ## 调试 -execute if score fz.logger.level fz.variable.integer matches ..500 run tellraw @a [{"nbt": "fz.level.info", "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 ..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:logger/clear_data"}, "hoverEvent": {"action": "show_text", "contents": {"text": "将命令填入聊天框"}}}] \ No newline at end of file diff --git a/data/fz/functions/module/config/load.mcfunction b/data/fz/functions/module/config/load.mcfunction index 45291bf..61c664b 100644 --- a/data/fz/functions/module/config/load.mcfunction +++ b/data/fz/functions/module/config/load.mcfunction @@ -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": "已加载组件:配置"}] \ No newline at end of file diff --git a/data/fz/functions/module/config/loop.mcfunction b/data/fz/functions/module/config/loop.mcfunction index a39b753..b51a37d 100644 --- a/data/fz/functions/module/config/loop.mcfunction +++ b/data/fz/functions/module/config/loop.mcfunction @@ -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 diff --git a/data/fz/functions/module/config/on_click.mcfunction b/data/fz/functions/module/config/on_click.mcfunction index 4572cd7..1d45b3c 100644 --- a/data/fz/functions/module/config/on_click.mcfunction +++ b/data/fz/functions/module/config/on_click.mcfunction @@ -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"}}] \ No newline at end of file diff --git a/data/fz/functions/module/config/on_config.mcfunction b/data/fz/functions/module/config/on_config.mcfunction index b111927..56b9ba8 100644 --- a/data/fz/functions/module/config/on_config.mcfunction +++ b/data/fz/functions/module/config/on_config.mcfunction @@ -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 \ No newline at end of file +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": "触发了配置页面"}] \ No newline at end of file diff --git a/data/fz/functions/module/config/reset_timeout.mcfunction b/data/fz/functions/module/config/reset_timeout.mcfunction new file mode 100644 index 0000000..2a4c033 --- /dev/null +++ b/data/fz/functions/module/config/reset_timeout.mcfunction @@ -0,0 +1,2 @@ +## 设置或重制超时时间 +schedule function #fz:module/config/timeout 300s replace \ No newline at end of file diff --git a/data/fz/functions/module/health/load.mcfunction b/data/fz/functions/module/health/load.mcfunction index 9e85796..a3033cb 100644 --- a/data/fz/functions/module/health/load.mcfunction +++ b/data/fz/functions/module/health/load.mcfunction @@ -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 diff --git a/data/fz/functions/module/here/custom_dimension_message/overworld.mcfunction b/data/fz/functions/module/here/custom_dimension_message/overworld.mcfunction deleted file mode 100644 index 7a35787..0000000 --- a/data/fz/functions/module/here/custom_dimension_message/overworld.mcfunction +++ /dev/null @@ -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 \ No newline at end of file diff --git a/data/fz/functions/module/here/custom_dimension_message/the_nether.mcfunction b/data/fz/functions/module/here/custom_dimension_message/the_nether.mcfunction deleted file mode 100644 index 4ba9d75..0000000 --- a/data/fz/functions/module/here/custom_dimension_message/the_nether.mcfunction +++ /dev/null @@ -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 \ No newline at end of file diff --git a/data/fz/functions/module/here/custom_dimension_message/if_in_overworld.mcfunction b/data/fz/functions/module/here/get_dimension_message/if_overworld.mcfunction similarity index 85% rename from data/fz/functions/module/here/custom_dimension_message/if_in_overworld.mcfunction rename to data/fz/functions/module/here/get_dimension_message/if_overworld.mcfunction index 90795d7..3bf1308 100644 --- a/data/fz/functions/module/here/custom_dimension_message/if_in_overworld.mcfunction +++ b/data/fz/functions/module/here/get_dimension_message/if_overworld.mcfunction @@ -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": "]"}]]' \ No newline at end of file diff --git a/data/fz/functions/module/here/custom_dimension_message/if_in_the_nether.mcfunction b/data/fz/functions/module/here/get_dimension_message/if_the_nether.mcfunction similarity index 86% rename from data/fz/functions/module/here/custom_dimension_message/if_in_the_nether.mcfunction rename to data/fz/functions/module/here/get_dimension_message/if_the_nether.mcfunction index 53c0d75..b84480a 100644 --- a/data/fz/functions/module/here/custom_dimension_message/if_in_the_nether.mcfunction +++ b/data/fz/functions/module/here/get_dimension_message/if_the_nether.mcfunction @@ -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": "]"}]]' \ No newline at end of file diff --git a/data/fz/functions/module/here/get_dimension_message/overworld.mcfunction b/data/fz/functions/module/here/get_dimension_message/overworld.mcfunction new file mode 100644 index 0000000..57c4362 --- /dev/null +++ b/data/fz/functions/module/here/get_dimension_message/overworld.mcfunction @@ -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 \ No newline at end of file diff --git a/data/fz/functions/module/here/get_dimension_message/the_nether.mcfunction b/data/fz/functions/module/here/get_dimension_message/the_nether.mcfunction new file mode 100644 index 0000000..5926bee --- /dev/null +++ b/data/fz/functions/module/here/get_dimension_message/the_nether.mcfunction @@ -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 \ No newline at end of file diff --git a/data/fz/functions/module/here/get_message.mcfunction b/data/fz/functions/module/here/get_message.mcfunction index 7dba9c6..17b9a03 100644 --- a/data/fz/functions/module/here/get_message.mcfunction +++ b/data/fz/functions/module/here/get_message.mcfunction @@ -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 \ No newline at end of file +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": "获取了位置信息"}] \ No newline at end of file diff --git a/data/fz/functions/module/here/global_message.mcfunction b/data/fz/functions/module/here/global_message.mcfunction index ee84ff0..4992e3d 100644 --- a/data/fz/functions/module/here/global_message.mcfunction +++ b/data/fz/functions/module/here/global_message.mcfunction @@ -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"}] \ No newline at end of file diff --git a/data/fz/functions/module/here/install.mcfunction b/data/fz/functions/module/here/install.mcfunction new file mode 100644 index 0000000..576c60d --- /dev/null +++ b/data/fz/functions/module/here/install.mcfunction @@ -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"}] \ No newline at end of file diff --git a/data/fz/functions/module/here/private_message.mcfunction b/data/fz/functions/module/here/private_message.mcfunction index da9138c..e9e53f2 100644 --- a/data/fz/functions/module/here/private_message.mcfunction +++ b/data/fz/functions/module/here/private_message.mcfunction @@ -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"}] \ No newline at end of file diff --git a/data/fz/functions/module/here/uninstall.mcfunction b/data/fz/functions/module/here/uninstall.mcfunction index 926b6bf..e34d0a4 100644 --- a/data/fz/functions/module/here/uninstall.mcfunction +++ b/data/fz/functions/module/here/uninstall.mcfunction @@ -1 +1,7 @@ -data remove storage fz:here fz \ No newline at end of file +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"}] \ No newline at end of file diff --git a/data/fz/functions/module/last_death/get_death_point.mcfunction b/data/fz/functions/module/last_death/get_death_point.mcfunction new file mode 100644 index 0000000..48ac7a8 --- /dev/null +++ b/data/fz/functions/module/last_death/get_death_point.mcfunction @@ -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": "获取了死亡点"}] \ No newline at end of file diff --git a/data/fz/functions/module/last_death/install.mcfunction b/data/fz/functions/module/last_death/install.mcfunction new file mode 100644 index 0000000..0dbf229 --- /dev/null +++ b/data/fz/functions/module/last_death/install.mcfunction @@ -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": "已安装组件:死亡点"}] \ No newline at end of file diff --git a/data/fz/functions/module/last_death/private_message.mcfunction b/data/fz/functions/module/last_death/private_message.mcfunction new file mode 100644 index 0000000..b2b47ad --- /dev/null +++ b/data/fz/functions/module/last_death/private_message.mcfunction @@ -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": "]"}]] \ No newline at end of file diff --git a/data/fz/functions/module/last_death/uninstall.mcfunction b/data/fz/functions/module/last_death/uninstall.mcfunction new file mode 100644 index 0000000..e837e73 --- /dev/null +++ b/data/fz/functions/module/last_death/uninstall.mcfunction @@ -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": "已卸载组件:死亡点"}] \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/display/reset_id.mcfunction b/data/fz/functions/module/scoreboard/display/reset_id.mcfunction new file mode 100644 index 0000000..12c0382 --- /dev/null +++ b/data/fz/functions/module/scoreboard/display/reset_id.mcfunction @@ -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 \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/load.mcfunction b/data/fz/functions/module/scoreboard/load.mcfunction index 7b03d03..e35ac96 100644 --- a/data/fz/functions/module/scoreboard/load.mcfunction +++ b/data/fz/functions/module/scoreboard/load.mcfunction @@ -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 -### 设置运行时计分板id,同时会计算最大id数 -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": "已加载组件:计分板"}] \ No newline at end of file diff --git a/data/fz/functions/module/scoreboard/uninstall.mcfunction b/data/fz/functions/module/scoreboard/uninstall.mcfunction index cc6ee9d..122434e 100644 --- a/data/fz/functions/module/scoreboard/uninstall.mcfunction +++ b/data/fz/functions/module/scoreboard/uninstall.mcfunction @@ -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": "将命令填入聊天框"}}}] diff --git a/data/fz/functions/module/try_install.mcfunction b/data/fz/functions/module/try_install.mcfunction deleted file mode 100644 index f7ba572..0000000 --- a/data/fz/functions/module/try_install.mcfunction +++ /dev/null @@ -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 diff --git a/data/fz/functions/system/uninstalled.mcfunction b/data/fz/functions/system/uninstalled.mcfunction index d2a330a..b98b17c 100644 --- a/data/fz/functions/system/uninstalled.mcfunction +++ b/data/fz/functions/system/uninstalled.mcfunction @@ -1,4 +1,5 @@ ## 标记为已卸载 +data remove storage fz:installed fz data modify storage fz:installed fz.global set value 0b ## 日志 diff --git a/data/fz/tags/functions/api/get_dimension.json b/data/fz/tags/functions/api/get_dimension.json new file mode 100644 index 0000000..25b7894 --- /dev/null +++ b/data/fz/tags/functions/api/get_dimension.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "fz:api/get_dimension", + "#fz:api/get_dimension_name" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/api/get_dimension_name.json b/data/fz/tags/functions/api/get_dimension_name.json new file mode 100644 index 0000000..febfb85 --- /dev/null +++ b/data/fz/tags/functions/api/get_dimension_name.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "fz:api/get_dimension_name/overworld", + "fz:api/get_dimension_name/the_nether" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/config/on_click.json b/data/fz/tags/functions/module/config/on_click.json index 6684d3e..7c67c57 100644 --- a/data/fz/tags/functions/module/config/on_click.json +++ b/data/fz/tags/functions/module/config/on_click.json @@ -2,6 +2,7 @@ "replace": false, "values": [ "fz:module/config/on_click", + "#fz:module/config/display", "fz:module/scoreboard/config/on_click" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/config/on_click/on_click.json b/data/fz/tags/functions/module/config/on_click/on_click.json new file mode 100644 index 0000000..a6d16f7 --- /dev/null +++ b/data/fz/tags/functions/module/config/on_click/on_click.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "#fz:module/config/on_click", + "#fz:module/config/reset_trigger" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/config/on_config.json b/data/fz/tags/functions/module/config/on_config.json index f5f752d..62b9cf7 100644 --- a/data/fz/tags/functions/module/config/on_config.json +++ b/data/fz/tags/functions/module/config/on_config.json @@ -2,6 +2,7 @@ "__comment": "调用者:fz:event/on_unsneak,当玩家抬头到最高角度并蹲起后,触发此事件", "replace": false, "values": [ - "fz:module/config/on_config" + "fz:module/config/loop", + "#fz:module/config/display" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/health/load.json b/data/fz/tags/functions/module/health/load.json index c63d310..e930fc1 100644 --- a/data/fz/tags/functions/module/health/load.json +++ b/data/fz/tags/functions/module/health/load.json @@ -1,6 +1,7 @@ { "replace": false, "values": [ + "#fz:module/health/set_health_name", "fz:module/health/load" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/here/custom_dimension_message.json b/data/fz/tags/functions/module/here/custom_dimension_message.json deleted file mode 100644 index e88316f..0000000 --- a/data/fz/tags/functions/module/here/custom_dimension_message.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "replace": false, - "values": [ - "fz:module/here/custom_dimension_message/overworld", - "fz:module/here/custom_dimension_message/the_nether" - ] -} \ No newline at end of file diff --git a/data/fz/tags/functions/module/here/get_dimension_message.json b/data/fz/tags/functions/module/here/get_dimension_message.json new file mode 100644 index 0000000..99196b7 --- /dev/null +++ b/data/fz/tags/functions/module/here/get_dimension_message.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "fz:module/here/get_dimension_message/overworld", + "fz:module/here/get_dimension_message/the_nether" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/here/get_message.json b/data/fz/tags/functions/module/here/get_message.json new file mode 100644 index 0000000..aa57091 --- /dev/null +++ b/data/fz/tags/functions/module/here/get_message.json @@ -0,0 +1,8 @@ +{ + "replace": false, + "values": [ + "#fz:api/get_dimension", + "fz:module/here/get_message", + "#fz:module/here/get_dimension_message" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/here/global_message.json b/data/fz/tags/functions/module/here/global_message.json new file mode 100644 index 0000000..5b82e69 --- /dev/null +++ b/data/fz/tags/functions/module/here/global_message.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "#fz:module/here/get_message", + "fz:module/here/global_message" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/here/install.json b/data/fz/tags/functions/module/here/install.json new file mode 100644 index 0000000..afb72c0 --- /dev/null +++ b/data/fz/tags/functions/module/here/install.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/here/install" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/here/private_message.json b/data/fz/tags/functions/module/here/private_message.json new file mode 100644 index 0000000..416ed9a --- /dev/null +++ b/data/fz/tags/functions/module/here/private_message.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "#fz:module/here/get_message", + "fz:module/here/private_message" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/last_death/get_death_point.json b/data/fz/tags/functions/module/last_death/get_death_point.json new file mode 100644 index 0000000..dd41031 --- /dev/null +++ b/data/fz/tags/functions/module/last_death/get_death_point.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "fz:module/last_death/get_death_point", + "#fz:api/get_dimension_name" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/last_death/install.json b/data/fz/tags/functions/module/last_death/install.json new file mode 100644 index 0000000..a80ef61 --- /dev/null +++ b/data/fz/tags/functions/module/last_death/install.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/last_death/install" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/last_death/private_message.json b/data/fz/tags/functions/module/last_death/private_message.json new file mode 100644 index 0000000..716959b --- /dev/null +++ b/data/fz/tags/functions/module/last_death/private_message.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "#fz:module/last_death/get_death_point", + "fz:module/last_death/private_message" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/last_death/uninstall.json b/data/fz/tags/functions/module/last_death/uninstall.json new file mode 100644 index 0000000..7e4a7b1 --- /dev/null +++ b/data/fz/tags/functions/module/last_death/uninstall.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fz:module/last_death/uninstall" + ] +} \ No newline at end of file diff --git a/data/fz/tags/functions/module/scoreboard/load.json b/data/fz/tags/functions/module/scoreboard/load.json index 40eb41e..1c6709c 100644 --- a/data/fz/tags/functions/module/scoreboard/load.json +++ b/data/fz/tags/functions/module/scoreboard/load.json @@ -2,6 +2,10 @@ "__comment": "调用者:fz:module/try_load", "replace": false, "values": [ + "fz:module/scoreboard/display/reset_id", + "fz:module/scoreboard/display/register_id", + "#fz:module/scoreboard/display/set_text", + "fz:module/scoreboard/display/carousel/loop", "fz:module/scoreboard/load" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/module/try_install.json b/data/fz/tags/functions/module/try_install.json deleted file mode 100644 index f6b5da7..0000000 --- a/data/fz/tags/functions/module/try_install.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "__comment": "调用者:fz:load", - "replace": false, - "values": [ - "fz:module/try_install" - ] -} \ No newline at end of file diff --git a/data/fz/tags/functions/system/install/module.json b/data/fz/tags/functions/system/install/module.json index 80da7aa..4120e7c 100644 --- a/data/fz/tags/functions/system/install/module.json +++ b/data/fz/tags/functions/system/install/module.json @@ -1,6 +1,10 @@ { "replace": false, "values": [ - "#fz:module/try_install" + "#fz:module/config/install", + "#fz:module/health/install", + "#fz:module/here/install", + "#fz:module/last_death/install", + "#fz:module/scoreboard/install" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/system/install/system.json b/data/fz/tags/functions/system/install/system.json index 23bf0ee..67cdd5e 100644 --- a/data/fz/tags/functions/system/install/system.json +++ b/data/fz/tags/functions/system/install/system.json @@ -3,7 +3,6 @@ "values": [ "fz:system/install", "fz:logger/install", - "fz:logger/load", "fz:game_event/install" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/system/load/system.json b/data/fz/tags/functions/system/load/system.json index 0c9ffbd..88715eb 100644 --- a/data/fz/tags/functions/system/load/system.json +++ b/data/fz/tags/functions/system/load/system.json @@ -2,6 +2,7 @@ "replace": false, "values": [ "fz:system/load", - "fz:logger/load" + "fz:logger/load", + "fz:game_event/load" ] } \ No newline at end of file diff --git a/data/fz/tags/functions/system/uninstall/module.json b/data/fz/tags/functions/system/uninstall/module.json index 7d02ff7..aff3fb4 100644 --- a/data/fz/tags/functions/system/uninstall/module.json +++ b/data/fz/tags/functions/system/uninstall/module.json @@ -4,6 +4,7 @@ "#fz:module/config/uninstall", "#fz:module/health/uninstall", "#fz:module/here/uninstall", + "#fz:module/last_death/uninstall", "#fz:module/scoreboard/uninstall" ] } \ No newline at end of file