public Model method578(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6) {
        Model model = method581(arg0, arg6, arg1);
        if (model == null) {
            return null;
        }
        if (flatTerrain || flatShading) {
            model = new Model(flatTerrain, flatShading, model);
        }
        if (flatTerrain) {
            int i = (arg2 + arg3 + arg4 + arg5) / 4;
            for (int j = 0; j < model.vertexCount; j++) {
                int j2 = model.xVertex[j];
                int k2 = model.zVertex[j];
                int l2 = arg2 + (arg3 - arg2) * (j2 + 64) / 128;
                int i3 = arg5 + (arg4 - arg5) * (j2 + 64) / 128;
                int j3 = l2 + (i3 - l2) * (k2 + 64) / 128;
                model.yVertex[j] += j3 - i;
            }
            model.method467();
        }
        return model;
    }