S2FPacketSetSlot .java

net.minecraft.network.play.server.S2FPacketSetSlot (class): members: func_149173_d, func_149174_e, func_149175_c, slot, item, windowId, processPacket.

net.minecraft.network.play.serverclass69 linesserver1.6 KB

Implements

API Surface (6)

void processPacket(INetHandlerPlayClient handler)
void readPacketData(PacketBuffer buf)
void writePacketData(PacketBuffer buf)
int func_149175_c()
int func_149173_d()
ItemStack func_149174_e()

Fields & Constants (3)

windowId
slot
item

Code Graph: Dependencies (4)

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

Full Source

S2FPacketSetSlot.java69 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.network.play.server;
2
3
import java.io.IOException;
4
import net.minecraft.item.ItemStack;
5
import net.minecraft.network.Packet;
6
import net.minecraft.network.PacketBuffer;
7
import net.minecraft.network.play.INetHandlerPlayClient;
8
9
public class S2FPacketSetSlot implements Packet<INetHandlerPlayClient>
10
{
11
    private int windowId;
12
    private int slot;
13
    private ItemStack item;
14
15
    public S2FPacketSetSlot()
16
    {
17
    }
18
19
    public S2FPacketSetSlot(int windowIdIn, int slotIn, ItemStack itemIn)
20
    {
21
        this.windowId = windowIdIn;
22
        this.slot = slotIn;
23
        this.item = itemIn == null ? null : itemIn.copy();
24
    }
25
26
    /**
27
     * Passes this Packet on to the NetHandler for processing.
28
     */
29
    public void processPacket(INetHandlerPlayClient handler)
30
    {
31
        handler.handleSetSlot(this);
32
    }
33
34
    /**
35
     * Reads the raw packet data from the data stream.
36
     */
37
    public void readPacketData(PacketBuffer buf) throws IOException
38
    {
39
        this.windowId = buf.readByte();
40
        this.slot = buf.readShort();
41
        this.item = buf.readItemStackFromBuffer();
42
    }
43
44
    /**
45
     * Writes the raw packet data to the data stream.
46
     */
47
    public void writePacketData(PacketBuffer buf) throws IOException
48
    {
49
        buf.writeByte(this.windowId);
50
        buf.writeShort(this.slot);
51
        buf.writeItemStackToBuffer(this.item);
52
    }
53
54
    public int func_149175_c()
55
    {
56
        return this.windowId;
57
    }
58
59
    public int func_149173_d()
60
    {
61
        return this.slot;
62
    }
63
64
    public ItemStack func_149174_e()
65
    {
66
        return this.item;
67
    }
68
}
69

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