Class ArbitraryShape
java.lang.Object
com.sk89q.worldedit.regions.shape.ArbitraryShape
- Direct Known Subclasses:
RegionShape
Generates solid and hollow shapes according to materials returned by the
getMaterial(int, int, int, com.sk89q.worldedit.world.block.BaseBlock)
method.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
generate
(EditSession editSession, Pattern pattern, boolean hollow) Generates the shape.protected Region
protected abstract BaseBlock
getMaterial
(int x, int y, int z, BaseBlock defaultMaterial) Override this function to specify the shape to generate.
-
Field Details
-
extent
-
-
Constructor Details
-
ArbitraryShape
-
-
Method Details
-
getExtent
-
getMaterial
Override this function to specify the shape to generate.- Parameters:
x
- X coordinate to be queriedy
- Y coordinate to be queriedz
- Z coordinate to be querieddefaultMaterial
- The material returned by the pattern for the current block.- Returns:
- material to place or null to not place anything.
-
generate
public int generate(EditSession editSession, Pattern pattern, boolean hollow) throws MaxChangedBlocksException Generates the shape.- Parameters:
editSession
- The EditSession to use.pattern
- The pattern to generate default materials from.hollow
- Specifies whether to generate a hollow shape.- Returns:
- number of affected blocks.
- Throws:
MaxChangedBlocksException
- if the maximum blocks changed is exceeded
-