/*
 * Decompiled with CFR 0.152.
 */
package meteordevelopment.meteorclient.systems.modules.render;

import meteordevelopment.meteorclient.settings.DoubleSetting;
import meteordevelopment.meteorclient.settings.Setting;
import meteordevelopment.meteorclient.settings.SettingGroup;
import meteordevelopment.meteorclient.systems.modules.Categories;
import meteordevelopment.meteorclient.systems.modules.Module;

public class SwingSpeed
extends Module {
    private final SettingGroup sgGeneral;
    public final Setting<Double> speed;

    public SwingSpeed() {
        super(Categories.Render, "swing-speed", "Controls hand swing animation speed");
        this.sgGeneral = this.settings.getDefaultGroup();
        this.speed = this.sgGeneral.add(((DoubleSetting.Builder)((DoubleSetting.Builder)new DoubleSetting.Builder().name("speed")).description("Controls hand swing animation speed.")).defaultValue(1.0).range(0.1, 2.0).sliderMax(2.0).decimalPlaces(2).build());
    }

    public int getHandSwingDuration(int original) {
        float speed = this.speed.get().floatValue();
        if (speed <= 0.0f) {
            speed = 0.1f;
        }
        return Math.max(1, Math.round((float)original / speed));
    }
}

