
# -> If farmland then return
execute if block ~ ~ ~ #overly_realistic:fertilizers_can_interact_with \
    align xyz run \
        return run \
            function overly_realistic:players/items/crop_additions/compost/operate_on_soil

# -> If a block is in the way then return
execute unless block ~ ~ ~ #overly_realistic:spear_can_passthrough run \
    return fail

# -> Debug
#particle small_flame ~ ~ ~ 0 0 0 0.0001 1 force @a

# -> Add to range
scoreboard players add @s OverlyRealistic.Player.LocalRayRange 1

# -> Recursive loop
execute unless score @s OverlyRealistic.Player.LocalRayRange >= @s OverlyRealistic.Player.LocalRayRangeMax \
    positioned ^ ^ ^0.1 run \
        function overly_realistic:players/items/crop_additions/compost/raycast_travel
