修复自动升级相关bug

This commit is contained in:
延皓 2022-08-02 01:43:37 +08:00
parent 24bb299869
commit 525e1a0865
12 changed files with 11 additions and 14 deletions

View File

@ -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 ''
## 调试

View File

@ -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"}]
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"}]]

View File

@ -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"}]
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"}]

View File

@ -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": "你从未死亡!"}

View File

@ -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": "你从未穿出过下界传送门!"}

View File

@ -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

View File

@ -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": "你从未穿出过下界传送门!"}

View File

@ -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": "你从未设置过出生点!"}

View File

@ -1,2 +1,2 @@
## 将模块安装记录缓存因为模块的卸载函数会覆盖该记录
data modify storage fzsd:installed fzsd.cache set from storage fzsd:installed fzsd.module
data modify storage fzsd:install fzsd.cache set from storage fzsd:install fzsd.module

View File

@ -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
data modify storage fzsd:install fzsd.module set from storage fzsd:install fzsd.cache
data remove storage fzsd:install fzsd.cache

View File

@ -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

View File

@ -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"
]
}