Only add mapping if it doesn't already exist.

Also moves MATERIALS constant into super class, and uses it there.
just noticed this. Nothing major, but if you'll squash the commits make the above 2 lines ``if (!mapping.hasKey(name)) {`` otherwise just ignore it. I like hitting format in IDEA and this will be reformatted when I do.