use of net.silentchaos512.gear.api.stats.ChargedProperties in project Silent-Gear by SilentChaos512.
the class MaterialInstance method getEnchantmentModifiedStats.
@Deprecated
private void getEnchantmentModifiedStats(List<StatInstance> mods, StatGearKey key) {
if (key.getStat() == ItemStats.CHARGEABILITY) {
return;
}
// Search for materials that stats
for (Map.Entry<Enchantment, Integer> entry : EnchantmentHelper.getEnchantments(this.item).entrySet()) {
Enchantment enchantment = entry.getKey();
Integer level = entry.getValue();
if (enchantment instanceof IStatModifierEnchantment) {
IStatModifierEnchantment statModifierEnchantment = (IStatModifierEnchantment) enchantment;
ChargedProperties charge = new ChargedProperties(level, getChargeability());
// Replace modifiers with updated ones (if provided)
for (int i = 0; i < mods.size(); i++) {
StatInstance mod = mods.get(i);
StatInstance newMod = statModifierEnchantment.modifyStat(key, mod, charge);
if (newMod != null) {
mods.remove(i);
mods.add(i, newMod);
}
}
}
}
}
Aggregations