S48PacketResourcePackSend .java

net.minecraft.network.play.server.S48PacketResourcePackSend (class): members: getHash, getURL, url, hash, processPacket, readPacketData, writePacketData.

net.minecraft.network.play.serverclass64 linesserver1.4 KB

Implements

API Surface (5)

void readPacketData(PacketBuffer buf)
void writePacketData(PacketBuffer buf)
void processPacket(INetHandlerPlayClient handler)
String getURL()
String getHash()

Fields & Constants (2)

url
hash

String literals (1)

"Hash is too long (max 40, was "

Code Graph: Dependencies (3)

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

Full Source

S48PacketResourcePackSend.java64 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.network.play.server;
2
3
import java.io.IOException;
4
import net.minecraft.network.Packet;
5
import net.minecraft.network.PacketBuffer;
6
import net.minecraft.network.play.INetHandlerPlayClient;
7
8
public class S48PacketResourcePackSend implements Packet<INetHandlerPlayClient>
9
{
10
    private String url;
11
    private String hash;
12
13
    public S48PacketResourcePackSend()
14
    {
15
    }
16
17
    public S48PacketResourcePackSend(String url, String hash)
18
    {
19
        this.url = url;
20
        this.hash = hash;
21
22
        if (hash.length() > 40)
23
        {
24
            throw new IllegalArgumentException("Hash is too long (max 40, was " + hash.length() + ")");
25
        }
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.url = buf.readStringFromBuffer(32767);
34
        this.hash = buf.readStringFromBuffer(40);
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.url);
43
        buf.writeString(this.hash);
44
    }
45
46
    /**
47
     * Passes this Packet on to the NetHandler for processing.
48
     */
49
    public void processPacket(INetHandlerPlayClient handler)
50
    {
51
        handler.handleResourcePack(this);
52
    }
53
54
    public String getURL()
55
    {
56
        return this.url;
57
    }
58
59
    public String getHash()
60
    {
61
        return this.hash;
62
    }
63
}
64

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