From 525e1a0865c2530b5ea6b30655a384fb342f682d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=B6=E7=9A=93?= <1214946206@qq.com> Date: Tue, 2 Aug 2022 01:43:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=8A=A8=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E7=9B=B8=E5=85=B3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/fzsd/functions/module/here/get_message.mcfunction | 2 -- data/fzsd/functions/module/here/global_message.mcfunction | 2 +- data/fzsd/functions/module/here/private_message.mcfunction | 2 +- .../functions/module/last_death/private_message.mcfunction | 2 +- .../module/last_nether_portal/global_message.mcfunction | 2 +- .../functions/module/last_nether_portal/install.mcfunction | 1 - .../module/last_nether_portal/private_message.mcfunction | 2 +- .../module/last_spawn_point/private_message.mcfunction | 2 +- .../system/uninstall/cache_module_install_data.mcfunction | 2 +- .../system/uninstall/restore_module_install_data.mcfunction | 4 ++-- data/fzsd/functions/system/update.mcfunction | 2 +- data/fzsd/tags/functions/uninstall.json | 2 +- 12 files changed, 11 insertions(+), 14 deletions(-) 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