
# -> If this block is insta-collapseable then return and collapse it
execute if block ~ ~ ~ #overly_realistic:instant_collapse run \
    return run \
        function overly_realistic:players/block_placement/block_collapse/block_collapse

# -> Reset var
scoreboard players set #or.global OverlyRealistic.General.ArbitraryData 0

# -> Check for supporting blocks
# -> (@NOTE: This looks abhorrent but its literally the only way to make this implementation in the most performant way possible...)
execute unless block ~1 ~-1 ~ #air unless block ~1 ~-2 ~ #air run scoreboard players set #or.global OverlyRealistic.General.ArbitraryData 1
execute unless block ~ ~-1 ~1 #air unless block ~ ~-2 ~1 #air run scoreboard players set #or.global OverlyRealistic.General.ArbitraryData 1
execute unless block ~1 ~-1 ~1 #air unless block ~1 ~-2 ~1 #air run scoreboard players set #or.global OverlyRealistic.General.ArbitraryData 1

execute unless block ~-1 ~-1 ~ #air unless block ~-1 ~-2 ~ #air run scoreboard players set #or.global OverlyRealistic.General.ArbitraryData 1
execute unless block ~ ~-1 ~-1 #air unless block ~ ~-2 ~-1 #air run scoreboard players set #or.global OverlyRealistic.General.ArbitraryData 1
execute unless block ~-1 ~-1 ~-1 #air unless block ~-1 ~-2 ~-1 #air run scoreboard players set #or.global OverlyRealistic.General.ArbitraryData 1

execute unless block ~1 ~-1 ~-1 #air unless block ~1 ~-2 ~-1 #air run scoreboard players set #or.global OverlyRealistic.General.ArbitraryData 1
execute unless block ~-1 ~-1 ~1 #air unless block ~-1 ~-2 ~1 #air run scoreboard players set #or.global OverlyRealistic.General.ArbitraryData 1

execute if score #or.global OverlyRealistic.General.ArbitraryData matches 0 run \
    function overly_realistic:players/block_placement/block_collapse/block_collapse