mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-12 21:34:35 +01:00
Make maxCustomRelicLevel also limit the max sub stat count
This commit is contained in:
@@ -197,7 +197,10 @@ public class CommandArgs {
|
||||
} else if (item.getExcel().isRelic()) {
|
||||
// Sub stats
|
||||
if (this.getMap() != null) {
|
||||
// Reset substats first
|
||||
item.resetSubAffixes();
|
||||
|
||||
int maxCount = (int) Math.floor(LunarCore.getConfig().getServerOptions().maxCustomRelicLevel / 3) + 1;
|
||||
hasChanged = true;
|
||||
|
||||
for (var entry : this.getMap().int2IntEntrySet()) {
|
||||
@@ -206,7 +209,9 @@ public class CommandArgs {
|
||||
var subAffix = GameData.getRelicSubAffixExcel(item.getExcel().getRelicExcel().getSubAffixGroup(), entry.getIntKey());
|
||||
if (subAffix == null) continue;
|
||||
|
||||
item.getSubAffixes().add(new GameItemSubAffix(subAffix, entry.getIntValue()));
|
||||
// Set count
|
||||
int count = Math.min(entry.getIntValue(), maxCount);
|
||||
item.getSubAffixes().add(new GameItemSubAffix(subAffix, count));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user