package Ġcom . ci ar and g . sound bounds . client . audio . song . types Ċ Ċ import Ġcom . ci ar and g . sound bounds . Sound Bounds Ċ import Ġcom . ci ar and g . sound bounds . client . exceptions . Missing Audio Exception Ċ import Ġcom . ci ar and g . sound bounds . client . exceptions . No Metadata Exception Ċ import Ġcom . ci ar and g . sound bounds . client . exceptions . Song Meta Mismatch Exception Ċ import Ġcom . ci ar and g . sound bounds . client . metadata . Client Meta Ċ import Ġcom . ci ar and g . sound bounds . common . metadata . Json Song Meta Ċ import Ġme . s hed an iel . architect ury . utils . Game Instance Ċ import Ġnet . minecraft . client . sound . O gg Audio Stream Ċ import Ġnet . minecraft . util . Identifier Ċ import Ġjava . io . IOException Ċ Ċ class ĠO gg Song ( meta : ĠJson Song Meta ) Ġ: ĠSong < O gg Audio Stream > Ġ{ ĊĠĠĠ Ġoverride Ġval Ġhead Ġ= Ġmeta . head ?. let Ġ{ ĠO gg Audio Stream ( id To Resource ( it ). inputStream ) Ġ} ĊĠĠĠ Ġoverride Ġval Ġbodies Ġ= Ġmeta . bodies . map Ġ{ ĠO gg Audio Stream ( id To Resource ( it ). inputStream ) Ġ} ĊĠĠĠ Ġoverride Ġval Ġloop Ġ= Ġmeta . loop ĊĠĠĠ Ġval Ġis Sound scape Ġ= Ġmeta . tags . map Ġ{ Ġit . toLowerCase () Ġ}. contains (" sound scape ") ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠRESOURCE _ PATH Ġ= Ġ" music /" ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠO GG _ EXT Ġ= Ġ". ogg " ĊĊĠĠĠĠĠĠĠ Ġfun Ġfrom ID ( song ID : ĠString ): ĠO gg Song Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġmeta Ġ= ĠClient Meta . meta Ġ?: Ġthrow ĠNo Metadata Exception () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġsong Meta Ġ= Ġmeta . songs [ song ID ] Ġ?: Ġthrow ĠSong Meta Mismatch Exception ( id Path ( song ID )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠO gg Song ( song Meta ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġprivate Ġfun Ġid To Resource ( song ID : ĠString ) Ġ= Ġtry Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġidentifier Ġ= ĠIdentifier ( Sound Bounds . MOD _ ID , Ġid Path ( song ID )) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠGame Instance . getClient (). resource Manager . getResource ( identifier ) ĊĠĠĠĠĠĠĠ Ġ} Ġcatch Ġ( e : ĠIOException ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġthrow ĠMissing Audio Exception ( song ID ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġprivate Ġfun Ġid Path ( song ID : ĠString ) Ġ= ĠRESOURCE _ PATH Ġ+ Ġsong ID Ġ+ ĠO GG _ EXT ĊĠĠĠ Ġ} Ċ } Ċ