程序包 org.bukkit.material

# 类 Comparator

java.lang.Object
org.bukkit.material.MaterialData
org.bukkit.material.Comparator

所有已实现的接口:
  `Cloneable`, `Directional`, `Redstone`

@Deprecated public class Comparator extends MaterialData implements Directional, Redstone
已过时。
all usage of MaterialData is deprecated and subject to removal. Use `BlockData`.
Represents a comparator in the on or off state, in normal or subtraction mode and facing in a specific direction.

另请参阅:
  - `Material.LEGACY_REDSTONE_COMPARATOR_OFF`
  - `Material.LEGACY_REDSTONE_COMPARATOR_ON`

- ## 字段概要

  字段
  修饰符和类型
  字段
  说明
  `protected static final BlockFace`
  `DEFAULT_DIRECTION`
  已过时。
  `protected static final boolean`
  `DEFAULT_STATE`
  已过时。
  `protected static final boolean`
  `DEFAULT_SUBTRACTION_MODE`
  已过时。

- ## 构造器概要

  构造器
  构造器
  说明
  `Comparator()`
  已过时。
  Constructs a comparator switched off, with the default mode (normal) and facing the default direction (north).
  `Comparator(BlockFace facingDirection)`
  已过时。
  Constructs a comparator switched off, with the default mode (normal) and facing the specified direction.
  `Comparator(BlockFace facingDirection, boolean isSubtraction)`
  已过时。
  Constructs a comparator switched off, with the specified mode and facing the specified direction.
  `Comparator(BlockFace facingDirection, boolean isSubtraction, boolean state)`
  已过时。
  Constructs a comparator switched on or off, with the specified mode and facing the specified direction.
  `Comparator(Material type)`
  已过时。
  `Comparator(Material type, byte data)`
  已过时。
  Magic value

- ## 方法概要

  修饰符和类型
  方法
  说明
  `Comparator`
  `clone()`
  已过时。
  `BlockFace`
  `getFacing()`
  已过时。
  Gets the direction this comparator is facing
  `boolean`
  `isBeingPowered()`
  已过时。
  Checks if the comparator is being powered
  `boolean`
  `isPowered()`
  已过时。
  Checks if the comparator is powered
  `boolean`
  `isSubtractionMode()`
  已过时。
  Checks whether the comparator is in subtraction mode
  `void`
  `setFacingDirection(BlockFace face)`
  已过时。
  Sets the direction this comparator is facing
  `void`
  `setSubtractionMode(boolean isSubtraction)`
  已过时。
  Sets whether the comparator is in subtraction mode.
  `String`
  `toString()`
  已过时。

  ### 从类继承的方法 org.bukkit.material.MaterialData

  `equals, getData, getItemType, hashCode, setData, toItemStack, toItemStack`

  ### 从类继承的方法 java.lang.Object

  `finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## 字段详细资料

  - ### DEFAULT_DIRECTION

    protected static final BlockFace DEFAULT_DIRECTION
    已过时。

  - ### DEFAULT_SUBTRACTION_MODE

    protected static final boolean DEFAULT_SUBTRACTION_MODE
    已过时。
    另请参阅:
      - 常量字段值

  - ### DEFAULT_STATE

    protected static final boolean DEFAULT_STATE
    已过时。
    另请参阅:
      - 常量字段值

- ## 构造器详细资料

  - ### Comparator

    public Comparator()
    已过时。
    Constructs a comparator switched off, with the default mode (normal) and facing the default direction (north).

  - ### Comparator

    public Comparator(BlockFace facingDirection)
    已过时。
    Constructs a comparator switched off, with the default mode (normal) and facing the specified direction.
    参数:
      `facingDirection` - the direction the comparator is facing
    另请参阅:
      - `BlockFace`

  - ### Comparator

    public Comparator(BlockFace facingDirection, boolean isSubtraction)
    已过时。
    Constructs a comparator switched off, with the specified mode and facing the specified direction.
    参数:
      `facingDirection` - the direction the comparator is facing
      `isSubtraction` - True if the comparator is in subtraction mode, false for normal comparator operation
    另请参阅:
      - `BlockFace`

  - ### Comparator

    public Comparator(BlockFace facingDirection, boolean isSubtraction, boolean state)
    已过时。
    Constructs a comparator switched on or off, with the specified mode and facing the specified direction.
    参数:
      `facingDirection` - the direction the comparator is facing
      `isSubtraction` - True if the comparator is in subtraction mode, false for normal comparator operation
      `state` - True if the comparator is in the on state
    另请参阅:
      - `BlockFace`

  - ### Comparator

    public Comparator(Material type)
    已过时。

  - ### Comparator

    @Deprecated public Comparator(Material type, byte data)
    已过时。
    Magic value
    参数:
      `type` - the type
      `data` - the raw data value

- ## 方法详细资料

  - ### setSubtractionMode

    public void setSubtractionMode(boolean isSubtraction)
    已过时。
    Sets whether the comparator is in subtraction mode.
    参数:
      `isSubtraction` - True if the comparator is in subtraction mode, false for normal comparator operation

  - ### isSubtractionMode

    public boolean isSubtractionMode()
    已过时。
    Checks whether the comparator is in subtraction mode
    返回:
      True if the comparator is in subtraction mode, false if normal comparator operation

  - ### setFacingDirection

    public void setFacingDirection(BlockFace face)
    已过时。
    Sets the direction this comparator is facing
    指定者:
      `setFacingDirection` 在接口中 `Directional`
    参数:
      `face` - The direction to set this comparator to
    另请参阅:
      - `BlockFace`

  - ### getFacing

    public BlockFace getFacing()
    已过时。
    Gets the direction this comparator is facing
    指定者:
      `getFacing` 在接口中 `Directional`
    返回:
      The direction this comparator is facing
    另请参阅:
      - `BlockFace`

  - ### toString

    public String toString()
    已过时。
    覆盖:
      `toString` 在类中 `MaterialData`

  - ### clone

    public Comparator clone()
    已过时。
    覆盖:
      `clone` 在类中 `MaterialData`

  - ### isPowered

    public boolean isPowered()
    已过时。
    Checks if the comparator is powered
    指定者:
      `isPowered` 在接口中 `Redstone`
    返回:
      true if the comparator is powered

  - ### isBeingPowered

    public boolean isBeingPowered()
    已过时。
    Checks if the comparator is being powered
    返回:
      true if the comparator is being powered