mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2025-03-23 15:10:52 +01:00
Dont get non-distill Recipe for distilled Brew
This commit is contained in:
parent
b09131c2e0
commit
c7c72e1699
@ -134,7 +134,7 @@ public class BIngredients {
|
||||
ingredientQuality = getIngredientQuality(recipe);
|
||||
cookingQuality = getCookingQuality(recipe, distilled);
|
||||
|
||||
if (ingredientQuality > -1) {
|
||||
if (ingredientQuality > -1 && cookingQuality > -1) {
|
||||
if (recipe.needsToAge()) {
|
||||
// needs riping in barrel
|
||||
ageQuality = getAgeQuality(recipe, time);
|
||||
@ -245,17 +245,17 @@ public class BIngredients {
|
||||
// returns the quality regarding the cooking-time conditioning given Recipe
|
||||
public int getCookingQuality(BRecipe recipe, boolean distilled) {
|
||||
if (!recipe.needsDistilling() == distilled) {
|
||||
return 0;
|
||||
}
|
||||
if (cookedTime <= 1) {
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
int quality = 10 - (int) Math.round(((float) Math.abs(cookedTime - recipe.getCookingTime()) / recipe.allowedTimeDiff(recipe.getCookingTime())) * 10.0);
|
||||
|
||||
if (quality > 0) {
|
||||
if (quality >= 0) {
|
||||
if (cookedTime <= 1) {
|
||||
return 0;
|
||||
}
|
||||
return quality;
|
||||
}
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
// returns pseudo quality of distilling. 0 if doesnt match the need of the recipes distilling
|
||||
|
Loading…
Reference in New Issue
Block a user