Class BrushTool

java.lang.Object
com.sk89q.worldedit.command.tool.BrushTool
All Implemented Interfaces:
Tool, TraceTool
Direct Known Subclasses:
DistanceWand, LongRangeBuildTool

public class BrushTool extends Object implements TraceTool
Builds a shape at the place being looked at.
  • Field Details

    • MAX_RANGE

      protected static int MAX_RANGE
    • range

      protected int range
  • Constructor Details

    • BrushTool

      public BrushTool(String permission)
      Construct the tool.
      Parameters:
      permission - the permission to check before use is allowed
    • BrushTool

      public BrushTool(Brush brush, String permission)
      Construct the tool.
      Parameters:
      brush - the brush to bind
      permission - the permission to check before use is allowed
  • Method Details

    • canUse

      public boolean canUse(Actor player)
      Description copied from interface: Tool
      Checks to see if the player can still be using this tool (considering permissions and such).
      Specified by:
      canUse in interface Tool
      Parameters:
      player - the actor
      Returns:
      true if use is permitted
    • getMask

      public Mask getMask()
      Get the filter.
      Returns:
      the filter
    • setMask

      public void setMask(Mask filter)
      Set the block filter used for identifying blocks to replace.
      Parameters:
      filter - the filter to set
    • getTraceMask

      @Nullable public Mask getTraceMask()
      Get the mask used for identifying where to stop traces.
      Returns:
      the mask used to stop block traces
    • setTraceMask

      public void setTraceMask(@Nullable Mask traceMask)
      Set the block mask used for identifying where to stop traces.
      Parameters:
      traceMask - the mask used to stop block traces
    • setBrush

      public void setBrush(Brush brush, String permission)
      Set the brush.
      Parameters:
      brush - the brush
      permission - the permission
    • getBrush

      public Brush getBrush()
      Get the current brush.
      Returns:
      the current brush
    • setFill

      public void setFill(@Nullable Pattern material)
      Set the material.
      Parameters:
      material - the material
    • getMaterial

      @Nullable public Pattern 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
    • 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 interface TraceTool
      Parameters:
      server - The platform
      config - The config instance
      player - The player
      session - The local session
      Returns:
      true to cancel the original event which triggered this action (if possible)