Доброго времени суток, мб кто подскажет, как сделать чтоб блок следил по Y? по X сделал, а вот по y чет не получается.
Java:
public void updateEntity() {
if(super.worldObj.isRemote) {
EntityPlayer entityplayer = super.worldObj.getClosestPlayer((double)((float)super.xCoord + 0.5F), (double)((float)super.yCoord + 0.5F), (double)((float)super.zCoord + 0.5F), 3.5D);
if(entityplayer != null) {
double d0 = entityplayer.posX - (double)((float)super.xCoord + 0.5F);
double d1 = entityplayer.posZ - (double)((float)super.zCoord + 0.5F);
double b0 = entityplayer.posY - 1.0F + (double)((float)super.yCoord + 5.6F);
double b1 = entityplayer.posZ;
float y = (float)Math.atan2(d1, d0) - (float)super.blockMetadata / 1.6F;
float x = (float)Math.atan2(b0, b1);
if((super.blockMetadata == 0 || (double)y >= 1.3D || (double)y <= -1.5D)) {
// this.yawy = 0.0F;
} else {
this.yawy = y;
this.pitch = x;
}
} else {
if(yawy > 0.04F)yawy -= 0.04F; else if(yawy < -0.04F) yawy += 0.04F;else
this.yawy = 0.0F;
}
}