public void setValue(Object value) {
        if (isTypeCheckEnabled()) {
            if (value != null && this.type != null && this.type.getJavaType().length != 0) {
                boolean valid = false;
                for (Class<?> jtype : this.type.getJavaType()) {
                    if (jtype.isAssignableFrom(value.getClass())) {
                        valid = true;
                        break;
                    }
                }
                if (!valid) {
                    throw new RuntimeException("Trying to assign a value of type " + value.getClass() 
                            + " to " + this.getName() 
                            + " of type " + type.name() 
                            + ". Valid types are " + Arrays.deepToString(type.getJavaType()));
                }
            }
        }
        this.value = value;
    }
Sets the value of this material parameter.
<p>
It is assumed the value is of the same {@link MatParam#getVarType() type}
as this material parameter.

@param value the value of this material parameter.
jme3-core/src/main/java/com/jme3/material/MatParam.java