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 ClientboundSetExperiencePacket implements Packet<ClientGamePacketListener> {
    private float experienceProgress;
    private int totalExperience;
    private int experienceLevel;
    
    public ClientboundSetExperiencePacket() {
    }
    
    public ClientboundSetExperiencePacket(final float float1, final int integer2, final int integer3) {
        this.experienceProgress = float1;
        this.totalExperience = integer2;
        this.experienceLevel = integer3;
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.experienceProgress = mg.readFloat();
        this.experienceLevel = mg.readVarInt();
        this.totalExperience = mg.readVarInt();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeFloat(this.experienceProgress);
        mg.writeVarInt(this.experienceLevel);
        mg.writeVarInt(this.totalExperience);
    }
    
    @Override
    public void handle(final ClientGamePacketListener nl) {
        nl.handleSetExperience(this);
    }
    
    public float getExperienceProgress() {
        return this.experienceProgress;
    }
    
    public int getTotalExperience() {
        return this.totalExperience;
    }
    
    public int getExperienceLevel() {
        return this.experienceLevel;
    }
}
