@@ -0,0 +1,3073 @@
+/*%0A * The MIT License (MIT)%0A *%0A * Copyright (c) 2014 The Voxel Plugineering Team%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in%0A * all copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN%0A * THE SOFTWARE.%0A */%0Apackage com.voxelplugineering.voxelsniper.brush.mask;%0A%0Aimport com.voxelplugineering.voxelsniper.GunsmithLogger;%0Aimport com.voxelplugineering.voxelsniper.brush.Brush;%0Aimport com.voxelplugineering.voxelsniper.brush.BrushContext;%0Aimport com.voxelplugineering.voxelsniper.brush.BrushInfo;%0Aimport com.voxelplugineering.voxelsniper.brush.BrushKeys;%0Aimport com.voxelplugineering.voxelsniper.brush.BrushPartType;%0Aimport com.voxelplugineering.voxelsniper.brush.BrushVars;%0Aimport com.voxelplugineering.voxelsniper.brush.ExecutionResult;%0Aimport com.voxelplugineering.voxelsniper.entity.Player;%0Aimport com.voxelplugineering.voxelsniper.shape.ComplexShape;%0Aimport com.voxelplugineering.voxelsniper.shape.Shape;%0A%0Aimport com.google.common.base.Optional;%0A%0A@BrushInfo(name = %22flatten%22, type = BrushPartType.MASK)%0Apublic class FlattenBrush implements Brush%0A%7B%0A%0A    @Override%0A    public ExecutionResult run(Player player, BrushVars args)%0A    %7B%0A        Optional%3CShape%3E s = args.get(BrushKeys.SHAPE, Shape.class);%0A        if (!s.isPresent())%0A        %7B%0A            player.sendMessage(%22You must have at least one shape brush before your flatten brush.%22);%0A            return ExecutionResult.abortExecution();%0A        %7D%0A        Shape base = s.get();%0A        ComplexShape shape = new ComplexShape(base.getWidth(), 1, base.getLength(), base.getOrigin().getX(), 0, base.getOrigin().getZ());%0A%0A        for (int x = 0; x %3C base.getWidth(); x++)%0A        %7B%0A            for (int z = 0; z %3C base.getLength(); z++)%0A            %7B%0A                for (int y = 0; y %3C base.getHeight(); y++)%0A                %7B%0A                    if (base.get(x, y, z, false))%0A                    %7B%0A                        shape.set(x, 0, z, false);%0A                        break;%0A                    %7D%0A                %7D%0A            %7D%0A        %7D%0A%0A        args.set(BrushContext.RUNTIME, BrushKeys.SHAPE, shape);%0A        return ExecutionResult.continueExecution();%0A    %7D%0A%0A%7D%0A

Add flatten mask brush