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 ServerboundRenameItemPacket implements Packet<ServerGamePacketListener> {
    private String name;
    
    public ServerboundRenameItemPacket() {
    }
    
    public ServerboundRenameItemPacket(final String string) {
        this.name = string;
    }
    
    @Override
    public void read(final FriendlyByteBuf mg) throws IOException {
        this.name = mg.readUtf(32767);
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeUtf(this.name);
    }
    
    @Override
    public void handle(final ServerGamePacketListener qz) {
        qz.handleRenameItem(this);
    }
    
    public String getName() {
        return this.name;
    }
}
