package Ġthere alf ar fetch d . qu ack lib . tools Ċ Ċ import Ġnet . minecraft . nbt . NBT Base Ċ import Ġnet . minecraft . util . Enum Facing Ċ import Ġnet . minecraftforge . common . capabilities . Capability Ċ import Ġnet . minecraftforge . common . capabilities . Capability Manager Ċ import Ġnet . minecraftforge . fml . common . discovery . ASM DataTable Ċ import Ġkotlin . reflect . K Class Ċ Ċ @ Suppress (" UN CHECK ED _ CAST ") Ċ fun Ġ< T Ġ: ĠAny > Ġregister Capability ( type : ĠK Class < T >) Ġ{ ĊĠ ĠCap ability Manager . INSTANCE . register < T >( ĊĠĠĠ Ġtype . java , ĊĠĠĠ ĠOm ni Storage Ġas ĠCap ability . I Storage < T >, ĊĠĠĠ ĠOm ni Factory ĊĠ Ġ) Ċ } Ċ Ċ fun Ġregister Annotated Capabilities ( table : ĠAS M DataTable ) Ġ{ ĊĠ Ġfor Ġ( c Ġin Ġtable . getAll (" there alf ar fetch d . qu ack lib . api . tools . Register Capability "). map Ġ{ Ġit . className Ġ}. distinct ()) Ġ{ ĊĠĠĠ Ġregister Capability ( Class . forName ( c ). kotlin ) ĊĠ Ġ} Ċ } Ċ Ċ private Ġobject ĠOm ni Storage Ġ: ĠCap ability . I Storage < Nothing > Ġ{ ĊĊĠ Ġoverride Ġfun Ġread NBT ( capability : ĠCap ability < Nothing > ?, Ġinstance : ĠNothing ?, Ġside : ĠEnum Facing ?, Ġn bt : ĠN BT Base ?) Ġ{} ĊĊĠ Ġoverride Ġfun Ġwrite NBT ( capability : ĠCap ability < Nothing > ?, Ġinstance : ĠNothing ?, Ġside : ĠEnum Facing ?) Ġ= Ġnull Ċ Ċ } Ċ Ċ private Ġval ĠOm ni Factory Ġ= Ġ{ Ġnull Ġ}