package Ġme . br am ha ag . min ig ame framework . feature . features Ċ Ċ import Ġme . br am ha ag . min ig ame framework . annotations . Game Event Ċ import Ġme . br am ha ag . min ig ame framework . event . events . game . Game Join Event Ċ import Ġme . br am ha ag . min ig ame framework . feature . Abstract Feature Ċ import Ġme . br am ha ag . min ig ame framework . player . Abstract Player Ċ import Ġme . br am ha ag . min ig ame framework . util . Location Ċ import Ġme . br am ha ag . min ig ame framework . world . Abstract World Ċ import Ġsun . plugin . dom . exception . Invalid StateException ĊĊ Ċ class ĠSpawn Feature Ġ: ĠAbstract Feature () Ġ{ ĊĊĊĠĠĠ Ġprivate Ġvar Ġspawn Points Temp Ġ= ĠArrayList < Location >() ĊĠĠĠ Ġprivate Ġvar Ġspawn Points Ġ= ĠArrayList < Location >() ĊĠĠĠ Ġprivate Ġvar Ġcounter Ġ= Ġ 0 ĊĊĠĠĠ Ġoverride Ġfun Ġenable () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġworld Ġ= Ġphase . get Feature ( World Feature :: class . java )?. world Ġ?: Ġthrow ĠIllegalStateException (" World Ġcannot Ġbe Ġnull ") ĊĊĠĠĠĠĠĠĠ Ġspawn Points Temp . map Ġ{ ĠLocation ( world , Ġit . x , Ġit . y , Ġit . z , Ġit . yaw , Ġit . pitch ) Ġ}. forEach Ġ{ Ġspawn Points . add ( it ) Ġ} ĊĠĠĠĠĠĠĠ Ġphase . game . players . forEach Ġ{ Ġspawn ( it ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Game Event ĊĠĠĠ Ġfun Ġon Join ( e : ĠGame Join Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġspawn ( e . player ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġadd Spawn ( x : ĠDouble , Ġy : ĠDouble , Ġz : ĠDouble , Ġyaw : ĠFloat , Ġpitch : ĠFloat ) Ġ{ ĊĠĠĠĠĠĠĠ Ġspawn Points Temp . add ( Location ( null , Ġx , Ġy , Ġz , Ġyaw , Ġpitch )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġspawn ( player : ĠAbstract Player ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif ( spawn Points . isEmpty ()) Ġthrow ĠInvalid StateException (" Spawn Ġpoints Ġcannot Ġbe Ġempty !") ĊĊĠĠĠĠĠĠĠ Ġif ( counter Ġ> Ġspawn Points . size Ġ- Ġ 1 ) Ġcounter Ġ= Ġ 0 ĊĊĠĠĠĠĠĠĠ Ġval Ġlocation Ġ= Ġspawn Points [ counter ] ĊĠĠĠĠĠĠĠ Ġlocation . world ?. load () ĊĠĠĠĠĠĠĠ Ġplayer . setLocation ( spawn Points [ counter ]) ĊĠĠĠĠĠĠĠ Ġcounter Ġ+= Ġ 1 ĊĠĠĠ Ġ} Ċ }