public void tick() 
    {
        double speed = 0.1;

        if (open) openness += speed;
        else openness -= speed;

        if (openness > 1) openness = 1;
        if (openness < 0) openness = 0;

        if (level.player.x == x && level.player.z == y) 
        {
            openness = 1;
            open = true;
        }
    }