use of org.spongepowered.api.data.property.item.DamageAbsorptionProperty in project SpongeCommon by SpongePowered.
the class DamageAbsorptionPropertyStore method getFor.
@Override
protected Optional<DamageAbsorptionProperty> getFor(ItemStack itemStack) {
if (itemStack.getItem() instanceof ItemArmor) {
final ItemArmor armor = (ItemArmor) itemStack.getItem();
final int reduction = armor.damageReduceAmount;
return Optional.of(new DamageAbsorptionProperty(reduction));
}
return Optional.empty();
}
Aggregations