From 9ccacd58125f88521c6039a65dac2c98e3d579d2 Mon Sep 17 00:00:00 2001 From: Sn0wStorm Date: Mon, 30 Oct 2023 23:24:35 +0100 Subject: [PATCH] lore suffix only with recipe --- pom.xml | 4 ++-- src/com/dre/brewery/lore/BrewLore.java | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/pom.xml b/pom.xml index e96f1e1e..59efcba7 100644 --- a/pom.xml +++ b/pom.xml @@ -38,8 +38,8 @@ maven-compiler-plugin 3.10.1 - 1.17 - 1.17 + 17 + 17 UTF-8 diff --git a/src/com/dre/brewery/lore/BrewLore.java b/src/com/dre/brewery/lore/BrewLore.java index f13b7067..ce149aa4 100644 --- a/src/com/dre/brewery/lore/BrewLore.java +++ b/src/com/dre/brewery/lore/BrewLore.java @@ -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"; } @@ -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); } } @@ -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"; } @@ -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); } /**