mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2025-07-02 11:26:42 +00:00
Improved speed greatly by deferring lighting until after all blocks are in place.
This needs CraftBukkit to work.
This commit is contained in:
@ -554,9 +554,14 @@ public class EditSession {
|
||||
return;
|
||||
}
|
||||
|
||||
final Set<BlockVector2D> dirtyChunks = new HashSet<BlockVector2D>();
|
||||
|
||||
for (Map.Entry<BlockVector, BaseBlock> entry : queueAfter) {
|
||||
BlockVector pt = (BlockVector) entry.getKey();
|
||||
rawSetBlock(pt, (BaseBlock) entry.getValue());
|
||||
|
||||
// TODO: use ChunkStore.toChunk(pt) after optimizing it.
|
||||
if (fastMode) dirtyChunks.add(new BlockVector2D(pt.getBlockX() >> 4, pt.getBlockZ() >> 4));
|
||||
}
|
||||
|
||||
// We don't want to place these blocks if other blocks were missing
|
||||
@ -622,10 +627,15 @@ public class EditSession {
|
||||
for (BlockVector pt : walked) {
|
||||
rawSetBlock(pt, blockTypes.get(pt));
|
||||
blocks.remove(pt);
|
||||
|
||||
// TODO: use ChunkStore.toChunk(pt) after optimizing it.
|
||||
if (fastMode) dirtyChunks.add(new BlockVector2D(pt.getBlockX() >> 4, pt.getBlockZ() >> 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!dirtyChunks.isEmpty()) world.fixLighting(dirtyChunks);
|
||||
|
||||
queueAfter.clear();
|
||||
queueLast.clear();
|
||||
}
|
||||
|
Reference in New Issue
Block a user