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)
      Constructs the HeightMap.
      Parameters:
      session - an edit session
      region - the region
    • HeightMap

      public HeightMap(EditSession session, Region region, @Nullable Mask mask)
    • HeightMap

      public HeightMap(EditSession session, Region region, @Nullable Mask mask, boolean layers)
    • HeightMap

      public HeightMap(EditSession session, Region region, int[] data, boolean layers)
  • 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
    • applyLayers

      public int applyLayers(int[] data)
    • 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