程序包 org.bukkit.material

# 类 Diode

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

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

@Deprecated public class Diode extends MaterialData implements Directional, Redstone
已过时。
all usage of MaterialData is deprecated and subject to removal. Use `BlockData`.
Represents a diode/repeater in the on or off state, with a delay and facing in a specific direction.

另请参阅:
  - `Material.LEGACY_DIODE_BLOCK_OFF`
  - `Material.LEGACY_DIODE_BLOCK_ON`

- ## 字段概要

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

- ## 构造器概要

  构造器
  构造器
  说明
  `Diode()`
  已过时。
  Constructs a diode switched on, with a delay of 1 and facing the default direction (north).
  `Diode(BlockFace facingDirection)`
  已过时。
  Constructs a diode switched off, with a delay of 1 and facing the specified direction.
  `Diode(BlockFace facingDirection, int delay)`
  已过时。
  Constructs a diode switched off, with the specified delay and facing the specified direction.
  `Diode(BlockFace facingDirection, int delay, boolean state)`
  已过时。
  Constructs a diode switched on or off, with the specified delay and facing the specified direction.
  `Diode(Material type)`
  已过时。
  `Diode(Material type, byte data)`
  已过时。
  Magic value

- ## 方法概要

  修饰符和类型
  方法
  说明
  `Diode`
  `clone()`
  已过时。
  `int`
  `getDelay()`
  已过时。
  Gets the delay of the repeater in ticks.
  `BlockFace`
  `getFacing()`
  已过时。
  Gets the direction this diode is facing
  `boolean`
  `isPowered()`
  已过时。
  Checks if the diode is powered.
  `void`
  `setDelay(int delay)`
  已过时。
  Sets the delay of the repeater.
  `void`
  `setFacingDirection(BlockFace face)`
  已过时。
  Sets the direction this diode is facing.
  `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_DELAY

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

  - ### DEFAULT_STATE

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

- ## 构造器详细资料

  - ### Diode

    public Diode()
    已过时。
    Constructs a diode switched on, with a delay of 1 and facing the default direction (north). By default this constructor creates a diode that is switched on for backwards compatibility with past implementations.

  - ### Diode

    public Diode(BlockFace facingDirection)
    已过时。
    Constructs a diode switched off, with a delay of 1 and facing the specified direction.
    参数:
      `facingDirection` - the direction the diode is facing
    另请参阅:
      - `BlockFace`

  - ### Diode

    public Diode(BlockFace facingDirection, int delay)
    已过时。
    Constructs a diode switched off, with the specified delay and facing the specified direction.
    参数:
      `facingDirection` - the direction the diode is facing
      `delay` - The number of ticks (1-4) before the diode turns on after being powered
    另请参阅:
      - `BlockFace`

  - ### Diode

    public Diode(BlockFace facingDirection, int delay, boolean state)
    已过时。
    Constructs a diode switched on or off, with the specified delay and facing the specified direction.
    参数:
      `facingDirection` - the direction the diode is facing
      `delay` - The number of ticks (1-4) before the diode turns on after being powered
      `state` - True if the diode is in the on state
    另请参阅:
      - `BlockFace`

  - ### Diode

    public Diode(Material type)
    已过时。

  - ### Diode

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

- ## 方法详细资料

  - ### setDelay

    public void setDelay(int delay)
    已过时。
    Sets the delay of the repeater.
    参数:
      `delay` - The new delay (1-4)

  - ### getDelay

    public int getDelay()
    已过时。
    Gets the delay of the repeater in ticks.
    返回:
      The delay (1-4)

  - ### setFacingDirection

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

  - ### getFacing

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

  - ### toString

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

  - ### clone

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

  - ### isPowered

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