Class AbstractBrush

java.lang.Object
com.thevoxelbox.voxelsniper.brush.type.AbstractBrush
All Implemented Interfaces:
Brush, VoxelCommandElement
Direct Known Subclasses:
AbstractBlendBrush, AbstractPerformerBrush, AbstractStampBrush, BiomeBrush, BlockResetBrush, BlockResetSurfaceBrush, CanyonBrush, CleanSnowBrush, CometBrush, CopyPastaBrush, DomeBrush, DrainBrush, EntityBrush, EntityRemovalBrush, EraserBrush, ErodeBlendBrush, ErodeBrush, ExtrudeBrush, FlatOceanBrush, GenerateTreeBrush, HeatRayBrush, JockeyBrush, LightningBrush, MoveBrush, OceanBrush, PaintingBrush, PullBrush, RandomErodeBrush, RegenerateChunkBrush, Rotation2DBrush, Rotation2DVerticalBrush, Rotation3DBrush, RulerBrush, ScannerBrush, SetRedstoneFlipBrush, SetRedstoneRotateBrush, ShellBallBrush, ShellSetBrush, ShellVoxelBrush, SignOverwriteBrush, SnowConeBrush, SpiralStaircaseBrush, StencilBrush, StencilListBrush, TreeSnipeBrush, VoltmeterBrush, WarpBrush

public abstract class AbstractBrush extends Object implements Brush
  • Field Details

  • Constructor Details

    • AbstractBrush

      public AbstractBrush()
  • Method Details

    • onBrushCommand

      protected void onBrushCommand(Snipe snipe)
    • onBrushInfoCommand

      protected void onBrushInfoCommand(Snipe snipe, com.sk89q.worldedit.util.formatting.text.Component component)
    • perform

      public void perform(Snipe snipe, ToolAction action, EditSession editSession, BlockVector3 targetBlock, BlockVector3 lastBlock)
      Description copied from interface: Brush
      Perform brush action.
      Specified by:
      perform in interface Brush
      Parameters:
      snipe - Snipe
      action - ToolAction
      editSession - EditSession
      targetBlock - Target Block
      lastBlock - Last Block, preceding Target Block
    • clampY

      public int clampY(int y)
    • clampY

      public BlockState clampY(BlockVector3 position)
    • clampY

      public BlockState clampY(int x, int y, int z)
    • setBiome

      public void setBiome(int x, int y, int z, BiomeType biomeType)
    • getHighestTerrainBlock

      public int getHighestTerrainBlock(int x, int z, int minY, int maxY)
    • regenerateChunk

      public boolean regenerateChunk(int chunkX, int chunkZ, BiomeType biomeType)
    • refreshChunk

      public void refreshChunk(int chunkX, int chunkZ)
    • generateTree

      public boolean generateTree(BlockVector3 location, TreeGenerator.TreeType treeType)
    • createEntity

      public Entity createEntity(BlockVector3 location, Entity bukkitEntity)
    • getDirection

      public Direction getDirection(BlockVector3 first, BlockVector3 second)
    • getRelativeBlock

      public BlockVector3 getRelativeBlock(BlockVector3 origin, Direction direction)
    • getRelativeBlock

      public BlockVector3 getRelativeBlock(int x, int y, int z, Direction direction)
    • getBlockType

      public BlockType getBlockType(BlockVector3 position)
    • getBlockType

      public BlockType getBlockType(int x, int y, int z)
    • setBlock

      public void setBlock(BlockVector3 position, Pattern pattern)
    • setBlock

      public void setBlock(int x, int y, int z, Pattern pattern)
    • setBlockData

      public void setBlockData(BlockVector3 position, BlockState blockState)
    • setBlockData

      public void setBlockData(int x, int y, int z, BlockState blockState)
    • simulateSetBlock

      public BaseBlock simulateSetBlock(int x, int y, int z, Pattern pattern)
    • getFullBlock

      public BaseBlock getFullBlock(BlockVector3 position)
    • getFullBlock

      public BaseBlock getFullBlock(int x, int y, int z)
    • getBlock

      public BlockState getBlock(BlockVector3 position)
    • getBlock

      public BlockState getBlock(int x, int y, int z)
    • setBlock

      public void setBlock(BlockVector3 position, BaseBlock block)
    • setBlock

      public void setBlock(int x, int y, int z, BaseBlock block)
    • getProperties

      public BrushProperties getProperties()
      Description copied from interface: Brush
      Return brush properties.
      Specified by:
      getProperties in interface Brush
      Returns:
      brush properties
    • setProperties

      public void setProperties(BrushProperties properties)
      Description copied from interface: Brush
      Set brush properties.
      Specified by:
      setProperties in interface Brush
      Parameters:
      properties - brush properties
    • getProperty

      public Object getProperty(String propertyName, Object defaultValue)
      Return a config property associated to a brush, if exists. Otherwise, set the default value and return it.
      Parameters:
      propertyName - the name of the property
      defaultValue - the default value to set and return
      Returns:
      the associated proprorty, or the default value
    • getProperty

      public Object getProperty(String propertyName, Object defaultValue, Object defaultConfigValue)
      Return a config property associated to a brush, if exists. Otherwise, set the default value and return it.
      Parameters:
      propertyName - the name of the property
      defaultValue - the default value to set and return
      defaultConfigValue - the default config value to set, objets such as Enum and Registry values are not serializable
      Returns:
      the associated property, or the default value
    • getStringProperty

      public String getStringProperty(String propertyName, String defaultValue)
    • getBooleanProperty

      public boolean getBooleanProperty(String propertyName, boolean defaultValue)
    • getIntegerProperty

      public int getIntegerProperty(String propertyName, int defaultValue)
    • getDoubleProperty

      public double getDoubleProperty(String propertyName, double defaultValue)
    • getListProperty

      public List<?> getListProperty(String propertyName, List<?> defaultValue)
    • getRegistryProperty

      public Object getRegistryProperty(String propertyName, NamespacedRegistry<? extends Keyed> registry, Keyed defaultValue)
    • getEnumProperty

      public Enum<?> getEnumProperty(String propertyName, Class<?> enumClass, Enum<?> defaultValue)
    • loadProperties

      public void loadProperties()
      Description copied from interface: Brush
      Load brush properties.
      Specified by:
      loadProperties in interface Brush
    • getEditSession

      public EditSession getEditSession()
    • getTargetBlock

      public BlockVector3 getTargetBlock()
    • setTargetBlock

      public void setTargetBlock(BlockVector3 targetBlock)
    • getLastBlock

      public BlockVector3 getLastBlock()
      Returns the Block before target Block.
    • setLastBlock

      public void setLastBlock(BlockVector3 lastBlock)