接口 ToolComponent.ToolRule
- 所有超级接口:
ConfigurationSerializable
- 封闭接口:
- ToolComponent
-
方法概要
修饰符和类型方法说明获取此工具规则适用的方块类型集合。getSpeed()获取此规则的挖掘速度。获取此规则是否被视为此规则所列方块的最佳工具并会掉落物品。voidsetBlocks(@NotNull Collection<Material> blocks) 设置此规则适用的方块类型。void设置此规则适用的方块类型。void设置此规则适用的方块类型(表示为方块Tag)。voidsetCorrectForDrops(@Nullable Boolean correct) 设置此规则是否被视为此规则所列方块的最佳工具并会掉落物品。void设置此规则的挖掘速度。从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
-
方法详细资料
-
getBlocks
获取此工具规则适用的方块类型集合。原文:Get a collection of the block types to which this tool rule applies.
- 返回:
- 方块集合
-
setBlocks
设置此规则适用的方块类型。原文:Set the block type to which this rule applies.
- 参数:
block- 方块类型
-
setBlocks
设置此规则适用的方块类型。原文:Set the block types to which this rule applies.
- 参数:
blocks- 方块类型
-
setBlocks
设置此规则适用的方块类型(表示为方块Tag)。原文:Set the block types (represented as a block
Tag) to which this rule applies.- 参数:
tag- 方块标签- 抛出:
IllegalArgumentException- 如果传入的tag不是方块标签
-
getSpeed
获取此规则的挖掘速度。如果非空,则使用此速度值代替工具的默认速度值。1.0为标准挖掘速度。原文: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.
- 返回:
- 挖掘速度,如果使用默认速度则返回null
-
setSpeed
设置此规则的挖掘速度。1.0为标准挖掘速度。原文:Set the mining speed of this rule. 1.0 is standard mining speed.
- 参数:
speed- 挖掘速度,或null使用默认速度
-
isCorrectForDrops
获取此规则是否被视为此规则所列方块的最佳工具并会掉落物品。如果非空,则使用此值代替Minecraft定义的默认工具检查行为。原文: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,否则返回false,或null以回退到原版工具检查行为
-
setCorrectForDrops
设置此规则是否被视为此规则所列方块的最佳工具并会掉落物品。原文:Set whether or not this rule is considered the optimal tool for the blocks listed by this rule and will drop items.
- 参数:
correct- 此规则是否适合掉落,或null以回退到原版工具检查行为
-