# To Gate
execute positioned ~23 ~ ~ if entity @e[tag=is_door,tag=E,distance=..0.1] at @s positioned ~-22.5 ~-0.5 ~-22.5 as @e[tag=wall,tag=east,dx=44,dy=32,dz=44] run tag @s add gate

execute positioned ~-23 ~ ~ if entity @e[tag=is_door,tag=W,distance=..0.1] at @s positioned ~-22.5 ~-0.5 ~-22.5 as @e[tag=wall,tag=west,dx=44,dy=32,dz=44] run tag @s add gate

execute positioned ~ ~ ~-23 if entity @e[tag=is_door,tag=N,distance=..0.1] at @s positioned ~-22.5 ~-0.5 ~-22.5 as @e[tag=wall,tag=north,dx=44,dy=32,dz=44] run tag @s add gate

execute positioned ~ ~ ~23 if entity @e[tag=is_door,tag=S,distance=..0.1] at @s positioned ~-22.5 ~-0.5 ~-22.5 as @e[tag=wall,tag=south,dx=44,dy=32,dz=44] run tag @s add gate

tag @e[tag=wall,tag=gate] remove wall


# Wall
execute positioned ~-22.5 11 ~-22.5 as @e[tag=wall,dx=44,dy=21,dz=44] at @s run function rooms_py:wall/floor_sort
