diff --git a/src/main/java/com/hbm/inventory/RecipesCommon.java b/src/main/java/com/hbm/inventory/RecipesCommon.java index fc219a3bf..740b909b8 100644 --- a/src/main/java/com/hbm/inventory/RecipesCommon.java +++ b/src/main/java/com/hbm/inventory/RecipesCommon.java @@ -202,21 +202,21 @@ public class RecipesCommon { @Override public boolean equals(Object obj) { - if (this == obj) + if(this == obj) return true; - if (obj == null) + if(obj == null) return false; - if (getClass() != obj.getClass()) + if(getClass() != obj.getClass()) return false; ComparableStack other = (ComparableStack) obj; - if (item == null) { - if (other.item != null) + if(item == null) { + if(other.item != null) return false; - } else if (!item.equals(other.item)) + } else if(!item.equals(other.item)) return false; - if (meta != OreDictionary.WILDCARD_VALUE && other.meta != OreDictionary.WILDCARD_VALUE && meta != other.meta) + if(meta != OreDictionary.WILDCARD_VALUE && other.meta != OreDictionary.WILDCARD_VALUE && meta != other.meta) return false; - if (stacksize != other.stacksize) + if(stacksize != other.stacksize) return false; return true; } @@ -330,7 +330,7 @@ public class RecipesCommon { } public static class OreDictStack extends AStack { - + public String name; public OreDictStack(String name) { @@ -410,6 +410,35 @@ public class RecipesCommon { return ores; } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + this.stacksize; + return result; + } + + @Override + public boolean equals(Object obj) { + if(this == obj) + return true; + if(obj == null) + return false; + if(getClass() != obj.getClass()) + return false; + OreDictStack other = (OreDictStack) obj; + if(name == null) { + if(other.name != null) + return false; + } else if(!name.equals(other.name)) { + return false; + } + if(this.stacksize != other.stacksize) + return false; + return true; + } } public static class MetaBlock { diff --git a/src/main/java/com/hbm/inventory/recipes/CyclotronRecipes.java b/src/main/java/com/hbm/inventory/recipes/CyclotronRecipes.java index 61afb281d..d552e73d6 100644 --- a/src/main/java/com/hbm/inventory/recipes/CyclotronRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/CyclotronRecipes.java @@ -119,7 +119,7 @@ public class CyclotronRecipes extends SerializableRecipe { for(Entry, Pair> entry : recipes.entrySet()) { if(entry.getKey().getKey().isApplicable(boxStack) && entry.getKey().getValue().isApplicable(comp)) { - return new Object[] { entry.getValue().getKey(), entry.getValue().getValue() }; + return new Object[] { entry.getValue().getKey().copy(), entry.getValue().getValue() }; } }