+
+ // If the name has not changed from the original name and we started with a system material.
+ if ( name.equals( originalMaterial.getName()) ) {
+ return Material.newUserMaterialWithKey(type, originalMaterial.getKey(), originalMaterial.getName(), density);
+ } else {
+ return Material.newUserMaterial(type, name, density);
+ }