lore suffix only with recipe

This commit is contained in:
Sn0wStorm 2023-10-30 23:24:35 +01:00
parent 1665047433
commit 9ccacd5812
2 changed files with 11 additions and 7 deletions

View File

@ -38,8 +38,8 @@
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version> <version>3.10.1</version>
<configuration> <configuration>
<source>1.17</source> <source>17</source>
<target>1.17</target> <target>17</target>
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
</configuration> </configuration>
</plugin> </plugin>

View File

@ -148,10 +148,12 @@ public class BrewLore {
public void updateDistillLore(boolean qualityColor) { public void updateDistillLore(boolean qualityColor) {
if (brew.getDistillRuns() <= 0) return; if (brew.getDistillRuns() <= 0) return;
String prefix; String prefix;
String suffix = "";
byte distillRuns = brew.getDistillRuns(); byte distillRuns = brew.getDistillRuns();
int quality = brew.getIngredients().getDistillQuality(brew.getCurrentRecipe(), distillRuns);
if (qualityColor && !brew.isUnlabeled() && brew.hasRecipe()) { if (qualityColor && !brew.isUnlabeled() && brew.hasRecipe()) {
int quality = brew.getIngredients().getDistillQuality(brew.getCurrentRecipe(), distillRuns);
prefix = getQualityColor(quality); prefix = getQualityColor(quality);
suffix = " " + getQualityIcon(quality);
} else { } else {
prefix = "§7"; prefix = "§7";
} }
@ -161,9 +163,9 @@ public class BrewLore {
} }
} }
if (brew.isUnlabeled() && brew.hasRecipe() && distillRuns < brew.getCurrentRecipe().getDistillRuns()) { if (brew.isUnlabeled() && brew.hasRecipe() && distillRuns < brew.getCurrentRecipe().getDistillRuns()) {
addOrReplaceLore(Type.DISTILL, prefix, P.p.languageReader.get("Brew_LessDistilled"), " " + getQualityIcon(quality)); addOrReplaceLore(Type.DISTILL, prefix, P.p.languageReader.get("Brew_LessDistilled"), suffix);
} else { } else {
addOrReplaceLore(Type.DISTILL, prefix, P.p.languageReader.get("Brew_Distilled"), " " + getQualityIcon(quality)); addOrReplaceLore(Type.DISTILL, prefix, P.p.languageReader.get("Brew_Distilled"), suffix);
} }
} }
@ -175,10 +177,12 @@ public class BrewLore {
public void updateAgeLore(boolean qualityColor) { public void updateAgeLore(boolean qualityColor) {
if (brew.isStripped()) return; if (brew.isStripped()) return;
String prefix; String prefix;
String suffix = "";
float age = brew.getAgeTime(); float age = brew.getAgeTime();
int quality = brew.getIngredients().getAgeQuality(brew.getCurrentRecipe(), age);
if (qualityColor && !brew.isUnlabeled() && brew.hasRecipe()) { if (qualityColor && !brew.isUnlabeled() && brew.hasRecipe()) {
int quality = brew.getIngredients().getAgeQuality(brew.getCurrentRecipe(), age);
prefix = getQualityColor(quality); prefix = getQualityColor(quality);
suffix = " " + getQualityIcon(quality);
} else { } else {
prefix = "§7"; prefix = "§7";
} }
@ -191,7 +195,7 @@ public class BrewLore {
prefix = prefix + P.p.languageReader.get("Brew_HundredsOfYears") + " "; prefix = prefix + P.p.languageReader.get("Brew_HundredsOfYears") + " ";
} }
} }
addOrReplaceLore(Type.AGE, prefix, P.p.languageReader.get("Brew_BarrelRiped"), " " + getQualityIcon(quality)); addOrReplaceLore(Type.AGE, prefix, P.p.languageReader.get("Brew_BarrelRiped"), suffix);
} }
/** /**