Advertisement
CoolLord22

Untitled

Nov 23rd, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. BlockArrayClipboard clipboard = null;
  2. ClipboardFormat format = ClipboardFormats.findByFile(schematicFile);
  3.  
  4. ClipboardReader reader = null;
  5. try {
  6. reader = format.getReader(new FileInputStream(schematicFile));
  7.  
  8. clipboard = (BlockArrayClipboard) reader.read();
  9.  
  10. EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(BukkitAdapter.adapt(w), -1);
  11.  
  12. Operation operation = new ClipboardHolder(clipboard)
  13. .createPaste(editSession)
  14. .to(origin)
  15. .ignoreAirBlocks(copyAir)
  16. .build();
  17.  
  18. Operations.complete(operation);
  19. editSession.flushSession();
  20.  
  21. } catch (FileNotFoundException e) {
  22. e.printStackTrace();
  23. } catch (IOException e) {
  24. e.printStackTrace();
  25. } catch (WorldEditException e) {
  26. e.printStackTrace();
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement