Enum Class TurtleUpgradeType

java.lang.Object
java.lang.Enum<TurtleUpgradeType>
dan200.computercraft.api.turtle.TurtleUpgradeType
All Implemented Interfaces:
Serializable, Comparable<TurtleUpgradeType>, Constable

public enum TurtleUpgradeType extends Enum<TurtleUpgradeType>
An enum representing the different types of turtle that an ITurtleUpgrade implementation can add to a turtle.
See Also:
  • Enum Constant Details

    • TOOL

      public static final TurtleUpgradeType TOOL
      A tool is rendered as an item on the side of the turtle, and responds to the turtle.dig() and turtle.attack() methods (Such as pickaxe or sword on Mining and Melee turtles).
    • PERIPHERAL

      public static final TurtleUpgradeType PERIPHERAL
      A peripheral adds a special peripheral which is attached to the side of the turtle, and can be interacted with the peripheral API (Such as the modem on Wireless Turtles).
    • BOTH

      public static final TurtleUpgradeType BOTH
      An upgrade which provides both a tool and a peripheral. This can be used when you wish your upgrade to also provide methods. For example, a pickaxe could provide methods determining whether it can break the given block or not.
  • Method Details

    • values

      public static TurtleUpgradeType[] 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 TurtleUpgradeType 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
    • isTool

      public boolean isTool()
    • isPeripheral

      public boolean isPeripheral()