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 ClientboundKeepAlivePacket implements Packet<ClientGamePacketListener> {
    private long id;
    
    public ClientboundKeepAlivePacket() {
    }
    
    public ClientboundKeepAlivePacket(final long long1) {
        this.id = long1;
    }
    
    @Override
    public void handle(final ClientGamePacketListener nl) {
        nl.handleKeepAlive(this);
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.id = mg.readLong();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeLong(this.id);
    }
    
    public long getId() {
        return this.id;
    }
}
