/** * Gets the current music this Jukebox plays * * @return */ public Music getMusic() { ItemStack current = inventory.getMusicSlot(); if (!canPlay(current)) { return Music.NONE; } return ((MusicDisc) current.getSubMaterial()).getMusic(); }
public boolean canPlay(ItemStack item) { return item != null && this.canPlay(item.getSubMaterial()); }