/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  net.minecraft.class_1293
 *  net.minecraft.class_1294
 *  net.minecraft.class_310
 */
package meteordevelopment.meteorclient.systems.modules.movement.speed;

import meteordevelopment.meteorclient.events.entity.player.PlayerMoveEvent;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.movement.speed.Speed;
import meteordevelopment.meteorclient.systems.modules.movement.speed.SpeedModes;
import net.minecraft.class_1293;
import net.minecraft.class_1294;
import net.minecraft.class_310;

public class SpeedMode {
    protected final class_310 mc;
    protected final Speed settings = Modules.get().get(Speed.class);
    private final SpeedModes type;
    protected int stage;
    protected double distance;
    protected double speed;

    public SpeedMode(SpeedModes type) {
        this.mc = class_310.method_1551();
        this.type = type;
        this.reset();
    }

    public void onTick() {
    }

    public void onMove(PlayerMoveEvent event) {
    }

    public void onRubberband() {
        this.reset();
    }

    public void onActivate() {
    }

    public void onDeactivate() {
    }

    protected double getDefaultSpeed() {
        int amplifier;
        double defaultSpeed = 0.2873;
        if (this.mc.field_1724.method_6059(class_1294.field_5904)) {
            amplifier = this.mc.field_1724.method_6112(class_1294.field_5904).method_5578();
            defaultSpeed *= 1.0 + 0.2 * (double)(amplifier + 1);
        }
        if (this.mc.field_1724.method_6059(class_1294.field_5909)) {
            amplifier = this.mc.field_1724.method_6112(class_1294.field_5909).method_5578();
            defaultSpeed /= 1.0 + 0.2 * (double)(amplifier + 1);
        }
        return defaultSpeed;
    }

    protected void reset() {
        this.stage = 0;
        this.distance = 0.0;
        this.speed = 0.2873;
    }

    protected double getHop(double height) {
        class_1293 jumpBoost;
        class_1293 class_12932 = jumpBoost = this.mc.field_1724.method_6059(class_1294.field_5913) ? this.mc.field_1724.method_6112(class_1294.field_5913) : null;
        if (jumpBoost != null) {
            height += (double)((float)(jumpBoost.method_5578() + 1) * 0.1f);
        }
        return height;
    }

    public String getHudString() {
        return this.type.name();
    }
}

