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
Modifier and TypeFieldDescriptionprotected static int
protected static int
protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
act
(com.sk89q.worldedit.command.tool.BrushTool.BrushAction action, Player player, LocalSession session) boolean
actPrimary
(Platform server, LocalConfiguration config, Player player, LocalSession session) Perform the primary action of this trace tool.boolean
actSecondary
(Platform server, LocalConfiguration config, Player player, LocalSession session) Perform the secondary function of this tool.boolean
Checks 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) int
getRange()
Get the set brush range.double
getSize()
Get the set brush size.Get the filter.int
Get the mask used for identifying where to stop traces.boolean
boolean
isSet()
boolean
boolean
reset()
void
Set the brush.void
setContext
(BrushSettings context) void
Set the material.void
void
Set the block filter used for identifying blocks to replace.void
setPrimary
(BrushSettings primary) void
setRange
(int range) Set the set brush range.void
setScrollAction
(Scroll scrollAction) void
setSecondary
(BrushSettings secondary) void
setSize
(double radius) Set the set brush size.void
setSize
(Expression radius) Set the set brush size.void
setSourceMask
(Mask filter) Set the block filter used for identifying blocks to replace.void
setTargetMode
(TargetMode targetMode) void
setTargetOffset
(int targetOffset) void
setTraceMask
(Mask traceMask) Set the block mask used for identifying where to stop traces.void
setTransform
(ResettableExtent transform) void
update()
-
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:Tool
Checks 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:
reset
in 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:TraceTool
Perform the primary action of this trace tool.- Specified by:
actPrimary
in 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:DoubleActionTraceTool
Perform the secondary function of this tool.- Specified by:
actSecondary
in 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:
increment
in interfaceScrollTool
-
move
- Specified by:
move
in interfaceMovableTool
-