use of com.sk89q.worldedit.command.tool.brush.SphereBrush in project FastAsyncWorldEdit by IntellectualSites.
the class BrushCommands method sphereBrush.
@Command(name = "sphere", aliases = { "s" }, desc = "Choose the sphere brush")
@CommandPermissions("worldedit.brush.sphere")
public void sphereBrush(Player player, InjectedValueAccess context, @Arg(desc = "The pattern of blocks to set") Pattern pattern, @Arg(desc = "The radius of the sphere", def = "2") Expression radius, @Switch(name = 'h', desc = "Create hollow spheres instead") boolean hollow, @Switch(name = 'f', desc = "Create falling spheres instead") boolean falling) throws WorldEditException {
worldEdit.checkMaxBrushRadius(radius);
Brush brush;
if (hollow) {
brush = new HollowSphereBrush();
} else {
// FAWE start - Suggest different brush material if sand or gravel is used
if (pattern instanceof BlockStateHolder) {
BlockType type = ((BlockStateHolder) pattern).getBlockType();
switch(type.getId()) {
case "minecraft:sand":
case "minecraft:gravel":
player.print(Caption.of("fawe.worldedit.brush.brush.try.other"));
falling = true;
break;
default:
break;
}
}
if (falling) {
brush = new FallingSphere();
} else {
brush = new SphereBrush();
}
}
// FAWE end
set(context, brush, "worldedit.brush.sphere").setSize(radius).setFill(pattern);
}
use of com.sk89q.worldedit.command.tool.brush.SphereBrush in project FastAsyncWorldEdit by IntellectualSites.
the class BrushCommands method extinguishBrush.
@Command(name = "extinguish", aliases = { "ex" }, desc = "Shortcut fire extinguisher brush")
@CommandPermissions("worldedit.brush.ex")
public void extinguishBrush(InjectedValueAccess context, EditSession editSession, @Arg(desc = "The radius to extinguish", def = "5") Expression radius) throws WorldEditException {
worldEdit.checkMaxBrushRadius(radius);
set(context, new SphereBrush(), "worldedit.brush.ex").setSize(radius).setFill(BlockTypes.AIR.getDefaultState()).setMask(new SingleBlockTypeMask(editSession, BlockTypes.FIRE));
}
Aggregations