接口 ToolComponent.ToolRule

所有超级接口:
ConfigurationSerializable
封闭接口:
ToolComponent

public static interface ToolComponent.ToolRule extends ConfigurationSerializable
管理此工具使用并覆盖每个方块属性的规则。
  • 方法详细资料

    • getBlocks

      获取此工具规则适用的方块类型集合。

      原文:Get a collection of the block types to which this tool rule applies.

      返回:
      方块集合
    • setBlocks

      void setBlocks(@NotNull @NotNull Material block)
      设置此规则适用的方块类型。

      原文:Set the block type to which this rule applies.

      参数:
      block - 方块类型
    • setBlocks

      void setBlocks(@NotNull @NotNull Collection<Material> blocks)
      设置此规则适用的方块类型。

      原文:Set the block types to which this rule applies.

      参数:
      blocks - 方块类型
    • setBlocks

      void setBlocks(@NotNull @NotNull Tag<Material> tag)
      设置此规则适用的方块类型(表示为方块 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

      void setSpeed(@Nullable @Nullable Float speed)
      设置此规则的挖掘速度。1.0为标准挖掘速度。

      原文:Set the mining speed of this rule. 1.0 is standard mining speed.

      参数:
      speed - 挖掘速度,或null使用默认速度
    • isCorrectForDrops

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

      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 - 此规则是否适合掉落,或null以回退到原版工具检查行为