2 Packet sending
Jesse Boyd edited this page 2017-03-27 11:02:11 +11:00

FAWE can send block changes either by refreshing the chunk, or sending individual block changes. Brush visualization is an example of the latter, in which block changes are sent to only one player (Note: Blocks don't have to be changed on the server).

There's the VisualExtent which is optimized to only send 1 block (glass), and reset the changes after.

VisualExtent extent = new VisualExtent(editSession.getExtent(), editSession.getQueue());
// set some blocks
extent.visualize(player);
// Some time later, reset all blocks
// If you pass another visual extent, it won't reset blocks present in that.
extent.clear(VisualExtent or null);

To send specific blocks to a bunch of players use the FaweQueue. You can use any FaweChunk class, e.g. CharFaweChunk, VisualChunk etc.

FaweQueue.sendBlockUpdate(FaweChunk, FawePlayer...);