use of com.sk89q.worldedit.command.tool.brush.HollowSphereBrush 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);
}
Aggregations