Java Examples for com.sk89q.worldedit.command.tool.brush.HollowCylinderBrush
The following java examples will help you to understand the usage of com.sk89q.worldedit.command.tool.brush.HollowCylinderBrush. These source code samples are taken from different open source projects.
Example 1
| Project: WorldEdit-master File: BrushCommands.java View source code |
@Command(aliases = { "cylinder", "cyl", "c" }, usage = "<block> [radius] [height]", flags = "h", desc = "Choose the cylinder brush", help = "Chooses the cylinder brush.\n" + "The -h flag creates hollow cylinders instead.", min = 1, max = 3)
@CommandPermissions("worldedit.brush.cylinder")
public void cylinderBrush(Player player, LocalSession session, EditSession editSession, Pattern fill, @Optional("2") double radius, @Optional("1") int height, @Switch('h') boolean hollow) throws WorldEditException {
worldEdit.checkMaxBrushRadius(radius);
worldEdit.checkMaxBrushRadius(height);
BrushTool tool = session.getBrushTool(player.getItemInHand());
tool.setFill(fill);
tool.setSize(radius);
if (hollow) {
tool.setBrush(new HollowCylinderBrush(height), "worldedit.brush.cylinder");
} else {
tool.setBrush(new CylinderBrush(height), "worldedit.brush.cylinder");
}
player.print(String.format("Cylinder brush shape equipped (%.0f by %d).", radius, height));
}