Add toughness to legendary wizard armour

This commit is contained in:
Electroblob
2018-06-04 18:32:32 +01:00
parent b61413f7f1
commit 2cd8b46c1f
@@ -164,14 +164,25 @@ public class ItemWizardArmour extends ItemArmor {
*/ */
@Override @Override
public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack){ public Multimap<String, AttributeModifier> getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack){
Multimap<String, AttributeModifier> map = HashMultimap.create(); Multimap<String, AttributeModifier> map = HashMultimap.create();
if(stack.getItemDamage() < stack.getMaxDamage() && this.armorType == slot){ if(stack.getItemDamage() < stack.getMaxDamage() && this.armorType == slot){
int defense = reductions[slot.getIndex()]; int defense = reductions[slot.getIndex()];
if(stack.hasTagCompound() && stack.getTagCompound().getBoolean("legendary")) float toughness = 0f;
if(stack.hasTagCompound() && stack.getTagCompound().getBoolean("legendary")) {
defense = ArmorMaterial.DIAMOND.getDamageReductionAmount(slot); defense = ArmorMaterial.DIAMOND.getDamageReductionAmount(slot);
toughness = ArmorMaterial.DIAMOND.getToughness();
}
map.put(SharedMonsterAttributes.ARMOR.getName(), new AttributeModifier(ARMOR_MODIFIERS[slot.getIndex()], map.put(SharedMonsterAttributes.ARMOR.getName(), new AttributeModifier(ARMOR_MODIFIERS[slot.getIndex()],
"Armor modifier", defense, 0)); "Armor modifier", defense, 0));
map.put(SharedMonsterAttributes.ARMOR.getName(), new AttributeModifier(ARMOR_MODIFIERS[slot.getIndex()],
"Armor toughness", toughness, 0));
} }
return map; return map;
} }