/* * Decompiled with CFR 0.152. */ package net.minecraft.network.protocol.common; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.codec.StreamCodec; import net.minecraft.network.protocol.Packet; import net.minecraft.network.protocol.PacketType; import net.minecraft.network.protocol.common.ClientCommonPacketListener; import net.minecraft.network.protocol.common.CommonPacketTypes; public class ClientboundPingPacket implements Packet { public static final StreamCodec STREAM_CODEC = Packet.codec(ClientboundPingPacket::write, ClientboundPingPacket::new); private final int id; public ClientboundPingPacket(int id) { this.id = id; } private ClientboundPingPacket(FriendlyByteBuf input) { this.id = input.readInt(); } private void write(FriendlyByteBuf output) { output.writeInt(this.id); } @Override public PacketType type() { return CommonPacketTypes.CLIENTBOUND_PING; } @Override public void handle(ClientCommonPacketListener listener) { listener.handlePing(this); } public int getId() { return this.id; } }