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