SPIGOT-7309: Add API for jukebox inventories

By: Parker Hawke <hawkeboyz2@hotmail.com>
This commit is contained in:
Bukkit/Spigot
2023-03-23 20:55:12 +11:00
parent 027afe0c44
commit 576f627798
3 changed files with 57 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
package org.bukkit.inventory;
import org.bukkit.Tag;
import org.bukkit.block.Jukebox;
import org.jetbrains.annotations.Nullable;
/**
* Interface to the inventory of a Jukebox.
*/
public interface JukeboxInventory extends Inventory {
/**
* Set the record in the jukebox.
* <p>
* This will immediately start playing the inserted item or stop playing if the
* item provided is null. If the provided item is not a record (according to
* {@link Tag#ITEMS_MUSIC_DISCS}), this method will do nothing and not set the
* item in the inventory.
*
* @param item the new record
*/
void setRecord(@Nullable ItemStack item);
/**
* Get the record in the jukebox.
*
* @return the current record
*/
@Nullable
ItemStack getRecord();
@Nullable
@Override
public Jukebox getHolder();
}