diff options
Diffstat (limited to 'src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java')
-rw-r--r-- | src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java index b5f5fa7989..dae1a663d7 100644 --- a/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java +++ b/src/Java/gtPlusPlus/nei/DecayableRecipeHandler.java @@ -220,7 +220,8 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { @Override public int compareTo(CachedRecipe o) { - if (o instanceof DecayableRecipeNEI) { + boolean b = DecayableRecipeNEI.class.isInstance(o); + if (b) { DecayableRecipeNEI p = (DecayableRecipeNEI) o; if (p.time > this.time) { return 1; @@ -232,5 +233,30 @@ public class DecayableRecipeHandler extends TemplateRecipeHandler { } return 0; } + + @Override + public boolean equals(Object obj) { + if (obj != null) { + if (DecayableRecipeNEI.class.isInstance(obj)) { + DecayableRecipeNEI p = (DecayableRecipeNEI) obj; + if (p != null) { + // Time check first to keep it simple and not unbox the Recipes. + if (p.time == this.time) { + ItemStack aInput = p.input.item; + ItemStack aOutput = p.output.item; + if (GT_Utility.areStacksEqual(aInput, this.input.item, true)) { + if (GT_Utility.areStacksEqual(aOutput, this.output.item, true)) { + return true; + } + } + } + } + + } + } + return false; + } + + } }
\ No newline at end of file |