package net.minecraft.network.protocol.game;

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

public class ClientboundUpdateTagsPacket implements Packet<ClientGamePacketListener> {
    private TagManager tags;
    
    public ClientboundUpdateTagsPacket() {
    }
    
    public ClientboundUpdateTagsPacket(final TagManager adh) {
        this.tags = adh;
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.tags = TagManager.deserializeFromNetwork(mg);
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        this.tags.serializeToNetwork(mg);
    }
    
    @Override
    public void handle(final ClientGamePacketListener nl) {
        nl.handleUpdateTags(this);
    }
    
    public TagManager getTags() {
        return this.tags;
    }
}
