Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pupnewfster authored and dizzyd committed Mar 17, 2019
1 parent 7257e2e commit ae2619c
Showing 1 changed file with 2 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ public static boolean matches(IIngredient input, IIngredient toMatch) {
if (input instanceof IGasStack) {
return GasHelper.matches(toMatch, (IGasStack) input);
} else if (input instanceof IItemStack) {
return ingredientMatchesStack(toMatch, (IItemStack) input);
return toMatch != null && toMatch.matches((IItemStack) input);
} else if (input instanceof ILiquidStack) {
return ingredientMatchesLiquid(toMatch, (ILiquidStack) input);
return toMatch != null && toMatch.matches((ILiquidStack) input);
}
//TODO: Support other types of things like ore dict
return false;
Expand Down Expand Up @@ -167,31 +167,4 @@ public static ItemStack toStack(IItemStack stack) {
public static FluidStack toFluid(ILiquidStack fluid) {
return fluid == null ? null : FluidRegistry.getFluidStack(fluid.getName(), fluid.getAmount());
}

public static boolean ingredientMatchesStack(IIngredient ingredient, IItemStack itemStack) {
return ingredient != null && ingredient.matches(itemStack);
}

public static boolean ingredientMatchesLiquid(IIngredient ingredient, ILiquidStack liquidStack) {
return ingredient != null && ingredient.matches(liquidStack);
/*if(ingredient == null) {
return false;
}
// Do we have a wildcard (<*>) ?
if(ingredient.matches(liquidStack)) {
return true;
}
// Does ingredient reference liquids?
if(ingredient.getLiquids() != null) {
for (ILiquidStack liquid : ingredient.getLiquids()) {
if(InputHelper.toFluid(liquid).isFluidEqual(InputHelper.toFluid(liquidStack))) {
return true;
}
}
}
return false;*/
}
}

0 comments on commit ae2619c

Please sign in to comment.