Disallow alloy recipes where the result is contained in the inputs
For example, this will prevent a recipe alloying 2 iron + 2 glass into 2 iron, but not 2 iron + 2 glass into 4 iron. Basically to stop those people who add the recipes that just delete glass
@@ -33,9 +33,15 @@ public class AlloyRecipe {
ImmutableList.Builder<FluidStack> builder = ImmutableList.builder();
for(FluidStack liquid : input) {
+ if(liquid == null) {
+ throw new TinkerAPIException("Invalid Alloy recipe: Input cannot be null");
+ }
if(liquid.amount < 1) {
throw new TinkerAPIException("Invalid Alloy recipe: Fluid amount can't be less than 1");
}
+ if(liquid.containsFluid(result)) {
+ throw new TinkerAPIException("Invalid Alloy recipe: Result cannot be contained in inputs");
+ }
builder.add(liquid);
}
