程序包 org.bukkit.block

接口 Dispenser

所有超级接口:
BlockInventoryHolder, BlockState, Container, InventoryHolder, Lockable, Lootable, Metadatable, Nameable, PersistentDataHolder, TileState

public interface Dispenser extends Container, Nameable, Lootable
代表发射器.
  • 方法详细资料

    • getBlockProjectileSource

      @Nullable @Nullable BlockProjectileSource getBlockProjectileSource()
      获取此发射器的BlockProjectileSource对象.

      如果这个方块不是发射器,将返回null.

      原文: Gets the BlockProjectileSource object for the dispenser.

      If the block represented by this state is no longer a dispenser, this will return null.

      返回:
      如果一个BlockProjectileSource对象有效将返回,否则返回null
      抛出:
      IllegalStateException - 如果方块状态未应用(译注:仅仅是一种表示而未应用到实际的方块上, 一种虚拟状态)
    • dispense

      boolean dispense()
      尝试发射发射器内的物品.

      如果这个方块不是发射器,将返回false.

      原文: Attempts to dispense the contents of the dispenser.

      If the block represented by this state is no longer a dispenser, this will return false.

      返回:
      返回true即表示成功,否则返回false
      抛出:
      IllegalStateException - 如果方块状态未应用(译注:仅仅是一种表示而未应用到实际的方块上, 一种虚拟状态)