Class TurtleUpgradeDataProvider.ToolBuilder

java.lang.Object
dan200.computercraft.api.turtle.TurtleUpgradeDataProvider.ToolBuilder
Enclosing class:
TurtleUpgradeDataProvider

public static class TurtleUpgradeDataProvider.ToolBuilder extends Object
A builder for custom turtle tool upgrades.
See Also:
  • Method Details

    • adjective

      public TurtleUpgradeDataProvider.ToolBuilder adjective(String adjective)
      Specify a custom adjective for this tool. By default this takes its adjective from the tool item.
      Parameters:
      adjective - The new adjective to use.
      Returns:
      The tool builder, for further use.
    • craftingItem

      public TurtleUpgradeDataProvider.ToolBuilder craftingItem(net.minecraft.world.item.Item craftingItem)
      Specify a custom item which is used to craft this upgrade. By default this is the same as the provided tool item, but you may wish to override it.
      Parameters:
      craftingItem - The item used to craft this upgrade.
      Returns:
      The tool builder, for further use.
    • damageMultiplier

      public TurtleUpgradeDataProvider.ToolBuilder damageMultiplier(float damageMultiplier)
      The amount of damage a swing of this tool will do. This is multiplied by Attributes.ATTACK_DAMAGE to get the final damage.
      Parameters:
      damageMultiplier - The damage multiplier.
      Returns:
      The tool builder, for further use.
    • allowEnchantments

      public TurtleUpgradeDataProvider.ToolBuilder allowEnchantments()
      Indicate that this upgrade allows items which have been enchanted or have custom attribute modifiers.
      Returns:
      The tool builder, for further use.
    • consumeDurability

      public TurtleUpgradeDataProvider.ToolBuilder consumeDurability(TurtleToolDurability durability)
      Set when the tool will consume durability.
      Parameters:
      durability - The durability predicate.
      Returns:
      The tool builder, for further use.
    • breakable

      public TurtleUpgradeDataProvider.ToolBuilder breakable(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> breakable)
      Provide a list of breakable blocks. If not given, the tool can break all blocks. If given, only blocks in this tag, those in ComputerCraftTags.Blocks.TURTLE_ALWAYS_BREAKABLE and "insta-mine" ones can be broken.
      Parameters:
      breakable - The tag containing all blocks breakable by this item.
      Returns:
      The tool builder, for further use.
      See Also:
    • add

      Register this as an upgrade.
      Parameters:
      add - The callback given to UpgradeDataProvider.addUpgrades(Consumer).