Package com.sk89q.worldedit.function
Class GroundFunction
java.lang.Object
com.sk89q.worldedit.function.GroundFunction
- All Implemented Interfaces:
LayerFunction
Applies a
RegionFunction to the first ground block.-
Constructor Summary
ConstructorsConstructorDescriptionGroundFunction(Mask mask, RegionFunction function) Create a new ground function. -
Method Summary
Modifier and TypeMethodDescriptionbooleanapply(BlockVector3 position, int depth) Apply the function to the given position.intGet the number of affected objects.getMask()Get the mask that determines what the ground consists of.booleanisGround(BlockVector3 position) Returns whether the given block should be "passed through" when conducting the ground search.voidSet the mask that determines what the ground consists of.
-
Constructor Details
-
GroundFunction
Create a new ground function.- Parameters:
mask- a maskfunction- the function to apply
-
-
Method Details
-
getMask
Get the mask that determines what the ground consists of.- Returns:
- a mask
-
setMask
Set the mask that determines what the ground consists of.- Parameters:
mask- a mask
-
getAffected
public int getAffected()Get the number of affected objects.- Returns:
- the number of affected
-
isGround
Description copied from interface:LayerFunctionReturns whether the given block should be "passed through" when conducting the ground search.- Specified by:
isGroundin interfaceLayerFunction- Parameters:
position- return whether the given block is the ground- Returns:
- true if the search should stop
-
apply
Description copied from interface:LayerFunctionApply the function to the given position.The depth would be the number of blocks from the surface if a
LayerVisitorwas used.- Specified by:
applyin interfaceLayerFunction- Parameters:
position- the positiondepth- the depth as a number starting from 0- Returns:
- true whether this method should be called for further layers
- Throws:
WorldEditException- thrown on an error
-