package Ġnet . star legacy . feature . star ship . subsystem . weapon . secondary Ċ Ċ import Ġjava . util . concurrent . TimeUnit Ċ import Ġnet . star legacy . feature . misc . Custom Items Ċ import Ġnet . star legacy . feature . mult ib lock . star ship weapon . heavy . Rocket Star ship Weapon Mult ib lock Ċ import Ġnet . star legacy . feature . star ship . active . Active Star ship Ċ import Ġnet . star legacy . feature . star ship . subsystem . Direction al Subsystem Ċ import Ġnet . star legacy . feature . star ship . subsystem . weapon . Weapon Subsystem Ċ import Ġnet . star legacy . feature . star ship . subsystem . weapon . interfaces . Ammo Consum ing Weapon Subsystem Ċ import Ġnet . star legacy . feature . star ship . subsystem . weapon . interfaces . He avy Weapon Subsystem Ċ import Ġnet . star legacy . feature . star ship . subsystem . weapon . interfaces . Manual Weapon Subsystem Ċ import Ġnet . star legacy . feature . star ship . subsystem . weapon . project ile . Rocket Projectile Ċ import Ġnet . star legacy . util . Vec 3 i Ċ import Ġnet . star legacy . util . left Face Ċ import Ġnet . star legacy . util . right Face Ċ import Ġnet . star legacy . util . vector To Block Face Ċ import Ġorg . bukkit . block . Block Face Ċ import Ġorg . bukkit . entity . Player Ċ import Ġorg . bukkit . inventory . ItemStack Ċ import Ġorg . bukkit . util . Vector Ċ Ċ class ĠRocket Weapon Subsystem ( Ċ ĉ star ship : ĠActive Star ship , Ċ ĉ pos : ĠVec 3 i , Ċ ĉ override Ġvar Ġface : ĠBlock Face , Ċ ĉ private Ġval Ġmult ib lock : ĠRocket Star ship Weapon Mult ib lock Ċ ) Ġ: ĠWeapon Subsystem ( star ship , Ġpos ), Ċ ĉ He avy Weapon Subsystem , Ċ ĉ Direction al Subsystem , Ċ ĉ Manual Weapon Subsystem , Ċ ĉ Ammo Consum ing Weapon Subsystem Ġ{ Ċ ĉ override Ġval Ġpower Usage : ĠInt Ġ= Ġ 5 0 _ 0 0 0 ĊĊ ĉ override Ġval Ġboost Charge Nan os : ĠLong Ġ= ĠTimeUnit . SECONDS . to Nan os ( 7 L ) ĊĊ ĉ override Ġfun Ġis Accept able Direction ( face : ĠBlock Face ): ĠBoolean Ġ{ Ċĉ ĉ return Ġtrue Ċ ĉ } ĊĊ ĉ override Ġfun Ġget Adjust ed Dir ( dir : ĠVector , Ġtarget : ĠVector ?): ĠVector Ġ{ Ċĉ ĉ return Ġdir Ċ ĉ } ĊĊ ĉ override Ġfun Ġcan Fire ( dir : ĠVector , Ġtarget : ĠVector ?): ĠBoolean Ġ{ Ċĉ ĉ if Ġ( vector To Block Face ( dir , Ġinclude Vertical Ġ= Ġtrue ) Ġ!= Ġthis . face ) Ġ{ Ċĉĉ ĉ return Ġfalse Ċĉ ĉ } ĊĊĉ ĉ val Ġfire Pos Ġ= Ġget Fire Pos () ĊĊĉ ĉ for Ġ( offset Ġin Ġget Sur rounding Faces ()) Ġ{ Ċĉĉ ĉ val Ġorigin Ġ= ĠVec 3 i ( fire Pos . clone (). add ( offset . direction )) ĊĊĉĉ ĉ if Ġ( star ship . isIn tern ally Ob struct ed ( origin , Ġdir )) Ġ{ Ċĉĉĉ ĉ return Ġfalse Ċĉĉ ĉ } Ċĉ ĉ } ĊĊĉ ĉ return Ġtrue Ċ ĉ } ĊĊ ĉ private Ġfun Ġget Sur rounding Faces (): ĠArray < Block Face > Ġ{ Ċĉ ĉ if Ġ( face . mod Y Ġ== Ġ 0 ) Ġ{ Ċĉĉ ĉ return ĠarrayOf ( Block Face . SELF , Ġface . right Face , Ġface . left Face , ĠBlock Face . UP , ĠBlock Face . DOWN ) Ċĉ ĉ } ĊĊĉ ĉ return ĠarrayOf ( Block Face . SELF , ĠBlock Face . EAST , ĠBlock Face . WEST , ĠBlock Face . NORTH , ĠBlock Face . SO UTH ) Ċ ĉ } ĊĊ ĉ private Ġfun Ġget Fire Pos (): ĠVector Ġ{ Ċĉ ĉ return Ġpos . to Vector (). add ( face . direction . clone (). multiply ( 3 . 0 )). add ( Vector ( 0 . 5 , Ġ 0 . 5 , Ġ 0 . 5 )) Ċ ĉ } ĊĊ ĉ override Ġfun Ġis Int act (): ĠBoolean Ġ{ Ċĉ ĉ val Ġblock Ġ= Ġpos . to Location ( star ship . world ). block Ċĉ ĉ val Ġin ward Ġ= Ġif Ġ( face Ġin ĠarrayOf ( Block Face . UP , ĠBlock Face . DOWN )) ĠBlock Face . NORTH Ġelse Ġface Ċĉ ĉ return Ġmult ib lock . block Matches Structure ( block , Ġin ward ) Ċ ĉ } ĊĊ ĉ override Ġfun Ġmanual Fire ( sh ooter : ĠPlayer , Ġdir : ĠVector , Ġtarget : ĠVector ?) Ġ{ Ċĉ ĉ val Ġorigin Ġ= Ġget Fire Pos (). to Location ( star ship . world ) Ċĉ ĉ val Ġproject ile Ġ= ĠRocket Projectile ( star ship , Ġorigin , Ġthis . face , Ġsh ooter ) Ċĉ ĉ project ile . fire () Ċ ĉ } ĊĊ ĉ override Ġfun Ġget Required Ammo (): ĠItemStack Ġ{ Ċĉ ĉ return ĠCustom Items . RO CKET _ OR IO MI UM . single Item () Ċ ĉ } Ċ } Ċ