Class ArmorSet

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

public class ArmorSet extends ItemSet<ArmorType,net.minecraft.world.item.ArmorItem>
Represents a complete set of armor consisting of helmet, chestplate, leggings, and boots.

This class provides a convenient abstraction for creating and managing a full armor set with consistent properties across all pieces. Each armor piece is lazily initialized upon first access and can be retrieved individually or as a complete collection.

Usage Example (with NeoForge) :


 // Create a basic armor set with default properties
 Holder<ArmorMaterial> diamondMaterial = ...;
 ArmorSet diamondArmor = new ArmorSet.Builder("diamond", diamondMaterial)
     .withDurabilityFactor(33)  // Standard diamond multiplier
     .build();

 // Register all armor pieces
 Map<ResourceLocation, Supplier<ArmorItem>> items = diamondArmor.getItemsForRegistration("mymod");
 items.forEach((id, supplier) -> ITEMS.register(id.getPath(), supplier));

 // Access individual pieces
 Supplier<ArmorItem> helmet = diamondArmor.getHelmet();
 Supplier<ArmorItem> chestplate = diamondArmor.getChestplate();
 
Since:
1.0.0
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Builder for constructing ArmorSet instances with a fluent API.
  • Field Summary

    Fields inherited from class net.xun.armory.api.item.ItemSet

    pieces, setName
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ArmorSet(String name, net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial> material, int durabilityFactor, Supplier<net.minecraft.world.item.Item.Properties> propertiesSupplier, ArmorCustomizer customizer)
    Constructs a new ArmorSet with the specified configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    Supplier<net.minecraft.world.item.ArmorItem>
    Gets the boots item supplier from this armor set.
    Supplier<net.minecraft.world.item.ArmorItem>
    Gets the chestplate item supplier from this armor set.
    Supplier<net.minecraft.world.item.ArmorItem>
    Gets the helmet item supplier from this armor set.
    Supplier<net.minecraft.world.item.ArmorItem>
    Gets the leggings item supplier from this armor set.

    Methods inherited from class net.xun.armory.api.item.ItemSet

    get, getAll, getPiecesForRegistration, getSetName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ArmorSet

      protected ArmorSet(String name, net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial> material, int durabilityFactor, Supplier<net.minecraft.world.item.Item.Properties> propertiesSupplier, ArmorCustomizer customizer)
      Constructs a new ArmorSet with the specified configuration.
      Parameters:
      name - base name for all armor pieces in the set (e.g., "diamond")
      material - holder for the armor material defining protection and toughness
      durabilityFactor - multiplier for the material's base durability
      propertiesSupplier - supplier for item properties applied to all pieces
      customizer - strategy for creating individual armor items
      Throws:
      NullPointerException - if any required parameter is null
      IllegalArgumentException - if durabilityFactor is negative
  • Method Details

    • getHelmet

      public Supplier<net.minecraft.world.item.ArmorItem> getHelmet()
      Gets the helmet item supplier from this armor set.

      The supplier will create the helmet item upon first invocation and cache the result for subsequent calls.

      Returns:
      supplier providing the registered helmet, never null
    • getChestplate

      public Supplier<net.minecraft.world.item.ArmorItem> getChestplate()
      Gets the chestplate item supplier from this armor set.

      The supplier will create the chestplate item upon first invocation and cache the result for subsequent calls.

      Returns:
      supplier providing the registered chestplate, never null
    • getLeggings

      public Supplier<net.minecraft.world.item.ArmorItem> getLeggings()
      Gets the leggings item supplier from this armor set.

      The supplier will create the leggings item upon first invocation and cache the result for subsequent calls.

      Returns:
      supplier providing the registered leggings, never null
    • getBoots

      public Supplier<net.minecraft.world.item.ArmorItem> getBoots()
      Gets the boots item supplier from this armor set.

      The supplier will create the boots item upon first invocation and cache the result for subsequent calls.

      Returns:
      supplier providing the registered boots, never null