mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-05 16:49:39 +00:00
#835: Add Jukebox#hasRecord() and #startPlaying(), clarify #setRecord()
This commit is contained in:
parent
2c64d8c4a8
commit
a6b85ac332
1 changed files with 21 additions and 1 deletions
|
@ -27,6 +27,18 @@ public interface Jukebox extends TileState, BlockInventoryHolder {
|
||||||
*/
|
*/
|
||||||
public void setPlaying(@Nullable Material record);
|
public void setPlaying(@Nullable Material record);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets whether or not this jukebox has a record.
|
||||||
|
* <p>
|
||||||
|
* A jukebox can have a record but not {@link #isPlaying() be playing}
|
||||||
|
* if it was stopped with {@link #stopPlaying()} or if a record has
|
||||||
|
* finished playing.
|
||||||
|
*
|
||||||
|
* @return true if this jukebox has a record, false if it the jukebox
|
||||||
|
* is empty
|
||||||
|
*/
|
||||||
|
public boolean hasRecord();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the record item inserted into the jukebox.
|
* Gets the record item inserted into the jukebox.
|
||||||
*
|
*
|
||||||
|
@ -36,7 +48,7 @@ public interface Jukebox extends TileState, BlockInventoryHolder {
|
||||||
public ItemStack getRecord();
|
public ItemStack getRecord();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the record being played.
|
* Sets the record being played. The jukebox will start playing automatically.
|
||||||
*
|
*
|
||||||
* @param record the record to insert or null/AIR to empty
|
* @param record the record to insert or null/AIR to empty
|
||||||
*/
|
*/
|
||||||
|
@ -49,6 +61,14 @@ public interface Jukebox extends TileState, BlockInventoryHolder {
|
||||||
*/
|
*/
|
||||||
public boolean isPlaying();
|
public boolean isPlaying();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Starts the jukebox playing if there is a record.
|
||||||
|
*
|
||||||
|
* @return 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
|
||||||
|
*/
|
||||||
|
public boolean startPlaying();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stops the jukebox playing without ejecting the record.
|
* Stops the jukebox playing without ejecting the record.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue