/* * Decompiled with CFR 0.152. */ package net.minecraft.network.protocol.configuration; import java.util.HashSet; import java.util.Set; 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.configuration.ClientConfigurationPacketListener; import net.minecraft.network.protocol.configuration.ConfigurationPacketTypes; import net.minecraft.resources.Identifier; public record ClientboundUpdateEnabledFeaturesPacket(Set features) implements Packet { public static final StreamCodec STREAM_CODEC = Packet.codec(ClientboundUpdateEnabledFeaturesPacket::write, ClientboundUpdateEnabledFeaturesPacket::new); private ClientboundUpdateEnabledFeaturesPacket(FriendlyByteBuf input) { this(input.readCollection(HashSet::new, FriendlyByteBuf::readIdentifier)); } private void write(FriendlyByteBuf output) { output.writeCollection(this.features, FriendlyByteBuf::writeIdentifier); } @Override public PacketType type() { return ConfigurationPacketTypes.CLIENTBOUND_UPDATE_ENABLED_FEATURES; } @Override public void handle(ClientConfigurationPacketListener listener) { listener.handleEnabledFeatures(this); } }