Class ArmorSet

java.lang.Object
net.xun.armory.api.item.ItemSet<ArmorPieceType,net.minecraft.world.item.Item>
net.xun.armory.api.item.armor.ArmorSet

public class ArmorSet extends ItemSet<ArmorPieceType,net.minecraft.world.item.Item>
A specialized ItemSet representing a collection of armor pieces that share a common ArmorMaterial.

An ArmorSet can contain any combination of ArmorPieceType values, allowing callers to create a complete armor set or a partial collection of armor pieces.

Armor creation is delegated to an ArmorCustomizer, allowing specialized armor implementations to be supplied without requiring a subclass of ArmorSet. Shared item properties and additional attribute modifiers can also be configured through the builder.

Armor pieces are exposed through the lazy suppliers inherited from ItemSet, allowing registration and item access to remain separate from the initial construction of the set.

Since:
1.0.0
See Also:
  • Constructor Details

    • ArmorSet

      protected ArmorSet(String name, net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial> material, List<ArmorPieceType> pieces, int durabilityFactor, UnaryOperator<net.minecraft.world.item.Item.Properties> propertiesModifier, Consumer<net.minecraft.world.item.component.ItemAttributeModifiers.Builder> additionalAttributes, ArmorCustomizer customizer)
      Constructs an armor set with the specified configuration.

      The supplied material, durability factor, item-property modifier, additional-attribute consumer, and customizer are shared across all armor pieces in the set.

      Parameters:
      name - the base name used to generate armor registry names
      material - holder containing the armor material used by the set
      pieces - the armor pieces included in the set
      durabilityFactor - multiplier applied to the material's base durability
      propertiesModifier - modifier applied to item properties during creation
      additionalAttributes - consumer used to add additional attribute modifiers
      customizer - strategy responsible for creating armor instances
      Throws:
      NullPointerException - if name, material, pieces, propertiesModifier, additionalAttributes, or customizer is null
  • Method Details

    • getMaterial

      public net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial> getMaterial()
      Returns the ArmorMaterial holder that defines protection values and toughness for this set.
      Returns:
      the armor material holder, never null
    • getDurabilityFactor

      public int getDurabilityFactor()
      Returns the durability multiplier applied to the base durability of each armor piece.

      The actual durability is calculated as: material.durability() * durabilityFactor.

      Returns:
      the durability factor (positive integer)
    • getContext

      public ArmorContext getContext()
      Returns the immutable context object that holds all configuration for this armor set.
      Returns:
      the armor context, never null
    • getHelmet

      public Supplier<net.minecraft.world.item.Item> getHelmet()
    • getChestplate

      public Supplier<net.minecraft.world.item.Item> getChestplate()
    • getLeggings

      public Supplier<net.minecraft.world.item.Item> getLeggings()
    • getBoots

      public Supplier<net.minecraft.world.item.Item> getBoots()
    • builder

      public static ArmorSet.Builder builder(String name, net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial> material)