Frevent a crash

http://pastebin.com/Y76TGRrd

Happened because the getUnlocalizedName() function was called before the textures were initialized. Now it works.