diff --git a/src/main/java/org/betterx/betterend/item/EndArmorItem.java b/src/main/java/org/betterx/betterend/item/EndArmorItem.java index 67d80edeb..3b9bc9c04 100644 --- a/src/main/java/org/betterx/betterend/item/EndArmorItem.java +++ b/src/main/java/org/betterx/betterend/item/EndArmorItem.java @@ -18,10 +18,24 @@ public class EndArmorItem extends ArmorItem implements ItemModelProvider { public static final ResourceLocation BASE_BLINDNESS_RESISTANCE = BetterEnd.C.mk("base_blindness_resistance"); - public static final ResourceLocation BASE_KNOCKBACK_RESISTANCE = BetterEnd.C.mk("base_knockback_resistance"); + public static final ResourceLocation[] KNOCKBACK_RESISTANCES = { + BetterEnd.C.mk("base_knockback_resistance_helmet"), + BetterEnd.C.mk("base_knockback_resistance_chestplate"), + BetterEnd.C.mk("base_knockback_resistance_leggings"), + BetterEnd.C.mk("base_knockback_resistance_boots")}; public static final ResourceLocation MAX_HEALTH_BOOST = BetterEnd.C.mk("max_health_boost"); - public static final ResourceLocation TOUGHNESS_BOOST = BetterEnd.C.mk("toughness_boost"); - public static final ResourceLocation ARMOR_BOOST = BetterEnd.C.mk("armor_boost"); + public static final ResourceLocation[] TOUGHNESS_BOOSTS = { + BetterEnd.C.mk("toughness_boost_helmet"), + BetterEnd.C.mk("toughness_boost_chestplate"), + BetterEnd.C.mk("toughness_boost_leggings"), + BetterEnd.C.mk("toughness_boost_boots") + }; + public static final ResourceLocation[] ARMOR_BOOSTS = { + BetterEnd.C.mk("armor_boost_helmet"), + BetterEnd.C.mk("armor_boost_chestplate"), + BetterEnd.C.mk("armor_boost_leggings"), + BetterEnd.C.mk("armor_boost_boots") + }; public static Properties createDefaultEndArmorSettings(ArmorSlot slot, ArmorTier tier) { var values = tier.getValues(slot); @@ -56,12 +70,21 @@ public static ItemAttributeModifiers.Builder startAttributeBuilder( ) { EquipmentSlotGroup slotGroup = EquipmentSlotGroup.bySlot(slot.armorType.getSlot()); + int boosterIdx = 0; + if (slot == ArmorSlot.CHESTPLATE_SLOT){ + boosterIdx = 1; + } else if (slot == ArmorSlot.LEGGINGS_SLOT) { + boosterIdx = 2; + } else if (slot == ArmorSlot.BOOTS_SLOT) { + boosterIdx = 3; + } + final ItemAttributeModifiers.Builder builder = ItemAttributeModifiers .builder() .add( Attributes.ARMOR, new AttributeModifier( - ARMOR_BOOST, + ARMOR_BOOSTS[boosterIdx], defense, AttributeModifier.Operation.ADD_VALUE ), @@ -70,7 +93,7 @@ public static ItemAttributeModifiers.Builder startAttributeBuilder( .add( Attributes.ARMOR_TOUGHNESS, new AttributeModifier( - TOUGHNESS_BOOST, + TOUGHNESS_BOOSTS[boosterIdx], toughness, AttributeModifier.Operation.ADD_VALUE ), @@ -81,7 +104,7 @@ public static ItemAttributeModifiers.Builder startAttributeBuilder( builder.add( Attributes.KNOCKBACK_RESISTANCE, new AttributeModifier( - BASE_KNOCKBACK_RESISTANCE, + KNOCKBACK_RESISTANCES[boosterIdx], knockbackResistance, AttributeModifier.Operation.ADD_VALUE ),