• Regenerates blocks within a specified area based on surrounding blocks.

    Parameters

    • corner1: Vector3

      The first corner of the area to regenerate.

    • corner2: Vector3

      The second corner of the area to regenerate.

    • dimension: Dimension

      The dimension in which the regeneration will take place.

    • radius: number

      The radius around each block to consider for regeneration.

    • Optionaloptions: {
          airPriority?: number;
          airPriorityCalculationFunction?: (
              minRelativeLocation: Vector3,
              min: Vector3,
              max: Vector3,
          ) => number;
          airPriorityScalingMode?:
              | "none"
              | "linear-bottom-to-top"
              | "linear-top-to-bottom"
              | "linear-east-to-west"
              | "linear-north-to-south"
              | "linear-radial-center"
              | "linear-radial-TNE"
              | "linear-radial-CNE"
              | "linear-radial-BNE"
              | "linear-radial-TNW"
              | "linear-radial-CNW"
              | "linear-radial-BNW"
              | "linear-radial-TSE"
              | "linear-radial-CSE"
              | "linear-radial-BSE"
              | "linear-radial-TSW"
              | "linear-radial-CSW"
              | "linear-radial-BSW"
              | "linear-radial-TN"
              | "linear-radial-CN"
              | "linear-radial-BN"
              | "linear-radial-TE"
              | "linear-radial-CE"
              | "linear-radial-BE"
              | "linear-radial-TS"
              | "linear-radial-CS"
              | "linear-radial-BS"
              | "linear-radial-TW"
              | "linear-radial-CW"
              | "linear-radial-BW";
          doDistanceBasedPriority?: boolean;
          horizontalDistancePriority?: number;
          ignoreAir?: boolean;
          ignoreNotYetGeneratedAir?: boolean;
          ignoreNotYetGeneratedBlocks?: boolean;
          minMSBetweenTickWaits?: number;
          onlyReplaceAir?: boolean;
          randomization?: number;
          verticalDistancePriority?: number;
      }

      Optional parameters to customize the regeneration process.

      • OptionalairPriority?: number

        The amount to multiply by the weight of air.
        Only applies when options.ignoreAir is set to false.
        Defaults to 0.5.

      • OptionalairPriorityCalculationFunction?: (minRelativeLocation: Vector3, min: Vector3, max: Vector3) => number

        Add functionality to this option.

      • OptionalairPriorityScalingMode?:
            | "none"
            | "linear-bottom-to-top"
            | "linear-top-to-bottom"
            | "linear-east-to-west"
            | "linear-north-to-south"
            | "linear-radial-center"
            | "linear-radial-TNE"
            | "linear-radial-CNE"
            | "linear-radial-BNE"
            | "linear-radial-TNW"
            | "linear-radial-CNW"
            | "linear-radial-BNW"
            | "linear-radial-TSE"
            | "linear-radial-CSE"
            | "linear-radial-BSE"
            | "linear-radial-TSW"
            | "linear-radial-CSW"
            | "linear-radial-BSW"
            | "linear-radial-TN"
            | "linear-radial-CN"
            | "linear-radial-BN"
            | "linear-radial-TE"
            | "linear-radial-CE"
            | "linear-radial-BE"
            | "linear-radial-TS"
            | "linear-radial-CS"
            | "linear-radial-BS"
            | "linear-radial-TW"
            | "linear-radial-CW"
            | "linear-radial-BW"

        Add functionality to this option.

      • OptionaldoDistanceBasedPriority?: boolean

        Whether to prioritize surrounding blocks that are closer to the block being generated.
        Defaults to true.

      • OptionalhorizontalDistancePriority?: number

        The amount that will be multiplied by the horizontal distance between the blocks to determine the amount to divide the weight of the block by.
        Setting it to 0 will disable horizontal distance priority.
        Only aplies when options.doDistanceBasedPriority is set to true.
        Defaults to 1.2.

      • OptionalignoreAir?: boolean

        If true, then surrounding air blocks will not affect the type of blocks generated.
        Defaults to true.

      • OptionalignoreNotYetGeneratedAir?: boolean

        If true, then surrounding air blocks that are in the section that has yet to be generated will not affect the type of blocks generated.
        Only applies when options.ignoreAir and options.ignoreNotYetGeneratedBlocks are set to false.
        Defaults to true.

      • OptionalignoreNotYetGeneratedBlocks?: boolean

        If true, then all surrounding blocks that are in the section that has yet to be generated will not affect the type of blocks generated.
        Defaults to false.

      • OptionalminMSBetweenTickWaits?: number

        Minimum amount of time in milliseconds to spend regenrating the blocks each tick.
        Defaults to 2000.

      • OptionalonlyReplaceAir?: boolean

        If true, then only air blocks will be replaced.
        Defaults to true.

      • Optionalrandomization?: number

        The maximum amount by which to multiply or divide weights of the surrounding block permutations to randomize the generated block slightly.
        It will add 1 to the randomization amount before calculating, so 0.2 would result in the weights being multiplied or divided by between 1 and 1.2.
        Defaults to 0.2.

      • OptionalverticalDistancePriority?: number

        The amount that will be multiplied by the vertical distance between the blocks to determine the amount to divide the weight of the block by.
        Setting it to 0 will disable vertical distance priority.
        Only aplies when options.doDistanceBasedPriority is set to true.
        Defaults to 1.5.

    Returns Promise<
        {
            containsUnloadedChunks: boolean;
            endTick: number;
            endTime: number;
            error?: Error;
            failedRegenerations: bigint;
            finalIndex: bigint;
            startTick: number;
            startTime: number;
            successfulRegenerations: bigint;
            surroundingBlocksContainsUnloadedChunks: boolean;
            totalTimeSpentRegenerating: number;
            unloadedBlockCount: bigint;
            unloadedSurroundingBlockCount: bigint;
        },
    >

    A promise that resolves with an object containing details about the regeneration process.