package eu.mhsl.minecraft.pixelblocks.utils;

import org.bukkit.util.Vector;

public enum Direction {
    north,
    east,
    south,
    west;

    public static Direction vectorToDirection(Vector vector) {
        if(Math.abs(vector.getX()) > Math.abs(vector.getZ())) {
            if(vector.getX() >= 0) {
                return east;
            } else {
                return west;
            }
        } else {
            if(vector.getZ() >= 0) {
                return south;
            } else {
                return north;
            }
        }
    }
}
