Exemple #1
0
  /**
   * 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();
  }
Exemple #2
0
 public boolean canPlay(ItemStack item) {
   return item != null && this.canPlay(item.getSubMaterial());
 }