/* Ċ Ġ* ĠMIT ĠLicense Ċ Ġ* Ċ Ġ* ĠCopyright Ġ( c ) Ġ 2 0 2 0 Ġ- Ġ 2 0 2 2 Ġv ini 2 0 0 3 Ċ Ġ* Ċ Ġ* ĠPermission Ġis Ġhereby Ġgranted , Ġfree Ġof Ġcharge , Ġto Ġany Ġperson Ġobtaining Ġa Ġcopy Ċ Ġ* Ġof Ġthis Ġsoftware Ġand Ġassociated Ġdocumentation Ġfiles Ġ( the Ġ" Software "), Ġto Ġdeal Ċ Ġ* Ġin Ġthe ĠSoftware Ġwithout Ġrestriction , Ġincluding Ġwithout Ġlimitation Ġthe Ġrights Ċ Ġ* Ġto Ġuse , Ġcopy , Ġmodify , Ġmerge , Ġpublish , Ġdistribute , Ġsublicense , Ġand / or Ġsell Ċ Ġ* Ġcopies Ġof Ġthe ĠSoftware , Ġand Ġto Ġpermit Ġpersons Ġto Ġwhom Ġthe ĠSoftware Ġis Ċ Ġ* Ġfurnished Ġto Ġdo Ġso , Ġsubject Ġto Ġthe Ġfollowing Ġconditions : Ċ Ġ* Ċ Ġ* ĠThe Ġabove Ġcopyright Ġnotice Ġand Ġthis Ġpermission Ġnotice Ġshall Ġbe Ġincluded Ġin Ġall Ċ Ġ* Ġcopies Ġor Ġsubstantial Ġportions Ġof Ġthe ĠSoftware . Ċ Ġ* Ċ Ġ* ĠTHE ĠSOFTWARE ĠIS ĠPROVIDED Ġ" AS ĠIS ", ĠWITHOUT ĠWARRANTY ĠOF ĠANY ĠKIND , ĠEXPRESS ĠOR Ċ Ġ* ĠIMPLIED , ĠINCLUDING ĠBUT ĠNOT ĠLIMITED ĠTO ĠTHE ĠWARRANTIES ĠOF ĠMERCHANTABILITY , Ċ Ġ* ĠFITNESS ĠFOR ĠA ĠPARTICULAR ĠPURPOSE ĠAND ĠNONINFRINGEMENT . ĠIN ĠNO ĠEVENT ĠSHALL ĠTHE Ċ Ġ* ĠAUTHORS ĠOR ĠCOPYRIGHT ĠHOLDERS ĠBE ĠLIABLE ĠFOR ĠANY ĠCLAIM , ĠDAMAGES ĠOR ĠOTHER Ċ Ġ* ĠLIABILITY , ĠWHETHER ĠIN ĠAN ĠACTION ĠOF ĠCONTRACT , ĠTORT ĠOR ĠOTHERWISE , ĠARISING ĠFROM , Ċ Ġ* ĠOUT ĠOF ĠOR ĠIN ĠCONNECTION ĠWITH ĠTHE ĠSOFTWARE ĠOR ĠTHE ĠUSE ĠOR ĠOTHER ĠDEALINGS ĠIN ĠTHE Ċ Ġ* ĠSOFTWARE . Ċ Ġ*/ Ċ Ċ package Ġdev . v ini 2 0 0 3 . hammer . core . api . common . util Ċ Ċ import Ġdev . v ini 2 0 0 3 . hammer . core . api . client . util . TextUtils . getId Mod Ċ import Ġdev . v ini 2 0 0 3 . hammer . core . api . common . color . Color Ċ import Ġdev . v ini 2 0 0 3 . hammer . core . api . common . util . extension .* Ċ import Ġdev . v ini 2 0 0 3 . hammer . core . registry . common . HC Config Ċ import Ġnet . fabric mc . fabric . api . transfer . v 1 . client . fluid . Fluid Variant Rendering Ċ import Ġnet . fabric mc . fabric . api . transfer . v 1 . fluid . Fluid Constants Ċ import Ġnet . fabric mc . fabric . api . transfer . v 1 . fluid . Fluid Variant Ċ import Ġnet . fabric mc . fabric . api . transfer . v 1 . storage . Storage View Ċ import Ġnet . fabric mc . loader . api . Fabric Loader Ċ import Ġnet . minecraft . text . Mutable Text Ċ import Ġnet . minecraft . text . Text Ċ import Ġnet . minecraft . text . TextColor Ċ import Ġnet . minecraft . util . registry . Registry Ċ Ċ object ĠFluid TextUtils Ġ{ Ċ ĉ @ Jvm Field Ċ ĉ val ĠCOLOR _ OVER RID ES : ĠMutable Map < Fluid Variant , ĠColor > Ġ= Ġmutable Map Of () ĊĉĊ ĉ @ Jvm Static Ċ ĉ fun Ġget Variant Tooltip s ( fluid Variant : ĠFluid Variant ): ĠList < Text > Ġ{ Ċĉ ĉ if Ġ( fluid Variant . isBlank ) Ġreturn ĠlistOf ( TextUtils . EMPTY . gray ()) ĊĉĉĊĉ ĉ val Ġcolor Ġ= ĠText Color . from Rgb ( COLOR _ OVER RID ES . get ( fluid Variant )?. to RGB () Ġ?: ĠFluid Variant Rendering . getColor ( fluid Variant )) ĊĉĉĊĉ ĉ return ĠFluid Variant Rendering . get Tooltip ( fluid Variant ). map Ġ{ Ġtext Ġ-> Ġtext Ġas ĠMutable Text Ġ}. on Each Ġ{ Ġtext Ġ-> Ġtext . styled Ġ{ Ġstyle Ġ-> Ġstyle . with Color ( color ) Ġ} Ġ} Ċ ĉ } ĊĊ ĉ @ Jvm Static Ċ ĉ fun Ġget Short ened Storage Tooltip s ( fluid View : ĠStorage View < Fluid Variant >): ĠList < Text > Ġ{ Ċĉ ĉ val Ġfluid Id Ġ= ĠRegistry . FL UID . getId ( fluid View . resource . fluid ) ĊĉĉĊĉ ĉ if Ġ( HC Config . USE _ DROP LE TS ) Ġ{ Ċĉĉ ĉ return Ġget Variant Tooltip s ( fluid View . resource ) Ġ+ Ġ"${ fluid View . amount . to Pretty Short ened String (" d ")} Ġ/ Ġ${ fluid View . capacity . to Pretty Short ened String (" d ") }". to Literal Text (). gray () Ġ+ ĠgetId Mod ( fluid Id ) Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ return Ġget Variant Tooltip s ( fluid View . resource ) Ġ+ Ġ"${ fluid View . amount . div ( Fluid Constants . BUCKET . toDouble ()). to Pretty Short ened String (" b ")} Ġ/ Ġ${ fluid View . capacity . div ( Fluid Constants . BUCKET . toDouble ()). to Pretty Short ened String (" b ") }". to Literal Text (). gray () Ġ+ ĠgetId Mod ( fluid Id ) Ċĉ ĉ } Ċ ĉ } ĊĉĊ ĉ @ Jvm Static Ċ ĉ fun Ġget Detailed Storage Tooltip s ( fluid View : ĠStorage View < Fluid Variant >): ĠList < Text > Ġ{ Ċĉ ĉ val Ġfluid Id Ġ= ĠRegistry . FL UID . getId ( fluid View . resource . fluid ) ĊĉĉĊĉ ĉ if Ġ( HC Config . USE _ DROP LE TS ) Ġ{ Ċĉĉ ĉ return Ġget Variant Tooltip s ( fluid View . resource ) Ġ+ Ġ"${ fluid View . amount . to Pretty String (" d ")} Ġ/ Ġ${ fluid View . capacity . to Pretty String (" d ") }". to Literal Text (). gray () Ġ+ ĠgetId Mod ( fluid Id ) Ċĉ ĉ } Ġelse Ġ{ Ċĉĉ ĉ return Ġget Variant Tooltip s ( fluid View . resource ) Ġ+ Ġ"${ fluid View . amount . div ( Fluid Constants . BUCKET . toDouble ()). to Pretty String (" b ")} Ġ/ Ġ${ fluid View . capacity . div ( Fluid Constants . BUCKET . toDouble ()). to Pretty String (" b ") }". to Literal Text (). gray () Ġ+ ĠgetId Mod ( fluid Id ) Ċĉ ĉ } Ċ ĉ } Ċ }