#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
scoreboard players set #&collsion.hit_shape.direction untwo.temp.0 0
execute if block ~ ~ ~ #untwo:collision/pass_through/functional/grindstone[facing=north] run scoreboard players set #&collsion.hit_shape.direction untwo.temp.0 1
execute if block ~ ~ ~ #untwo:collision/pass_through/functional/grindstone[facing=south] run scoreboard players set #&collsion.hit_shape.direction untwo.temp.0 2
execute if block ~ ~ ~ #untwo:collision/pass_through/functional/grindstone[facing=east] run scoreboard players set #&collsion.hit_shape.direction untwo.temp.0 3
execute if block ~ ~ ~ #untwo:collision/pass_through/functional/grindstone[facing=west] run scoreboard players set #&collsion.hit_shape.direction untwo.temp.0 4

execute if block ~ ~ ~ #untwo:collision/pass_through/functional/grindstone[face=wall] run scoreboard players set #&collsion.hit_shape.special untwo.temp.0 1
execute if score #&collsion.hit_shape.special untwo.temp.0 matches 1 if score #&collsion.hit_shape.direction untwo.temp.0 matches 1..2 run scoreboard players operation #&collsion.hit_shape.special.z untwo.temp.0 >< #&collsion.hit_shape.special.y 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 2 run function untwo:proj_sys/collision_check/operation/convert.up_down
execute if score #&collsion.hit_shape.special untwo.temp.0 matches 1 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.y 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.up_down
execute if score #&collsion.hit_shape.special untwo.temp.0 matches 1 run function untwo:proj_sys/collision_check/operation/convert.up_down
execute 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.x untwo.temp.0 matches 1250..2500 if score #&collsion.hit_shape.special.y untwo.temp.0 matches 0..4375 if score #&collsion.hit_shape.special.z untwo.temp.0 matches 3750..6250 run return 1
execute if score collsion.hit_shape.special.x untwo.temp.0 matches 1250..2500 if score #&collsion.hit_shape.special.y untwo.temp.0 matches 4375..8125 if score #&collsion.hit_shape.special.z untwo.temp.0 matches 3125..6875 run return 1
execute if score collsion.hit_shape.special.x untwo.temp.0 matches 7500..8750 if score #&collsion.hit_shape.special.y untwo.temp.0 matches 0..4375 if score #&collsion.hit_shape.special.z untwo.temp.0 matches 3750..6250 run return 1
execute if score collsion.hit_shape.special.x untwo.temp.0 matches 7500..8750 if score #&collsion.hit_shape.special.y untwo.temp.0 matches 4375..8125 if score #&collsion.hit_shape.special.z untwo.temp.0 matches 3125..6875 run return 1
execute if score collsion.hit_shape.special.x untwo.temp.0 matches 2500..7500 if score #&collsion.hit_shape.special.y untwo.temp.0 matches 2500..9999 if score #&collsion.hit_shape.special.z untwo.temp.0 matches 1250..8750 run return 1

return fail
