!Random enchants cannot go lower than min level

This commit is contained in:
Indyuce 2020-04-08 10:59:08 +02:00
parent bc0beb087c
commit 1d2743d5f2

View File

@ -43,7 +43,7 @@ public class RandomEnchantListData implements RandomStatData {
@Override
public StatData randomize(GeneratedItemBuilder builder) {
EnchantListData list = new EnchantListData();
enchants.forEach((enchant, formula) -> list.addEnchant(enchant, (int) formula.calculate(builder.getLevel())));
enchants.forEach((enchant, formula) -> list.addEnchant(enchant, (int) Math.max(formula.calculate(builder.getLevel()), enchant.getStartLevel())));
return list;
}
}