Package com.sk89q.worldedit.command.tool
Class BrushTool
java.lang.Object
com.sk89q.worldedit.command.tool.BrushTool
- All Implemented Interfaces:
MovableTool,ResettableTool,ScrollTool,DoubleActionTraceTool,Tool,TraceTool,Serializable
- Direct Known Subclasses:
DistanceWand,InspectBrush,LongRangeBuildTool
public class BrushTool
extends Object
implements DoubleActionTraceTool, ScrollTool, MovableTool, ResettableTool, Serializable, TraceTool
Builds a shape at the place being looked at.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static intprotected static intprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanact(com.sk89q.worldedit.command.tool.BrushTool.BrushAction action, Player player, LocalSession session) booleanactPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session) Perform the primary action of this trace tool.booleanactSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session) Perform the secondary function of this tool.booleanChecks to see if the player can still be using this tool (considering permissions and such).getBrush()Get the current brush.getMask()Get the filter.Get the material.getPosition(EditSession editSession, Player player) intgetRange()Get the set brush range.doublegetSize()Get the set brush size.Get the filter.intGet the mask used for identifying where to stop traces.booleanbooleanisSet()booleanbooleanreset()voidSet the brush.voidsetContext(BrushSettings context) voidSet the material.voidvoidSet the block filter used for identifying blocks to replace.voidsetPrimary(BrushSettings primary) voidsetRange(int range) Set the set brush range.voidsetScrollAction(Scroll scrollAction) voidsetSecondary(BrushSettings secondary) voidsetSize(double radius) Set the set brush size.voidsetSize(Expression radius) Set the set brush size.voidsetSourceMask(Mask filter) Set the block filter used for identifying blocks to replace.voidsetTargetMode(TargetMode targetMode) voidsetTargetOffset(int targetOffset) voidsetTraceMask(Mask traceMask) Set the block mask used for identifying where to stop traces.voidsetTransform(ResettableExtent transform) voidupdate()
-
Field Details
-
MAX_RANGE
protected static int MAX_RANGE -
range
protected int range -
DEFAULT_RANGE
protected static int DEFAULT_RANGE
-
-
Constructor Details
-
BrushTool
Construct the tool.- Parameters:
permission- the permission to check before use is allowed
-
BrushTool
public BrushTool()
-
-
Method Details
-
setHolder
-
isSet
public boolean isSet() -
update
public void update() -
getContext
-
setContext
-
canUse
Description copied from interface:ToolChecks to see if the player can still be using this tool (considering permissions and such). -
getTransform
-
getPrimary
-
getSecondary
-
getOffHand
-
setPrimary
-
setSecondary
-
setTransform
-
getSourceMask
Get the filter.- Returns:
- the filter
-
reset
public boolean reset()- Specified by:
resetin interfaceResettableTool
-
setMask
Set the block filter used for identifying blocks to replace.- Parameters:
filter- the filter to set
-
getMask
Get the filter.- Returns:
- the filter
-
getTraceMask
Get the mask used for identifying where to stop traces.- Returns:
- the mask used to stop block traces
-
setTraceMask
Set the block mask used for identifying where to stop traces.- Parameters:
traceMask- the mask used to stop block traces
-
setSourceMask
Set the block filter used for identifying blocks to replace.- Parameters:
filter- the filter to set
-
setBrush
Set the brush.- Parameters:
brush- the brushpermission- the permission
-
getBrush
Get the current brush.- Returns:
- the current brush
-
setFill
Set the material.- Parameters:
material- the material
-
getMaterial
Get the material.- Returns:
- the material
-
getSize
public double getSize()Get the set brush size.- Returns:
- a radius
-
setSize
public void setSize(double radius) Set the set brush size.- Parameters:
radius- a radius
-
setSize
Set the set brush size.- Parameters:
radius- a radius
-
getRange
public int getRange()Get the set brush range.- Returns:
- the range of the brush in blocks
-
setRange
public void setRange(int range) Set the set brush range.- Parameters:
range- the range of the brush in blocks
-
actPrimary
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session) Description copied from interface:TraceToolPerform the primary action of this trace tool.- Specified by:
actPrimaryin interfaceTraceTool- Parameters:
server- The platformconfig- The config instanceplayer- The playersession- The local session- Returns:
- true to cancel the original event which triggered this action (if possible)
-
getPosition
-
act
public boolean act(com.sk89q.worldedit.command.tool.BrushTool.BrushAction action, Player player, LocalSession session) -
actSecondary
public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session) Description copied from interface:DoubleActionTraceToolPerform the secondary function of this tool.- Specified by:
actSecondaryin interfaceDoubleActionTraceTool- Parameters:
server- The platformconfig- The config instanceplayer- The playersession- The local session- Returns:
- true to cancel the original event which triggered this action (if possible)
-
setScrollAction
-
setTargetOffset
public void setTargetOffset(int targetOffset) -
setTargetMode
-
getTargetMode
-
getTargetOffset
public int getTargetOffset() -
increment
- Specified by:
incrementin interfaceScrollTool
-
move
- Specified by:
movein interfaceMovableTool
-