Class ToolSet.Builder
java.lang.Object
net.xun.lib.common.api.item.tools.ToolSet.Builder
- Enclosing class:
ToolSet
Builder for constructing ToolSet instances with flexible configuration.
Allows setting per-tool attributes, item properties, and registration behavior.
-
Constructor Summary
ConstructorsConstructorDescriptionBuilder(String name, net.minecraft.world.item.Tier tier, AttributeHelper attributeHelper) Constructs a new ToolSet builder. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the configured ToolSet instance.withConfiguration(ToolConfigurator configurator) Sets custom tool creation configuration.withItemProperties(net.minecraft.world.item.Item.Properties properties) Sets base item properties for all tools in the set.withToolStats(float[] damages, float[] speeds) Sets attack stats for all tools using arrays.withToolStats(ToolType type, float damage, float speed) Sets attack stats for a specific tool type.Configures tools with vanilla Minecraft balance values.
-
Constructor Details
-
Builder
Constructs a new ToolSet builder.- Parameters:
name- Base name for tools (will be combined with tool-specific suffixes)tier- Material tier for all tools in the setattributeHelper- Helper for applying item attributes to tool properties
-
-
Method Details
-
withToolStats
Sets attack stats for all tools using arrays. Array order must match ToolType.values().- Parameters:
damages- Attack damage values (added to tier's base damage)speeds- Attack speed values- Returns:
- This builder for chaining
- Throws:
IllegalArgumentException- If array lengths don't match ToolType count
-
withToolStats
Sets attack stats for a specific tool type.- Parameters:
type- Tool type to configuredamage- Attack damage (added to tier's base damage)speed- Attack speed- Returns:
- This builder for chaining
-
withVanillaBalance
Configures tools with vanilla Minecraft balance values. Uses standard damage bonuses and speeds from vanilla tool behavior.- Returns:
- This builder for chaining
-
withItemProperties
Sets base item properties for all tools in the set.- Parameters:
properties- Item properties (durability, rarity, etc.)- Returns:
- This builder for chaining
-
withConfiguration
Sets custom tool creation configuration.- Parameters:
configurator- Tool creation strategy implementation- Returns:
- This builder for chaining
-
build
Builds the configured ToolSet instance.- Returns:
- New ToolSet with specified configuration
-