C0EPacketClickWindow .java

net.minecraft.network.play.client.C0EPacketClickWindow (class): members: getClickedItem, getUsedButton, clickedItem, usedButton, getMode, mode, getSlotId.

net.minecraft.network.play.clientclass107 linesclient2.6 KB

Implements

API Surface (9)

void processPacket(INetHandlerPlayServer handler)
void readPacketData(PacketBuffer buf)
void writePacketData(PacketBuffer buf)
int getWindowId()
int getSlotId()
int getUsedButton()
short getActionNumber()
ItemStack getClickedItem()
int getMode()

Fields & Constants (6)

windowId
slotId
usedButton
actionNumber
clickedItem
mode

Code Graph: Dependencies (4)

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

Full Source

C0EPacketClickWindow.java107 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.network.play.client;
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.INetHandlerPlayServer;
8
9
public class C0EPacketClickWindow implements Packet<INetHandlerPlayServer>
10
{
11
    /** The id of the window which was clicked. 0 for player inventory. */
12
    private int windowId;
13
14
    /** Id of the clicked slot */
15
    private int slotId;
16
17
    /** Button used */
18
    private int usedButton;
19
20
    /** A unique number for the action, used for transaction handling */
21
    private short actionNumber;
22
23
    /** The item stack present in the slot */
24
    private ItemStack clickedItem;
25
26
    /** Inventory operation mode */
27
    private int mode;
28
29
    public C0EPacketClickWindow()
30
    {
31
    }
32
33
    public C0EPacketClickWindow(int windowId, int slotId, int usedButton, int mode, ItemStack clickedItem, short actionNumber)
34
    {
35
        this.windowId = windowId;
36
        this.slotId = slotId;
37
        this.usedButton = usedButton;
38
        this.clickedItem = clickedItem != null ? clickedItem.copy() : null;
39
        this.actionNumber = actionNumber;
40
        this.mode = mode;
41
    }
42
43
    /**
44
     * Passes this Packet on to the NetHandler for processing.
45
     */
46
    public void processPacket(INetHandlerPlayServer handler)
47
    {
48
        handler.processClickWindow(this);
49
    }
50
51
    /**
52
     * Reads the raw packet data from the data stream.
53
     */
54
    public void readPacketData(PacketBuffer buf) throws IOException
55
    {
56
        this.windowId = buf.readByte();
57
        this.slotId = buf.readShort();
58
        this.usedButton = buf.readByte();
59
        this.actionNumber = buf.readShort();
60
        this.mode = buf.readByte();
61
        this.clickedItem = buf.readItemStackFromBuffer();
62
    }
63
64
    /**
65
     * Writes the raw packet data to the data stream.
66
     */
67
    public void writePacketData(PacketBuffer buf) throws IOException
68
    {
69
        buf.writeByte(this.windowId);
70
        buf.writeShort(this.slotId);
71
        buf.writeByte(this.usedButton);
72
        buf.writeShort(this.actionNumber);
73
        buf.writeByte(this.mode);
74
        buf.writeItemStackToBuffer(this.clickedItem);
75
    }
76
77
    public int getWindowId()
78
    {
79
        return this.windowId;
80
    }
81
82
    public int getSlotId()
83
    {
84
        return this.slotId;
85
    }
86
87
    public int getUsedButton()
88
    {
89
        return this.usedButton;
90
    }
91
92
    public short getActionNumber()
93
    {
94
        return this.actionNumber;
95
    }
96
97
    public ItemStack getClickedItem()
98
    {
99
        return this.clickedItem;
100
    }
101
102
    public int getMode()
103
    {
104
        return this.mode;
105
    }
106
}
107

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