@Override
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;

        result = result * PRIME + Float.floatToIntBits(this.getYaw());
        result = result * PRIME + Float.floatToIntBits(this.getPitch());

        return result;
    }
An immutable and serializable direction object
helper/src/main/java/me/lucko/helper/serialize/Direction.java