use of com.sk89q.worldedit.command.util.Logging in project FastAsyncWorldEdit by IntellectualSites.
the class RegionCommands method hollow.
@Command(name = "/hollow", desc = "Hollows out the object contained in this selection", descFooter = "Hollows out the object contained in this selection.\n" + "Optionally fills the hollowed out part with the given block.\n" + "Thickness is measured in manhattan distance.")
@CommandPermissions("worldedit.region.hollow")
@Logging(REGION)
@Preload(Preload.PreloadCheck.PRELOAD)
@Confirm(Confirm.Processor.REGION)
public int hollow(Actor actor, EditSession editSession, @Selection Region region, @Arg(desc = "Thickness of the shell to leave", def = "0") int thickness, @Arg(desc = "The pattern of blocks to replace the hollowed area with", def = "air") Pattern pattern, @ArgFlag(name = 'm', desc = "Mask to hollow with") Mask mask) throws WorldEditException {
checkCommandArgument(thickness >= 0, "Thickness must be >= 0");
// FAWE start > the mask will have been initialised with a WorldWrapper extent (very bad/slow)
Mask finalMask;
if (mask != null) {
new MaskTraverser(mask).setNewExtent(editSession);
finalMask = mask;
} else {
finalMask = new SolidBlockMask(editSession);
}
// FAWE end
int affected = editSession.hollowOutRegion(region, thickness, pattern, finalMask);
actor.print(Caption.of("worldedit.hollow.changed", TextComponent.of(affected)));
return affected;
}
use of com.sk89q.worldedit.command.util.Logging in project FastAsyncWorldEdit by IntellectualSites.
the class ExpandCommands method expand.
@org.enginehub.piston.annotation.Command(name = "/expand", desc = "Expand the selection area")
@Logging(REGION)
public void expand(Actor actor, World world, LocalSession session, @Arg(desc = "Amount to expand the selection by, can be `vert` to expand to the whole vertical column") int amount, @Arg(desc = "Amount to expand the selection by in the other direction", def = "0") int reverseAmount, @Arg(desc = "Direction to expand", def = Direction.AIM) @MultiDirection List<BlockVector3> direction) throws WorldEditException {
Region region = session.getSelection(world);
long oldSize = region.getVolume();
if (reverseAmount == 0) {
for (BlockVector3 dir : direction) {
region.expand(dir.multiply(amount));
}
} else {
for (BlockVector3 dir : direction) {
region.expand(dir.multiply(amount), dir.multiply(-reverseAmount));
}
}
session.getRegionSelector(world).learnChanges();
long newSize = region.getVolume();
session.getRegionSelector(world).explainRegionAdjust(actor, session);
long changeSize = newSize - oldSize;
actor.print(Caption.of("worldedit.expand.expanded", TextComponent.of(changeSize)));
}
Aggregations