{
  "type": "minecraft:add",
  "argument1": "angel_islands:terrain/custom_caves",
  "argument2": {
    "type": "minecraft:min",
    "argument1": {
      "type": "minecraft:squeeze",
      "argument": {
        "type": "minecraft:interpolated",
        "argument": {
          "type": "minecraft:add",
          "argument1": {
            "type": "minecraft:y_clamped_gradient",
            "from_y": -64,
            "to_y": -60,
            "from_value": -0.5,
            "to_value": 0
          },
          "argument2": {
            "type": "minecraft:add",
            "argument1": {
              "type": "minecraft:y_clamped_gradient",
              "from_y": 316,
              "to_y": 320,
              "from_value": 0,
              "to_value": -0.5
            },
            "argument2": {
              "type": "minecraft:range_choice",
              "input": "angel_islands:terrain/pre_caves",
              "min_inclusive": -1000000,
              "max_exclusive": 1.5625,
              "when_in_range": {
                "type": "minecraft:min",
                "argument1": "angel_islands:terrain/pre_caves",
                "argument2": {
                  "type": "minecraft:mul",
                  "argument1": 5,
                  "argument2": "minecraft:overworld/caves/entrances"
                }
              },
              "when_out_of_range": {
                "type": "minecraft:min",
                "argument1": {
                  "type": "minecraft:min",
                  "argument1": {
                    "type": "minecraft:add",
                    "argument1": {
                      "type": "minecraft:mul",
                      "argument1": 4,
                      "argument2": {
                        "type": "minecraft:square",
                        "argument": {
                          "type": "minecraft:noise",
                          "noise": "minecraft:cave_layer",
                          "xz_scale": 1,
                          "y_scale": 8
                        }
                      }
                    },
                    "argument2": {
                      "type": "minecraft:add",
                      "argument1": {
                        "type": "minecraft:clamp",
                        "input": {
                          "type": "minecraft:add",
                          "argument1": 0.27,
                          "argument2": {
                            "type": "minecraft:noise",
                            "noise": "minecraft:cave_cheese",
                            "xz_scale": 1,
                            "y_scale": 0.6666666666666666
                          }
                        },
                        "min": -1,
                        "max": 1
                      },
                      "argument2": {
                        "type": "minecraft:clamp",
                        "input": {
                          "type": "minecraft:add",
                          "argument1": 1.5,
                          "argument2": {
                            "type": "minecraft:mul",
                            "argument1": -0.64,
                            "argument2": "angel_islands:terrain/pre_caves"
                          }
                        },
                        "min": 0,
                        "max": 0.5
                      }
                    }
                  },
                  "argument2": "minecraft:overworld/caves/entrances"
                },
                "argument2": {
                  "type": "minecraft:add",
                  "argument1": "minecraft:overworld/caves/spaghetti_2d",
                  "argument2": "minecraft:overworld/caves/spaghetti_roughness_function"
                }
              }
            }
          }
        }
      }
    },
    "argument2": "minecraft:overworld/caves/noodle"
  }
}
