package Ġcom . exp an se mc . town ship . plugin . command Ċ Ċ import Ġcom . exp an se mc . town ship . plugin . storage . dao . Res ident Dao Ċ import Ġcom . exp an se mc . town ship . plugin . storage . dao . Town Claim Dao Ċ import Ġcom . exp an se mc . town ship . plugin . storage . dao . Town Dao Ċ import Ġcom . exp an se mc . town ship . plugin . util . unwrap Ċ import Ġnet . ky ori . ad venture . text . Text Component Ċ import Ġorg . spongepowered . api . command . exception . Command Exception Ċ import Ġorg . spongepowered . api . command . parameter . Command Context Ċ import Ġorg . spongepowered . api . entity . living . player . server . Server Player Ċ import Ġorg . spongepowered . api . world . Server Location Ċ Ċ fun ĠCommand Context . get Self Res ident (): ĠRes ident Dao ? Ġ= ĊĠĠĠ Ġthis . cause . first ( Server Player :: class . java ). unwrap ()?. let Ġ{ ĠRes ident Dao . findBy Player Id ( it . unique Id ) Ġ} Ċ Ċ fun ĠCommand Context . require Self Res ident (): ĠRes ident Dao Ġ= ĊĠĠĠ Ġthis . get Self Res ident () ĊĠĠĠĠĠĠĠ Ġ?: Ġthrow ĠCommand Exception ( Text Component . of (" You Ġmust Ġbe Ġa Ġres ident Ġto Ġdo Ġthat .")) Ċ Ċ fun ĠCommand Context . get Own Town (): ĠT own Dao ? Ġ= ĊĠĠĠ Ġthis . get Self Res ident ()?. cit izen ?. town Ċ Ċ fun ĠCommand Context . require Own Town (): ĠT own Dao Ġ= ĊĠĠĠ Ġthis . get Own Town () ĊĠĠĠĠĠĠĠ Ġ?: Ġthrow ĠCommand Exception ( Text Component . of (" You Ġmust Ġbe Ġin Ġa Ġtown Ġto Ġdo Ġthat .")) Ċ Ċ fun ĠCommand Context . require In Claim ( town : ĠT own Dao ?): ĠT own Claim Dao Ġ{ ĊĠĠĠ Ġval Ġlocation : ĠServer Location Ġ= Ġthis . cause . location . unwrap () ĊĠĠĠĠĠĠĠ Ġ?: Ġthrow ĠCommand Exception ( Text Component . of (" You Ġmust Ġbe Ġlo cat able Ġto Ġuse Ġthis Ġcommand .")) ĊĠĠĠ Ġval Ġclaim : ĠT own Claim Dao Ġ= ĠT own Claim Dao . get Claim At ( location ) ĊĠĠĠĠĠĠĠ Ġ?: Ġthrow ĠCommand Exception ( Text Component . of (" You Ġmust Ġbe Ġwithin Ġa Ġtown Ġclaim Ġto Ġdo Ġthat .")) ĊĠĠĠ Ġif Ġ( town Ġ!= Ġnull Ġ&& Ġclaim . town Ġ!= Ġtown ) Ġ{ ĊĠĠĠĠĠĠĠ Ġthrow ĠCommand Exception ( Text Component . of (" You Ġmust Ġbe Ġwithin Ġa Ġtown Ġclaim Ġof Ġ${ town . name } Ġto Ġdo Ġthat .")) ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġclaim Ċ }