Class HeightMap

java.lang.Object
com.sk89q.worldedit.math.convolution.HeightMap

public class HeightMap extends Object
Allows applications of Kernels onto the region's height map.

Currently only used for smoothing (with a GaussianKernel)

.
  • Constructor Details

    • HeightMap

      public HeightMap(EditSession session, Region region, @Nullable Mask mask)
      Constructs the HeightMap.
      Parameters:
      session - an edit session
      region - the region
      mask - optional mask for the height map
  • Method Details

    • applyFilter

      public int applyFilter(HeightMapFilter filter, int iterations) throws MaxChangedBlocksException
      Apply the filter 'iterations' amount times.
      Parameters:
      filter - the filter
      iterations - the number of iterations
      Returns:
      number of blocks affected
      Throws:
      MaxChangedBlocksException - if the maximum block change limit is exceeded
    • apply

      public int apply(int[] data) throws MaxChangedBlocksException
      Apply a raw heightmap to the region.
      Parameters:
      data - the data
      Returns:
      number of blocks affected
      Throws:
      MaxChangedBlocksException - if the maximum block change limit is exceeded