/*
 * Decompiled with CFR 0.152.
 * 
 * Could not load the following classes:
 *  com.llamalad7.mixinextras.injector.ModifyExpressionValue
 *  net.minecraft.class_10014
 *  net.minecraft.class_3532
 *  net.minecraft.class_9946
 *  org.spongepowered.asm.mixin.Mixin
 *  org.spongepowered.asm.mixin.injection.At
 */
package meteordevelopment.meteorclient.mixin;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.render.Chams;
import net.minecraft.class_10014;
import net.minecraft.class_3532;
import net.minecraft.class_9946;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(value={class_9946.class})
public abstract class EndCrystalEntityModelMixin {
    @ModifyExpressionValue(method={"method_62083(Lnet/minecraft/class_10014;)V"}, at={@At(value="INVOKE", target="Lnet/minecraft/class_892;method_23155(F)F")})
    private float setAngles$bounce(float original, class_10014 state) {
        Chams module = Modules.get().get(Chams.class);
        if (!module.isActive() || !module.crystals.get().booleanValue()) {
            return original;
        }
        float g = class_3532.method_15374((double)(state.field_53328 * 0.2f)) / 2.0f + 0.5f;
        g = (g * g + g) * 0.4f * module.crystalsBounce.get().floatValue();
        return g - 1.4f;
    }

    @ModifyExpressionValue(method={"method_62083(Lnet/minecraft/class_10014;)V"}, at={@At(value="FIELD", target="Lnet/minecraft/class_10014;field_53328:F", ordinal=0)})
    private float modifySpeed(float original) {
        Chams module = Modules.get().get(Chams.class);
        if (!module.isActive() || !module.crystals.get().booleanValue()) {
            return original;
        }
        return original * module.crystalsRotationSpeed.get().floatValue();
    }
}

