package net.minecraft.network.protocol.status;

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

public class ServerboundPingRequestPacket implements Packet<ServerStatusPacketListener> {
    private long time;
    
    public ServerboundPingRequestPacket() {
    }
    
    public ServerboundPingRequestPacket(final long long1) {
        this.time = long1;
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.time = kv.readLong();
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeLong(this.time);
    }
    
    @Override
    public void handle(final ServerStatusPacketListener rx) {
        rx.handlePingRequest(this);
    }
    
    public long getTime() {
        return this.time;
    }
}
