package Ġthere alf ar fetch d . qu ack lib . item . impl Ċ Ċ import Ġnet . minecraft . util . Enum Facing Ċ import Ġnet . minecraftforge . common . capabilities . Capability Ċ import Ġnet . minecraftforge . common . capabilities . IC ap ability Provider Ċ import Ġthere alf ar fetch d . qu ack lib . api . item . component . Item Component Capability Ċ import Ġthere alf ar fetch d . qu ack lib . api . objects . get Components OfType Ċ import Ġthere alf ar fetch d . qu ack lib . api . objects . item . Item Ċ Ċ class ĠCap ability Provider Item ( val Ġitem : ĠItem ) Ġ: ĠI Capability Provider Ġ{ ĊĊĠ Ġval Ġstorage Ġ= ĠCap ability Item Qu ack Lib ( item ) ĊĊĠ Ġval Ġc Item Ġ= Ġitem . type . get Components OfType < Item Component Capability >() ĊĊĠ Ġ@ Suppress (" UN CHECK ED _ CAST ") ĊĠ Ġoverride Ġfun Ġ< T Ġ: ĠAny ?> Ġget Capability ( capability : ĠCap ability < T >, Ġfacing : ĠEnum Facing ?): ĠT ? Ġ= Ġwhen Ġ( capability ) Ġ{ ĊĠĠĠ ĠCap ability Item Qu ack Lib . CAP ABILITY Ġ-> Ġstorage Ġas ĠT ĊĠĠĠ Ġelse Ġ-> Ġc Item . first OrNull Ġ{ Ġit . has Capability ( item , Ġcapability , Ġfacing ) Ġ} ?. get Capability ( item , Ġcapability , Ġfacing ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġhas Capability ( capability : ĠCap ability <* >, Ġfacing : ĠEnum Facing ?): ĠBoolean Ġ= Ġwhen Ġ( capability ) Ġ{ ĊĠĠĠ ĠCap ability Item Qu ack Lib . CAP ABILITY Ġ-> Ġtrue ĊĠĠĠ Ġelse Ġ-> Ġc Item . any Ġ{ Ġit . has Capability ( item , Ġcapability , Ġfacing ) Ġ} ĊĠ Ġ} Ċ Ċ }