mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-02-06 18:17:00 +01:00
Fix gacha avatars (fixes #1870)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package emu.grasscutter.data.excels;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.IntStream;
|
||||
|
||||
import emu.grasscutter.data.GameData;
|
||||
@@ -36,6 +37,7 @@ public class AvatarSkillDepotData extends GameResource {
|
||||
@Getter private AvatarSkillData energySkillData;
|
||||
@Getter private ElementType elementType;
|
||||
@Getter private IntList abilities;
|
||||
@Getter private int talentCostItemId;
|
||||
|
||||
@Override
|
||||
public int getId() {
|
||||
@@ -66,6 +68,13 @@ public class AvatarSkillDepotData extends GameResource {
|
||||
this.setAbilities(new AbilityEmbryoEntry(getSkillDepotAbilityGroup(), config.abilities.stream().map(Object::toString).toArray(String[]::new)));
|
||||
}
|
||||
}
|
||||
|
||||
// Get constellation item from GameData
|
||||
Optional.ofNullable(this.talents)
|
||||
.map(talents -> talents.get(0))
|
||||
.map(i -> GameData.getAvatarTalentDataMap().get((int) i))
|
||||
.map(talentData -> talentData.getMainCostItemId())
|
||||
.ifPresent(itemId -> this.talentCostItemId = itemId);
|
||||
}
|
||||
|
||||
public static class InherentProudSkillOpens {
|
||||
|
||||
@@ -2,6 +2,7 @@ package emu.grasscutter.data.excels;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import emu.grasscutter.data.GameResource;
|
||||
@@ -133,6 +134,7 @@ public class ItemData extends GameResource {
|
||||
this.itemUseActions = this.itemUse.stream()
|
||||
.filter(x -> x.getUseOp() != ItemUseOp.ITEM_USE_NONE)
|
||||
.map(ItemUseAction::fromItemUseData)
|
||||
.filter(Objects::nonNull)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user