diff --git a/src/main/java/appeng/client/gui/widgets/GuiImgButton.java b/src/main/java/appeng/client/gui/widgets/GuiImgButton.java index 76640a3f..dc1a3eb4 100644 --- a/src/main/java/appeng/client/gui/widgets/GuiImgButton.java +++ b/src/main/java/appeng/client/gui/widgets/GuiImgButton.java @@ -53,8 +53,12 @@ public class GuiImgButton extends GuiButton implements ITooltip @Override public boolean equals(Object obj) { - EnumPair d = (EnumPair) obj; - return d.setting.equals( setting ) && d.value.equals( value ); + if ( obj == null ) + return false; + if ( getClass() != obj.getClass() ) + return false; + EnumPair other = (EnumPair) obj; + return other.setting.equals( setting ) && other.value.equals( value ); } } diff --git a/src/main/java/appeng/helpers/PatternHelper.java b/src/main/java/appeng/helpers/PatternHelper.java index a477d3ed..b68a5b4f 100644 --- a/src/main/java/appeng/helpers/PatternHelper.java +++ b/src/main/java/appeng/helpers/PatternHelper.java @@ -48,11 +48,13 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable bOres = b.getOres(); for (Integer ore : a.getOres()) { diff --git a/src/main/java/appeng/util/item/SharedSearchObject.java b/src/main/java/appeng/util/item/SharedSearchObject.java index 82caca1a..59b7acff 100644 --- a/src/main/java/appeng/util/item/SharedSearchObject.java +++ b/src/main/java/appeng/util/item/SharedSearchObject.java @@ -23,10 +23,12 @@ public class SharedSearchObject { if ( obj == null ) return false; - SharedSearchObject b = (SharedSearchObject) obj; - if ( def == b.def && hash == b.hash ) + if ( getClass() != obj.getClass() ) + return false; + SharedSearchObject other = (SharedSearchObject) obj; + if ( def == other.def && hash == other.hash ) { - return Platform.NBTEqualityTest( compound, b.compound ); + return Platform.NBTEqualityTest( compound, other.compound ); } return false; }