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