More Information can be found at: https://www.spigotmc.org/threads/methods-for-changing-massive-amount-of-blocks-up-to-14m-blocks-s.395868/
Just put the BlockChanger class in your project
BlockChanger.load(this, false);
World world = ...;
Location location = ...;
List<BlockChanger.BlockSnapshot> blocks = new ArrayList<>();
blocks.add(new BlockChanger.BlockSnapshot(location, Material.GOLD_BLOCK);
BlockChanger.setBlocks(world, blocks);
BlockChanger. // see all available methods
Location pos1 = ...;
Location pos2 = ...;
BlockChanger.Snapshot snapshot = BlockChanger.capture(pos1, pos2);
BlockChanger.revert(snapshot);
BlockChanger.Snapshot snapshot = ...;
// Pasting the snapshot with an offset of X: 100 and Z: 0
BlockChanger.duplicate(snapshot, 100, 0);