Class ToolItemFactories

java.lang.Object
net.xun.armory.api.item.tools.ToolItemFactories

public final class ToolItemFactories extends Object
Utility class providing factory methods for common tool item creation patterns.

This class contains helper methods to create ToolItemFactory instances for vanilla tool constructors (e.g., SwordItem(Tier, Item.Properties)).

This class is not intended to be instantiated.

Since:
3.0.0
  • Method Details

    • fromConstructor

      public static ToolItemFactory fromConstructor(ToolItemFactories.VanillaItemConstructor vanillaFactory)
      Creates a ToolItemFactory that delegates to a vanilla-style constructor accepting a Tier and Item.Properties.

      The returned factory ignores the piece and context other than extracting the tier.

      Parameters:
      vanillaFactory - a functional interface matching vanilla constructors
      Returns:
      a factory that uses the given constructor
      Throws:
      NullPointerException - if vanillaFactory is null