/* Ċ Ġ* ĠTer re Ċ Ġ* Ċ Ġ* ĠCopyright Ġ( c ) ĠL an tern Power ed Ġ< https :// www . lan tern powered . org > Ċ Ġ* ĠCopyright Ġ( c ) Ġcontributors Ċ Ġ* Ċ Ġ* ĠThis Ġwork Ġis Ġlicensed Ġunder Ġthe Ġterms Ġof Ġthe ĠMIT ĠLicense Ġ( MIT ). ĠFor Ċ Ġ* Ġa Ġcopy , Ġsee Ġ' LICENSE . txt ' Ġor Ġ< https :// opensource . org / licenses / MIT >. Ċ Ġ*/ Ċ package Ġorg . lan tern powered . ter re . impl . network . packet Ċ Ċ import Ġorg . lan tern powered . ter re . impl . network . Packet Ċ import Ġorg . lan tern powered . ter re . impl . network . buffer . Player Id Ċ import Ġorg . lan tern powered . ter re . impl . network . buffer . read Player Id Ċ import Ġorg . lan tern powered . ter re . impl . network . buffer . read Vec 2 f Ċ import Ġorg . lan tern powered . ter re . impl . network . buffer . write Player Id Ċ import Ġorg . lan tern powered . ter re . impl . network . buffer . write Vec 2 f Ċ import Ġorg . lan tern powered . ter re . impl . network . Packet Decoder Ċ import Ġorg . lan tern powered . ter re . impl . network . Packet Encoder Ċ import Ġorg . lan tern powered . ter re . math . Vec 2 f Ċ Ċ internal Ġdata Ġclass ĠPlayer Teleport Through Portal Packet ( ĊĠ Ġval Ġplayer Id : ĠPlayer Id , ĊĠ Ġval Ġcolor Index : ĠInt , ĊĠ Ġval Ġposition : ĠVec 2 f , ĊĠ Ġval Ġvelocity : ĠVec 2 f Ċ ) Ġ: ĠPacket Ċ Ċ internal Ġval ĠPlayer Teleport Through Portal Encoder Ġ= ĠPacket Encoder < Player Teleport Through Portal Packet > Ġ{ Ġbuf , Ġpacket Ġ-> ĊĠ Ġbuf . write Player Id ( packet . player Id ) ĊĠ Ġbuf . write Short LE ( packet . color Index ) ĊĠ Ġbuf . write Vec 2 f ( packet . position ) ĊĠ Ġbuf . write Vec 2 f ( packet . velocity ) Ċ } Ċ Ċ internal Ġval ĠPlayer Teleport Through Portal Decoder Ġ= ĠPacket Decoder Ġ{ Ġbuf Ġ-> ĊĠ Ġval Ġplayer Id Ġ= Ġbuf . read Player Id () ĊĠ Ġval Ġcolor Index Ġ= Ġbuf . read Short LE (). toInt () ĊĠ Ġval Ġposition Ġ= Ġbuf . read Vec 2 f () ĊĠ Ġval Ġvelocity Ġ= Ġbuf . read Vec 2 f () ĊĠ ĠPlayer Teleport Through Portal Packet ( player Id , Ġcolor Index , Ġposition , Ġvelocity ) Ċ } Ċ