From 6b4033e0817dea2dce381272fb4c6e9b9e0cd6aa Mon Sep 17 00:00:00 2001 From: Mark Rapson Date: Fri, 16 May 2025 02:02:01 +0100 Subject: [PATCH] Fixed blocks not being removed with Trowel Removed unneeded tags Added clean trowel data after use --- .../function/block/place/leaves.mcfunction | 2 +- .../function/block/place/nesw.mcfunction | 8 ++++---- .../function/block/place/neswud.mcfunction | 12 ++++++------ .../function/block/place/slabs.mcfunction | 4 ++-- .../function/raycast/start.mcfunction | 17 +++++++++++++---- .../function/raycast/start.mcfunction | 6 ++---- 6 files changed, 28 insertions(+), 21 deletions(-) diff --git a/data/lzstools_trowel/function/block/place/leaves.mcfunction b/data/lzstools_trowel/function/block/place/leaves.mcfunction index 03ebe48..d36721c 100644 --- a/data/lzstools_trowel/function/block/place/leaves.mcfunction +++ b/data/lzstools_trowel/function/block/place/leaves.mcfunction @@ -1,2 +1,2 @@ # Place Leaves -$setblock ~ ~ ~ $(chosen_block)[persistent=true] keep \ No newline at end of file +$execute as @s store result score @s lzt_trowel_success setblock ~ ~ ~ $(chosen_block)[persistent=true] keep \ No newline at end of file diff --git a/data/lzstools_trowel/function/block/place/nesw.mcfunction b/data/lzstools_trowel/function/block/place/nesw.mcfunction index 9a7e1f0..3d049e6 100644 --- a/data/lzstools_trowel/function/block/place/nesw.mcfunction +++ b/data/lzstools_trowel/function/block/place/nesw.mcfunction @@ -1,5 +1,5 @@ # Place NESW -$execute as @s[y_rotation=-45..45] store result score @s lzt_trowel_raycast run setblock ~ ~ ~ $(chosen_block)[facing=north] keep -$execute as @s[y_rotation=45..135] store result score @s lzt_trowel_raycast run setblock ~ ~ ~ $(chosen_block)[facing=east] keep -$execute as @s[y_rotation=135..-135] store result score @s lzt_trowel_raycast run setblock ~ ~ ~ $(chosen_block)[facing=south] keep -$execute as @s[y_rotation=-135..-45] store result score @s lzt_trowel_raycast run setblock ~ ~ ~ $(chosen_block)[facing=west] keep \ No newline at end of file +$execute as @s[y_rotation=-45..45] store result score @s lzt_trowel_success run setblock ~ ~ ~ $(chosen_block)[facing=north] keep +$execute as @s[y_rotation=45..135] store result score @s lzt_trowel_success run setblock ~ ~ ~ $(chosen_block)[facing=east] keep +$execute as @s[y_rotation=135..-135] store result score @s lzt_trowel_success run setblock ~ ~ ~ $(chosen_block)[facing=south] keep +$execute as @s[y_rotation=-135..-45] store result score @s lzt_trowel_success run setblock ~ ~ ~ $(chosen_block)[facing=west] keep \ No newline at end of file diff --git a/data/lzstools_trowel/function/block/place/neswud.mcfunction b/data/lzstools_trowel/function/block/place/neswud.mcfunction index 719775c..61f004a 100644 --- a/data/lzstools_trowel/function/block/place/neswud.mcfunction +++ b/data/lzstools_trowel/function/block/place/neswud.mcfunction @@ -1,7 +1,7 @@ # Place NESWUD -$execute as @s[x_rotation=45..90] store result score @s lzt_trowel_raycast run setblock ~ ~ ~ $(chosen_block)[facing=up] keep -$execute as @s[x_rotation=-90..-45] store result score @s lzt_trowel_raycast run setblock ~ ~ ~ $(chosen_block)[facing=down] keep -$execute as @s[x_rotation=-45..45, y_rotation=-45..45] store result score @s lzt_trowel_raycast run setblock ~ ~ ~ $(chosen_block)[facing=north] keep -$execute as @s[x_rotation=-45..45, y_rotation=45..135] store result score @s lzt_trowel_raycast run setblock ~ ~ ~ $(chosen_block)[facing=east] keep -$execute as @s[x_rotation=-45..45, y_rotation=135..-135] store result score @s lzt_trowel_raycast run setblock ~ ~ ~ $(chosen_block)[facing=south] keep -$execute as @s[x_rotation=-45..45, y_rotation=-135..-45] store result score @s lzt_trowel_raycast run setblock ~ ~ ~ $(chosen_block)[facing=west] keep \ No newline at end of file +$execute as @s[x_rotation=45..90] store result score @s lzt_trowel_success run setblock ~ ~ ~ $(chosen_block)[facing=up] keep +$execute as @s[x_rotation=-90..-45] store result score @s lzt_trowel_success run setblock ~ ~ ~ $(chosen_block)[facing=down] keep +$execute as @s[x_rotation=-45..45, y_rotation=-45..45] store result score @s lzt_trowel_success run setblock ~ ~ ~ $(chosen_block)[facing=north] keep +$execute as @s[x_rotation=-45..45, y_rotation=45..135] store result score @s lzt_trowel_success run setblock ~ ~ ~ $(chosen_block)[facing=east] keep +$execute as @s[x_rotation=-45..45, y_rotation=135..-135] store result score @s lzt_trowel_success run setblock ~ ~ ~ $(chosen_block)[facing=south] keep +$execute as @s[x_rotation=-45..45, y_rotation=-135..-45] store result score @s lzt_trowel_success run setblock ~ ~ ~ $(chosen_block)[facing=west] keep \ No newline at end of file diff --git a/data/lzstools_trowel/function/block/place/slabs.mcfunction b/data/lzstools_trowel/function/block/place/slabs.mcfunction index fd46db8..992efc5 100644 --- a/data/lzstools_trowel/function/block/place/slabs.mcfunction +++ b/data/lzstools_trowel/function/block/place/slabs.mcfunction @@ -1,3 +1,3 @@ # Place Slabs -$execute as @s if score py lzt_trowel_raycast matches 8.. store result score @s lzt_wrench_success run setblock ~ ~ ~ $(chosen_block)[type=top] keep -$execute as @s if score py lzt_trowel_raycast matches ..7 store result score @s lzt_wrench_success run setblock ~ ~ ~ $(chosen_block)[type=bottom] keep \ No newline at end of file +$execute as @s if score py lzt_trowel_raycast matches 8.. store result score @s lzt_trowel_success run setblock ~ ~ ~ $(chosen_block)[type=top] keep +$execute as @s if score py lzt_trowel_raycast matches ..7 store result score @s lzt_trowel_success run setblock ~ ~ ~ $(chosen_block)[type=bottom] keep \ No newline at end of file diff --git a/data/lzstools_trowel/function/raycast/start.mcfunction b/data/lzstools_trowel/function/raycast/start.mcfunction index 4a51267..2967f17 100644 --- a/data/lzstools_trowel/function/raycast/start.mcfunction +++ b/data/lzstools_trowel/function/raycast/start.mcfunction @@ -1,9 +1,18 @@ #Setting up the raycasting data. scoreboard players set #distance lzt_trowel_raycast 0 -tag @s add lzt_trowel_raycast #Activating the raycast. This function will call itself until it is done. -execute as @e[tag=lzt_trowel_raycast] at @s anchored eyes positioned ^ ^ ^ run function lzstools_trowel:raycast/rayloop +execute as @s at @s anchored eyes positioned ^ ^ ^ anchored feet run function lzstools_trowel:raycast/rayloop -#Raycasting finished, removing tag from the raycaster. -tag @s remove lzt_trowel_raycast \ No newline at end of file +# Clean Data +data remove storage lzstools:trowel inventory +data remove storage lzstools:trowel components +data remove storage lzstools:trowel damage +data remove storage lzstools:trowel slots +data remove storage lzstools:trowel blocks +data remove storage lzstools:trowel length +data remove storage lzstools:trowel temp_slot +data remove storage lzstools:trowel temp_id +data remove storage lzstools:trowel chosen_index +data remove storage lzstools:trowel chosen_block +data remove storage lzstools:trowel chosen_slot \ No newline at end of file diff --git a/data/lzstools_wrench/function/raycast/start.mcfunction b/data/lzstools_wrench/function/raycast/start.mcfunction index cac3706..a34df5e 100644 --- a/data/lzstools_wrench/function/raycast/start.mcfunction +++ b/data/lzstools_wrench/function/raycast/start.mcfunction @@ -1,10 +1,8 @@ #Setting up the raycasting data. scoreboard players set #distance lzt_wrench_raycast 0 -tag @s add lzt_wrench_raycast #Activating the raycast. This function will call itself until it is done. -execute as @e[tag=lzt_wrench_raycast] at @s anchored eyes positioned ^ ^ ^ run function lzstools_wrench:raycast/rayloop +execute as @s at @s anchored eyes positioned ^ ^ ^ anchored feet run function lzstools_wrench:raycast/rayloop -#Raycasting finished, removing tag from the raycaster. -tag @s remove lzt_wrench_raycast +# Clean Data data remove storage lzstools:wrench block \ No newline at end of file