private float getRotationY(double x, double y, double z) { double dis1 = y - (this.y + 1); double dis2 = Math.sqrt(Math.pow(x - this.x, 2) + Math.pow(z - this.z, 2)); return (float) ((Math.atan2(dis2, dis1) * 180D) / Math.PI) - 90F; }
private float getRotationX(double x, double y, double z) { double d = this.x - x; double d1 = this.z - z; return (float) (((Math.atan2(d1, d) * 180D) / Math.PI) + 90) % 360; }