Package net.xun.armory.api.item.tools
Class ToolItemFactories
java.lang.Object
net.xun.armory.api.item.tools.ToolItemFactories
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFunctional interface matching the constructor signature of most vanilla tool classes. -
Method Summary
Modifier and TypeMethodDescriptionstatic ToolItemFactoryfromConstructor(ToolItemFactories.VanillaItemConstructor vanillaFactory) Creates aToolItemFactorythat delegates to a vanilla-style constructor accepting aTierandItem.Properties.
-
Method Details
-
fromConstructor
public static ToolItemFactory fromConstructor(ToolItemFactories.VanillaItemConstructor vanillaFactory) Creates aToolItemFactorythat delegates to a vanilla-style constructor accepting aTierandItem.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- ifvanillaFactoryisnull
-