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

public class StencilBrush extends AbstractBrush
This is paste only currently. Assumes files exist, and thus has no usefulness until I add in saving stencils later. Uses sniper-exclusive stencil format: 3 shorts for X,Z,Y size of cuboid 3 shorts for X,Z,Y offsets from the -X,-Z,-Y corner. This is the reference point for pasting, corresponding to where you click your brush. 1 long integer saying how many runs of blocks are in the schematic (data is compressed into runs) 1 per run: (1 boolean: true = compressed line ahead, false = locally unique block ahead. This wastes a bit instead of a byte, and overall saves space, as long as at least 1/8 of all RUNS are going to be size 1, which in Minecraft is almost definitely true. IF boolean was true, next unstenciled byte stores the number of consecutive blocks of the same type, up to 256. IF boolean was false, there is no byte here, goes straight to ID and data instead, which applies to just one block. 2 bytes to identify type of block. First byte is ID, second is data. This applies to every one of the line of consecutive blocks if boolean was true.)
  • Constructor Details

    • StencilBrush

      public StencilBrush()
  • Method Details

    • loadProperties

      public void loadProperties()
      Description copied from interface: Brush
      Load brush properties.
      Specified by:
      loadProperties in interface Brush
      Overrides:
      loadProperties in class AbstractBrush
    • onBrush

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

      public void onBrushInfo(@NotNull @NotNull Snipe snipe)
    • onBrushFull

      public void onBrushFull(@NotNull @NotNull Snipe snipe, @NotNull @NotNull File stencil)
    • onBrushFill

      public void onBrushFill(@NotNull @NotNull Snipe snipe, @NotNull @NotNull File stencil)
    • onBrushReplace

      public void onBrushReplace(@NotNull @NotNull Snipe snipe, @NotNull @NotNull File stencil)
    • onBrushStencil

      public void onBrushStencil(@NotNull @NotNull Snipe snipe, @NotNull @NotNull File stencil)
    • 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