mirror of
https://github.com/DieReicheErethons/Brewery.git
synced 2025-01-24 21:31:22 +01:00
rework getLoreForQuality() to extract a more generic getStringForQuality()
This commit is contained in:
parent
d3da0dbe14
commit
adaeeed88c
@ -631,7 +631,15 @@ public class BRecipe {
|
||||
|
||||
@Nullable
|
||||
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;
|
||||
if (quality <= 3) {
|
||||
plus = 1;
|
||||
@ -640,8 +648,8 @@ public class BRecipe {
|
||||
} else {
|
||||
plus = 3;
|
||||
}
|
||||
List<String> list = new ArrayList<>(lore.size());
|
||||
for (Tuple<Integer, String> line : lore) {
|
||||
List<String> list = new ArrayList<>(source.size());
|
||||
for (Tuple<Integer, String> line : source) {
|
||||
if (line.first() == 0 || line.first() == plus) {
|
||||
list.add(line.second());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user