/* * Decompiled with CFR 0.152. * * Could not load the following classes: * org.jspecify.annotations.Nullable */ package net.minecraft.network.protocol.cookie; 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.ClientboundStoreCookiePacket; import net.minecraft.network.protocol.cookie.CookiePacketTypes; import net.minecraft.network.protocol.cookie.ServerCookiePacketListener; import net.minecraft.resources.Identifier; import org.jspecify.annotations.Nullable; public record ServerboundCookieResponsePacket(Identifier key, byte @Nullable [] payload) implements Packet { public static final StreamCodec STREAM_CODEC = Packet.codec(ServerboundCookieResponsePacket::write, ServerboundCookieResponsePacket::new); private ServerboundCookieResponsePacket(FriendlyByteBuf input) { this(input.readIdentifier(), input.readNullable(ClientboundStoreCookiePacket.PAYLOAD_STREAM_CODEC)); } private void write(FriendlyByteBuf output) { output.writeIdentifier(this.key); output.writeNullable(this.payload, ClientboundStoreCookiePacket.PAYLOAD_STREAM_CODEC); } @Override public PacketType type() { return CookiePacketTypes.SERVERBOUND_COOKIE_RESPONSE; } @Override public void handle(ServerCookiePacketListener listener) { listener.handleCookieResponse(this); } }