接口 ToolComponent.ToolRule
- 所有超级接口:
ConfigurationSerializable
- 封闭接口:
- ToolComponent
A rule governing use of this tool and overriding attributes per-block.
-
方法概要
修饰符和类型方法说明Get a collection of the block types to which this tool rule applies.getSpeed()
Get the mining speed of this rule.Get whether or not this rule is considered the optimal tool for the blocks listed by this rule and will drop items.void
setBlocks
(@NotNull Collection<Material> blocks) Set the block types to which this rule applies.void
Set the block type to which this rule applies.void
Set the block types (represented as a blockTag
) to which this rule applies.void
setCorrectForDrops
(@Nullable Boolean correct) Set whether or not this rule is considered the optimal tool for the blocks listed by this rule and will drop items.void
Set the mining speed of this rule. 1.0 is standard mining speed.从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
-
方法详细资料
-
getBlocks
Get a collection of the block types to which this tool rule applies.- 返回:
- the blocks
-
setBlocks
Set the block type to which this rule applies.- 参数:
block
- the block type
-
setBlocks
Set the block types to which this rule applies.- 参数:
blocks
- the block types
-
setBlocks
Set the block types (represented as a blockTag
) to which this rule applies.- 参数:
tag
- the block tag- 抛出:
IllegalArgumentException
- if the passedtag
is not a block tag
-
getSpeed
Get the mining speed of this rule. If non-null, this speed value is used in lieu of the default speed value of the tool. 1.0 is standard mining speed.- 返回:
- the mining speed, or null if the default speed is used
-
setSpeed
Set the mining speed of this rule. 1.0 is standard mining speed.- 参数:
speed
- the mining speed, or null to use the default speed
-
isCorrectForDrops
Get whether or not this rule is considered the optimal tool for the blocks listed by this rule and will drop items. If non-null, this value is used in lieu of the default tool checking behavior defined by Minecraft.- 返回:
- true if correct for drops, false otherwise, or null to fallback to vanilla tool checking behavior
-
setCorrectForDrops
Set whether or not this rule is considered the optimal tool for the blocks listed by this rule and will drop items.- 参数:
correct
- whether or not this rule is correct for drops, or null to fallback to vanilla tool checking behavior
-