3 FaweQueue
Jesse Boyd edited this page 2017-02-14 08:25:47 +11:00

Disclaimer

The FaweQueue is the most basic class for modifying the world, and can be fast if used properly. I recommend using Operations/EditSession instead since they simplify a lot of abstract tasks and will usually offer better performance than a naive approach with the FaweQueue. There's also the AsyncWorld if you are more comfortable with the Bukkit API.

The FaweQueue

The FaweQueue is a basic queue for modifying the world from async threads

  • Use it to modify whole chunks or individual blocks efficiently
  • See EditSession or AsyncWorld which will be easier to use but slower
  • If you need more control, the queue can usually be casted to NMSMappedFaweQueue.
// Auto queuing will mean blocks start to place before it is flushed
FaweQueue queue = FaweAPI.createQueue(worldName, autoQueue);
queue.setBlock(0, 0, 0, id, data);
queue.setBiome(0, 0, biome);
// Set entire chunks
FaweChunk<?> chunk = queue.getFaweChunk(5, 5);
chunk.fill(id, data);
chunk.addToQueue();
// Repeat the same for position
chunk = chunk.copy(true);
chunk.setLoc(queue, 5, 6);
chunk.addToQueue();

NMS methods

Further methods are available for supported platforms. You can cast the FaweQueue to an NMSMappedFaweQueue to access these. More info: https://github.com/boy0001/FastAsyncWorldedit/wiki/Light-API