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 ClientboundSetChunkCacheRadiusPacket implements Packet<ClientGamePacketListener> {
    private int radius;
    
    public ClientboundSetChunkCacheRadiusPacket() {
    }
    
    public ClientboundSetChunkCacheRadiusPacket(final int integer) {
        this.radius = integer;
    }
    
    @Override
    public void read(final FriendlyByteBuf kv) throws IOException {
        this.radius = kv.readVarInt();
    }
    
    @Override
    public void write(final FriendlyByteBuf kv) throws IOException {
        kv.writeVarInt(this.radius);
    }
    
    @Override
    public void handle(final ClientGamePacketListener lw) {
        lw.handleSetChunkCacheRadius(this);
    }
    
    public int getRadius() {
        return this.radius;
    }
}
