<commit_before>package com.thevoxelbox.voxelsniper.brush;

import org.bukkit.ChatColor;

import com.thevoxelbox.voxelsniper.SnipeData;
import com.thevoxelbox.voxelsniper.Message;
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;

/**
 * http://www.voxelwiki.com/minecraft/Voxelsniper#Underlay_Brush
 * @author jmck95 Credit to GavJenks for framework and 95 of code. Big Thank you to GavJenks
 */

public class UnderlayBrush extends PerformBrush {
	private static final int DEFAULT_DEPTH = 3;
	
	private static int timesUsed = 0;
    private int depth = DEFAULT_DEPTH;
    private boolean allBlocks = false;

    /**
     * 
     */
    public UnderlayBrush() {
        this.setName("Underlay (Reverse Overlay)");
    }

    private final void underlay(final SnipeData v) {
        final int _bSize = v.getBrushSize();
        final int[][] _memory = new int[_bSize * 2 + 1][_bSize * 2 + 1];
        final double _bPow = Math.pow(_bSize + 0.5, 2);
        
        for (int _z = _bSize; _z >= -_bSize; _z--) {
            for (int _x = _bSize; _x >= -_bSize; _x--) {
                for (int _y = this.getBlockPositionY(); _y < this.getBlockPositionY() + this.depth; _y++) { // start scanning from the height you clicked at
                    if (_memory[_x + _bSize][_z + _bSize] != 1) { // if haven't already found the surface in this column
                        if ((Math.pow(_x, 2) + Math.pow(_z, 2)) <= _bPow) { // if inside of the column...
                            if (!this.allBlocks) { // if the override parameter has not been activated, go to the switch that filters out manmade stuff.
                                switch (this.getBlockIdAt(this.getBlockPositionX() + _x, _y, this.getBlockPositionZ() + _z)) {
                                case 1:
                                case 2:
                                case 3:
                                case 12:
                                case 13:
                                case 24:// These cases filter out any manufactured or refined blocks, any trees and leas, etc. that you don't want to mess with.
                                case 48:
                                case 82:
                                case 49:
                                case 78:
                                    for (int _d = 0; (_d < this.depth); _d++) {
                                        if (this.clampY(this.getBlockPositionX() + _x, _y + _d, this.getBlockPositionZ() + _z).getTypeId() != 0) {
                                            this.current.perform(this.clampY(this.getBlockPositionX() + _x, _y + _d, this.getBlockPositionZ() + _z)); // fills down as many layers as you specify in
                                                                                                                // parameters
                                            _memory[_x + _bSize][_z + _bSize] = 1; // stop it from checking any other blocks in this vertical 1x1 column.
                                        }
                                    }
                                    break;

                                default:
                                    break;
                                }
                            } else {
                                for (int _d = 0; (_d < this.depth); _d++) {
                                    if (this.clampY(this.getBlockPositionX() + _x, _y + _d, this.getBlockPositionZ() + _z).getTypeId() != 0) {
                                        this.current.perform(this.clampY(this.getBlockPositionX() + _x, _y + _d, this.getBlockPositionZ() + _z)); // fills down as many layers as you specify in
                                                                                                            // parameters
                                        _memory[_x + _bSize][_z + _bSize] = 1; // stop it from checking any other blocks in this vertical 1x1 column.
                                    }
                                }
                            }
                        }

                    }
                }
            }
        }

        v.storeUndo(this.current.getUndo());
    }

    private final void underlay2(final SnipeData v) {
        final int _bSize = v.getBrushSize();
        final int[][] _memory = new int[_bSize * 2 + 1][_bSize * 2 + 1];
        final double _bPow = Math.pow(_bSize + 0.5, 2);
        
        for (int _z = _bSize; _z >= -_bSize; _z--) {
            for (int _x = _bSize; _x >= -_bSize; _x--) {
                for (int _y = this.getBlockPositionY(); _y < this.getBlockPositionY() + this.depth; _y++) { // start scanning from the height you clicked at
                    if (_memory[_x + _bSize][_z + _bSize] != 1) { // if haven't already found the surface in this column
                        if ((Math.pow(_x, 2) + Math.pow(_z, 2)) <= _bPow) { // if inside of the column...

                            if (!this.allBlocks) { // if the override parameter has not been activated, go to the switch that filters out manmade stuff.

                                switch (this.getBlockIdAt(this.getBlockPositionX() + _x, _y, this.getBlockPositionZ() + _z)) {
                                case 1:
                                case 2:
                                case 3:
                                case 12:
                                case 13:
                                case 14: // These cases filter out any manufactured or refined blocks, any trees and leas, etc. that you don't want to mess
                                         // with.<commit_msg>* Some Checkstyle fixes in UnderlayBrush.java<commit_after>package com.thevoxelbox.voxelsniper.brush;

import org.bukkit.ChatColor;

import com.thevoxelbox.voxelsniper.SnipeData;
import com.thevoxelbox.voxelsniper.Message;
import com.thevoxelbox.voxelsniper.brush.perform.PerformBrush;

/**
 * http://www.voxelwiki.com/minecraft/Voxelsniper#Underlay_Brush
 * @author jmck95 Credit to GavJenks for framework and 95 of code. Big Thank you to GavJenks
 */

public class UnderlayBrush extends PerformBrush {
	private static final int DEFAULT_DEPTH = 3;
	
	private static int timesUsed = 0;
    private int depth = DEFAULT_DEPTH;
    private boolean allBlocks = false;

    /**
     * 
     */
    public UnderlayBrush() {
        this.setName("Underlay (Reverse Overlay)");
    }

    private void underlay(final SnipeData v) {
        final int _bSize = v.getBrushSize();
        final int[][] _memory = new int[_bSize * 2 + 1][_bSize * 2 + 1];
        final double _bPow = Math.pow(_bSize + 0.5, 2);
        
        for (int _z = _bSize; _z >= -_bSize; _z--) {
            for (int _x = _bSize; _x >= -_bSize; _x--) {
                for (int _y = this.getBlockPositionY(); _y < this.getBlockPositionY() + this.depth; _y++) { // start scanning from the height you clicked at
                    if (_memory[_x + _bSize][_z + _bSize] != 1) { // if haven't already found the surface in this column
                        if ((Math.pow(_x, 2) + Math.pow(_z, 2)) <= _bPow) { // if inside of the column...
                            if (!this.allBlocks) { // if the override parameter has not been activated, go to the switch that filters out manmade stuff.
                                switch (this.getBlockIdAt(this.getBlockPositionX() + _x, _y, this.getBlockPositionZ() + _z)) {
                                case 1:
                                case 2:
                                case 3:
                                case 12:
                                case 13:
                                case 24:// These cases filter out any manufactured or refined blocks, any trees and leas, etc. that you don't want to mess with.
                                case 48:
                                case 82:
                                case 49:
                                case 78:
                                    for (int _d = 0; (_d < this.depth); _d++) {
                                        if (this.clampY(this.getBlockPositionX() + _x, _y + _d, this.getBlockPositionZ() + _z).getTypeId() != 0) {
                                            this.current.perform(this.clampY(this.getBlockPositionX() + _x, _y + _d, this.getBlockPositionZ() + _z)); // fills down as many layers as you specify in
                                                                                                                // parameters
                                            _memory[_x + _bSize][_z + _bSize] = 1; // stop it from checking any other blocks in this vertical 1x1 column.
                                        }
                                    }
                                    break;

                                default:
                                    break;
                                }
                            } else {
                                for (int _d = 0; (_d < this.depth); _d++) {
                                    if (this.clampY(this.getBlockPositionX() + _x, _y + _d, this.getBlockPositionZ() + _z).getTypeId() != 0) {
                                        this.current.perform(this.clampY(this.getBlockPositionX() + _x, _y + _d, this.getBlockPositionZ() + _z)); // fills down as many layers as you specify in
                                                                                                            // parameters
                                        _memory[_x + _bSize][_z + _bSize] = 1; // stop it from checking any other blocks in this vertical 1x1 column.
                                    }
                                }
                            }
                        }

                    }
                }
            }
        }

        v.storeUndo(this.current.getUndo());
    }

    private void underlay2(final SnipeData v) {
        final int _bSize = v.getBrushSize();
        final int[][] _memory = new int[_bSize * 2 + 1][_bSize * 2 + 1];
        final double _bPow = Math.pow(_bSize + 0.5, 2);
        
        for (int _z = _bSize; _z >= -_bSize; _z--) {
            for (int _x = _bSize; _x >= -_bSize; _x--) {
                for (int _y = this.getBlockPositionY(); _y < this.getBlockPositionY() + this.depth; _y++) { // start scanning from the height you clicked at
                    if (_memory[_x + _bSize][_z + _bSize] != 1) { // if haven't already found the surface in this column
                        if ((Math.pow(_x, 2) + Math.pow(_z, 2)) <= _bPow) { // if inside of the column...

                            if (!this.allBlocks) { // if the override parameter has not been activated, go to the switch that filters out manmade stuff.

                                switch (this.getBlockIdAt(this.getBlockPositionX() + _x, _y, this.getBlockPositionZ() + _z)) {
                                case 1:
                                case 2:
                                case 3:
                                case 12:
                                case 13:
                                case 14: // These cases filter out any manufactured or refined blocks, any trees and leas, etc. that you don't want to mess
                                         // with.
{'fraction_non_alphanumeric': 0.09315555555555556, 'fraction_numerical': 0.0112, 'mean_word_length': 1.1369420702754036, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 60, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6889455', 'n_tokens_mistral': 3102, 'n_tokens_neox': 2841, 'n_words': 880}