Class ArmorSet
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:
-
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, 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. -
Method Summary
Modifier and TypeMethodDescriptionstatic ArmorSet.BuilderSupplier<net.minecraft.world.item.Item> getBoots()Supplier<net.minecraft.world.item.Item> Returns the immutable context object that holds all configuration for this armor set.intReturns the durability multiplier applied to the base durability of each armor piece.Supplier<net.minecraft.world.item.Item> Supplier<net.minecraft.world.item.Item> net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial> Returns theArmorMaterialholder that defines protection values and toughness for this set.Methods inherited from class net.xun.armory.api.item.ItemSet
bind, get, getAll, getPieces, getPiecesForRegistration, getSetName
-
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 namesmaterial- holder containing the armor material used by the setpieces- the armor pieces included in the setdurabilityFactor- multiplier applied to the material's base durabilitypropertiesModifier- modifier applied to item properties during creationadditionalAttributes- consumer used to add additional attribute modifierscustomizer- strategy responsible for creating armor instances- Throws:
NullPointerException- ifname,material,pieces,propertiesModifier,additionalAttributes, orcustomizerisnull
-
-
Method Details
-
getMaterial
public net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial> getMaterial()Returns theArmorMaterialholder 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
Returns the immutable context object that holds all configuration for this armor set.- Returns:
- the armor context, never
null
-
getHelmet
-
getChestplate
-
getLeggings
-
getBoots
-
builder
public static ArmorSet.Builder builder(String name, net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial> material)
-