vproxy/proxy/src/main/java/proxy/packet/play/server/S06PacketUpdateHealth.java
2025-06-03 09:52:43 +02:00

42 lines
1.1 KiB
Java
Executable file

package proxy.packet.play.server;
import java.io.IOException;
import proxy.network.NetHandlerPlayServer;
import proxy.network.Packet;
import proxy.network.PacketBuffer;
public class S06PacketUpdateHealth implements Packet<NetHandlerPlayServer>
{
private float health;
private int foodLevel;
private float saturationLevel;
/**
* Reads the raw packet data from the data stream.
*/
public void readPacketData(PacketBuffer buf) throws IOException
{
this.health = buf.readFloat();
this.foodLevel = buf.readVarIntFromBuffer();
this.saturationLevel = buf.readFloat();
}
/**
* Writes the raw packet data to the data stream.
*/
public void writePacketData(PacketBuffer buf) throws IOException
{
buf.writeFloat(this.health);
buf.writeVarIntToBuffer(this.foodLevel);
buf.writeFloat(this.saturationLevel);
}
/**
* Passes this Packet on to the NetHandler for processing.
*/
public void processPacket(NetHandlerPlayServer handler)
{
handler.handleUpdateHealth(this);
}
}