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 mg) throws IOException {
        this.health = mg.readFloat();
        this.food = mg.readVarInt();
        this.saturation = mg.readFloat();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeFloat(this.health);
        mg.writeVarInt(this.food);
        mg.writeFloat(this.saturation);
    }
    
    @Override
    public void handle(final ClientGamePacketListener nl) {
        nl.handleSetHealth(this);
    }
    
    public float getHealth() {
        return this.health;
    }
    
    public int getFood() {
        return this.food;
    }
    
    public float getSaturation() {
        return this.saturation;
    }
}
