package net.minecraft.network.protocol.game;

import net.minecraft.network.PacketListener;
import java.io.IOException;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.Packet;

public class ClientboundSetHealthPacket implements Packet<ClientGamePacketListener> {
    private float health;
    private int food;
    private float saturation;
    
    public ClientboundSetHealthPacket() {
    }
    
    public ClientboundSetHealthPacket(final float float1, final int integer, final float float3) {
        this.health = float1;
        this.food = integer;
        this.saturation = float3;
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.health = kv.readFloat();
        this.food = kv.readVarInt();
        this.saturation = kv.readFloat();
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeFloat(this.health);
        kv.writeVarInt(this.food);
        kv.writeFloat(this.saturation);
    }
    
    @Override
    public void handle(final ClientGamePacketListener lw) {
        lw.handleSetHealth(this);
    }
    
    public float getHealth() {
        return this.health;
    }
    
    public int getFood() {
        return this.food;
    }
    
    public float getSaturation() {
        return this.saturation;
    }
}
