diff --git a/data/fzsd/functions/api/get_dimension_name/default.mcfunction b/data/fzsd/functions/api/get_dimension_name/default.mcfunction index afc12f5..dc3a371 100644 --- a/data/fzsd/functions/api/get_dimension_name/default.mcfunction +++ b/data/fzsd/functions/api/get_dimension_name/default.mcfunction @@ -1 +1 @@ -data modify storage fzsd:global fzsd.api.dimension.name set value '{"nbt": "fzsd.cache.dimension.id", "storage": "fzsd:global"}' \ No newline at end of file +data modify storage fzsd:global fzsd.api.dimension.name set value '{"nbt": "fzsd.api.dimension.id", "storage": "fzsd:global"}' \ No newline at end of file diff --git a/data/fzsd/functions/game_event/player/on_broke_block_with_tool/on_used_tool.mcfunction b/data/fzsd/functions/game_event/player/on_broke_block_with_tool/calculate_dig_score.mcfunction similarity index 94% rename from data/fzsd/functions/game_event/player/on_broke_block_with_tool/on_used_tool.mcfunction rename to data/fzsd/functions/game_event/player/on_broke_block_with_tool/calculate_dig_score.mcfunction index db1f86f..a92443b 100644 --- a/data/fzsd/functions/game_event/player/on_broke_block_with_tool/on_used_tool.mcfunction +++ b/data/fzsd/functions/game_event/player/on_broke_block_with_tool/calculate_dig_score.mcfunction @@ -30,7 +30,4 @@ scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.eve scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.wooden_pickaxe scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.wooden_shovel scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.wooden_sword -scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.dig_offset - -## 判断分数 -execute unless score fzsd.var.score fzsd.variable.integer matches ..0 run function fzsd:game_event/player/on_broke_block_with_tool \ No newline at end of file +scoreboard players operation fzsd.var.score fzsd.variable.integer += @s fzsd.event.used_tool.dig_offset \ No newline at end of file diff --git a/data/fzsd/functions/game_event/player/on_broke_block_with_tool/try_trigger.mcfunction b/data/fzsd/functions/game_event/player/on_broke_block_with_tool/try_trigger.mcfunction new file mode 100644 index 0000000..5d65686 --- /dev/null +++ b/data/fzsd/functions/game_event/player/on_broke_block_with_tool/try_trigger.mcfunction @@ -0,0 +1,2 @@ +## 判断分数 +execute unless score fzsd.var.score fzsd.variable.integer matches ..0 run function fzsd:game_event/player/on_broke_block_with_tool \ No newline at end of file diff --git a/data/fzsd/functions/module/here/get_dimension_message/if_the_nether.mcfunction b/data/fzsd/functions/module/here/get_dimension_message/if_the_nether.mcfunction index d94cae7..48d2e89 100644 --- a/data/fzsd/functions/module/here/get_dimension_message/if_the_nether.mcfunction +++ b/data/fzsd/functions/module/here/get_dimension_message/if_the_nether.mcfunction @@ -3,4 +3,5 @@ execute store result storage fzsd:here fzsd.overworld.x int 8 run data get entit execute store result storage fzsd:here fzsd.overworld.z int 8 run data get entity @s Pos[2] data modify storage fzsd:global fzsd.api.dimension.id set value "minecraft:overworld" function #fzsd:api/get_dimension_name -data modify storage fzsd:here fzsd.message.append set value '[{"text": ",对应", "color": "white"}, {"nbt": "fzsd.api.dimension.name", "interpret": true, "storage": "fzsd:global"}, [{"text": "[", "color": "green"}, {"nbt": "fzsd.overworld.x", "storage": "fzsd:here"}, {"text": ", "}, {"nbt": "fzsd.overworld.z", "storage": "fzsd:here"}, {"text": "]"}]]' \ No newline at end of file +data modify storage fzsd:here fzsd.message.append set value '[{"text": ",对应", "color": "white"}, {"nbt": "fzsd.api.dimension.name", "interpret": true, "storage": "fzsd:global"}, [{"text": "[", "color": "green"}, {"nbt": "fzsd.overworld.x", "storage": "fzsd:here"}, {"text": ", "}, {"nbt": "fzsd.overworld.z", "storage": "fzsd:here"}, {"text": "]"}]]' +## 恢复用于判断的维度id \ No newline at end of file diff --git a/data/fzsd/functions/module/here/get_dimension_message/overworld.mcfunction b/data/fzsd/functions/module/here/get_dimension_message/overworld.mcfunction index 71763c5..46c00ec 100644 --- a/data/fzsd/functions/module/here/get_dimension_message/overworld.mcfunction +++ b/data/fzsd/functions/module/here/get_dimension_message/overworld.mcfunction @@ -1 +1 @@ -execute if data storage fzsd:global fzsd.api.dimension{id:"minecraft:overworld"} run function fzsd:module/here/get_dimension_message/if_overworld \ No newline at end of file +execute if data entity @s {Dimension:"minecraft:overworld"} run function fzsd:module/here/get_dimension_message/if_overworld \ No newline at end of file diff --git a/data/fzsd/functions/module/here/get_dimension_message/the_nether.mcfunction b/data/fzsd/functions/module/here/get_dimension_message/the_nether.mcfunction index 44bae3a..474495e 100644 --- a/data/fzsd/functions/module/here/get_dimension_message/the_nether.mcfunction +++ b/data/fzsd/functions/module/here/get_dimension_message/the_nether.mcfunction @@ -1 +1 @@ -execute if data storage fzsd:global fzsd.api.dimension{id:"minecraft:the_nether"} run function fzsd:module/here/get_dimension_message/if_the_nether \ No newline at end of file +execute if data entity @s {Dimension:"minecraft:the_nether"} run function fzsd:module/here/get_dimension_message/if_the_nether \ No newline at end of file diff --git a/data/fzsd/functions/module/here/get_message.mcfunction b/data/fzsd/functions/module/here/get_message.mcfunction index 300836b..dad1942 100644 --- a/data/fzsd/functions/module/here/get_message.mcfunction +++ b/data/fzsd/functions/module/here/get_message.mcfunction @@ -1,8 +1,8 @@ -## fzsd.cache.pos已在install中初始化 + 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.append set value '' - +data modify storage fzsd:here fzsd.dimension.name set from storage fzsd:global fzsd.api.dimension.name ## 调试 execute if score fzsd.logger.level fzsd.variable.integer matches ..400 run tellraw @a [{"nbt": "fzsd.level.debug", "interpret": true, "storage": "fzsd:logger"}, {"text": "玩家"}, {"selector": "@s"}, {"text": "获取了位置信息"}] \ No newline at end of file diff --git a/data/fzsd/functions/module/here/global_message.mcfunction b/data/fzsd/functions/module/here/global_message.mcfunction index 2c23865..93c12c0 100644 --- a/data/fzsd/functions/module/here/global_message.mcfunction +++ b/data/fzsd/functions/module/here/global_message.mcfunction @@ -1 +1 @@ -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 +tellraw @a [{"selector": "@s"}, [{"text": "说:我在", "color": "white"}, {"nbt": "fzsd.dimension.name", "interpret": true, "storage": "fzsd:here"}, [{"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 39d2e35..9da0724 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.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 +tellraw @s [{"text": "你在", "color": "white"}, {"nbt": "fzsd.dimension.name", "interpret": true, "storage": "fzsd:here"}, [{"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/tags/functions/game_event/player/on_broke_block_with_tool/calculate_dig_score.json b/data/fzsd/tags/functions/game_event/player/on_broke_block_with_tool/calculate_dig_score.json new file mode 100644 index 0000000..a050418 --- /dev/null +++ b/data/fzsd/tags/functions/game_event/player/on_broke_block_with_tool/calculate_dig_score.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "fzsd:game_event/player/on_broke_block_with_tool/calculate_dig_score" + ] +} \ No newline at end of file diff --git a/data/fzsd/tags/functions/game_event/player/on_used_tool.json b/data/fzsd/tags/functions/game_event/player/on_used_tool.json index 2259bd7..ce9eb56 100644 --- a/data/fzsd/tags/functions/game_event/player/on_used_tool.json +++ b/data/fzsd/tags/functions/game_event/player/on_used_tool.json @@ -1,6 +1,7 @@ { "replace": false, "values": [ - "fzsd:game_event/player/on_broke_block_with_tool/on_used_tool" + "#fzsd:game_event/player/on_broke_block_with_tool/calculate_dig_score", + "fzsd:game_event/player/on_broke_block_with_tool/try_trigger" ] } \ No newline at end of file