diff --git a/data/fzsd/functions/module/here/get_message.mcfunction b/data/fzsd/functions/module/here/get_message.mcfunction index 2517c4b..300836b 100644 --- a/data/fzsd/functions/module/here/get_message.mcfunction +++ b/data/fzsd/functions/module/here/get_message.mcfunction @@ -2,8 +2,6 @@ execute store result storage fzsd:here fzsd.x int 1 run data get entity @s Pos[0] execute store result storage fzsd:here fzsd.y int 1 run data get entity @s Pos[1] execute store result storage fzsd:here fzsd.z int 1 run data get entity @s Pos[2] -data modify storage fzsd:here fzsd.message.dimension set from storage fzsd:global fzsd.api.dimension.name -data modify storage fzsd:here fzsd.message.position set value '[{"text": "[", "color": "green"}, {"nbt": "fzsd.x", "storage": "fzsd:here"}, {"text": ", "}, {"nbt": "fzsd.y", "storage": "fzsd:here"}, {"text": ", "}, {"nbt": "fzsd.z", "storage": "fzsd:here"}, {"text": "]"}]' data modify storage fzsd:here fzsd.message.append set value '' ## 调试 diff --git a/data/fzsd/functions/module/here/global_message.mcfunction b/data/fzsd/functions/module/here/global_message.mcfunction index 7f88145..2c23865 100644 --- a/data/fzsd/functions/module/here/global_message.mcfunction +++ b/data/fzsd/functions/module/here/global_message.mcfunction @@ -1 +1 @@ -tellraw @a [{"text": "", "color": "white"}, {"selector": "@s"}, {"text": "说:"}, {"text": "我在"}, {"nbt": "fzsd.message.dimension", "interpret": true, "storage": "fzsd:here"}, {"nbt": "fzsd.message.position", "interpret": true, "storage": "fzsd:here"}, {"nbt": "fzsd.message.append", "interpret": true, "storage": "fzsd:here"}] \ No newline at end of file +tellraw @a [{"selector": "@s"}, [{"text": "说:我在", "color": "white"}, {"nbt": "fzsd.api.dimension.name", "interpret": true, "storage": "fzsd:global"}, [{"text": " [", "color": "green"}, {"nbt": "fzsd.x", "storage": "fzsd:here"}, {"text": ", "}, {"nbt": "fzsd.y", "storage": "fzsd:here"}, {"text": ", "}, {"nbt": "fzsd.z", "storage": "fzsd:here"}, {"text": "]"}], {"nbt": "fzsd.message.append", "interpret": true, "storage": "fzsd:here"}]] \ No newline at end of file diff --git a/data/fzsd/functions/module/here/private_message.mcfunction b/data/fzsd/functions/module/here/private_message.mcfunction index b885357..39d2e35 100644 --- a/data/fzsd/functions/module/here/private_message.mcfunction +++ b/data/fzsd/functions/module/here/private_message.mcfunction @@ -1 +1 @@ -tellraw @s [{"text": "你在", "color": "white"}, {"nbt": "fzsd.message.dimension", "interpret": true, "storage": "fzsd:here"}, {"nbt": "fzsd.message.position", "interpret": true, "storage": "fzsd:here"}, {"nbt": "fzsd.message.append", "interpret": true, "storage": "fzsd:here"}] \ No newline at end of file +tellraw @s [{"text": "你在", "color": "white"}, {"nbt": "fzsd.api.dimension.name", "interpret": true, "storage": "fzsd:global"}, [{"text": " [", "color": "green"}, {"nbt": "fzsd.x", "storage": "fzsd:here"}, {"text": ", "}, {"nbt": "fzsd.y", "storage": "fzsd:here"}, {"text": ", "}, {"nbt": "fzsd.z", "storage": "fzsd:here"}, {"text": "]"}], {"nbt": "fzsd.message.append", "interpret": true, "storage": "fzsd:here"}] \ No newline at end of file diff --git a/data/fzsd/functions/module/last_death/private_message.mcfunction b/data/fzsd/functions/module/last_death/private_message.mcfunction index 75d262b..4fe4c42 100644 --- a/data/fzsd/functions/module/last_death/private_message.mcfunction +++ b/data/fzsd/functions/module/last_death/private_message.mcfunction @@ -1,2 +1,2 @@ -execute if data entity @s LastDeathLocation run tellraw @s [{"text": "你上次死亡于"}, {"nbt": "fzsd.api.dimension.name", "interpret": true, "storage": "fzsd:global"}, [{"text": "[", "color": "green"}, {"nbt": "fzsd.x", "storage": "fzsd:last_death"}, {"text": ", "}, {"nbt": "fzsd.y", "storage": "fzsd:last_death"}, {"text": ", "}, {"nbt": "fzsd.z", "storage": "fzsd:last_death"}, {"text": "]"}]] +execute if data entity @s LastDeathLocation run tellraw @s [{"text": "你上次死亡于"}, {"nbt": "fzsd.api.dimension.name", "interpret": true, "storage": "fzsd:global"}, [{"text": " [", "color": "green"}, {"nbt": "fzsd.x", "storage": "fzsd:last_death"}, {"text": ", "}, {"nbt": "fzsd.y", "storage": "fzsd:last_death"}, {"text": ", "}, {"nbt": "fzsd.z", "storage": "fzsd:last_death"}, {"text": "]"}]] execute unless data entity @s LastDeathLocation run tellraw @s {"text": "你从未死亡!"} \ No newline at end of file diff --git a/data/fzsd/functions/module/last_nether_portal/global_message.mcfunction b/data/fzsd/functions/module/last_nether_portal/global_message.mcfunction index 4eb2323..e4348d8 100644 --- a/data/fzsd/functions/module/last_nether_portal/global_message.mcfunction +++ b/data/fzsd/functions/module/last_nether_portal/global_message.mcfunction @@ -1,2 +1,2 @@ -execute if score @s fzsd.module.last_nether_portal.dimension matches -2147483648..2147483647 run tellraw @a [{"selector": "@s"}, [{"text": "说:我上次穿出的下界传送门位于", "color": "white"}, {"nbt": "fzsd.message", "interpret": true, "storage": "fzsd:last_nether_portal"}]] +execute if score @s fzsd.module.last_nether_portal.dimension matches -2147483648..2147483647 run tellraw @a [{"selector": "@s"}, [{"text": "说:我上次穿出的下界传送门位于", "color": "white"}, {"nbt": "fzsd.api.dimension.name", "interpret": true, "storage": "fzsd:global"}, [{"text": " [", "color": "green"}, {"score": {"name": "@s", "objective": "fzsd.module.last_nether_portal.x"}}, {"text": ", "}, {"score": {"name": "@s", "objective": "fzsd.module.last_nether_portal.z"}}, {"text": ", "}, {"score": {"name": "@s", "objective": "fzsd.module.last_nether_portal.z"}}, {"text": "]"}]]] execute unless score @s fzsd.module.last_nether_portal.dimension matches -2147483648..2147483647 run tellraw @s {"text": "你从未穿出过下界传送门!"} \ No newline at end of file diff --git a/data/fzsd/functions/module/last_nether_portal/install.mcfunction b/data/fzsd/functions/module/last_nether_portal/install.mcfunction index 38d60f7..b584dbf 100644 --- a/data/fzsd/functions/module/last_nether_portal/install.mcfunction +++ b/data/fzsd/functions/module/last_nether_portal/install.mcfunction @@ -2,7 +2,6 @@ scoreboard objectives add fzsd.module.last_nether_portal.dimension dummy scoreboard objectives add fzsd.module.last_nether_portal.x dummy scoreboard objectives add fzsd.module.last_nether_portal.y dummy scoreboard objectives add fzsd.module.last_nether_portal.z dummy -data modify storage fzsd:last_nether_portal fzsd.message set value '[{"nbt": "fzsd.api.dimension.name", "interpret": true, "storage": "fzsd:global"}, [{"text": "[", "color": "green"}, {"score": {"name": "@s", "objective": "fzsd.module.last_nether_portal.x"}}, {"text": ", "}, {"score": {"name": "@s", "objective": "fzsd.module.last_nether_portal.z"}}, {"text": ", "}, {"score": {"name": "@s", "objective": "fzsd.module.last_nether_portal.z"}}, {"text": "]"}]]' ## 标记为已安装 data modify storage fzsd:install fzsd.module.last_nether_portal set value 1b diff --git a/data/fzsd/functions/module/last_nether_portal/private_message.mcfunction b/data/fzsd/functions/module/last_nether_portal/private_message.mcfunction index aff0265..b624a95 100644 --- a/data/fzsd/functions/module/last_nether_portal/private_message.mcfunction +++ b/data/fzsd/functions/module/last_nether_portal/private_message.mcfunction @@ -1,2 +1,2 @@ -execute if score @s fzsd.module.last_nether_portal.dimension matches -2147483648..2147483647 run tellraw @s [{"text": "你上次穿出的下界传送门位于"}, {"nbt": "fzsd.message", "interpret": true, "storage": "fzsd:last_nether_portal"}] +execute if score @s fzsd.module.last_nether_portal.dimension matches -2147483648..2147483647 run tellraw @s [{"text": "你上次穿出的下界传送门位于"}, {"nbt": "fzsd.api.dimension.name", "interpret": true, "storage": "fzsd:global"}, [{"text": " [", "color": "green"}, {"score": {"name": "@s", "objective": "fzsd.module.last_nether_portal.x"}}, {"text": ", "}, {"score": {"name": "@s", "objective": "fzsd.module.last_nether_portal.z"}}, {"text": ", "}, {"score": {"name": "@s", "objective": "fzsd.module.last_nether_portal.z"}}, {"text": "]"}]] execute unless score @s fzsd.module.last_nether_portal.dimension matches -2147483648..2147483647 run tellraw @s {"text": "你从未穿出过下界传送门!"} \ No newline at end of file diff --git a/data/fzsd/functions/module/last_spawn_point/private_message.mcfunction b/data/fzsd/functions/module/last_spawn_point/private_message.mcfunction index c16e509..2fda5c4 100644 --- a/data/fzsd/functions/module/last_spawn_point/private_message.mcfunction +++ b/data/fzsd/functions/module/last_spawn_point/private_message.mcfunction @@ -1,2 +1,2 @@ -execute if data entity @s SpawnDimension run tellraw @s [{"text": "你的上个出生点位于"}, {"nbt": "fzsd.api.dimension.name", "interpret": true, "storage": "fzsd:global"}, [{"text": "[x: ", "color": "green"}, {"nbt": "fzsd.x", "storage": "fzsd:last_spawn_point"}, {"text": ", y: "}, {"nbt": "fzsd.y", "storage": "fzsd:last_spawn_point"}, {"text": ", z: "}, {"nbt": "fzsd.z", "storage": "fzsd:last_spawn_point"}, {"text": "]"}]] +execute if data entity @s SpawnDimension run tellraw @s [{"text": "你的上个出生点位于"}, {"nbt": "fzsd.api.dimension.name", "interpret": true, "storage": "fzsd:global"}, [{"text": " [", "color": "green"}, {"nbt": "fzsd.x", "storage": "fzsd:last_spawn_point"}, {"text": ", "}, {"nbt": "fzsd.y", "storage": "fzsd:last_spawn_point"}, {"text": ", "}, {"nbt": "fzsd.z", "storage": "fzsd:last_spawn_point"}, {"text": "]"}]] execute unless data entity @s SpawnDimension run tellraw @s {"text": "你从未设置过出生点!"} \ No newline at end of file diff --git a/data/fzsd/functions/system/uninstall/cache_module_install_data.mcfunction b/data/fzsd/functions/system/uninstall/cache_module_install_data.mcfunction index 2b269f0..4bd895f 100644 --- a/data/fzsd/functions/system/uninstall/cache_module_install_data.mcfunction +++ b/data/fzsd/functions/system/uninstall/cache_module_install_data.mcfunction @@ -1,2 +1,2 @@ ## 将模块安装记录缓存,因为模块的卸载函数会覆盖该记录 -data modify storage fzsd:installed fzsd.cache set from storage fzsd:installed fzsd.module \ No newline at end of file +data modify storage fzsd:install fzsd.cache set from storage fzsd:install fzsd.module \ No newline at end of file diff --git a/data/fzsd/functions/system/uninstall/restore_module_install_data.mcfunction b/data/fzsd/functions/system/uninstall/restore_module_install_data.mcfunction index 8d96824..37595a1 100644 --- a/data/fzsd/functions/system/uninstall/restore_module_install_data.mcfunction +++ b/data/fzsd/functions/system/uninstall/restore_module_install_data.mcfunction @@ -1,3 +1,3 @@ ## 恢复模块安装记录 -data modify storage fzsd:installed fzsd.module set from storage fzsd:installed fzsd.cache -data remove storage fzsd:installed fzsd.cache \ No newline at end of file +data modify storage fzsd:install fzsd.module set from storage fzsd:install fzsd.cache +data remove storage fzsd:install fzsd.cache \ No newline at end of file diff --git a/data/fzsd/functions/system/update.mcfunction b/data/fzsd/functions/system/update.mcfunction index 6ebc09d..42e11c5 100644 --- a/data/fzsd/functions/system/update.mcfunction +++ b/data/fzsd/functions/system/update.mcfunction @@ -1,2 +1,2 @@ -execute if data storage fzsd:installed fzsd{global: 1b} run function #fzsd:uninstall +execute if data storage fzsd:install fzsd{global: 1b} run function #fzsd:uninstall function #fzsd:install diff --git a/data/fzsd/tags/functions/uninstall.json b/data/fzsd/tags/functions/uninstall.json index b78e8d9..acb3f21 100644 --- a/data/fzsd/tags/functions/uninstall.json +++ b/data/fzsd/tags/functions/uninstall.json @@ -5,8 +5,8 @@ "#fzsd:system/uninstall/before", "fzsd:system/uninstall/cache_module_install_data", "#fzsd:system/uninstall/module", - "fzsd:system/uninstall/restore_module_install_data", "#fzsd:system/uninstall/system", + "fzsd:system/uninstall/restore_module_install_data", "#fzsd:system/uninstall/after" ] } \ No newline at end of file