Make materials work

Now the defined the material of custom blocks will actually be used.