use of delta.games.lotro.lore.items.stats.SlicesBasedItemStatsProvider in project lotro-tools by dmorcellet.
the class ItemNormalization method findArmourTypeFromFormulas.
private void findArmourTypeFromFormulas(Armour armour) {
String slices = armour.getProperty(ItemPropertyNames.FORMULAS);
if (slices != null) {
SlicesBasedItemStatsProvider provider = SlicesBasedItemStatsProvider.fromPersistedString(slices);
ItemStatSliceData data = provider.getSliceForStat(STAT.ARMOUR);
if (data != null) {
String armourDescription = data.getAdditionalParameter();
ArmourType sliceType = SlicesBasedItemStatsProvider.getArmorType(armourDescription);
if (sliceType != null) {
ArmourType itemType = armour.getArmourType();
if (itemType != sliceType) {
if (itemType != null) {
System.out.println("Updated armour type from: " + itemType + " to " + sliceType + " for " + armour);
}
armour.setArmourType(sliceType);
}
}
}
}
}
Aggregations