C0BPacketEntityAction .java

net.minecraft.network.play.client.C0BPacketEntityAction (class): members: getAuxData, auxData, entityID, getAction, Action, action, processPacket.

net.minecraft.network.play.clientclass80 linesclient2.0 KB

Implements

API Surface (5)

void readPacketData(PacketBuffer buf)
void writePacketData(PacketBuffer buf)
void processPacket(INetHandlerPlayServer handler)
C0BPacketEntityAction.Action getAction()
int getAuxData()

Fields & Constants (3)

entityID
action
auxData

Code Graph: Dependencies (5)

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

Full Source

C0BPacketEntityAction.java80 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.network.play.client;
2
3
import java.io.IOException;
4
import net.minecraft.entity.Entity;
5
import net.minecraft.network.Packet;
6
import net.minecraft.network.PacketBuffer;
7
import net.minecraft.network.play.INetHandlerPlayServer;
8
9
public class C0BPacketEntityAction implements Packet<INetHandlerPlayServer>
10
{
11
    private int entityID;
12
    private C0BPacketEntityAction.Action action;
13
    private int auxData;
14
15
    public C0BPacketEntityAction()
16
    {
17
    }
18
19
    public C0BPacketEntityAction(Entity entity, C0BPacketEntityAction.Action action)
20
    {
21
        this(entity, action, 0);
22
    }
23
24
    public C0BPacketEntityAction(Entity entity, C0BPacketEntityAction.Action action, int auxData)
25
    {
26
        this.entityID = entity.getEntityId();
27
        this.action = action;
28
        this.auxData = auxData;
29
    }
30
31
    /**
32
     * Reads the raw packet data from the data stream.
33
     */
34
    public void readPacketData(PacketBuffer buf) throws IOException
35
    {
36
        this.entityID = buf.readVarIntFromBuffer();
37
        this.action = (C0BPacketEntityAction.Action)buf.readEnumValue(C0BPacketEntityAction.Action.class);
38
        this.auxData = buf.readVarIntFromBuffer();
39
    }
40
41
    /**
42
     * Writes the raw packet data to the data stream.
43
     */
44
    public void writePacketData(PacketBuffer buf) throws IOException
45
    {
46
        buf.writeVarIntToBuffer(this.entityID);
47
        buf.writeEnumValue(this.action);
48
        buf.writeVarIntToBuffer(this.auxData);
49
    }
50
51
    /**
52
     * Passes this Packet on to the NetHandler for processing.
53
     */
54
    public void processPacket(INetHandlerPlayServer handler)
55
    {
56
        handler.processEntityAction(this);
57
    }
58
59
    public C0BPacketEntityAction.Action getAction()
60
    {
61
        return this.action;
62
    }
63
64
    public int getAuxData()
65
    {
66
        return this.auxData;
67
    }
68
69
    public static enum Action
70
    {
71
        START_SNEAKING,
72
        STOP_SNEAKING,
73
        STOP_SLEEPING,
74
        START_SPRINTING,
75
        STOP_SPRINTING,
76
        RIDING_JUMP,
77
        OPEN_INVENTORY;
78
    }
79
}
80

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