mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 06:38:56 +00:00
Handling for renamed or removed Recipes
This commit is contained in:
@@ -41,7 +41,7 @@ Hier werden die Rezepte für die verschiedenen Tränke eingetragen. Es können b
|
||||
|
||||
Die Rezepte bestimmen alle Eigenschaften der entstehenden Tränke. Ob und wie lange sie reifen müssen, ihre Farbe, Effekte die beim Trinken wirken, den Alkoholgehalt, usw. Optionen die weggelassen werden, werden nicht verwendet, oder verwenden die Standardwerte. Wenn z.B. die Anzahl der Destilliervorgänge weggelassen wird, muss der Trank nicht destilliert werden.
|
||||
|
||||
Wichtig: Werdem die Namen der Rezepte verändert werden vorhandene Tränke der geänderten Rezepte nutzlos!
|
||||
Werden im Nachhinein Rezepte umbenannt, so kann es sein, dass vorhandene Tränke den neuen Namen erst nach erneutem Reifen/Brauen erhalten.
|
||||
|
||||
**Wörter**
|
||||
|
||||
|
||||
@@ -47,14 +47,33 @@ public class Brew {
|
||||
|
||||
// loading from file
|
||||
public Brew(int uid, BIngredients ingredients, int quality, int distillRuns, float ageTime, float wood, String recipe, Boolean unlabeled) {
|
||||
potions.put(uid, this);
|
||||
this.ingredients = ingredients;
|
||||
this.quality = quality;
|
||||
this.distillRuns = distillRuns;
|
||||
this.ageTime = ageTime;
|
||||
this.wood = wood;
|
||||
this.currentRecipe = BIngredients.getRecipeByName(recipe);
|
||||
this.unlabeled = unlabeled;
|
||||
potions.put(uid, this);
|
||||
if (recipe != null && !recipe.equals("")) {
|
||||
currentRecipe = BIngredients.getRecipeByName(recipe);
|
||||
if (currentRecipe == null) {
|
||||
if (quality > 0) {
|
||||
if (ageTime > 0.5) {
|
||||
currentRecipe = ingredients.getAgeRecipe(wood, ageTime, distillRuns > 0);
|
||||
} else if (distillRuns > 0) {
|
||||
currentRecipe = ingredients.getdistillRecipe(wood, ageTime);
|
||||
} else {
|
||||
currentRecipe = ingredients.getBestRecipe(wood, ageTime, distillRuns > 0);
|
||||
}
|
||||
if (currentRecipe != null) {
|
||||
this.quality = calcQuality();
|
||||
P.p.log("Brew was made from Recipe: '" + recipe + "' which could not be found. '" + currentRecipe.getName(5) + "' used instead!");
|
||||
} else {
|
||||
P.p.errorLog("Brew was made from Recipe: '" + recipe + "' which could not be found!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// returns a Brew by its UID
|
||||
|
||||
Reference in New Issue
Block a user