Package net.xun.armory.api.item.armor
Class ArmorSet
java.lang.Object
net.xun.armory.api.item.ItemSet<ArmorType,net.minecraft.world.item.ArmorItem>
net.xun.armory.api.item.armor.ArmorSet
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 ClassesModifier and TypeClassDescriptionstatic classBuilder for constructingArmorSetinstances with a fluent API. -
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedArmorSet(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 TypeMethodDescriptionSupplier<net.minecraft.world.item.ArmorItem> getBoots()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
-
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 toughnessdurabilityFactor- multiplier for the material's base durabilitypropertiesSupplier- supplier for item properties applied to all piecescustomizer- strategy for creating individual armor items- Throws:
NullPointerException- if any required parameter isnullIllegalArgumentException- if durabilityFactor is negative
-
-
Method Details
-
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
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
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
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
-