Class ToolSet.Builder

java.lang.Object
net.xun.lib.common.api.item.tools.ToolSet.Builder
Enclosing class:
ToolSet

public static class ToolSet.Builder extends Object
Builder for constructing ToolSet instances with flexible configuration. Allows setting per-tool attributes, item properties, and registration behavior.
  • Constructor Details

    • Builder

      public Builder(String name, net.minecraft.world.item.Tier tier, AttributeHelper attributeHelper)
      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 set
      attributeHelper - Helper for applying item attributes to tool properties
  • Method Details

    • withToolStats

      public ToolSet.Builder withToolStats(float[] damages, float[] speeds)
      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

      public ToolSet.Builder withToolStats(ToolType type, float damage, float speed)
      Sets attack stats for a specific tool type.
      Parameters:
      type - Tool type to configure
      damage - Attack damage (added to tier's base damage)
      speed - Attack speed
      Returns:
      This builder for chaining
    • withVanillaBalance

      public ToolSet.Builder withVanillaBalance()
      Configures tools with vanilla Minecraft balance values. Uses standard damage bonuses and speeds from vanilla tool behavior.
      Returns:
      This builder for chaining
    • withItemProperties

      public ToolSet.Builder withItemProperties(net.minecraft.world.item.Item.Properties properties)
      Sets base item properties for all tools in the set.
      Parameters:
      properties - Item properties (durability, rarity, etc.)
      Returns:
      This builder for chaining
    • withConfiguration

      public ToolSet.Builder withConfiguration(ToolConfigurator configurator)
      Sets custom tool creation configuration.
      Parameters:
      configurator - Tool creation strategy implementation
      Returns:
      This builder for chaining
    • build

      public ToolSet build()
      Builds the configured ToolSet instance.
      Returns:
      New ToolSet with specified configuration