mirror of
https://github.com/exituser/Brewery.git
synced 2026-09-17 06:38:56 +00:00
rework getLoreForQuality() to extract a more generic getStringForQuality()
This commit is contained in:
@@ -631,7 +631,15 @@ public class BRecipe {
|
|||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public List<String> getLoreForQuality(int quality) {
|
public List<String> getLoreForQuality(int quality) {
|
||||||
if (lore == null) return null;
|
return getStringForQuality(quality, lore);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a quality filtered list of supported attributes
|
||||||
|
*/
|
||||||
|
@Nullable
|
||||||
|
public List<String> getStringForQuality(int quality, List<Tuple<Integer, String>> source) {
|
||||||
|
if (source == null) return null;
|
||||||
int plus;
|
int plus;
|
||||||
if (quality <= 3) {
|
if (quality <= 3) {
|
||||||
plus = 1;
|
plus = 1;
|
||||||
@@ -640,8 +648,8 @@ public class BRecipe {
|
|||||||
} else {
|
} else {
|
||||||
plus = 3;
|
plus = 3;
|
||||||
}
|
}
|
||||||
List<String> list = new ArrayList<>(lore.size());
|
List<String> list = new ArrayList<>(source.size());
|
||||||
for (Tuple<Integer, String> line : lore) {
|
for (Tuple<Integer, String> line : source) {
|
||||||
if (line.first() == 0 || line.first() == plus) {
|
if (line.first() == 0 || line.first() == plus) {
|
||||||
list.add(line.second());
|
list.add(line.second());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user