code: public static BlockPos rotate(BlockPos pos, int rotation)
  	{
  		int[] cos = { 1, 0, -1, 0 };
  		int[] sin = { 0, 1, 0, -1 };
  
  		int a = -rotation & 3;
  
  		int newX = (pos.getX() * cos[a]) - (pos.getZ() * sin[a]);
  		int newZ = (pos.getX() * sin[a]) + (pos.getZ() * cos[a]);
  
  		return new BlockPos(newX, pos.getY(), newZ);
  	}
docs: Rotates the {@link BlockPos} around the Y axis around the origin (0,0,0).
  
  @param pos the pos
  @param rotation the rotation
  @return the block pos