Workaround for ClassCastException: MaterialData cannot be cast to Tree