// Generated by delombok at Tue Dec 16 19:35:15 UTC 2025
package net.md_5.bungee.protocol.packet;

import io.netty.buffer.ByteBuf;
import net.md_5.bungee.protocol.AbstractPacketHandler;
import net.md_5.bungee.protocol.DefinedPacket;

public class ViewDistance extends DefinedPacket {
    private int distance;

    @Override
    public void read(ByteBuf buf) {
        distance = DefinedPacket.readVarInt(buf);
    }

    @Override
    public void write(ByteBuf buf) {
        DefinedPacket.writeVarInt(distance, buf);
    }

    @Override
    public void handle(AbstractPacketHandler handler) throws Exception {
        handler.handle(this);
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int getDistance() {
        return this.distance;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public void setDistance(final int distance) {
        this.distance = distance;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public java.lang.String toString() {
        return "ViewDistance(distance=" + this.getDistance() + ")";
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public ViewDistance() {
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public ViewDistance(final int distance) {
        this.distance = distance;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public boolean equals(final java.lang.Object o) {
        if (o == this) return true;
        if (!(o instanceof ViewDistance)) return false;
        final ViewDistance other = (ViewDistance) o;
        if (!other.canEqual((java.lang.Object) this)) return false;
        if (this.getDistance() != other.getDistance()) return false;
        return true;
    }

    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    protected boolean canEqual(final java.lang.Object other) {
        return other instanceof ViewDistance;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("all")
    @lombok.Generated
    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        result = result * PRIME + this.getDistance();
        return result;
    }
}
