MinecraftForge/MinecraftForge — pull request #171 by monoxide0184 (2012-09-16 14:18:09+00:00)
Title: Add hooks to modify light levels just before rendering.

Research has provided the following in terms of performance:

* Light values for blocks are cached. No real persistent performance hit.
* Light values for entities are checked every frame, however there are significantly less of these than blocks. Anything that can be run for a block when a chunk loads shouldn't have issues with this limitation.

Clearly, anything that uses this hook will need to be pretty well optimised as it could be prone to lag spikes when chunks load. All lag is limited to the client as this is purely client side (totally limited to rendering code) so it should scale fine in SMP.

There is a (somewhat bad, for now) example client implementation available here: https://github.com/monoxide0184/Lanterns

Relevant code is in `ClientProxy` and `*ZeroTorch`.