C19PacketResourcePackStatus .java

net.minecraft.network.play.client.C19PacketResourcePackStatus (class): members: status, hash, Action, processPacket, readPacketData, writePacketData.

net.minecraft.network.play.clientclass62 linesclient1.5 KB

Implements

API Surface (3)

void readPacketData(PacketBuffer buf)
void writePacketData(PacketBuffer buf)
void processPacket(INetHandlerPlayServer handler)

Fields & Constants (2)

hash
status

Code Graph: Dependencies (4)

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

Full Source

C19PacketResourcePackStatus.java62 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.network.play.client;
2
3
import java.io.IOException;
4
import net.minecraft.network.Packet;
5
import net.minecraft.network.PacketBuffer;
6
import net.minecraft.network.play.INetHandlerPlayServer;
7
8
public class C19PacketResourcePackStatus implements Packet<INetHandlerPlayServer>
9
{
10
    private String hash;
11
    private C19PacketResourcePackStatus.Action status;
12
13
    public C19PacketResourcePackStatus()
14
    {
15
    }
16
17
    public C19PacketResourcePackStatus(String hashIn, C19PacketResourcePackStatus.Action statusIn)
18
    {
19
        if (hashIn.length() > 40)
20
        {
21
            hashIn = hashIn.substring(0, 40);
22
        }
23
24
        this.hash = hashIn;
25
        this.status = statusIn;
26
    }
27
28
    /**
29
     * Reads the raw packet data from the data stream.
30
     */
31
    public void readPacketData(PacketBuffer buf) throws IOException
32
    {
33
        this.hash = buf.readStringFromBuffer(40);
34
        this.status = (C19PacketResourcePackStatus.Action)buf.readEnumValue(C19PacketResourcePackStatus.Action.class);
35
    }
36
37
    /**
38
     * Writes the raw packet data to the data stream.
39
     */
40
    public void writePacketData(PacketBuffer buf) throws IOException
41
    {
42
        buf.writeString(this.hash);
43
        buf.writeEnumValue(this.status);
44
    }
45
46
    /**
47
     * Passes this Packet on to the NetHandler for processing.
48
     */
49
    public void processPacket(INetHandlerPlayServer handler)
50
    {
51
        handler.handleResourcePackStatus(this);
52
    }
53
54
    public static enum Action
55
    {
56
        SUCCESSFULLY_LOADED,
57
        DECLINED,
58
        FAILED_DOWNLOAD,
59
        ACCEPTED;
60
    }
61
}
62

Deobfuscated MCP 1.8.9 source of C19PacketResourcePackStatus from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/client/C19PacketResourcePackStatus.java), stored verbatim.