程序包 org.bukkit.inventory.meta.components

# 接口 ToolComponent.ToolRule

所有超级接口:
  `ConfigurationSerializable`

封闭接口:
  ToolComponent

public static interface ToolComponent.ToolRule extends ConfigurationSerializable
A rule governing use of this tool and overriding attributes per-block.

- ## 方法概要

  修饰符和类型
  方法
  说明
  `@NotNull Collection<Material>`
  `getBlocks()`
  Get a collection of the block types to which this tool rule applies.
  `@Nullable Float`
  `getSpeed()`
  Get the mining speed of this rule.
  `@Nullable Boolean`
  `isCorrectForDrops()`
  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`
  `setBlocks(@NotNull Material block)`
  Set the block type to which this rule applies.
  `void`
  `setBlocks(@NotNull Tag<Material> tag)`
  Set the block types (represented as a block `Tag`) 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`
  `setSpeed(@Nullable Float speed)`
  Set the mining speed of this rule. 1.0 is standard mining speed.

  ### 从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable

  `serialize`

- ## 方法详细资料

  - ### getBlocks

    @NotNull @NotNull Collection<Material> getBlocks()
    Get a collection of the block types to which this tool rule applies.
    返回:
      the blocks

  - ### setBlocks

    void setBlocks(@NotNull @NotNull Material block)
    Set the block type to which this rule applies.
    参数:
      `block` - the block type

  - ### setBlocks

    void setBlocks(@NotNull @NotNull Collection<Material> blocks)
    Set the block types to which this rule applies.
    参数:
      `blocks` - the block types

  - ### setBlocks

    void setBlocks(@NotNull @NotNull Tag<Material> tag)
    Set the block types (represented as a block `Tag`) to which this rule applies.
    参数:
      `tag` - the block tag
    抛出:
      `IllegalArgumentException` - if the passed `tag` is not a block tag

  - ### getSpeed

    @Nullable @Nullable Float 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

    void setSpeed(@Nullable @Nullable Float speed)
    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

    @Nullable @Nullable Boolean 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

    void setCorrectForDrops(@Nullable @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.
    参数:
      `correct` - whether or not this rule is correct for drops, or null to fallback to vanilla tool checking behavior