S02PacketLoginSuccess .java

net.minecraft.network.login.server.S02PacketLoginSuccess (class, 57 lines): members: getProfile, profile, processPacket, readPacketData, writePacketData.

net.minecraft.network.login.serverclass57 linesserver1.4 KB

Implements

API Surface (4)

void readPacketData(PacketBuffer buf)
void writePacketData(PacketBuffer buf)
void processPacket(INetHandlerLoginClient handler)
GameProfile getProfile()

Fields & Constants (1)

profile

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

S02PacketLoginSuccess.java57 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.network.login.server;
2
3
import com.mojang.authlib.GameProfile;
4
import java.io.IOException;
5
import java.util.UUID;
6
import net.minecraft.network.Packet;
7
import net.minecraft.network.PacketBuffer;
8
import net.minecraft.network.login.INetHandlerLoginClient;
9
10
public class S02PacketLoginSuccess implements Packet<INetHandlerLoginClient>
11
{
12
    private GameProfile profile;
13
14
    public S02PacketLoginSuccess()
15
    {
16
    }
17
18
    public S02PacketLoginSuccess(GameProfile profileIn)
19
    {
20
        this.profile = profileIn;
21
    }
22
23
    /**
24
     * Reads the raw packet data from the data stream.
25
     */
26
    public void readPacketData(PacketBuffer buf) throws IOException
27
    {
28
        String s = buf.readStringFromBuffer(36);
29
        String s1 = buf.readStringFromBuffer(16);
30
        UUID uuid = UUID.fromString(s);
31
        this.profile = new GameProfile(uuid, s1);
32
    }
33
34
    /**
35
     * Writes the raw packet data to the data stream.
36
     */
37
    public void writePacketData(PacketBuffer buf) throws IOException
38
    {
39
        UUID uuid = this.profile.getId();
40
        buf.writeString(uuid == null ? "" : uuid.toString());
41
        buf.writeString(this.profile.getName());
42
    }
43
44
    /**
45
     * Passes this Packet on to the NetHandler for processing.
46
     */
47
    public void processPacket(INetHandlerLoginClient handler)
48
    {
49
        handler.handleLoginSuccess(this);
50
    }
51
52
    public GameProfile getProfile()
53
    {
54
        return this.profile;
55
    }
56
}
57

Deobfuscated MCP 1.8.9 source of S02PacketLoginSuccess from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/login/server/S02PacketLoginSuccess.java), stored verbatim.