It doesn't overwrite any base classes anymore, yea. What it does is use the ASM transformer offered by FML and replaces a single line of code in World.computeBlockLight, which is the point at which Minecraft reads every Blocks Light output (0 by most, 14 by Torches etc).
Instead of reading the Blocks innate value, a call is made to Dynamic Lights to determine whether or not a Dynamic Light source is at those exact coordinates at the moment. If no, the Block value is returned. If yes, it checks the Light power and returns the Dynamic Light value.
Now, that wouldn't cut it, but that's all base modification needed. The other part is keeping track of active Dynamic Light sources (i'm really glad how the new system turned out, see source modules) and in particular their movement, appearance and disappearance.
Each of those actions warrants a call for Minecraft to update the "Block" Light at the current (and if existing, previous) coordinates of the Light Source. Minecraft recalculates all Light starting from that Block, and since the Injected Code from above now returns the Dynamic Light value, propagates the new (or now-gone) light source in all directions by itself.
I've wanted to do this rewrite for months, but always shirked from the challenge and not really understanding how Minecraft works its Light. It's clearer to me now
Compared to the old, really-messy code, which used 2 crude base edits in too high-level places, looped all Light Sources for every single Light computation (whether active or not), had to keep track of hundreds of possible light values (and cache this crap), and had to call THOUSANDS of markBlockDirty methods for every change ... yeah, it's SO MUCH BETTER now.
It has also some very nice side effects like the flicker/chunk bugs gone, Light getting dimmed through water....
That is all better news for this mod than I had ever even hoped for! Thank you for that explanation.
Now it should be a piece of cake adding mobile light support for Cart Mod! At least for the Forge version of Cart Mod. (Once it is updated...)
That brings up another question. Is all of Forge actually needed for this new version of Dynamic Lights or would FML by itself be enough?
Hmm, as it is Cart Mod should co-exist with Forge anyway without any special compiles (no base edits).
So, if someone is using a modern Forge and Dynamic Lights with a theoretical Modern Cart Mod that is compiled against just Risugami's ML (FML is compatible with this), then will glowing objects (like a burning furnace, glowstone block etc) still properly project mobile light ala Dynamic Lights when being moved around on the Cart without any special code being added to Cart Mod?
I would just test this myself except that we haven't been able to get past the MCP errors to update from 1.2.5 to 1.3.2 etc yet.
After loading up the world it instantly crashed with DL installed. I do have mo'creatures installed, so i can confirm that both are working together and not crashing on the creeper now with the last release
Keep em coming, it's amazing what i didn't think to test
- further synchronization to prevent accidents
- fixed small issue preventing it to work in SMP
- side note: In SSP, the Dynamic Lights are probably fully functional (stop Mob Spawning, allow Growth etc)
- fixed another NPE in removeLightSource
It requires Forge because it uses Forge Configuration files. Small issue .. but what the hell, everyone should use Forge anyway.
Minecarts do NOT glow as of now, because nobody has written a module for them to do so
at java.util.concurrent.ConcurrentHashMap.hash(Unknown Source)
at java.util.concurrent.ConcurrentHashMap.get(Unknown Source)
at java.lang.Thread.run(Unknown Source)
It did not crash me, but i saw the error on MultiMC Console. 9:00am in game. While typeing this i just went to a skele i saw in distance and pushed him out of the water and he burnt up, no error in console.
Let me know if ya need more info or to do some tests. i didnt clean out my old configs when updating (my bad).
- fixed crash when changing Keybinding without World loaded
- added chat message to toggling Dynamic Lights on/off
- fixed possible ConcurrentModificationException crashes in Entitylist accessing modules (i hope)
I could and technically on a client world it does, however if i made it a serverside mod it would only be a matter of time before server owners tracked me down and tortured me to death
Minecraft has stopped running because it encountered a problem; Unexpected error
This error has been saved to /Users/Scott/Library/Application Support/minecraft/crash-reports/crash-2012-11-11_11.31.54-client.txt for your convenience. Please include a copy of this file if you report this crash to anyone.
--- BEGIN ERROR REPORT 1859c5cd --------
Generated 11/11/12 11:31 AM
--- END ERROR REPORT 815f8b99 ----------
Okay, as far, this mod is working fantastic. Just for some reason, fire on enemies, dropped torches, break once in a while. Once it gets an error, it stops working forever until you restart your client. D: