Class ArmorSet.Builder
java.lang.Object
net.xun.lib.common.api.item.armor.ArmorSet.Builder
- Enclosing class:
ArmorSet
Builder for constructing
ArmorSet instances.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs the configuredArmorSet.withConfiguration(ArmorConfigurator configuration) Sets custom armor creation logic.withDurabilityFactor(int durabilityFactor) Sets durability multiplier for all armor pieces.withItemProperties(net.minecraft.world.item.Item.Properties properties) Caution: Sets shared item properties for all armor pieces.withItemPropertiesSupplier(Supplier<net.minecraft.world.item.Item.Properties> propertiesSupplier) Sets item properties using a supplier (called per-piece during construction).
-
Constructor Details
-
Builder
public Builder(String name, net.minecraft.core.Holder<net.minecraft.world.item.ArmorMaterial> material) Constructs a new builder for an armor set.- Parameters:
name- Base name for armor pieces (appended with armor-specific suffixes)material- Armor material holder
-
-
Method Details
-
withDurabilityFactor
Sets durability multiplier for all armor pieces. Final durability = material durability * factor.- Parameters:
durabilityFactor- Multiplier for base material durability- Returns:
- This builder for chaining
-
withItemProperties
Caution: Sets shared item properties for all armor pieces. May cause issues if properties are mutated internally. PreferwithItemPropertiesSupplier(java.util.function.Supplier<net.minecraft.world.item.Item.Properties>)for multi-piece sets.- Parameters:
properties- Base properties for all armor- Returns:
- This builder for chaining
-
withItemPropertiesSupplier
public ArmorSet.Builder withItemPropertiesSupplier(Supplier<net.minecraft.world.item.Item.Properties> propertiesSupplier) Sets item properties using a supplier (called per-piece during construction). Safer thanwithItemProperties(net.minecraft.world.item.Item.Properties)for armor sets.- Parameters:
propertiesSupplier- Supplier providing base properties- Returns:
- This builder for chaining
-
withConfiguration
Sets custom armor creation logic.- Parameters:
configuration- Armor creation strategy implementation- Returns:
- This builder for chaining
-
build
Constructs the configuredArmorSet.- Returns:
- New armor set instance
-