diff --git a/datapacks/Bookshelf/data/bs.schedule/function/cancel/cancel_all.mcfunction b/datapacks/Bookshelf/data/bs.schedule/function/cancel/cancel_all.mcfunction index 29f708b2c6..dd029a273a 100644 --- a/datapacks/Bookshelf/data/bs.schedule/function/cancel/cancel_all.mcfunction +++ b/datapacks/Bookshelf/data/bs.schedule/function/cancel/cancel_all.mcfunction @@ -15,5 +15,5 @@ # Documentation of the feature: https://bookshelf.docs.gunivers.net/en/latest/modules/schedule.html#cancel # ------------------------------------------------------------------------------------------------------------ -$execute store result score #result bs.data run data remove storage bs:data schedule[$(with)] +$execute store result score #result bs.data run data remove storage bs:data schedule.queue[$(with)] function #bs.log:info {namespace:"bs.schedule", tag:"cancel", path:"#bs.schedule:cancel", message:'["Canceled ",{"score":{"name":"#result","objective":"bs.data"}}," command(s)."]'} diff --git a/datapacks/Bookshelf/data/bs.schedule/function/cancel/cancel_one.mcfunction b/datapacks/Bookshelf/data/bs.schedule/function/cancel/cancel_one.mcfunction index b6602057bd..68d6b783b3 100644 --- a/datapacks/Bookshelf/data/bs.schedule/function/cancel/cancel_one.mcfunction +++ b/datapacks/Bookshelf/data/bs.schedule/function/cancel/cancel_one.mcfunction @@ -16,6 +16,6 @@ # ------------------------------------------------------------------------------------------------------------ # Find the last element of the queue with the given data. -$data modify storage bs:ctx _ set from storage bs:data schedule[$(with)] +$data modify storage bs:ctx _ set from storage bs:data schedule.queue[$(with)] execute store success score #success bs.data run function bs.schedule:cancel/remove_one with storage bs:ctx _ function #bs.log:info {namespace:"bs.schedule", tag:"cancel_one", path:"#bs.schedule:cancel_one", message:'["Canceled ",{"score":{"name":"#success","objective":"bs.data"}}," command."]'} diff --git a/datapacks/Bookshelf/data/bs.schedule/function/cancel/remove_one.mcfunction b/datapacks/Bookshelf/data/bs.schedule/function/cancel/remove_one.mcfunction index 533afd3686..13a271e480 100644 --- a/datapacks/Bookshelf/data/bs.schedule/function/cancel/remove_one.mcfunction +++ b/datapacks/Bookshelf/data/bs.schedule/function/cancel/remove_one.mcfunction @@ -13,4 +13,4 @@ # For more details, refer to the MPL v2.0. # ------------------------------------------------------------------------------------------------------------ -$return run data remove storage bs:data schedule[{suid:$(suid)}] +$return run data remove storage bs:data schedule.queue[{suid:$(suid)}] diff --git a/datapacks/Bookshelf/data/bs.schedule/function/clear.mcfunction b/datapacks/Bookshelf/data/bs.schedule/function/clear.mcfunction index d45433c730..f7ff8121eb 100644 --- a/datapacks/Bookshelf/data/bs.schedule/function/clear.mcfunction +++ b/datapacks/Bookshelf/data/bs.schedule/function/clear.mcfunction @@ -16,5 +16,5 @@ # ------------------------------------------------------------------------------------------------------------ scoreboard players set #schedule.suid bs.data 0 -data modify storage bs:data schedule set value [] +data modify storage bs:data schedule.queue set value [] schedule clear bs.schedule:execute/callback diff --git a/datapacks/Bookshelf/data/bs.schedule/function/execute/callback.mcfunction b/datapacks/Bookshelf/data/bs.schedule/function/execute/callback.mcfunction index 45775cea61..fab305def9 100644 --- a/datapacks/Bookshelf/data/bs.schedule/function/execute/callback.mcfunction +++ b/datapacks/Bookshelf/data/bs.schedule/function/execute/callback.mcfunction @@ -13,7 +13,7 @@ # For more details, refer to the MPL v2.0. # ------------------------------------------------------------------------------------------------------------ -data modify storage bs:ctx _ set value [] +data modify storage bs:data schedule._ set value [] execute store result storage bs:ctx y int 1 run time query gametime function bs.schedule:execute/splice with storage bs:ctx execute as B5-0-0-0-4 run function bs.schedule:execute/context diff --git a/datapacks/Bookshelf/data/bs.schedule/function/execute/context.mcfunction b/datapacks/Bookshelf/data/bs.schedule/function/execute/context.mcfunction index 2c63e60607..239fe3abc5 100644 --- a/datapacks/Bookshelf/data/bs.schedule/function/execute/context.mcfunction +++ b/datapacks/Bookshelf/data/bs.schedule/function/execute/context.mcfunction @@ -13,5 +13,5 @@ # For more details, refer to the MPL v2.0. # ------------------------------------------------------------------------------------------------------------ -execute if data storage bs:ctx _[-1] run function bs.schedule:execute/loop +execute if data storage bs:data schedule._[-1] run function bs.schedule:execute/loop execute in minecraft:overworld run tp @s -30000000 0 1600 diff --git a/datapacks/Bookshelf/data/bs.schedule/function/execute/loop.mcfunction b/datapacks/Bookshelf/data/bs.schedule/function/execute/loop.mcfunction index 3bacbb69e2..38d080c9c8 100644 --- a/datapacks/Bookshelf/data/bs.schedule/function/execute/loop.mcfunction +++ b/datapacks/Bookshelf/data/bs.schedule/function/execute/loop.mcfunction @@ -13,10 +13,10 @@ # For more details, refer to the MPL v2.0. # ------------------------------------------------------------------------------------------------------------ -data modify entity @s {} merge from storage bs:ctx _[-1] -execute store success score #success bs.data if data storage bs:ctx _[-1].Owner -execute if score #success bs.data matches 0 at @s run function bs.schedule:execute/run with storage bs:ctx _[-1] -execute if score #success bs.data matches 1 at @s on origin run function bs.schedule:execute/run with storage bs:ctx _[-1] +data modify entity @s {} merge from storage bs:data schedule._[-1] +execute store success score #success bs.data if data storage bs:data schedule._[-1].Owner +execute if score #success bs.data matches 0 at @s run function bs.schedule:execute/run with storage bs:data schedule._[-1] +execute if score #success bs.data matches 1 at @s on origin run function bs.schedule:execute/run with storage bs:data schedule._[-1] -data remove storage bs:ctx _[-1] -execute if data storage bs:ctx _[-1] run function bs.schedule:execute/loop +data remove storage bs:data schedule._[-1] +execute if data storage bs:data schedule._[-1] run function bs.schedule:execute/loop diff --git a/datapacks/Bookshelf/data/bs.schedule/function/execute/splice.mcfunction b/datapacks/Bookshelf/data/bs.schedule/function/execute/splice.mcfunction index e93fba1331..8f403f39b7 100644 --- a/datapacks/Bookshelf/data/bs.schedule/function/execute/splice.mcfunction +++ b/datapacks/Bookshelf/data/bs.schedule/function/execute/splice.mcfunction @@ -13,5 +13,5 @@ # For more details, refer to the MPL v2.0. # ------------------------------------------------------------------------------------------------------------ -$data modify storage bs:ctx _ append from storage bs:data schedule[{time:$(y)}] -$data remove storage bs:data schedule[{time:$(y)}] +$data modify storage bs:data schedule._ append from storage bs:data schedule.queue[{time:$(y)}] +$data remove storage bs:data schedule.queue[{time:$(y)}] diff --git a/datapacks/Bookshelf/data/bs.schedule/function/schedule/schedule.mcfunction b/datapacks/Bookshelf/data/bs.schedule/function/schedule/schedule.mcfunction index 6af7e039cd..051c24278c 100644 --- a/datapacks/Bookshelf/data/bs.schedule/function/schedule/schedule.mcfunction +++ b/datapacks/Bookshelf/data/bs.schedule/function/schedule/schedule.mcfunction @@ -31,6 +31,6 @@ data modify storage bs:ctx _.Owner set from entity @s UUID execute as B5-0-0-0-1 run function bs.schedule:schedule/context # Add the command to the schedule queue -data modify storage bs:data schedule prepend from storage bs:ctx _ +data modify storage bs:data schedule.queue prepend from storage bs:ctx _ function #bs.log:info {namespace:"bs.schedule", tag:"schedule", path:"#bs.schedule:schedule", message:'"Command scheduled."'} return run data get storage bs:ctx _.suid 1 diff --git a/datapacks/Bookshelf/data/bs.schedule/function/schedule/unit/handle.mcfunction b/datapacks/Bookshelf/data/bs.schedule/function/schedule/unit/handle.mcfunction index 19235729b4..74864d2d9c 100644 --- a/datapacks/Bookshelf/data/bs.schedule/function/schedule/unit/handle.mcfunction +++ b/datapacks/Bookshelf/data/bs.schedule/function/schedule/unit/handle.mcfunction @@ -14,6 +14,5 @@ # ------------------------------------------------------------------------------------------------------------ $execute store success score #success bs.data run function bs.schedule:schedule/unit/normalize with storage bs:const schedule.units[{name:'$(unit)'}] -execute if score #success bs.data matches 0 run say a execute if score #success bs.data matches 0 run function #bs.log:error {namespace:"bs.schedule", tag:"schedule", path:"#bs.schedule:schedule", message:'["Unit \\\'",{"storage":"bs:ctx","nbt":"_.unit"},"\\\' is not supported."]'} data remove storage bs:ctx _.unit