package Ġmod . luck y . forge čĊč Ċ import Ġmod . luck y . common . GAME _ API č Ċ import Ġmod . luck y . common . PLATFORM _ API č Ċ import Ġmod . luck y . common . LOGGER č Ċ import Ġmod . luck y . java . Java Platform API č Ċ import Ġmod . luck y . forge . game .* č Ċ import Ġmod . luck y . java .* č Ċ import Ġnet . minecraft . client . Minecraft č Ċ import Ġnet . minecraft . resources .* č Ċ import Ġnet . minecraft . server . packs . File Pack Resources č Ċ import Ġnet . minecraft . server . packs . Folder Pack Resources č Ċ import Ġnet . minecraft . server . packs . resources . Simple Reload able ResourceManager č Ċ import Ġnet . minecraft . world . entity . EntityType č Ċ import Ġnet . minecraft . world . entity . Mob Category č Ċ import Ġnet . minecraft . world . item . craft ing . Recipe Serializer č Ċ import Ġnet . minecraft . world . item . craft ing . Simple Recipe Serializer č Ċ import Ġnet . minecraft . world . level . block . entity . Block EntityType č Ċ import Ġnet . minecraft . world . level . level gen . Generation Step č Ċ import Ġnet . minecraft . world . level . level gen . feature . configurations . None Feature Configuration č Ċ import Ġnet . minecraftforge . api . dist marker . Dist č Ċ import Ġnet . minecraftforge . client . event . Entity Render ers Event č Ċ import Ġnet . minecraftforge . common . Minecraft Forge č Ċ import Ġnet . minecraftforge . event . Registry Event č Ċ import Ġnet . minecraftforge . event . world . Bio me Loading Event č Ċ import Ġnet . minecraftforge . event . world . World Event č Ċ import Ġnet . minecraftforge . event bus . api . Subscribe Event č Ċ import Ġnet . minecraftforge . fml . Mod Loading Context č Ċ import Ġnet . minecraftforge . fml . common . Mod č Ċ import Ġnet . minecraftforge . fml . common . Mod . EventBus Subscriber č Ċ import Ġnet . minecraftforge . fml . event . lifecycle . F ML Client Setup Event č Ċ import Ġnet . minecraftforge . fml . event . lifecycle . F ML Common Setup Event č Ċ import Ġnet . minecraftforge . fml . java fml mod . F ML Java Mod Loading Context č Ċ import Ġnet . minecraftforge . regist ries . Forge Regist ries č Ċ import Ġorg . apache . logging . log 4 j . Log Manager č Ċ import Ġorg . apache . logging . log 4 j . Logger čĊč Ċ object ĠFor ge L uck y Registry Ġ{ čĊĠĠĠ Ġval ĠLOGGER : ĠLogger Ġ= ĠLog Manager . getLogger () čĊĠĠĠ Ġval Ġluck y Block Ġ= ĠL uck y Block () čĊĠĠĠ Ġval Ġaddon L uck y Blocks Ġ= ĠHashMap < String , ĠL uck y Block >() čĊĠĠĠ Ġval Ġluck y Block Item Ġ= ĠL uck y Block Item ( luck y Block ) čĊĠĠĠ Ġval Ġluck yB ow Ġ= ĠL uck yB ow () čĊĠĠĠ Ġval Ġluck y S word Ġ= ĠL uck y S word () čĊĠĠĠ Ġval Ġluck y P otion Ġ= ĠL uck y P otion () čĊĠĠĠ Ġlateinit Ġvar Ġmod Version : ĠString čĊĠĠĠ Ġlateinit Ġvar Ġluck y Block Entity : ĠBlock EntityType < L uck y Block Entity > čĊĠĠĠ Ġlateinit Ġvar Ġluck y Projectile : ĠEntityType < L uck y Projectile > čĊĠĠĠ Ġlateinit Ġvar Ġthrown L uck y P otion : ĠEntityType < Thrown L uck y P otion > čĊĠĠĠ Ġlateinit Ġvar Ġdelayed Drop : ĠEntityType < Delayed Drop > čĊĠĠĠ Ġlateinit Ġvar Ġluck Modifier Craft ing Recipe : ĠRecipe Serializer < L uck Modifier Craft ing Recipe > čĊĠĠĠ Ġlateinit Ġvar Ġaddon Craft ing Recipe : ĠRecipe Serializer < Addon Craft ing Recipe > č Ċ } čĊč Ċ private Ġfun Ġget Addon Block ( id : ĠString ): ĠL uck y Block Ġ{ čĊĠĠĠ Ġreturn ĠFor ge L uck y Registry . addon L uck y Blocks . getOrElse ( id , Ġ{ čĊĠĠĠĠĠĠĠ Ġval Ġblock Ġ= ĠL uck y Block () čĊĠĠĠĠĠĠĠ ĠFor ge L uck y Registry . addon L uck y Blocks [ id ] Ġ= Ġblock čĊĠĠĠĠĠĠĠ Ġblock čĊĠĠĠ Ġ}) č Ċ } čĊč Ċ @ Mod (" luck y ") č Ċ class ĠFor ge Mod Ġ{ čĊĠĠĠ Ġinit Ġ{ čĊĠĠĠĠĠĠĠ ĠPLATFORM _ API Ġ= ĠJava Platform API čĊĠĠĠĠĠĠĠ ĠLOGGER Ġ= ĠFor ge Game API čĊĠĠĠĠĠĠĠ ĠGAME _ API Ġ= ĠFor ge Game API čĊĠĠĠĠĠĠĠ ĠJAVA _ GAME _ API Ġ= ĠFor ge Java Game API čĊčĊĠĠĠĠĠĠĠ ĠFor ge L uck y Registry . mod Version Ġ= ĠMod Loading Context . get (). active Container . mod Info . version . toString () čĊčĊĠĠĠĠĠĠĠ ĠFor ge Game API . init () čĊĠĠĠĠĠĠĠ ĠJava L uck y Registry . init () čĊčĊĠĠĠĠĠĠĠ ĠF ML Java Mod Loading Context . get (). mod EventBus čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. addListener Ġ{ Ġ_: ĠF ML Common Setup Event Ġ-> Ġsetup Common () Ġ} čĊĠĠĠĠĠĠĠ ĠF ML Java Mod Loading Context . get (). mod EventBus čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. addListener { Ġ_: ĠF ML Client Setup Event Ġ-> Ġsetup Client () Ġ} čĊĠĠĠĠĠĠĠ ĠMinecraft Forge . EVENT _ BUS . addListener Ġ{ Ġevent : ĠBio me Loading Event Ġ-> čĊĠĠĠĠĠĠĠĠĠĠĠ Ġregister Bio me Features ( event ) čĊĠĠĠĠĠĠĠ Ġ} čĊĠĠĠĠĠĠĠ ĠMinecraft Forge . EVENT _ BUS . register ( this ) čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġprivate Ġfun Ġregister Bio me Features ( event : ĠBio me Loading Event ) Ġ{ čĊĠĠĠĠĠĠĠ Ġval Ġblock Ids Ġ= ĠlistOf ( Java L uck y Registry . block Id ) Ġ+ ĠJava L uck y Registry . addons . map NotNull Ġ{ Ġit . ids . block Ġ} čĊĠĠĠĠĠĠĠ Ġblock Ids . forEach Ġ{ čĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġfeature Ġ= ĠL uck y World Feature ( None Feature Configuration . CODEC , Ġit ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġplaced Feature Ġ= Ġfeature . configured ( None Feature Configuration . INSTANCE ). placed () čĊĠĠĠĠĠĠĠĠĠĠĠ Ġevent . generation . get Features ( Generation Step . Decoration . SURFACE _ STRUCTURE S ). add Ġ{ Ġplaced Feature Ġ} čĊĠĠĠĠĠĠĠ Ġ} čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġprivate Ġfun Ġsetup Common () Ġ{ čĊĠĠĠĠĠĠĠ Ġregister Addon Craft ing Recipes () čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġ@ Only In Client čĊĠĠĠ Ġprivate Ġfun Ġsetup Client () Ġ{ čĊĠĠĠĠĠĠĠ ĠMinecraft Forge . EVENT _ BUS . addListener Ġ{ Ġ_: ĠWorld Event . Load Ġ-> čĊĠĠĠĠĠĠĠĠĠĠĠ ĠJava L uck y Registry . notification State Ġ= Ġcheck For Updates ( Java L uck y Registry . notification State ) čĊĠĠĠĠĠĠĠ Ġ} čĊčĊĠĠĠĠĠĠĠ Ġfor Ġ( addon Ġin ĠJava L uck y Registry . addons ) Ġ{ čĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġfile Ġ= Ġaddon . file čĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġpack Ġ= Ġif Ġ( file . isDirectory ) ĠFolder Pack Resources ( file ) Ġelse ĠFile Pack Resources ( file ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġresource Manager Ġ= ĠMinecraft . getInstance (). resource Manager čĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( resource Manager Ġis ĠSimple Reload able ResourceManager ) Ġ{ čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġresource Manager . add ( pack ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} čĊĠĠĠĠĠĠĠ Ġ} čĊčĊĠĠĠĠĠĠĠ Ġregister L uck yB ow Models ( Forge L uck y Registry . luck yB ow ) čĊĠĠĠĠĠĠĠ ĠJava L uck y Registry . addons . map Ġ{ Ġaddon Ġ-> čĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( addon . ids . bow Ġ!= Ġnull ) Ġregister L uck yB ow Models ( Forge Regist ries . ITEMS . getValue ( MC Identifier ( addon . ids . bow !! )) Ġas ĠL uck yB ow ) čĊĠĠĠĠĠĠĠ Ġ} čĊĠĠĠ Ġ} č Ċ } čĊč Ċ @ EventBus Subscriber ( bus Ġ= ĠEvent Bus Subscriber . Bus . MOD ) č Ċ object ĠFor ge Subscriber Ġ{ čĊĠĠĠ Ġ@ Jvm Static Ġ@ Subscribe Event čĊĠĠĠ Ġfun Ġregister Blocks ( event : ĠRegistry Event . Register < MC Block >) Ġ{ čĊĠĠĠĠĠĠĠ Ġevent . registry . register ( Forge L uck y Registry . luck y Block . set Registry Name ( Java L uck y Registry . block Id )) čĊĠĠĠĠĠĠĠ ĠJava L uck y Registry . addons . map Ġ{ Ġaddon Ġ-> čĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( addon . ids . block Ġ!= Ġnull ) Ġ{ čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġevent . registry . register ( get Addon Block ( addon . ids . block !! ). set Registry Name ( addon . ids . block )) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} čĊĠĠĠĠĠĠĠ Ġ} čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġ@ Jvm Static Ġ@ Subscribe Event čĊĠĠĠ Ġfun Ġregister Items ( event : ĠRegistry Event . Register < MC Item >) Ġ{ čĊĠĠĠĠĠĠĠ Ġevent . registry . register ( Forge L uck y Registry . luck y Block Item . set Registry Name ( Java L uck y Registry . block Id )) čĊĠĠĠĠĠĠĠ Ġevent . registry . register ( Forge L uck y Registry . luck y S word . set Registry Name ( Java L uck y Registry . s word Id )) čĊĠĠĠĠĠĠĠ Ġevent . registry . register ( Forge L uck y Registry . luck yB ow . set Registry Name ( Java L uck y Registry . bow Id )) čĊĠĠĠĠĠĠĠ Ġevent . registry . register ( Forge L uck y Registry . luck y P otion . set Registry Name ( Java L uck y Registry . p otion Id )) čĊčĊĠĠĠĠĠĠĠ ĠJava L uck y Registry . addons . map Ġ{ Ġaddon Ġ-> čĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( addon . ids . block Ġ!= Ġnull ) Ġ{ čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġblock Ġ= ĠFor ge L uck y Registry . addon L uck y Blocks . getOrElse ( addon . ids . block !! , Ġ{ ĠL uck y Block () Ġ}) čĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġevent . registry . register ( L uck y Block Item ( block ). set Registry Name ( block . registry Name )) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} čĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( addon . ids . s word Ġ!= Ġnull ) Ġevent . registry . register ( L uck y S word (). set Registry Name ( addon . ids . s word )) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( addon . ids . bow Ġ!= Ġnull ) Ġevent . registry . register ( L uck yB ow (). set Registry Name ( addon . ids . bow )) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( addon . ids . p otion Ġ!= Ġnull ) Ġevent . registry . register ( L uck y P otion (). set Registry Name ( addon . ids . p otion )) čĊĠĠĠĠĠĠĠ Ġ} čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġ@ Jvm Static Ġ@ Subscribe Event čĊĠĠĠ Ġfun Ġregister Ent ites ( event : ĠRegistry Event . Register < EntityType <* >>) Ġ{ čĊĠĠĠĠĠĠĠ ĠFor ge L uck y Registry . luck y Projectile Ġ= ĠEntityType . Builder . of (:: L uck y Projectile , ĠMob Category . MISC ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Tracking Range ( 1 0 0 ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Update Interval ( 2 0 ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Should Receive Velocity Updates ( true ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build ( Java L uck y Registry . project ile Id ) čĊčĊĠĠĠĠĠĠĠ ĠFor ge L uck y Registry . throw n L uck y P otion Ġ= ĠEntityType . Builder . of (:: Thrown L uck y P otion , ĠMob Category . MISC ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Tracking Range ( 1 0 0 ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Update Interval ( 2 0 ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Should Receive Velocity Updates ( true ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build ( Java L uck y Registry . p otion Id ) čĊčĊĠĠĠĠĠĠĠ ĠFor ge L uck y Registry . delayed Drop Ġ= ĠEntityType . Builder . of (:: Delayed Drop , ĠMob Category . MISC ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Tracking Range ( 1 0 0 ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Update Interval ( 2 0 ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. set Should Receive Velocity Updates ( true ) čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build ( Java L uck y Registry . p otion Id ) čĊčĊĠĠĠĠĠĠĠ Ġevent . registry . register ( Forge L uck y Registry . luck y Projectile . set Registry Name ( Java L uck y Registry . project ile Id )) čĊĠĠĠĠĠĠĠ Ġevent . registry . register ( Forge L uck y Registry . throw n L uck y P otion . set Registry Name ( Java L uck y Registry . p otion Id )) čĊĠĠĠĠĠĠĠ Ġevent . registry . register ( Forge L uck y Registry . delayed Drop . set Registry Name ( Java L uck y Registry . delayed Drop Id )) čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġ@ Jvm Static Ġ@ Subscribe Event čĊĠĠĠ Ġfun Ġregister Recipes ( event : ĠRegistry Event . Register < Recipe Serializer <* >>) Ġ{ čĊĠĠĠĠĠĠĠ ĠFor ge L uck y Registry . luck Modifier Craft ing Recipe Ġ= ĠSimple Recipe Serializer (:: L uck Modifier Craft ing Recipe ) čĊĠĠĠĠĠĠĠ ĠFor ge L uck y Registry . addon Craft ing Recipe Ġ= ĠSimple Recipe Serializer (:: Addon Craft ing Recipe ) čĊčĊĠĠĠĠĠĠĠ Ġevent . registry . register ( Forge L uck y Registry . luck Modifier Craft ing Recipe . set Registry Name ( Resource Location (" luck y : craft ing _ luck "))) čĊĠĠĠĠĠĠĠ Ġevent . registry . register ( Forge L uck y Registry . addon Craft ing Recipe . set Registry Name ( Resource Location (" luck y : craft ing _ addons "))) čĊĠĠĠ Ġ} čĊčĊĠĠĠ Ġ@ Jvm Static Ġ@ Subscribe Event čĊĠĠĠ Ġfun Ġregister Tile Ent ites ( event : ĠRegistry Event . Register < Block EntityType <* >>) Ġ{ čĊĠĠĠĠĠĠĠ Ġval Ġvalid Blocks Ġ= ĠlistOf ( Forge L uck y Registry . luck y Block ) Ġ+ ĠJava L uck y Registry . addons čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map NotNull Ġ{ Ġit . ids . block Ġ} čĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġget Addon Block ( it ) Ġ} čĊčĊĠĠĠĠĠĠĠ ĠFor ge L uck y Registry . luck y Block Entity Ġ= Ġ@ Suppress ĠBlock EntityType . Builder . of (:: L uck y Block Entity , Ġ* valid Blocks . to Typed Array ()). build ( null ) čĊčĊĠĠĠĠĠĠĠ Ġevent . registry . register ( Forge L uck y Registry . luck y Block Entity . set Registry Name ( Java L uck y Registry . block Id )) čĊĠĠĠ Ġ} č Ċ } čĊč Ċ @ EventBus Subscriber ( Dist . CLIENT , Ġbus Ġ= ĠEvent Bus Subscriber . Bus . MOD ) č Ċ object ĠFor ge Client Subscriber Ġ{ čĊĠĠĠ Ġ@ Jvm Static Ġ@ Subscribe Event čĊĠĠĠ Ġfun Ġregister Entity Render ers ( event : ĠEntity Render ers Event . Register Render ers ) Ġ{ čĊĠĠĠĠĠĠĠ Ġevent . register Entity Renderer ( Forge L uck y Registry . luck y Projectile , Ġ:: L uck y Projectile Renderer ) čĊĠĠĠĠĠĠĠ Ġevent . register Entity Renderer ( Forge L uck y Registry . throw n L uck y P otion , Ġ:: Thrown L uck y P otion Renderer ) čĊĠĠĠĠĠĠĠ Ġevent . register Entity Renderer ( Forge L uck y Registry . delayed Drop , Ġ:: Delayed Drop Renderer ) čĊĠĠĠ Ġ} č Ċ } čĊ