Class ExpandTool
java.lang.Object
com.blamejared.crafttweaker.natives.item.component.ExpandTool
Represents the tool properties of an item, including mining speed, damage per block, and rules for specific blocks.
This class is used to define how a tool interacts with blocks in the game.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a rule that defines how a tool interacts with specific blocks. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intdamagePerBlock(net.minecraft.world.item.component.Tool internal) Retrieves the amount of damage the tool takes per block mined.static floatdefaultMiningSpeed(net.minecraft.world.item.component.Tool internal) Retrieves the default mining speed of the tool when no specific rule applies.static floatgetMiningSpeed(net.minecraft.world.item.component.Tool internal, net.minecraft.world.level.block.state.BlockState state) Retrieves the mining speed of the tool for the given block state.static booleanisCorrectForDrops(net.minecraft.world.item.component.Tool internal, net.minecraft.world.level.block.state.BlockState state) Checks if the tool is correct for harvesting drops from the given block state.static net.minecraft.world.item.component.Toolof(List<net.minecraft.world.item.component.Tool.Rule> rules, float defaultMiningSpeed, int damagePerBlock) Creates a new Tool instance with the specified rules, default mining speed, and damage per block.static List<net.minecraft.world.item.component.Tool.Rule> rules(net.minecraft.world.item.component.Tool internal) Retrieves the list of rules that define how the tool interacts with specific blocks.
-
Constructor Details
-
ExpandTool
public ExpandTool()
-
-
Method Details
-
of
public static net.minecraft.world.item.component.Tool of(List<net.minecraft.world.item.component.Tool.Rule> rules, float defaultMiningSpeed, int damagePerBlock) Creates a new Tool instance with the specified rules, default mining speed, and damage per block.- Parameters:
rules- The list of rules that define how the tool interacts with specific blocks.defaultMiningSpeed- The default mining speed of the tool when no specific rule applies.damagePerBlock- The amount of damage the tool takes per block mined.- Returns:
- A new Tool instance.
-
getMiningSpeed
public static float getMiningSpeed(net.minecraft.world.item.component.Tool internal, net.minecraft.world.level.block.state.BlockState state) Retrieves the mining speed of the tool for the given block state.- Parameters:
state- The block state to check the mining speed for.- Returns:
- The mining speed of the tool for the given block state.
-
rules
public static List<net.minecraft.world.item.component.Tool.Rule> rules(net.minecraft.world.item.component.Tool internal) Retrieves the list of rules that define how the tool interacts with specific blocks.- Returns:
- The list of rules for this tool.
-
isCorrectForDrops
public static boolean isCorrectForDrops(net.minecraft.world.item.component.Tool internal, net.minecraft.world.level.block.state.BlockState state) Checks if the tool is correct for harvesting drops from the given block state.- Parameters:
state- The block state to check.- Returns:
- True if the tool is correct for harvesting drops, false otherwise.
-
damagePerBlock
public static int damagePerBlock(net.minecraft.world.item.component.Tool internal) Retrieves the amount of damage the tool takes per block mined.- Returns:
- The damage per block value.
-
defaultMiningSpeed
public static float defaultMiningSpeed(net.minecraft.world.item.component.Tool internal) Retrieves the default mining speed of the tool when no specific rule applies.- Returns:
- The default mining speed.
-