minecraft_25w45a_unobfuscated/net/minecraft/network/protocol/ping/ClientboundPongResponsePacket.java
2025-11-24 22:52:51 +03:00

36 lines
1.1 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.network.protocol.ping;
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.ping.ClientPongPacketListener;
import net.minecraft.network.protocol.ping.PingPacketTypes;
public record ClientboundPongResponsePacket(long time) implements Packet<ClientPongPacketListener>
{
public static final StreamCodec<FriendlyByteBuf, ClientboundPongResponsePacket> STREAM_CODEC = Packet.codec(ClientboundPongResponsePacket::write, ClientboundPongResponsePacket::new);
private ClientboundPongResponsePacket(FriendlyByteBuf input) {
this(input.readLong());
}
private void write(FriendlyByteBuf output) {
output.writeLong(this.time);
}
@Override
public PacketType<ClientboundPongResponsePacket> type() {
return PingPacketTypes.CLIENTBOUND_PONG_RESPONSE;
}
@Override
public void handle(ClientPongPacketListener listener) {
listener.handlePongResponse(this);
}
}