Enum Class ToolType

java.lang.Object
java.lang.Enum<ToolType>
net.xun.armory.api.item.tools.ToolType
All Implemented Interfaces:
Serializable, Comparable<ToolType>, Constable, PieceType

public enum ToolType extends Enum<ToolType> implements PieceType
Enumerates the five standard tool types in Minecraft with associated metadata.

This enum defines the complete set of craftable tools, each with:
  • A registration suffix for automatic naming
  • The corresponding vanilla Minecraft tool class
The naming convention follows Minecraft's standard: base_name + suffix.

Important: The iteration order of values is fixed as: [SWORD, AXE, PICKAXE, HOE, SHOVEL]. This order must be respected when using array-based configuration methods like ToolSet.Builder.withToolStats(float[], float[]).

Example Naming: For base name "iron":
Tool Piece Naming
ToolTypeFull NameVanilla Class
SWORDiron_swordSwordItem
AXEiron_axeAxeItem
PICKAXEiron_pickaxePickaxeItem
HOEiron_hoeHoeItem
SHOVELiron_shovelShovelItem
Since:
1.0.0
See Also:
  • Enum Constant Details

    • SWORD

      public static final ToolType SWORD
      Sword tool type
    • AXE

      public static final ToolType AXE
      Axe tool type
    • PICKAXE

      public static final ToolType PICKAXE
      Pickaxe tool type
    • HOE

      public static final ToolType HOE
      Hoe tool type
    • SHOVEL

      public static final ToolType SHOVEL
      Shovel tool type
  • Method Details

    • values

      public static ToolType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ToolType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getNameSuffix

      public String getNameSuffix()
      Gets the registration suffix for this tool type.

      This suffix is concatenated with the base name to form the complete registry ID for the tool.

      Specified by:
      getNameSuffix in interface PieceType
      Returns:
      the registration suffix, never null
    • getVanillaClass

      public Class<? extends net.minecraft.world.item.Item> getVanillaClass()
      Gets the vanilla Minecraft tool class for this tool type.

      This class is used by DefaultToolCustomizer to create standard tool instances and can be used for type checking or reflection.

      Returns:
      the vanilla tool class for this type, never null