Skip to content

Commit

Permalink
lore suffix only with recipe
Browse files Browse the repository at this point in the history
  • Loading branch information
Sn0wStorm committed Oct 30, 2023
1 parent 1665047 commit 9ccacd5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>1.17</source>
<target>1.17</target>
<source>17</source>
<target>17</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
Expand Down
14 changes: 9 additions & 5 deletions src/com/dre/brewery/lore/BrewLore.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ public void updateCookLore(boolean qualityColor) {
public void updateDistillLore(boolean qualityColor) {
if (brew.getDistillRuns() <= 0) return;
String prefix;
String suffix = "";
byte distillRuns = brew.getDistillRuns();
int quality = brew.getIngredients().getDistillQuality(brew.getCurrentRecipe(), distillRuns);
if (qualityColor && !brew.isUnlabeled() && brew.hasRecipe()) {
int quality = brew.getIngredients().getDistillQuality(brew.getCurrentRecipe(), distillRuns);
prefix = getQualityColor(quality);
suffix = " " + getQualityIcon(quality);
} else {
prefix = "§7";
}
Expand All @@ -161,9 +163,9 @@ public void updateDistillLore(boolean qualityColor) {
}
}
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 {
addOrReplaceLore(Type.DISTILL, prefix, P.p.languageReader.get("Brew_Distilled"), " " + getQualityIcon(quality));
addOrReplaceLore(Type.DISTILL, prefix, P.p.languageReader.get("Brew_Distilled"), suffix);
}
}

Expand All @@ -175,10 +177,12 @@ public void updateDistillLore(boolean qualityColor) {
public void updateAgeLore(boolean qualityColor) {
if (brew.isStripped()) return;
String prefix;
String suffix = "";
float age = brew.getAgeTime();
int quality = brew.getIngredients().getAgeQuality(brew.getCurrentRecipe(), age);
if (qualityColor && !brew.isUnlabeled() && brew.hasRecipe()) {
int quality = brew.getIngredients().getAgeQuality(brew.getCurrentRecipe(), age);
prefix = getQualityColor(quality);
suffix = " " + getQualityIcon(quality);
} else {
prefix = "§7";
}
Expand All @@ -191,7 +195,7 @@ public void updateAgeLore(boolean qualityColor) {
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);
}

/**
Expand Down

0 comments on commit 9ccacd5

Please sign in to comment.