desht/dhutils — pull request #8 by rmichela (2014-06-03 06:33:01+00:00)
Title: Implemented faster bulk block updating for 1.7.x series servers

In this PR I implemented an improved algorithm for bulk updating and relighting blocks for 1.7.x series servers. As part of Mojang's massive 1.7 rewrite, adding a block to the world ended up automatically relighting that block. This works individually when placed by a player, but falls apart when hundreds of thousands of blocks are being changed at the same time. To make bulk block updating work, I did the following:
* Lifted the NMS code responsible out of the core Minecraft code into each NMSHandler.
* Split the NMS code into block update and block relight code.
* Applied additional optimizations to the block relight code that only make sense in the context of bulk operations
* A block cannot affect the relighting calculations if it is completely surrounded by opaque blocks.
* Created a new RelightStrategy called HYBRID
* With RelightStrategy.HYBRID, block changes are sent to the client immediately, but relight calculations are sent when they are ready.