Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingredient and Fermentation Quality Color Does Not Update In Barrel #603

Open
AlgebraManiacABC opened this issue Dec 20, 2023 · 0 comments · May be fixed by #604
Open

Ingredient and Fermentation Quality Color Does Not Update In Barrel #603

AlgebraManiacABC opened this issue Dec 20, 2023 · 0 comments · May be fixed by #604

Comments

@AlgebraManiacABC
Copy link

AlgebraManiacABC commented Dec 20, 2023

I have been running some experiments to find the highest quality of a particular brew on a server I play on. I started to notice that the ingredient and/or the fermentation color would change if I took a brew out of the barrel and put it back in. I was highly confused at this at first, but then I realized it was because aging a drink does not update these values. I have double checked the source code and I believe that the age() method does not update the ingredient nor fermentation lore on a Brew.

Normally, this would make sense, as you cannot change the ingredients nor the cook time in a barrel. However, if the highest quality recipe changes due to aging, then the new recipe's ingredients/fermentation will not be updated to reflect the new recipe.
I have tried this with a drink whose recipe I know (3 wheat, 1 sugar), which only becomes the topmost recipe after some aging. Before this point, it is the recipe of a brew that only takes 3 wheat, and its ingredient lore was yellow. Upon aging into the new brew, the ingredient quality was still yellow. I picked it up and set it back into the barrel, and after a minute (when the lore was updated via convertLore) it showed green ingredient lore.
I have also observed this phenomenon with fermentation quality, which I notice is also absent from age().

To fix this, I propose the following change:

Line 723 of Brew.java:

		// Lore
		if (currentRecipe != null && BConfig.colorInBarrels != BrewLore.hasColorLore(potionMeta)) {
			lore.convertLore(BConfig.colorInBarrels);
		} else {
			if (ageTime >= 1) {
				lore.updateAgeLore(BConfig.colorInBarrels);
			}
			if (ageTime > 0.5) {
				if (BConfig.colorInBarrels) {
					lore.updateWoodLore(true);
+					lore.updateIngredientLore(true);
+					lore.updateCookLore(true);
				}
				lore.updateQualityStars(BConfig.colorInBarrels);
				lore.updateCustomLore();
				lore.updateAlc(false);
			}
		}
		lore.write();

There should just be updates to ingredient and cook lore in the shown if.
Or, at least, if you detect the "best" recipe has changed. It wouldn't hurt to update every time anyway though.

AlgebraManiacABC added a commit to AlgebraManiacABC/Brewery-plugin that referenced this issue Dec 20, 2023
Updates Ingredient and Fermentation Lore while aging.
@AlgebraManiacABC AlgebraManiacABC linked a pull request Dec 20, 2023 that will close this issue
Vinellon added a commit to Vinellon/Brewery that referenced this issue Dec 27, 2023
Jsinco added a commit to Jsinco/BreweryX that referenced this issue Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant