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 mg) throws IOException {
        this.radius = mg.readVarInt();
    }
    
    @Override
    public void write(final FriendlyByteBuf mg) throws IOException {
        mg.writeVarInt(this.radius);
    }
    
    @Override
    public void handle(final ClientGamePacketListener nl) {
        nl.handleSetChunkCacheRadius(this);
    }
    
    public int getRadius() {
        return this.radius;
    }
}
