public int checkBoundary(Vector3f playerPos)
    {
        int max = -1;
        if(playerPos.x > maxX)
        {
            if(Math.abs(maxX - playerPos.x) > max)
            {
                max = 90;
            }
        }
        if(playerPos.x <= minX)
        {
            if(Math.abs(minX - playerPos.x) > max)
            {
                max = 270;
            }
        }
        if(playerPos.z > maxZ)
        {
            if(Math.abs(maxZ - playerPos.z) > max)
            {
                max = 180;
            }
        }
        if(playerPos.z <= minZ)
        {
            if(Math.abs(minZ - playerPos.z) > max)
            {
                max = 0;
            }
        }
        return max;
    }