
# -> Reset return condition value
scoreboard players set #or.large_ship_move_return OverlyRealistic.General.ArbitraryData 1

# -> If there is something blocking the ship then return
execute if score @s OverlyRealistic.World.LargeShip_Velocity_Forward matches ..-1 \
    if block ^0 ^7 ^-5 #overly_realistic:large_ship_can_pass_through \
    if block ^-0.5 ^7 ^-5 #overly_realistic:large_ship_can_pass_through \
    if block ^0.5 ^7 ^-5 #overly_realistic:large_ship_can_pass_through \
    if block ^1 ^7 ^-5 #overly_realistic:large_ship_can_pass_through \
    if block ^1.5 ^7 ^-5 #overly_realistic:large_ship_can_pass_through \
    if block ^2 ^7 ^-5 #overly_realistic:large_ship_can_pass_through \
    if block ^2.5 ^7 ^-5 #overly_realistic:large_ship_can_pass_through \
    if block ^-1 ^7 ^-5 #overly_realistic:large_ship_can_pass_through \
    if block ^-1.5 ^7 ^-5 #overly_realistic:large_ship_can_pass_through \
    if block ^-2 ^7 ^-5 #overly_realistic:large_ship_can_pass_through \
    if block ^-2.5 ^7 ^-5 #overly_realistic:large_ship_can_pass_through run \
        scoreboard players set #or.large_ship_move_return OverlyRealistic.General.ArbitraryData 0

# -> If return condition = 1 then return
execute if score #or.large_ship_move_return OverlyRealistic.General.ArbitraryData matches 1 run \
    return fail

# -> If there is something blocking the ship then return
execute if score @s OverlyRealistic.World.LargeShip_Velocity_Forward matches ..-5 \
    if block ^0 ^7 ^-6 #overly_realistic:large_ship_can_pass_through \
    if block ^-0.5 ^7 ^-6 #overly_realistic:large_ship_can_pass_through \
    if block ^0.5 ^7 ^-6 #overly_realistic:large_ship_can_pass_through \
    if block ^1 ^7 ^-6 #overly_realistic:large_ship_can_pass_through \
    if block ^1.5 ^7 ^-6 #overly_realistic:large_ship_can_pass_through \
    if block ^2 ^7 ^-6 #overly_realistic:large_ship_can_pass_through \
    if block ^2.5 ^7 ^-6 #overly_realistic:large_ship_can_pass_through \
    if block ^-1 ^7 ^-6 #overly_realistic:large_ship_can_pass_through \
    if block ^-1.5 ^7 ^-6 #overly_realistic:large_ship_can_pass_through \
    if block ^-2 ^7 ^-6 #overly_realistic:large_ship_can_pass_through \
    if block ^-2.5 ^7 ^-6 #overly_realistic:large_ship_can_pass_through run \
        scoreboard players set #or.large_ship_move_return OverlyRealistic.General.ArbitraryData 0

# -> If return condition = 1 then return
execute if score #or.large_ship_move_return OverlyRealistic.General.ArbitraryData matches 1 run \
    return fail

# -> Move ship
tp @s[scores={OverlyRealistic.World.LargeShip_Velocity_Forward=-4..-1}] ^ ^ ^-0.35
tp @s[scores={OverlyRealistic.World.LargeShip_Velocity_Forward=..-5}] ^ ^ ^-1
