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 ClientboundContainerSetDataPacket implements Packet<ClientGamePacketListener> {
    private int containerId;
    private int id;
    private int value;
    
    public ClientboundContainerSetDataPacket() {
    }
    
    public ClientboundContainerSetDataPacket(final int integer1, final int integer2, final int integer3) {
        this.containerId = integer1;
        this.id = integer2;
        this.value = integer3;
    }
    
    @Override
    public void handle(final ClientGamePacketListener lw) {
        lw.handleContainerSetData(this);
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.containerId = kv.readUnsignedByte();
        this.id = kv.readShort();
        this.value = kv.readShort();
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeByte(this.containerId);
        kv.writeShort(this.id);
        kv.writeShort(this.value);
    }
    
    public int getContainerId() {
        return this.containerId;
    }
    
    public int getId() {
        return this.id;
    }
    
    public int getValue() {
        return this.value;
    }
}
