mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 09:47:38 +00:00
Added shortcut fire extinguisher brush.
This commit is contained in:
parent
7787f7c4f6
commit
9151f8b6bf
@ -30,7 +30,11 @@ import com.sk89q.worldedit.LocalSession;
|
|||||||
import com.sk89q.worldedit.Vector;
|
import com.sk89q.worldedit.Vector;
|
||||||
import com.sk89q.worldedit.WorldEdit;
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
import com.sk89q.worldedit.WorldEditException;
|
import com.sk89q.worldedit.WorldEditException;
|
||||||
|
import com.sk89q.worldedit.blocks.BaseBlock;
|
||||||
|
import com.sk89q.worldedit.blocks.BlockID;
|
||||||
|
import com.sk89q.worldedit.masks.BlockTypeMask;
|
||||||
import com.sk89q.worldedit.patterns.Pattern;
|
import com.sk89q.worldedit.patterns.Pattern;
|
||||||
|
import com.sk89q.worldedit.patterns.SingleBlockPattern;
|
||||||
import com.sk89q.worldedit.tools.BrushTool;
|
import com.sk89q.worldedit.tools.BrushTool;
|
||||||
import com.sk89q.worldedit.tools.brushes.ClipboardBrush;
|
import com.sk89q.worldedit.tools.brushes.ClipboardBrush;
|
||||||
import com.sk89q.worldedit.tools.brushes.CylinderBrush;
|
import com.sk89q.worldedit.tools.brushes.CylinderBrush;
|
||||||
@ -194,4 +198,36 @@ public class BrushCommands {
|
|||||||
player.print(String.format("Smooth brush equipped (%d x %dx).",
|
player.print(String.format("Smooth brush equipped (%d x %dx).",
|
||||||
radius, iterations));
|
radius, iterations));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Command(
|
||||||
|
aliases = {"ex", "extinguish"},
|
||||||
|
usage = "[radius]",
|
||||||
|
desc = "Shortcut fire extinguisher brush",
|
||||||
|
min = 0,
|
||||||
|
max = 1
|
||||||
|
)
|
||||||
|
@CommandPermissions({"worldedit.brush.ex"})
|
||||||
|
public static void extinguishBrush(CommandContext args, WorldEdit we,
|
||||||
|
LocalSession session, LocalPlayer player, EditSession editSession)
|
||||||
|
throws WorldEditException {
|
||||||
|
|
||||||
|
LocalConfiguration config = we.getConfiguration();
|
||||||
|
|
||||||
|
int radius = args.argsLength() > 1 ? args.getInteger(1) : 5;
|
||||||
|
if (radius > config.maxBrushRadius) {
|
||||||
|
player.printError("Maximum allowed brush radius: "
|
||||||
|
+ config.maxBrushRadius);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BrushTool tool = session.getBrushTool(player.getItemInHand());
|
||||||
|
Pattern fill = new SingleBlockPattern(new BaseBlock(0));
|
||||||
|
tool.setFill(fill);
|
||||||
|
tool.setSize(radius);
|
||||||
|
tool.setMask(new BlockTypeMask(BlockID.FIRE));
|
||||||
|
tool.setBrush(new SphereBrush());
|
||||||
|
|
||||||
|
player.print(String.format("Extinguisher equipped (%d).",
|
||||||
|
radius));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user