Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. package net.minecraft.network.login.client;
  2.  
  3. import com.mojang.authlib.GameProfile;
  4. import java.io.IOException;
  5. import java.util.UUID;
  6. import net.minecraft.network.INetHandler;
  7. import net.minecraft.network.Packet;
  8. import net.minecraft.network.PacketBuffer;
  9. import net.minecraft.network.login.INetHandlerLoginServer;
  10.  
  11. public class C00PacketLoginStart implements Packet
  12. {
  13. private GameProfile profile;
  14.  
  15. public C00PacketLoginStart() {}
  16.  
  17. public C00PacketLoginStart(GameProfile profileIn)
  18. {
  19. this.profile = profileIn;
  20. }
  21.  
  22. /**
  23. * Reads the raw packet data from the data stream.
  24. */
  25. public void readPacketData(PacketBuffer buf) throws IOException
  26. {
  27. this.profile = new GameProfile((UUID)null, buf.readStringFromBuffer(16));
  28. }
  29.  
  30. /**
  31. * Writes the raw packet data to the data stream.
  32. */
  33. public void writePacketData(PacketBuffer buf) throws IOException
  34. {
  35. buf.writeString(this.profile.getName());
  36. }
  37.  
  38. public void processPacket(INetHandlerLoginServer handler)
  39. {
  40. handler.processLoginStart(this);
  41. }
  42.  
  43. public GameProfile getProfile()
  44. {
  45. return this.profile;
  46. }
  47.  
  48. /**
  49. * Passes this Packet on to the NetHandler for processing.
  50. */
  51. public void processPacket(INetHandler handler)
  52. {
  53. this.processPacket((INetHandlerLoginServer)handler);
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement