package net.minecraft.network.protocol.game;

import net.minecraft.network.PacketListener;
import java.io.IOException;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.chat.Component;
import net.minecraft.core.BlockPos;
import net.minecraft.network.protocol.Packet;

public class ServerboundSignUpdatePacket implements Packet<ServerGamePacketListener> {
    private BlockPos pos;
    private String[] lines;
    
    public ServerboundSignUpdatePacket() {
    }
    
    public ServerboundSignUpdatePacket(final BlockPos fk, final Component lf2, final Component lf3, final Component lf4, final Component lf5) {
        this.pos = fk;
        this.lines = new String[] { lf2.getString(), lf3.getString(), lf4.getString(), lf5.getString() };
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.pos = kv.readBlockPos();
        this.lines = new String[4];
        for (int integer3 = 0; integer3 < 4; ++integer3) {
            this.lines[integer3] = kv.readUtf(384);
        }
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeBlockPos(this.pos);
        for (int integer3 = 0; integer3 < 4; ++integer3) {
            kv.writeUtf(this.lines[integer3]);
        }
    }
    
    @Override
    public void handle(final ServerGamePacketListener pl) {
        pl.handleSignUpdate(this);
    }
    
    public BlockPos getPos() {
        return this.pos;
    }
    
    public String[] getLines() {
        return this.lines;
    }
}
