diff --git a/gm4_block_compressors/data/gm4_block_compressors/test/compress_7.mcfunction b/gm4_block_compressors/data/gm4_block_compressors/test/compress_7.mcfunction index 4da09b10a2..99a3edb517 100644 --- a/gm4_block_compressors/data/gm4_block_compressors/test/compress_7.mcfunction +++ b/gm4_block_compressors/data/gm4_block_compressors/test/compress_7.mcfunction @@ -1,6 +1,5 @@ # @template gm4:test_platform # @skyaccess -# @optional execute positioned ~1.5 ~1.5 ~1.5 run function gm4_block_compressors:machine/create item replace block ~1 ~1 ~1 container.0 with cobblestone 7 diff --git a/gm4_block_compressors/data/gm4_block_compressors/test/destroy.mcfunction b/gm4_block_compressors/data/gm4_block_compressors/test/destroy.mcfunction index 1e0f00c1dc..acbf57abe0 100644 --- a/gm4_block_compressors/data/gm4_block_compressors/test/destroy.mcfunction +++ b/gm4_block_compressors/data/gm4_block_compressors/test/destroy.mcfunction @@ -1,6 +1,5 @@ # @template gm4:test_platform # @dummy ~ ~1 ~ -# @optional execute positioned ~1.5 ~1.5 ~1.5 run function gm4_block_compressors:machine/create give @s diamond_pickaxe diff --git a/gm4_block_compressors/data/gm4_block_compressors/test/fixed_uuid_present.mcfunction b/gm4_block_compressors/data/gm4_block_compressors/test/fixed_uuid_present.mcfunction new file mode 100644 index 0000000000..751ffbeb7b --- /dev/null +++ b/gm4_block_compressors/data/gm4_block_compressors/test/fixed_uuid_present.mcfunction @@ -0,0 +1,2 @@ +# Make sure that the armor stand with fixed UUID is present +assert entity 344d47-4-4-4-f04ce104d diff --git a/gm4_display_frames/data/gm4_display_frames/test/splash.mcfunction b/gm4_display_frames/data/gm4_display_frames/test/splash.mcfunction index 085a9cb49a..1b789d20aa 100644 --- a/gm4_display_frames/data/gm4_display_frames/test/splash.mcfunction +++ b/gm4_display_frames/data/gm4_display_frames/test/splash.mcfunction @@ -1,6 +1,5 @@ # @template gm4:test_platform # @dummy ~ ~1 ~ -# @optional fill ~2 ~1 ~ ~2 ~1 ~2 gray_concrete give @s item_frame diff --git a/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw.mcfunction b/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw.mcfunction index 9a8857848d..f1419e4c87 100644 --- a/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw.mcfunction +++ b/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw.mcfunction @@ -1,6 +1,5 @@ # @template gm4:test_platform # @dummy ~1 ~1 ~ -# @optional loot give @s loot gm4_lightning_in_a_bottle:items/splash_bottle_of_lightning execute at @s run tp @s ~ ~ ~ facing ~ ~-1.5 ~1 diff --git a/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_evoker.mcfunction b/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_evoker.mcfunction index 4691aa16fe..61e67f3bdb 100644 --- a/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_evoker.mcfunction +++ b/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_evoker.mcfunction @@ -1,6 +1,5 @@ # @template gm4:test_platform # @dummy ~1 ~1 ~ -# @optional summon pillager ~1.5 ~1 ~1.5 loot give @s loot gm4_lightning_in_a_bottle:items/splash_bottle_of_lightning diff --git a/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_guardian.mcfunction b/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_guardian.mcfunction index 5c4034ea2a..ba588b7e19 100644 --- a/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_guardian.mcfunction +++ b/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_guardian.mcfunction @@ -1,6 +1,5 @@ # @template gm4:test_platform # @dummy ~1 ~1 ~ -# @optional setblock ~1 ~ ~1 prismarine_bricks loot give @s loot gm4_lightning_in_a_bottle:items/splash_bottle_of_lightning diff --git a/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_illusioner.mcfunction b/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_illusioner.mcfunction index 4691aa16fe..61e67f3bdb 100644 --- a/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_illusioner.mcfunction +++ b/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_illusioner.mcfunction @@ -1,6 +1,5 @@ # @template gm4:test_platform # @dummy ~1 ~1 ~ -# @optional summon pillager ~1.5 ~1 ~1.5 loot give @s loot gm4_lightning_in_a_bottle:items/splash_bottle_of_lightning diff --git a/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_shulker.mcfunction b/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_shulker.mcfunction index bfde86b1e7..404f77b616 100644 --- a/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_shulker.mcfunction +++ b/gm4_lightning_in_a_bottle/data/gm4_lightning_in_a_bottle/test/throw_shulker.mcfunction @@ -1,6 +1,5 @@ # @template gm4:test_platform # @dummy ~1 ~1 ~ -# @optional setblock ~1 ~ ~1 purpur_block loot give @s loot gm4_lightning_in_a_bottle:items/splash_bottle_of_lightning diff --git a/lib_forceload/beet.yaml b/lib_forceload/beet.yaml index e6a45ce947..b98238a047 100644 --- a/lib_forceload/beet.yaml +++ b/lib_forceload/beet.yaml @@ -14,7 +14,7 @@ meta: gm4: versioning: extra_version_injections: - advancements: [dimension_marking] + advancements: [change_dimension, join] smithed: pack_id: gm4_lib_forceload credits: diff --git a/lib_forceload/data/gm4_forceload/advancement/dimension_marking.json b/lib_forceload/data/gm4_forceload/advancement/change_dimension.json similarity index 56% rename from lib_forceload/data/gm4_forceload/advancement/dimension_marking.json rename to lib_forceload/data/gm4_forceload/advancement/change_dimension.json index 502ff4cda6..3d72c81925 100644 --- a/lib_forceload/data/gm4_forceload/advancement/dimension_marking.json +++ b/lib_forceload/data/gm4_forceload/advancement/change_dimension.json @@ -1,10 +1,10 @@ { "criteria": { - "change_inventory": { + "change_dimension": { "trigger": "minecraft:changed_dimension" } }, "rewards": { - "function": "gm4_forceload:check_dimension" + "function": "gm4_forceload:mark_dimension" } } diff --git a/lib_forceload/data/gm4_forceload/advancement/join.json b/lib_forceload/data/gm4_forceload/advancement/join.json new file mode 100644 index 0000000000..3764b73436 --- /dev/null +++ b/lib_forceload/data/gm4_forceload/advancement/join.json @@ -0,0 +1,10 @@ +{ + "criteria": { + "join": { + "trigger": "minecraft:tick" + } + }, + "rewards": { + "function": "gm4_forceload:mark_dimension" + } +} diff --git a/lib_forceload/data/gm4_forceload/function/check_dimension.mcfunction b/lib_forceload/data/gm4_forceload/function/check_dimension.mcfunction deleted file mode 100644 index 2c1c703f5e..0000000000 --- a/lib_forceload/data/gm4_forceload/function/check_dimension.mcfunction +++ /dev/null @@ -1,8 +0,0 @@ -# @s = player who changed dimensions -# run from load_wait and advancement "dimension_marking" - -advancement revoke @s only gm4_forceload:dimension_marking - -# spawns a dimension marker if one doesn't already exist in the dimension -execute store success score $initialized gm4_dimension if block 29999998 1 7133 birch_wall_sign -execute if score $initialized gm4_dimension matches 0 run function gm4_forceload:mark_dimension diff --git a/lib_forceload/data/gm4_forceload/function/init_chunk.mcfunction b/lib_forceload/data/gm4_forceload/function/init_chunk.mcfunction index e41b6bc690..67af4ca387 100644 --- a/lib_forceload/data/gm4_forceload/function/init_chunk.mcfunction +++ b/lib_forceload/data/gm4_forceload/function/init_chunk.mcfunction @@ -1,4 +1,4 @@ -# run from load and mark_dimension +# run from init_ow_chunk and mark_dimension forceload remove 29999999 7134 forceload add 29999999 7134 diff --git a/lib_forceload/data/gm4_forceload/function/init_ow_chunk.mcfunction b/lib_forceload/data/gm4_forceload/function/init_ow_chunk.mcfunction index 98735a71d4..3451b1b6cc 100644 --- a/lib_forceload/data/gm4_forceload/function/init_ow_chunk.mcfunction +++ b/lib_forceload/data/gm4_forceload/function/init_ow_chunk.mcfunction @@ -1,6 +1,9 @@ # @s = marker entity to forceload overworld # run from load +tag @s add gm4_dimension +data merge entity @s {CustomName:"minecraft:overworld"} + function gm4_forceload:init_chunk setblock 29999998 1 7131 minecraft:repeating_command_block{auto:1b,Command:"function #gm4_forceload:command_block_tick"} summon armor_stand 29999999 0 7135 {UUID:[I;3427655,262148,262159,80613453],Invulnerable:1b,Invisible:1b,Marker:1b,Tags:["smithed.entity","smithed.strict"],CustomName:"lib_forceload_armorstand"} @@ -9,4 +12,3 @@ summon armor_stand 29999999 0 7135 {UUID:[I;3427655,262148,262159,80613453],Invu scoreboard players add #max gm4_dimension 1 scoreboard players operation @s gm4_dimension = #max gm4_dimension tp @s 29999999 0 7135 -tag @s remove gm4_new_dimension diff --git a/lib_forceload/data/gm4_forceload/function/load.mcfunction b/lib_forceload/data/gm4_forceload/function/load.mcfunction index 2946fa974b..9e749184e2 100644 --- a/lib_forceload/data/gm4_forceload/function/load.mcfunction +++ b/lib_forceload/data/gm4_forceload/function/load.mcfunction @@ -2,6 +2,4 @@ scoreboard objectives add gm4_dimension dummy gamerule command_block_output false execute store success score $initialized gm4_dimension if block 29999998 1 7133 birch_wall_sign -execute if score $initialized gm4_dimension matches 0 run summon marker ~ 0 ~ {CustomName:"minecraft:overworld",Tags:["gm4_dimension","gm4_new_dimension"]} -execute if score $initialized gm4_dimension matches 0 as @e[type=marker,tag=gm4_new_dimension,limit=1] run function gm4_forceload:init_ow_chunk -function gm4_forceload:load_wait +execute if score $initialized gm4_dimension matches 0 positioned ~ 0 ~ summon marker run function gm4_forceload:init_ow_chunk diff --git a/lib_forceload/data/gm4_forceload/function/load_wait.mcfunction b/lib_forceload/data/gm4_forceload/function/load_wait.mcfunction deleted file mode 100644 index 7e7b7be5a9..0000000000 --- a/lib_forceload/data/gm4_forceload/function/load_wait.mcfunction +++ /dev/null @@ -1,2 +0,0 @@ -execute unless entity @a[limit=1] run schedule function gm4_forceload:load_wait 2t -execute as @a at @s run function gm4_forceload:check_dimension diff --git a/lib_forceload/data/gm4_forceload/function/mark_dimension.mcfunction b/lib_forceload/data/gm4_forceload/function/mark_dimension.mcfunction index dd3a6c5c4d..25e78a7a3e 100644 --- a/lib_forceload/data/gm4_forceload/function/mark_dimension.mcfunction +++ b/lib_forceload/data/gm4_forceload/function/mark_dimension.mcfunction @@ -1,14 +1,14 @@ -# @s = player who entered a new dimension -# run from advancement dimension_marking and function load +# @s = player who changed dimensions or joined for the first time +# run from advancements "change_dimension" and "join" -function gm4_forceload:init_chunk +advancement revoke @s only gm4_forceload:change_dimension -# spawn dimension marker -summon minecraft:marker ~ 0 ~ {Tags:["gm4_dimension","gm4_new_dimension"]} +# exit if the dimension is already initialized +execute if block 29999998 1 7133 birch_wall_sign run return 0 -# give dimension marker a scoreboard ID and name -tag @s add gm4_in_new_dimension -execute as @e[type=marker,tag=gm4_new_dimension,limit=1] in minecraft:overworld run function gm4_forceload:set_marker_data +function gm4_forceload:init_chunk -# remove temporary tags +# spawn dimension marker with scoreboard ID and name +tag @s add gm4_in_new_dimension +execute summon minecraft:marker in minecraft:overworld run function gm4_forceload:set_marker_data tag @s remove gm4_in_new_dimension diff --git a/lib_forceload/data/gm4_forceload/function/set_marker_data.mcfunction b/lib_forceload/data/gm4_forceload/function/set_marker_data.mcfunction index 3f4cf217d2..10707b5c50 100644 --- a/lib_forceload/data/gm4_forceload/function/set_marker_data.mcfunction +++ b/lib_forceload/data/gm4_forceload/function/set_marker_data.mcfunction @@ -12,4 +12,4 @@ data modify entity @s CustomName set from block 29999998 1 7133 front_text.messa # move to forceloaded chunk execute at @s run tp @s 29999999 0 7135 -tag @s remove gm4_new_dimension +tag @s add gm4_dimension