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 blockChanger = new BlockChanger(main, false);
Location location = ...;
BlockData blockData = ...;
blockChanger.setBlock(location, blockData);
// Run this after placing all your block(s)
blockChanger.notifyChanges();
Location min = ...;
Location max = ...;
BlockChanger.Snapshot snapshot;
snapshot = blockChanger.capture(min, max);
blockChanger.revert(snapshot);