github.com/df-mc/dragonfly@v0.9.13/server/item/music_disc.go (about)

     1  package item
     2  
     3  import (
     4  	"github.com/df-mc/dragonfly/server/world/sound"
     5  )
     6  
     7  // MusicDisc is an item that can be played in jukeboxes.
     8  type MusicDisc struct {
     9  	// DiscType is the disc type of the music disc.
    10  	DiscType sound.DiscType
    11  }
    12  
    13  // MaxCount always returns 1.
    14  func (MusicDisc) MaxCount() int {
    15  	return 1
    16  }
    17  
    18  // EncodeItem ...
    19  func (m MusicDisc) EncodeItem() (name string, meta int16) {
    20  	return "minecraft:music_disc_" + m.DiscType.String(), 0
    21  }