Interface ArmorCustomizer
Implementations of this interface provide fine-grained control over armor item creation,
allowing for custom armor classes, modified durability calculations, or additional
properties beyond the standard ArmorItem behavior. The DEFAULT
implementation delegates to the piece's own factory via
ArmorPieceType.createItem(ArmorContext, Item.Properties).
- Since:
- 1.0.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ArmorCustomizerThe default customizer that simply uses the piece's own factory. -
Method Summary
Modifier and TypeMethodDescriptiondefault net.minecraft.world.item.Itemcreate(ArmorPieceType piece, ArmorContext context, net.minecraft.world.item.Item.Properties properties) Creates a fully configured armor item instance for the given piece.
-
Field Details
-
DEFAULT
The default customizer that simply uses the piece's own factory.This instance does not override
create(net.xun.armory.api.item.armor.ArmorPieceType, net.xun.armory.api.item.armor.ArmorContext, net.minecraft.world.item.Item.Properties), so it inherits the default method defined below, which callsArmorPieceType.createItem(net.xun.armory.api.item.armor.ArmorContext, net.minecraft.world.item.Item.Properties).
-
-
Method Details
-
create
default net.minecraft.world.item.Item create(ArmorPieceType piece, ArmorContext context, net.minecraft.world.item.Item.Properties properties) Creates a fully configured armor item instance for the given piece.Implementations are responsible for constructing the armor item with appropriate durability calculation and property configuration. The returned item should be ready for registration and use in-game.
Implementation Notes:- Durability can be obtained from
context.material().value().getDurability(context.durabilityFactor()). - Properties may be modified but should not be shared between item instances.
- The provided
propertieshave already been processed by global and per‑piece modifiers.
- Parameters:
piece- the armor piece type (nevernull)context- the armor context providing material and modifiers (nevernull)properties- the final item properties (already modified) (nevernull)- Returns:
- a fully configured armor item instance, never
null - Throws:
NullPointerException- if any argument isnull
- Durability can be obtained from
-