Colored Light For Minecraft!
Mod Developers. Thank you!
What is this?
Colored light has been well sought after, highly debated, and a seemingly complex addition to Minecraft.
Lot's of people have claimed it's impossible, hard to do, or won't run well.
I hereby provide a counter example:


I've been working for quite some time, and there are progress posts littered about the forums.
This post will serve as a center point to refer to. If you want to see my progress, stick around and I'll be sure to keep you up to date on my progress.
What is this trying to accomplish?
I am trying to add three separate channels of colored lighting within blocks, so that they appear to spread around and mix Red, Green, and Blue channels!
- Obviously the mod needs to operate at a high level of efficiency, otherwise it won't run well. We're paying close attention to our state of efficiency, and love hearing feedback on your experience here!
- All blocks that produce light will still behave the same! Torches will still have a light value of 14, but they may be colored differently. Same with redstone torches. Same lightvalue, but their color may look a little different after you install this mod!
- Worlds that use colored light will remain backwards compatible with vanilla Minecraft. (except for the missing Block ID's from the now absent colored lights) We aren't trying to ruin your save, or anything like that. (Please make backups though. If you accidentally lose your save because of a mistake we made, we can't do much to fix it, so make backups just to be sure)
Now, I must immediately say that while this mod relies on base Minecraft edits, We've been writing this in the Forge Environment. Forge has allowed us to test the lighting methods, while also giving us easier access to the Decompiled Minecraft source. The mod will likely stay as a Forge Mod for the rest of it's existence
After having several conversations, this will most likely stand as a separate, stand-alone API, much like the CodeChickenCore. I might be able to get some help with a couple of method hooks in Forge, but they aren't necessary. The API can be used relatively easily.
How does this work?
With this simple change came a great number of problems with things that weren't expecting extra bits of information in the lightvalue, so we went through, and edited all of the methods that weren't happy. This coremod is a collection of edits to two primary systems:
The Vanilla Lighting Engine - To now support color, and the spreading of color
The Rendering Engine - To render the color on top of your favorite blocks!
Why choose RGB over Y'CbCr?
RGB tinting is already implemented. I simply used what Minecraft was expecting. While it uses more RAM and packet chatter, it was the easiest way to start thinking about the whole project. I am not opposed to moving to a more compact data system that uses the already existing vanilla brightness, but It's not a high priority on the list at the moment.
edit: When it's all said and done, OpenGL speaks RGB. I think I'm going to keep it, over Y'CbCr, simply because it works already ^.^
If you happen to know how to rewrite computeLightByType and updateLightByType using Y'CbCr while keeping all of the functionality, go right ahead! I'm very open to this idea, and a pull request accomplishing this task would be a welcome addition. All credit will be given where it's due.
What about performance?
Well, we know that performance is of top concern, however you can't go about a project like this without impeding some performance somewhere. Currently, the two large areas that were modified have become slightly more complex.The Lighting Engine takes a bit longer to spread light values around - I've written a brand new one from scratch to stay as efficient as possible!
The Rendering Engine now implements a custom Vertex and Fragment Shader to place color over other vertexes. This was an easy way for us to write it "one time" and have it apply to a lot of places all at once. This is a cause for some mod conflicts, as the shader core and other "shader themed" mods may conflict directly, and there are also rendering mishaps when you load this mod with other custom blocks, such as the chisel mod.
That's right... OpenGL 2.1 is used heavily. This means that while we share the same OpenGL requirement that Minecraft has... we may stop on a graphics adaptor here or there (looking at YOU intel) because we simply use a couple more things in the OpenGL 2.1 toolkit that Minecraft doesn't use itself.
Overall, if you have some sort of GPU, then the core won't be a huge hit to performance, but if it is, try running fast lighting and see if it improves. Feel free to post in the forums about your change in performance. I'm interested in what you have to say!
If you have a lot of trouble, I'm trying to make sure that I stay compatible with Optifine and Fastcraft, (and I honestly recommend that you run those mods anyway). You'll be able to reclaim some of the frams you lose here, while maintaining the rainbow!
So why isn't it out of Beta yet?
There is a ton of work to do. I have several bugs that I have to hunt still, and a lot more functionality I'd like to add! Again, it's still a work in progress. Feel free to hang around, and discuss what you see. What you like and what you don't like, and I'll be sure to hang around myself and answer what I can!
Current TODO list:
- There are still a couple Lighting Engine bugs lying around - I know of a few, and if you can repeat a couple steps that break how lights show up in your world, I want to hear about it!
- A significant amount of mod and rendering conflicts - A couple of which break the GLstate... so I need to clean up my end before a formal release.
- Rave Lights - nuff said
Special Thanks:
- TheMogMiner implemented his own Colored Lights before, then was hired by Mojang! Having gotten lost in some implementation, he stepped in and was incredibly helpful! Thank you for helping out the project when I was stuck!
- Heaton84... for pretty much anything that just happened with the 1.7.2 update! Thank you for your time and effort put into getting this project along with the new systems!
- Murray, for basically everything in 1.7.10 on the rendering side of things. He showed up with a couple of pull requests, and then made a whole bundle of nice additions with his work in the Shader! Give him a huge thanks for his work on the new system.
- Nocte's shown some interest and has supplied incredibly helpful knowledge about Minecraft's internal workings.
- Kovu's been around and has helped out with a bit of testing, and his knowledge of Git was quite nice to have on hand. A major contributor for the ASM packaging. Thank him for the easy installation of the core mod!
- StraightDigger and I've been pming each other quite a bit, and we discuss where the mod's going, and how it might behave. Expect to see excerpts from our conversations show up as answers to any questions you might have!
- Xeronut has been on the up and up testing out everything, and maintaining this incredibly impressive list of compatible mods. Thank you so much for your time and effort! A list like that is incredibly helpful!
- A quick shout out to Galatic Muffin and the Colored Glass/Light Forum thread. If you haven't seen that, make sure to check it out!
- Avarisc and Glitchfinder have been working together on the smooth lighting side of things. While their work has come and gone, they did a ton of amazing work, and deserve a lot of credit for it here!
Latest ColoredLightsCore for Minecraft Forge 1.7.10 - Does not run with Forge 1339 or later.
Moved to Curse! - https://minecraft.curseforge.com/projects/colored-light-core
Warning: Make Backups before you go running this please.
List of Mod Compatibility:
https://docs.google.com/spreadsheets/d/1mfAradGBs1U2LOVHIW6_2FNKnc4pKB00qr9VAYtrKZc/pubhtml
Recent Notes:
- Optifine should work
- ShaderCore is not happy at all.... and I don't know where to begin. Hopefully, someone can help me out here.
- Atomicstryker's DynamicLights are almost compatible, but they cause update bugs (which I need to fix) and the lights aren't colorful due to his implementation. Hopefully I can do something about this.
- On that note: The lighting engine will cause a hiccup or two once in a while... If you see something weird, just break a block, or place a light to cause another light update. If you found something that's repeatable, and you don't like it, report it as a bug!
- Colored Glowstone spawns in the nether now!
- Rave lights don't randomly change colors... nor do they light up at all... I intend to do something fancy here... but I need to sit down and learn a bit more about OpenGL before I can do anything like that
- "Black Lights" were fixed recently! Let me know if you find anymore!
Expect bugs, and poor performance. And have fun!
Old Versions:
1.2.2 - http://www.mediafire.com/download/x78xmp5912tg8er/ColoredLightsCore-1.2.2.jar
1.2.1 - http://www.mediafire.com/download/r3k45h8a845yt13/ColoredLightsCore-1.2.1.jar
1.7.10.01 - http://www.mediafire.com/download/j5thct8w1h2ctsm/ColoredLightsCore-1.7.10.01.jar
1.7.2.2 - http://www.mediafire.com/download/wgp9hcygwd13vpq/ColoredLightsCore[1.7.2.2].jar
1.7.2.1 - http://tinyurl.com/n6wq9vj
1.6.4.4 - http://tinyurl.com/k5eekds
*Reporting bugs old versions will most likely incur a brief response saying that this is fixed. No I will not port features down to old versions. Please enjoy the mod for what it's worth, but refrain from posting bugs from incomplete work.
Thank you
Where's the Source?
If you want to see the code, or are interested in working or offering advice, go ahead and PM me. We have the code set up as a Git Repository, and it can be applied to an FML/MCP workspace.
https://github.com/C...tsModdingLight/
Media
Forum Signatures:

Red:

Green:

Blue:

Cyan:

Yellow:

Magenta:

Head to My Settings->Signature, then click "Toggle Editing Mode"

Paste the code you want in there, and enjoy!
Texture Packs:
Here's one that has high resolution 128x128 stone-looking textures for all of the blocks

https://www.dropbox.com/s/p5lyvo5mqc5k2z5/Easycolouredlights.zip
Credit: Schlingman
And this one does a great job by adding 15 high resolution Lamp Textures that look a bit like SPHAX would!

http://www.mediafire.com/download/13eebdstnq1zd74/Sphax_ColoredLightsCore-1.7.10.01.rar
Credit: Ruyan
Found a bug? Want to Chat?
Post here in the forums if you have a crash report, and I can read through it when I can. Feel free to ask any sort of question, and we also registered an IRC channel on espernet! So feel free to hop in #ColoredLightCore if you get a chance, or need some more help.
If you wish to report a bug with the mod, please be sure to include...
- The version of the ColoredLightCore (CLC) you are using
- The version of Forge you are using
- The crash report (preferrably via Pastebin) generated by the error
- Depending on the error, an image of the problem
Also, DO NOT INCLUDE 100 MODS IN YOUR CRASH REPORT! If you have a mod conflict, please find the offending mods before submitting a bug report. I'd like to hear about the crash, and we can look at the issues on a close basis... But I'm tired of reading through mile long logs filled with clutter.
PSA:
I don't think I'm going to work on this mod very much anymore.
I will continue maintaining the git-repo, and I'll make sure the build server stays up... If anyone submits a PR, or wants to develop/make changes to the mod in a significant way, the door is wide open. I'll review code to the best of my ability, and make sure things stay the same, but I simply don't have any motivation to spend hours of my life learning Java + ASM.
Since many of you may not know what that is... I'll try to give you guys a 2 second low-down:
Minecraft by itself doesn't have colored lights... or any ability to color lights in its unmodded state. So my job is to stop Minecraft from loading, grab the classes that handle light calculations, light data, world saves, etc, and modify them. This modification is usually hacky to some extent, and requires a deep understanding of how Minecraft's rendering pipeline works, as well as interactions between modified classes, and the Java Virtual Machine (JVM). There are some libraries that can help modders make changes like I was doing: (ASM) And I was able to use Forge to create a Core-Mod that would alter Minecraft as it was loaded into RAM.
If everything works, you get to see colors, and your worlds are STILL backwards compatible.
The issues that I kept on running into are twofold.
1.) I don't know ASM that well... and how I need to use it to satisfy the JVM... It's a LOT of guess + check. Doing simple things like adding variables could take me hours if I didn't know what was going wrong. Here are the 17 lines of code that set the default sunlight color variable in the world class. It's not simple stuff... and writing that kind of code isn't fun for me either. I'm sure there are better ways of doing it... and I simply don't want to find out anymore.
2.) I don't know NEARLY enough about OpenGL. At first, I wasn't using much of OpenGL to add color to the world, but it became increasingly clear that I'd need delve into OpenGL and shaders to get everything to work. I don't have a clear understanding still... Murray and a couple others were able to start the implementation, and we got most of it working. So while I can see what's going on in the current setup, I don't know how to rewrite a "better shader" or fix the issues that currently exist in the pipeline. (This is what causes so many issues with Optifine and the ShaderCore)
So... what does that mean?
I'll make sure things compile. And I'll make sure to help anyone who wants to show up, and start turning wrenches and writing code. But... my interests have moved on. When Minecraft moves to C++ (the Windows 10 release thing), I might look at it again, but I don't need more Java right now... especially ASM + Java... It's not a very useful skill for what I do (embedded systems developer/engineer) and I'm sad I have to break it to you all. It hasn't been all bad, and I've had moments that were a TON of fun!
I hope we can still be friends,
-CptSpaceToaster-
Licensing
The Colored Light Core shall hence forth be classified under the WTFPL.
1
Oh, no, i was just asking. I think the idea has merit.
1
What do you mean "today's rap"? If you think all rap is like that you're either not taking the initiative to find music you like, instead opting to mindlessly hate on not only an entire genre but an entire era of music, or you're delusional. I also like how you change from "every rap song ever" being the same, but then do a 180 and say 'uh no i only meant "today's rap"'.
1
First of all, I've heard this reasoning tons of time and it's unbelievable how wrong it is. People don't think Minecraft is an "80's game", they think it has bad graphics, sure, but it isn't synonymous. And it does have bad graphics, in a way: Minecraft is incredibly resource intensive for something that isn't particularly good looking. Obviously it's because of the size and scope of the game world, but people who are just trying it out won't know that (unless they did background research). Plus, the amount of garbage videos that clog up Youtube would have definitely turned me off it it was my only exposure to the game.
As for the OP: I personally think the stereotyping is warranted, as the fanbase skews young. This is inevitable, because the more popular a game is the younger the fanbase will be. Why do you think CoD gets such a bad rap?
1
1
No way man Minecraft is now down permanently have a good life gg
1
It's called the report button.
1
To attack a mob with the shears, you have to charge it up, like a bow. However, there is still only a 50/50 chance that it will work, but if it does, they will die instantly. Any mob killed will drop one, and only one, of every drop, including the head. For balance reasons, this instantly destroys the shears, and they must be at full health to use. If it is not at full health, it won't work. It hurts the drop rate for most drops, so they aren't perfect for every situation. They CANNOT be used on the Enderdragon, for obvious reasons, nor on Wither Skeletons. Using it on the Wither has a unique effect, which I'll describe below.
When used on the Wither, it will shatter, and will cut off one of the side heads. This will slightly gimp it's shooting, making fighting it easier. If you have another pair of shears, you can clip the other head, but the middle one is un-shearable.
As a side note, this is useful in creative for clearing out a group of mobs in a build/map, if switching to peaceful is not an option (Your map/build requires a zombie to work, for example.).
1
We should probably try to spread this thread, seeing as it has a most complete image of how this would work. A good reason enough to keep it around for a little while longer.
1
You did mention slime blocks and flying machines. Archimedes ships CAN FLY if you give them balloons. Did you check the mod page or did you just make an assumption?
As for the lack of realistic mechanics: Who cares? We don't have any sort of rowing for tiny boats, and yes, you need to propel it in SOME way, this isn't just for bigger boats. Wind mechanics have never applied for those boats either, I don't know why you expect these too.
1
I'm also bad at GUI design, so if anyone feels up to it, I would appreciate concept art.