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
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final int
protected static final VoxelSniperConfig
protected static final DecimalFormat
protected static final VoxelSniperPlugin
protected static final File
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
clampY
(int y) clampY
(int x, int y, int z) clampY
(BlockVector3 position) createEntity
(BlockVector3 location, Entity bukkitEntity) boolean
generateTree
(BlockVector3 location, TreeGenerator.TreeType treeType) getBlock
(int x, int y, int z) getBlock
(BlockVector3 position) getBlockType
(int x, int y, int z) getBlockType
(BlockVector3 position) boolean
getBooleanProperty
(String propertyName, boolean defaultValue) getDirection
(BlockVector3 first, BlockVector3 second) double
getDoubleProperty
(String propertyName, double defaultValue) Enum
<?> getEnumProperty
(String propertyName, Class<?> enumClass, Enum<?> defaultValue) getFullBlock
(int x, int y, int z) getFullBlock
(BlockVector3 position) int
getHighestTerrainBlock
(int x, int z, int minY, int maxY) int
getIntegerProperty
(String propertyName, int defaultValue) Returns the Block before target Block.List
<?> getListProperty
(String propertyName, List<?> defaultValue) Return brush properties.getProperty
(String propertyName, Object defaultValue) Return a config property associated to a brush, if exists.getProperty
(String propertyName, Object defaultValue, Object defaultConfigValue) Return a config property associated to a brush, if exists.getRegistryProperty
(String propertyName, NamespacedRegistry<? extends Keyed> registry, Keyed defaultValue) getRelativeBlock
(int x, int y, int z, Direction direction) getRelativeBlock
(BlockVector3 origin, Direction direction) getStringProperty
(String propertyName, String defaultValue) void
Load brush properties.protected void
onBrushCommand
(Snipe snipe) protected void
onBrushInfoCommand
(Snipe snipe, com.sk89q.worldedit.util.formatting.text.Component component) void
perform
(Snipe snipe, ToolAction action, EditSession editSession, BlockVector3 targetBlock, BlockVector3 lastBlock) Perform brush action.void
refreshChunk
(int chunkX, int chunkZ) boolean
regenerateChunk
(int chunkX, int chunkZ, BiomeType biomeType) void
void
void
void
setBlock
(BlockVector3 position, Pattern pattern) void
setBlock
(BlockVector3 position, BaseBlock block) void
setBlockData
(int x, int y, int z, BlockState blockState) void
setBlockData
(BlockVector3 position, BlockState blockState) void
setLastBlock
(BlockVector3 lastBlock) void
setProperties
(BrushProperties properties) Set brush properties.void
setTargetBlock
(BlockVector3 targetBlock) simulateSetBlock
(int x, int y, int z, Pattern pattern) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.thevoxelbox.voxelsniper.brush.Brush
handleArrowAction, handleGunpowderAction, sendInfo
-
Field Details
-
PLUGIN
-
CONFIG
-
PLUGIN_DATA_FOLDER
-
CHUNK_SIZE
protected static final int CHUNK_SIZE- See Also:
-
DECIMAL_FORMAT
-
-
Constructor Details
-
AbstractBrush
public AbstractBrush()
-
-
Method Details
-
onBrushCommand
-
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. -
clampY
public int clampY(int y) -
clampY
-
clampY
-
setBiome
-
getHighestTerrainBlock
public int getHighestTerrainBlock(int x, int z, int minY, int maxY) -
regenerateChunk
-
refreshChunk
public void refreshChunk(int chunkX, int chunkZ) -
generateTree
-
createEntity
-
getDirection
-
getRelativeBlock
-
getRelativeBlock
-
getBlockType
-
getBlockType
-
setBlock
-
setBlock
-
setBlockData
-
setBlockData
-
simulateSetBlock
-
getFullBlock
-
getFullBlock
-
getBlock
-
getBlock
-
setBlock
-
setBlock
-
getProperties
Description copied from interface:Brush
Return brush properties.- Specified by:
getProperties
in interfaceBrush
- Returns:
- brush properties
-
setProperties
Description copied from interface:Brush
Set brush properties.- Specified by:
setProperties
in interfaceBrush
- Parameters:
properties
- brush properties
-
getProperty
Return a config property associated to a brush, if exists. Otherwise, set the default value and return it.- Parameters:
propertyName
- the name of the propertydefaultValue
- the default value to set and return- Returns:
- the associated proprorty, or the default value
-
getProperty
Return a config property associated to a brush, if exists. Otherwise, set the default value and return it.- Parameters:
propertyName
- the name of the propertydefaultValue
- the default value to set and returndefaultConfigValue
- 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
-
getBooleanProperty
-
getIntegerProperty
-
getDoubleProperty
-
getListProperty
-
getRegistryProperty
public Object getRegistryProperty(String propertyName, NamespacedRegistry<? extends Keyed> registry, Keyed defaultValue) -
getEnumProperty
-
loadProperties
public void loadProperties()Description copied from interface:Brush
Load brush properties.- Specified by:
loadProperties
in interfaceBrush
-
getEditSession
-
getTargetBlock
-
setTargetBlock
-
getLastBlock
Returns the Block before target Block. -
setLastBlock
-