diff --git a/engine/src/core/com/jme3/material/Material.java b/engine/src/core/com/jme3/material/Material.java index a018a31bb..8dc5015c6 100644 --- a/engine/src/core/com/jme3/material/Material.java +++ b/engine/src/core/com/jme3/material/Material.java @@ -202,6 +202,14 @@ public class Material implements Asset, Cloneable, Savable, Comparable return m.getSortId() - getSortId(); } + @Override + public boolean equals(Object obj) { + if(obj instanceof Material){ + return ((Material)obj).compareTo(this) == 0; + } + return super.equals(obj); + } + /** * Clones this material. The result is returned. */ @@ -331,10 +339,7 @@ public class Material implements Asset, Cloneable, Savable, Comparable */ public MatParam getParam(String name) { MatParam param = paramValues.get(name); - if (param instanceof MatParam) { - return (MatParam) param; - } - return null; + return param; } /**