From 2bcf3eedf1ef596c3a02b1739b7c51fad3a14d59 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Wed, 4 Aug 2021 22:29:43 +0200 Subject: [PATCH] Add `//br snow` Apparently an upstream addition we forgot to pull. --- .../worldedit/command/BrushCommands.java | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java index da44f1a10..b155e6525 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushCommands.java @@ -91,8 +91,10 @@ import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.extent.clipboard.io.ClipboardFormats; import com.sk89q.worldedit.function.Contextual; import com.sk89q.worldedit.function.factory.Apply; +import com.sk89q.worldedit.function.factory.ApplyLayer; import com.sk89q.worldedit.function.factory.Deform; import com.sk89q.worldedit.function.factory.Paint; +import com.sk89q.worldedit.function.factory.Snow; import com.sk89q.worldedit.function.mask.ExistingBlockMask; import com.sk89q.worldedit.function.mask.Mask; import com.sk89q.worldedit.function.operation.Operation; @@ -101,6 +103,7 @@ import com.sk89q.worldedit.internal.annotation.ClipboardMask; import com.sk89q.worldedit.internal.expression.Expression; import com.sk89q.worldedit.math.BlockVector3; import com.sk89q.worldedit.math.Vector3; +import com.sk89q.worldedit.regions.factory.CylinderRegionFactory; import com.sk89q.worldedit.regions.factory.RegionFactory; import com.sk89q.worldedit.session.ClipboardHolder; import com.sk89q.worldedit.util.HandSide; @@ -1012,6 +1015,7 @@ public class BrushCommands { player.print(TextComponent.of("Set brush to " + factory)); } + //FAWE end @Command( name = "deform", @@ -1116,7 +1120,30 @@ public class BrushCommands { new Deform("y+=1"), shape, "worldedit.brush.lower" ); } - //FAWE end + + @Command( + name = "snow", + desc = "Snow brush, sets snow in the area" + ) + @CommandPermissions("worldedit.brush.snow") + public void snow( + Player player, LocalSession localSession, + @Arg(desc = "The shape of the region") + RegionFactory shape, + @Arg(desc = "The size of the brush", def = "5") + double radius, + @Switch(name = 's', desc = "Whether to stack snow") + boolean stack + ) throws WorldEditException { + + if (shape instanceof CylinderRegionFactory) { + shape = new CylinderRegionFactory(radius); + } + + setOperationBasedBrush(player, localSession, radius, + new ApplyLayer(new Snow(stack)), shape, "worldedit.brush.snow" + ); + } @Command( name = "sphere",