use of com.fastasyncworldedit.core.extent.clipboard.ReadOnlyClipboard in project FastAsyncWorldEdit by IntellectualSites.
the class ClipboardCommands method lazyCopy.
// FAWE start
@Command(name = "/lazycopy", desc = "Lazily copy the selection to the clipboard")
@CommandPermissions("worldedit.clipboard.lazycopy")
public void lazyCopy(Actor actor, LocalSession session, EditSession editSession, @Selection Region region, @Switch(name = 'e', desc = "Skip copy entities") boolean skipEntities, @Switch(name = 'b', desc = "Also copy biomes") boolean copyBiomes) throws WorldEditException {
BlockVector3 min = region.getMinimumPoint();
BlockVector3 max = region.getMaximumPoint();
long volume = (((long) max.getX() - (long) min.getX() + 1) * ((long) max.getY() - (long) min.getY() + 1) * ((long) max.getZ() - (long) min.getZ() + 1));
FaweLimit limit = actor.getLimit();
if (volume >= limit.MAX_CHECKS) {
throw FaweCache.MAX_CHECKS;
}
session.setClipboard(null);
ReadOnlyClipboard lazyClipboard = ReadOnlyClipboard.of(region, !skipEntities, copyBiomes);
lazyClipboard.setOrigin(session.getPlacementPosition(actor));
session.setClipboard(new ClipboardHolder(lazyClipboard));
actor.print(Caption.of("fawe.worldedit.copy.command.copy", region.getVolume()));
}
Aggregations