Package dan200.computercraft.api.turtle
Class TurtleUpgradeDataProvider.ToolBuilder
java.lang.Object
dan200.computercraft.api.turtle.TurtleUpgradeDataProvider.ToolBuilder
- Enclosing class:
 - TurtleUpgradeDataProvider
 
A builder for custom turtle tool upgrades.
- 
Method Summary
Modifier and TypeMethodDescriptionvoidRegister this as an upgrade.Specify a custom adjective for this tool.Indicate that this upgrade allows items which have been enchanted or have custom attribute modifiers.breakable(net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> breakable) Provide a list of breakable blocks.consumeDurability(TurtleToolDurability durability) Set when the tool will consume durability.craftingItem(net.minecraft.world.item.Item craftingItem) Specify a custom item which is used to craft this upgrade.damageMultiplier(float damageMultiplier) The amount of damage a swing of this tool will do. 
- 
Method Details
- 
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
The amount of damage a swing of this tool will do. This is multiplied byAttributes.ATTACK_DAMAGEto get the final damage.- Parameters:
 damageMultiplier- The damage multiplier.- Returns:
 - The tool builder, for further use.
 
 - 
allowEnchantments
Indicate that this upgrade allows items which have been enchanted or have custom attribute modifiers.- Returns:
 - The tool builder, for further use.
 
 - 
consumeDurability
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 inComputerCraftTags.Blocks.TURTLE_ALWAYS_BREAKABLEand "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 toUpgradeDataProvider.addUpgrades(Consumer).
 
 -