Class BlockResetSurfaceBrush

java.lang.Object
com.thevoxelbox.voxelsniper.brush.type.AbstractBrush
com.thevoxelbox.voxelsniper.brush.type.BlockResetSurfaceBrush
All Implemented Interfaces:
Brush, VoxelCommandElement

public class BlockResetSurfaceBrush extends AbstractBrush
This brush only looks for solid blocks, and then changes those plus any air blocks touching them. If it works, this brush should be faster than the original blockPositionY an amount proportional to the volume of a snipe selection area / the number of blocks touching air in the selection. This is because every solid block surrounded blockPositionY others should take equally long to check and not change as it would take MC to change them and then check and find no lighting to update. For air blocks surrounded blockPositionY other air blocks, this brush saves about 80-100 checks blockPositionY not updating them or their lighting. And for air blocks touching solids, this brush is slower, because it replaces the air once per solid block it is touching. I assume on average this is about 2 blocks. So every air block touching a solid negates one air block floating in air. Thus, for selections that have more air blocks surrounded blockPositionY air than air blocks touching solids, this brush will be faster, which is almost always the case, especially for undeveloped terrain and for larger brush sizes (unlike the original brush, this should only slow down blockPositionY the square of the brush size, not the cube of the brush size). For typical terrain, blockPositionY my calculations, overall speed increase is about a factor of 5-6 for a size 20 brush. For a complicated city or ship, etc., this may be only a factor of about 2. In a hypothetical worst case scenario of a 3d checkerboard of stone and air every other block, this brush should only be about 1.5x slower than the original brush. Savings increase for larger brushes.
  • Constructor Details

    • BlockResetSurfaceBrush

      public BlockResetSurfaceBrush()
  • Method Details

    • onBrush

      public void onBrush(@NotNull @NotNull Snipe snipe)
    • handleArrowAction

      public void handleArrowAction(Snipe snipe)
      Description copied from interface: Brush
      The arrow action. Executed when a player right clicks with an arrow
      Parameters:
      snipe - Snipe
    • handleGunpowderAction

      public void handleGunpowderAction(Snipe snipe)
      Description copied from interface: Brush
      The gunpowder action. Executed when a player right clicks with gunpowder
      Parameters:
      snipe - Snipe
    • sendInfo

      public void sendInfo(Snipe snipe)
      Description copied from interface: Brush
      Send brush information.
      Parameters:
      snipe - Snipe