Complete rewrite

Prep for addition of optional additional tools
Removed config (for now)
Added loads of blocks
This commit is contained in:
2025-05-13 02:30:39 +01:00
parent 02a8a2ca97
commit 48d5cf9d5e
195 changed files with 2060 additions and 6794 deletions

View File

@@ -1,42 +1,29 @@
#Raycast Partial-box
## Raycast Partial-box
### Get Raycast Target Coords
# Get Raycast Target Coords
function wrench:raycast/target_coords
# Stored Value for Calc
scoreboard players set c16 WrenchRaycast 16
# Summon Invisible Entity
summon area_effect_cloud ~ ~ ~ {Radius:0.01,Duration:1,Tags:["RaycastMark"]}
# Pixel Calculations
execute store result score px WrenchRaycast run data get entity @e[tag=RaycastMark,sort=nearest,limit=1] Pos[0] 16
scoreboard players operation px WrenchRaycast %= c16 WrenchRaycast
execute if score px WrenchRaycast matches ..-1 run scoreboard players add px WrenchRaycast 16
execute store result score py WrenchRaycast run data get entity @e[tag=RaycastMark,sort=nearest,limit=1] Pos[1] 16
scoreboard players operation py WrenchRaycast %= c16 WrenchRaycast
execute if score py WrenchRaycast matches ..-1 run scoreboard players add py WrenchRaycast 16
execute store result score pz WrenchRaycast run data get entity @e[tag=RaycastMark,sort=nearest,limit=1] Pos[2] 16
scoreboard players operation pz WrenchRaycast %= c16 WrenchRaycast
execute if score pz WrenchRaycast matches ..-1 run scoreboard players add pz WrenchRaycast 16
# Remove Entity
kill @e[tag=RaycastMark,sort=nearest,limit=1]
### Partial Boxes
# Calculate partial-box
#Rails
execute if block ~ ~ ~ #minecraft:rails unless score WrenchRails WrenchConfig matches 0 run function wrench:raycast/partialbox/rails
#Redstone
execute if block ~ ~ ~ minecraft:repeater unless score WrenchRedstone WrenchConfig matches 0 if score py WrenchRaycast matches ..1 run function wrench:rotate/redstone
execute if block ~ ~ ~ minecraft:comparator unless score WrenchRedstone WrenchConfig matches 0 if score py WrenchRaycast matches ..1 run function wrench:rotate/redstone
execute if block ~ ~ ~ minecraft:calibrated_sculk_sensor unless score WrenchRedstone WrenchConfig matches 0 if score py WrenchRaycast matches ..7 run function wrench:rotate/redstone
execute if block ~ ~ ~ minecraft:piston unless score WrenchRedstone WrenchConfig matches 0 run function wrench:raycast/partialbox/pistons
execute if block ~ ~ ~ minecraft:sticky_piston unless score WrenchRedstone WrenchConfig matches 0 run function wrench:raycast/partialbox/sticky_pistons
execute if block ~ ~ ~ minecraft:hopper unless score WrenchRedstone WrenchConfig matches 0 run function wrench:raycast/partialbox/hoppers
#Blocks
execute if block ~ ~ ~ #minecraft:slabs unless score WrenchSlabs WrenchConfig matches 0 run function wrench:raycast/partialbox/slabs
execute if block ~ ~ ~ #minecraft:stairs unless score WrenchStairs WrenchConfig matches 0 run function wrench:raycast/partialbox/stairs
execute if block ~ ~ ~ minecraft:end_rod unless score WrenchRods WrenchConfig matches 0 run function wrench:raycast/partialbox/end_rods
execute if block ~ ~ ~ minecraft:chain unless score WrenchRods WrenchConfig matches 0 run function wrench:raycast/partialbox/chain
# Partial Boxes
execute if block ~ ~ ~ #wrench:banners run function wrench:raycast/partialbox/banners
execute if block ~ ~ ~ #minecraft:rails run function wrench:raycast/partialbox/rails
execute if block ~ ~ ~ #minecraft:trapdoors run function wrench:raycast/partialbox/trapdoors
execute if block ~ ~ ~ #minecraft:slabs run function wrench:raycast/partialbox/slabs
execute if block ~ ~ ~ #minecraft:stairs run function wrench:raycast/partialbox/stairs
execute if block ~ ~ ~ #minecraft:fence_gates run function wrench:raycast/partialbox/fence_gates
execute if block ~ ~ ~ #minecraft:campfires run function wrench:raycast/partialbox/campfires
execute if block ~ ~ ~ #minecraft:all_signs run function wrench:raycast/partialbox/signs
execute if block ~ ~ ~ #minecraft:anvil run function wrench:raycast/partialbox/anvils
execute if block ~ ~ ~ minecraft:repeater run function wrench:raycast/partialbox/repeater
execute if block ~ ~ ~ minecraft:comparator run function wrench:raycast/partialbox/comparator
execute if block ~ ~ ~ minecraft:calibrated_sculk_sensor run function wrench:raycast/partialbox/calibrated_sculk_sensor
execute if block ~ ~ ~ minecraft:piston run function wrench:raycast/partialbox/pistons
execute if block ~ ~ ~ minecraft:sticky_piston run function wrench:raycast/partialbox/pistons
execute if block ~ ~ ~ minecraft:hopper run function wrench:raycast/partialbox/hopper
execute if block ~ ~ ~ minecraft:end_rod run function wrench:raycast/partialbox/end_rod
execute if block ~ ~ ~ minecraft:lightning_rod run function wrench:raycast/partialbox/lightning_rod
execute if block ~ ~ ~ minecraft:chain run function wrench:raycast/partialbox/chain
execute if block ~ ~ ~ minecraft:decorated_pot run function wrench:raycast/partialbox/decorated_pot
execute if block ~ ~ ~ minecraft:stonecutter run function wrench:raycast/partialbox/stonecutter
execute if block ~ ~ ~ minecraft:ender_chest run function wrench:raycast/partialbox/ender_chest
execute if block ~ ~ ~ minecraft:bell run function wrench:raycast/partialbox/bell
execute if block ~ ~ ~ minecraft:grindstone run function wrench:raycast/partialbox/grindstone