public class BrushTool extends java.lang.Object implements TraceTool
Modifier and Type | Field and Description |
---|---|
protected static int |
MAX_RANGE |
protected int |
range |
Constructor and Description |
---|
BrushTool(java.lang.String permission)
Construct the tool.
|
Modifier and Type | Method and Description |
---|---|
boolean |
actPrimary(Platform server,
LocalConfiguration config,
Player player,
LocalSession session)
Perform the primary action of this trace tool.
|
boolean |
canUse(Actor player)
Checks to see if the player can still be using this tool (considering
permissions and such).
|
Brush |
getBrush()
Get the current brush.
|
Mask |
getMask()
Get the filter.
|
Pattern |
getMaterial()
Get the material.
|
int |
getRange()
Get the set brush range.
|
double |
getSize()
Get the set brush size.
|
Mask |
getTraceMask()
Get the mask used for identifying where to stop traces.
|
void |
setBrush(Brush brush,
java.lang.String permission)
Set the brush.
|
void |
setFill(Pattern material)
Set the material.
|
void |
setMask(Mask filter)
Set the block filter used for identifying blocks to replace.
|
void |
setRange(int range)
Set the set brush range.
|
void |
setSize(double radius)
Set the set brush size.
|
void |
setTraceMask(Mask traceMask)
Set the block mask used for identifying where to stop traces.
|
public BrushTool(java.lang.String permission)
permission
- the permission to check before use is allowedpublic boolean canUse(Actor player)
Tool
public Mask getMask()
public void setMask(Mask filter)
filter
- the filter to set@Nullable public Mask getTraceMask()
public void setTraceMask(@Nullable Mask traceMask)
traceMask
- the mask used to stop block tracespublic void setBrush(Brush brush, java.lang.String permission)
brush
- tbe brushpermission
- the permissionpublic Brush getBrush()
public void setFill(@Nullable Pattern material)
material
- the material@Nullable public Pattern getMaterial()
public double getSize()
public void setSize(double radius)
radius
- a radiuspublic int getRange()
public void setRange(int range)
range
- the range of the brush in blockspublic boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session)
TraceTool
actPrimary
in interface TraceTool
server
- The platformconfig
- The config instanceplayer
- The playersession
- The local session