mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
cyclotron recipe fix, hashCode implementation for ODStacks
This commit is contained in:
parent
a5f4726244
commit
f57a6f35a4
@ -202,21 +202,21 @@ public class RecipesCommon {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (this == obj)
|
if(this == obj)
|
||||||
return true;
|
return true;
|
||||||
if (obj == null)
|
if(obj == null)
|
||||||
return false;
|
return false;
|
||||||
if (getClass() != obj.getClass())
|
if(getClass() != obj.getClass())
|
||||||
return false;
|
return false;
|
||||||
ComparableStack other = (ComparableStack) obj;
|
ComparableStack other = (ComparableStack) obj;
|
||||||
if (item == null) {
|
if(item == null) {
|
||||||
if (other.item != null)
|
if(other.item != null)
|
||||||
return false;
|
return false;
|
||||||
} else if (!item.equals(other.item))
|
} else if(!item.equals(other.item))
|
||||||
return false;
|
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;
|
return false;
|
||||||
if (stacksize != other.stacksize)
|
if(stacksize != other.stacksize)
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -410,6 +410,35 @@ public class RecipesCommon {
|
|||||||
|
|
||||||
return ores;
|
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 {
|
public static class MetaBlock {
|
||||||
|
|||||||
@ -119,7 +119,7 @@ public class CyclotronRecipes extends SerializableRecipe {
|
|||||||
for(Entry<Pair<ComparableStack, AStack>, Pair<ItemStack, Integer>> entry : recipes.entrySet()) {
|
for(Entry<Pair<ComparableStack, AStack>, Pair<ItemStack, Integer>> entry : recipes.entrySet()) {
|
||||||
|
|
||||||
if(entry.getKey().getKey().isApplicable(boxStack) && entry.getKey().getValue().isApplicable(comp)) {
|
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() };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user