程序包 org.bukkit.block

接口 Jukebox

所有超级接口:
BlockInventoryHolder, BlockState, InventoryHolder, Metadatable, PersistentDataHolder, TileState

public interface Jukebox extends TileState, BlockInventoryHolder
代表唱片机.
  • 方法详细资料

    • getPlaying

      @NotNull @NotNull Material getPlaying()
      获取插入该唱片机的唱片.

      原文: Gets the record inserted into the jukebox.

      返回:
      这个唱片物品,如果返回AIR就表示唱片机内无唱片插入
    • setPlaying

      void setPlaying(@Nullable @Nullable Material record)
      设置将要播放的唱片.

      原文: Sets the record being played.

      参数:
      record - 这个唱片物品,设置为AIR/null则停止播放
    • hasRecord

      boolean hasRecord()
      Gets whether or not this jukebox has a record.

      A jukebox can have a record but not be playing if it was stopped with stopPlaying() or if a record has finished playing.

      返回:
      true if this jukebox has a record, false if it the jukebox is empty
    • getRecord

      获取插入该唱片机的唱片 (译注:这是较新版本才有的API, 建议使用getPlaying).

      原文:Sets the record being played.

      返回:
      唱片物品堆副本,如果返回空气物品堆(本方法不会返回null)就表示唱片机内无唱片插入
    • setRecord

      void setRecord(@Nullable @Nullable ItemStack record)
      设置将要播放的唱片, 唱片机将自动播放. (译注:这是较新版本才有的API, 建议使用setPlaying).

      原文:Sets the record being played. The jukebox will start playing automatically.

      参数:
      record - 这个唱片物品,设置为AIR/null则停止播放
    • isPlaying

      boolean isPlaying()
      检查唱片机是否正在播放唱片.

      原文: Checks if the jukebox is playing a record.

      返回:
      返回true就表示唱片正在播放
    • startPlaying

      boolean startPlaying()
      Starts the jukebox playing if there is a record.
      返回:
      true if the jukebox had a record and was able to start playing, false if the jukebox was already playing or did not have a record
    • stopPlaying

      void stopPlaying()
      使唱片机停止播放, 但不弹出唱片.

      原文:Stops the jukebox playing without ejecting the record.

    • eject

      boolean eject()
      停止唱片机的播放,并弹出唱片.

      如果这个方块不再是一个唱片机, 那么使用本方法将没有任何效果并返回false.

      原文: Stops the jukebox playing and ejects the current record.

      If the block represented by this state is no longer a jukebox, this will do nothing and return false.

      返回:
      true表示已弹出唱片;false表示唱片机没有播放唱片
      抛出:
      IllegalStateException - 如果方块状态未应用(译注:仅仅是一种表示而未应用到实际的方块上, 一种虚拟状态)
    • getInventory

      从接口复制的说明: InventoryHolder
      获取该对象的用户界面项目.

      原文:Get the object's inventory.

      指定者:
      getInventory 在接口中 InventoryHolder
      返回:
      inventory
      另请参阅:
    • getSnapshotInventory

      @NotNull @NotNull JukeboxInventory getSnapshotInventory()
      返回:
      snapshot inventory
      另请参阅: