S06PacketUpdateHealth .java

net.minecraft.network.play.server.S06PacketUpdateHealth (class): members: saturationLevel, getSaturationLevel, getFoodLevel, foodLevel, getHealth, health.

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

Implements

API Surface (6)

void readPacketData(PacketBuffer buf)
void writePacketData(PacketBuffer buf)
void processPacket(INetHandlerPlayClient handler)
float getHealth()
int getFoodLevel()
float getSaturationLevel()

Fields & Constants (3)

health
foodLevel
saturationLevel

Code Graph: Dependencies (3)

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

Full Source

S06PacketUpdateHealth.java68 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 S06PacketUpdateHealth implements Packet<INetHandlerPlayClient>
9
{
10
    private float health;
11
    private int foodLevel;
12
    private float saturationLevel;
13
14
    public S06PacketUpdateHealth()
15
    {
16
    }
17
18
    public S06PacketUpdateHealth(float healthIn, int foodLevelIn, float saturationIn)
19
    {
20
        this.health = healthIn;
21
        this.foodLevel = foodLevelIn;
22
        this.saturationLevel = saturationIn;
23
    }
24
25
    /**
26
     * Reads the raw packet data from the data stream.
27
     */
28
    public void readPacketData(PacketBuffer buf) throws IOException
29
    {
30
        this.health = buf.readFloat();
31
        this.foodLevel = buf.readVarIntFromBuffer();
32
        this.saturationLevel = buf.readFloat();
33
    }
34
35
    /**
36
     * Writes the raw packet data to the data stream.
37
     */
38
    public void writePacketData(PacketBuffer buf) throws IOException
39
    {
40
        buf.writeFloat(this.health);
41
        buf.writeVarIntToBuffer(this.foodLevel);
42
        buf.writeFloat(this.saturationLevel);
43
    }
44
45
    /**
46
     * Passes this Packet on to the NetHandler for processing.
47
     */
48
    public void processPacket(INetHandlerPlayClient handler)
49
    {
50
        handler.handleUpdateHealth(this);
51
    }
52
53
    public float getHealth()
54
    {
55
        return this.health;
56
    }
57
58
    public int getFoodLevel()
59
    {
60
        return this.foodLevel;
61
    }
62
63
    public float getSaturationLevel()
64
    {
65
        return this.saturationLevel;
66
    }
67
}
68

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