public interface Jukebox extends BlockState
限定符和类型 | 方法和说明 |
---|---|
boolean |
eject()
停止唱片机的播放,并弹出唱片.
|
Material |
getPlaying()
获取唱片机正在播放的唱片.
|
boolean |
isPlaying()
检查唱片机是否正在播放唱片.
|
void |
setPlaying(Material record)
设置正在播放的唱片.
|
getBlock, getChunk, getData, getLightLevel, getLocation, getLocation, getRawData, getType, getTypeId, getWorld, getX, getY, getZ, isPlaced, setData, setRawData, setType, setTypeId, update, update, update
getMetadata, hasMetadata, removeMetadata, setMetadata
Material getPlaying()
原文: Gets the record being played.
void setPlaying(Material record)
原文: Sets the record being played.
record
- 这个唱片物品,设置为AIR/null则为停止播放boolean isPlaying()
原文: Checks if the jukebox is playing a record.
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.
java.lang.IllegalStateException
- 如果方块状态未应用(译注:仅仅是一种表示而未应用到实际的方块上)