Merge pull request #518 from narc0tiq/refinery-recipe-query2

API change: query for refinery recipes, now with Collections.unmodifiableSortedSet
This commit is contained in:
SirSengir 2012-12-19 07:57:39 -08:00
commit 378f3d9fd8

View file

@ -9,6 +9,7 @@
package buildcraft.api.recipes; package buildcraft.api.recipes;
import java.util.Collections;
import java.util.SortedSet; import java.util.SortedSet;
import java.util.TreeSet; import java.util.TreeSet;
@ -24,6 +25,10 @@ public class RefineryRecipe implements Comparable<RefineryRecipe> {
} }
} }
public static SortedSet<RefineryRecipe> getRecipes() {
return Collections.unmodifiableSortedSet(recipes);
}
public static RefineryRecipe findRefineryRecipe(LiquidStack liquid1, LiquidStack liquid2) { public static RefineryRecipe findRefineryRecipe(LiquidStack liquid1, LiquidStack liquid2) {
for (RefineryRecipe recipe : recipes) for (RefineryRecipe recipe : recipes)
if (recipe.matches(liquid1, liquid2)) if (recipe.matches(liquid1, liquid2))