package net.minecraft.network.protocol.game;

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

public class ServerboundCommandSuggestionPacket implements Packet<ServerGamePacketListener> {
    private int id;
    private String command;
    
    public ServerboundCommandSuggestionPacket() {
    }
    
    public ServerboundCommandSuggestionPacket(final int integer, final String string) {
        this.id = integer;
        this.command = string;
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.id = kv.readVarInt();
        this.command = kv.readUtf(32500);
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeVarInt(this.id);
        kv.writeUtf(this.command, 32500);
    }
    
    @Override
    public void handle(final ServerGamePacketListener pl) {
        pl.handleCustomCommandSuggestions(this);
    }
    
    public int getId() {
        return this.id;
    }
    
    public String getCommand() {
        return this.command;
    }
}
