I-edit

BrushShape Class

Classes that extend BrushShape

  • ConeBrushShape
  • CuboidBrushShape
  • CylinderBrushShape
  • EllipsoidBrushShape
  • PyramidBrushShape
  • SingleBlockBrushShape

Base for creating new brush shapes

Properties

displayName

read-only displayName: string;

Type: string

icon

read-only icon: string;

Type: string

id

read-only id: string;

Type: string

Methods

constructor

new BrushShape(_id: string, _displayName: string, _icon: string)

Constructs a new instance of the BrushShape class

Parameters

  • _id: string
  • _displayName: string
  • _icon: string

Returns BrushShape

applySetting

applySetting(brushSettings: BrushShapeSettings): void

Parameters

  • brushSettings: BrushShapeSettings

Returns void

calculateBounds

calculateBounds(): minecraftserver.BlockBoundingBox

Calculates the bounding box of the shape in local coordinates. Used for region allocation before shape placement.

Returns minecraftserver.BlockBoundingBox - Object with min and max Vector3 bounds

createSettingsPane

createSettingsPane(parentPane: IPropertyPane, onSettingsChange?: () => void, flatLayout?: boolean): ISubPanePropertyItem | undefined

Parameters

  • parentPane: IPropertyPane
  • onSettingsChange?: () => void
  • flatLayout?: boolean

Returns ISubPanePropertyItem | undefined

createShape

createShape(): RelativeVolumeListBlockVolume

Returns RelativeVolumeListBlockVolume

createShapeAsync

createShapeAsync(cancelToken?: { cancelled: boolean; }, yieldInterval?: number): Promise<RelativeVolumeListBlockVolume>

Asynchronously creates the shape, yielding control periodically to avoid timeouts. Use this for large shapes where createShape() may timeout.

Parameters

  • cancelToken?: { cancelled: boolean; }

    Optional token to cancel the operation. Set cancelled to true to abort.

  • yieldInterval?: number

    Number of blocks to process before yielding. Default is 10000.

Returns Promise<RelativeVolumeListBlockVolume> - Promise that resolves to the shape positions as Vector3 array.

estimateBlockCount

estimateBlockCount(): number

Returns a mathematical estimate of the number of blocks in the shape. Used for UI display and validation before shape creation.

Returns number - Estimated block count

getSettings

getSettings(): BrushShapeSettings

Returns BrushShapeSettings