Class ToolSet
ItemSet representing a collection of tools that share
a common Tier.
A ToolSet associates each ToolPieceType with tool-specific
ToolStats, while the Tier provides the shared material
properties used by the tools in the set.
Tool creation is delegated to a ToolCustomizer, allowing individual
sets to create specialized tool implementations without requiring
subclasses of ToolSet. Item properties and additional attribute
modifiers can also be configured globally through the builder.
Tools are exposed as lazy suppliers inherited from ItemSet. This
allows the set to be constructed independently of the final registered item
instances.
- Since:
- 1.0.0
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedToolSet(String name, net.minecraft.world.item.Tier tier, List<ToolPieceType> pieces, Map<ToolPieceType, ToolStats> statsByPiece, UnaryOperator<net.minecraft.world.item.Item.Properties> propertiesModifier, Consumer<net.minecraft.world.item.component.ItemAttributeModifiers.Builder> additionalAttributes, ToolCustomizer customizer) Constructs a tool set with the specified configuration. -
Method Summary
Modifier and TypeMethodDescriptionstatic ToolSet.BuilderSupplier<net.minecraft.world.item.Item> getAxe()Returns the immutable context object that holds all configuration for this tool set.Supplier<net.minecraft.world.item.Item> getHoe()Supplier<net.minecraft.world.item.Item> Supplier<net.minecraft.world.item.Item> getStats(ToolPieceType piece) Retrieves the tool stats (attack damage and speed) for a specific piece.Supplier<net.minecraft.world.item.Item> getSword()net.minecraft.world.item.TiergetTier()Returns theTierthat defines the material properties for all tools in this set.Methods inherited from class net.xun.armory.api.item.ItemSet
bind, get, getAll, getPieces, getPiecesForRegistration, getSetName
-
Constructor Details
-
ToolSet
protected ToolSet(String name, net.minecraft.world.item.Tier tier, List<ToolPieceType> pieces, Map<ToolPieceType, ToolStats> statsByPiece, UnaryOperator<net.minecraft.world.item.Item.Properties> propertiesModifier, Consumer<net.minecraft.world.item.component.ItemAttributeModifiers.Builder> additionalAttributes, ToolCustomizer customizer) Constructs a tool set with the specified configuration.The supplied tool statistics are associated with their corresponding piece types and are used by the tool creation factory. The supplied properties modifier and additional attribute consumer are shared by all tools created by this set.
- Parameters:
name- the base name used to generate tool registry namestier- the shared material tier for the toolspieces- the tool pieces included in the setstatsByPiece- the tool statistics associated with each piecepropertiesModifier- modifier applied to item properties during creationadditionalAttributes- consumer used to add additional attribute modifierscustomizer- strategy responsible for creating the tool instances- Throws:
NullPointerException- ifname,tier,pieces,statsByPiece,propertiesModifier,additionalAttributes, orcustomizerisnull
-
-
Method Details
-
getTier
public net.minecraft.world.item.Tier getTier()Returns theTierthat defines the material properties for all tools in this set.- Returns:
- the tier, never
null
-
getStats
Retrieves the tool stats (attack damage and speed) for a specific piece.- Parameters:
piece- the tool piece type (must belong to this set)- Returns:
- the stats for that piece
- Throws:
IllegalArgumentException- ifpieceis not part of this set
-
getContext
Returns the immutable context object that holds all configuration for this tool set.- Returns:
- the tool context, never
null
-
getSword
-
getAxe
-
getPickaxe
-
getShovel
-
getHoe
-
builder
-