#untwo:proj_sys/collision_check/
#xyzのいずれかが範囲外なら0を返す(当たったら1)

###
scoreboard players set #&collsion.hit_shape.special untwo.temp.0 0
scoreboard players operation #&collsion.hit_shape.special.x untwo.temp.0 = #&collsion.decimal.x untwo.temp.0
scoreboard players operation #&collsion.hit_shape.special.y untwo.temp.0 = #&collsion.decimal.y untwo.temp.0
scoreboard players operation #&collsion.hit_shape.special.z untwo.temp.0 = #&collsion.decimal.z untwo.temp.0
execute if block ~ ~ ~ #minecraft:doors[open=true,hinge=left] run scoreboard players set #&collsion.hit_shape.special untwo.temp.0 1
execute if block ~ ~ ~ #minecraft:doors[open=true,hinge=right] run scoreboard players set #&collsion.hit_shape.special untwo.temp.0 2
scoreboard players set #&collsion.hit_shape.direction untwo.temp.0 0
execute if block ~ ~ ~ #minecraft:doors[facing=north] run scoreboard players set #&collsion.hit_shape.direction untwo.temp.0 1
execute if block ~ ~ ~ #minecraft:doors[facing=south] run scoreboard players set #&collsion.hit_shape.direction untwo.temp.0 2
execute if block ~ ~ ~ #minecraft:doors[facing=east] run scoreboard players set #&collsion.hit_shape.direction untwo.temp.0 3
execute if block ~ ~ ~ #minecraft:doors[facing=west] run scoreboard players set #&collsion.hit_shape.direction untwo.temp.0 4
execute if score #&collsion.hit_shape.special untwo.temp.0 matches 0 if score #&collsion.hit_shape.direction untwo.temp.0 matches 1 run function untwo:proj_sys/collision_check/operation/convert.nouth_south
execute if score #&collsion.hit_shape.special untwo.temp.0 matches 0 if score #&collsion.hit_shape.direction untwo.temp.0 matches 4 run function untwo:proj_sys/collision_check/operation/convert.east_west
execute if score #&collsion.hit_shape.special untwo.temp.0 matches 0 if score #&collsion.hit_shape.direction untwo.temp.0 matches 3..4 run scoreboard players operation #&collsion.hit_shape.special.x untwo.temp.0 >< #&collsion.hit_shape.special.z untwo.temp.0
execute if score #&collsion.hit_shape.special untwo.temp.0 matches 1 if score #&collsion.hit_shape.direction untwo.temp.0 matches 4 run function untwo:proj_sys/collision_check/operation/convert.nouth_south
execute if score #&collsion.hit_shape.special untwo.temp.0 matches 1 if score #&collsion.hit_shape.direction untwo.temp.0 matches 2 run function untwo:proj_sys/collision_check/operation/convert.east_west
execute if score #&collsion.hit_shape.special untwo.temp.0 matches 2 if score #&collsion.hit_shape.direction untwo.temp.0 matches 1 run function untwo:proj_sys/collision_check/operation/convert.east_west
execute if score #&collsion.hit_shape.special untwo.temp.0 matches 2 if score #&collsion.hit_shape.direction untwo.temp.0 matches 3 run function untwo:proj_sys/collision_check/operation/convert.nouth_south
execute if score #&collsion.hit_shape.special untwo.temp.0 matches 1..2 if score #&collsion.hit_shape.direction untwo.temp.0 matches 1..2 run scoreboard players operation #&collsion.hit_shape.special.x untwo.temp.0 >< #&collsion.hit_shape.special.z untwo.temp.0

execute if score #&collsion.hit_shape.special.x untwo.temp.0 matches 0..9999 if score #&collsion.hit_shape.special.y untwo.temp.0 matches 0..9999 if score #&collsion.hit_shape.special.z untwo.temp.0 matches 0..1875 run return 1

#何にもあたらなかったら0を返す
return fail