Skip to content

Instantly share code, notes, and snippets.

@boy0001
Created April 18, 2018 12:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boy0001/683a5af929436570b1863095af4b6b81 to your computer and use it in GitHub Desktop.
Save boy0001/683a5af929436570b1863095af4b6b81 to your computer and use it in GitHub Desktop.
Region region = new CuboidRegion(pos1, pos2);
Vector to /* = where you want to paste */;
String worldName;
boolean pasteAir = true;
boolean skipEntities = false;
boolean copyBiomes = false;
EditSession editSession = new EditSessionBuilder(worldName).fastmode(true).build();
WorldData worldData = editSession.getWorldData();
ReadOnlyClipboard lazyClipboard = ReadOnlyClipboard.of(editSession, region, !skipEntities, copyBiomes);
BlockArrayClipboard clipboard = new BlockArrayClipboard(region, lazyClipboard);
ClipboardHolder holder = new ClipboardHolder(clipboard, worldData);
new Schematic(clipboard).paste(editSession, worldData, to, pasteAir, null);
editSession.flushQueue();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment