From 2cd8b46c1f4c178d4c45ada3337a5f0c18bff1da Mon Sep 17 00:00:00 2001 From: Electroblob <35599699+Electroblob77@users.noreply.github.com> Date: Mon, 4 Jun 2018 18:32:32 +0100 Subject: [PATCH] Add toughness to legendary wizard armour --- .../wizardry/item/ItemWizardArmour.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main/java/electroblob/wizardry/item/ItemWizardArmour.java b/src/main/java/electroblob/wizardry/item/ItemWizardArmour.java index 494f1dd5..63484b97 100644 --- a/src/main/java/electroblob/wizardry/item/ItemWizardArmour.java +++ b/src/main/java/electroblob/wizardry/item/ItemWizardArmour.java @@ -163,15 +163,26 @@ public class ItemWizardArmour extends ItemArmor { * the armor value. It is also what handles armor toughness, but the wizard armor had a value of 0 for that. */ @Override - public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack) { + public Multimap getAttributeModifiers(EntityEquipmentSlot slot, ItemStack stack){ + Multimap map = HashMultimap.create(); - if(stack.getItemDamage() < stack.getMaxDamage() && this.armorType == slot) { + + if(stack.getItemDamage() < stack.getMaxDamage() && this.armorType == slot){ + 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); + toughness = ArmorMaterial.DIAMOND.getToughness(); + } + map.put(SharedMonsterAttributes.ARMOR.getName(), new AttributeModifier(ARMOR_MODIFIERS[slot.getIndex()], "Armor modifier", defense, 0)); + map.put(SharedMonsterAttributes.ARMOR.getName(), new AttributeModifier(ARMOR_MODIFIERS[slot.getIndex()], + "Armor toughness", toughness, 0)); } + return map; }