mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-09 00:22:08 -07:00
#835: Add Jukebox#hasRecord() and #startPlaying(), clarify #setRecord()
By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
@@ -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.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user