PalladiumEvents.registerAnimations((event) => {
    event.register('aerokinesis_anim', 20, (builder) => {
        if (abilityUtil.isEnabled(builder.getPlayer(), "arrzenhanced:speedforce", "aerokinesis_animation")) {
            const progress = animationUtil.getAnimationTimerAbilityValue(builder.getPlayer(), 'arrzenhanced:speedforce', 'aerokinesis_animation', builder.getPartialTicks());
            if (progress < 1/4) {
                if (builder.isFirstPerson()) {
                    builder.get('left_arm')
                        .setXRotDegrees(0)
                        .setZRotDegrees(45)
                        .setYRotDegrees(0)
                    builder.get('right_arm')
                        .setXRotDegrees(0)
                        .setZRotDegrees(45)
                        .setYRotDegrees(0)
                } else {
                    builder.get('left_arm')
                        .setXRotDegrees(90)
                        .setZRotDegrees(0)
                        .setYRotDegrees(0)
                    builder.get('right_arm')
                        .setXRotDegrees(90)
                        .setZRotDegrees(0)
                        .setYRotDegrees(0)
                }
            } else if (progress < 2/4) {
                if (builder.isFirstPerson()) {
                    builder.get('left_arm')
                        .setXRotDegrees(20)
                        .setZRotDegrees(0)
                        .setYRotDegrees(0)
                    builder.get('right_arm')
                        .setXRotDegrees(20)
                        .setZRotDegrees(0)
                        .setYRotDegrees(0)
                } else {
                    builder.get('left_arm')
                        .setXRotDegrees(-90)
                        .setZRotDegrees(0)
                        .setYRotDegrees(-20)
                    builder.get('right_arm')
                        .setXRotDegrees(-90)
                        .setZRotDegrees(0)
                        .setYRotDegrees(20)
                }
            } else if (progress < 3/4) {
                if (builder.isFirstPerson()) {
                    builder.get('left_arm')
                    .setXRotDegrees(0)
                    .setZRotDegrees(25)
                    .setYRotDegrees(0)
                    builder.get('right_arm')
                    .setXRotDegrees(0)
                    .setZRotDegrees(-25)
                    .setYRotDegrees(0)
                } else {
                    builder.get('left_arm')
                        .setXRotDegrees(-90)
                        .setZRotDegrees(0)
                        .setYRotDegrees(0)
                    builder.get('right_arm')
                        .setXRotDegrees(-90)
                        .setZRotDegrees(0)
                        .setYRotDegrees(0)
                }
            } else if (progress < 4/4) {
                if (builder.isFirstPerson()) {
                    builder.get('left_arm')
                        .setXRotDegrees(-25)
                        .setZRotDegrees(0)
                        .setYRotDegrees(0)
                    builder.get('right_arm')
                        .setXRotDegrees(-25)
                        .setZRotDegrees(0)
                        .setYRotDegrees(0)
                } else {
                    builder.get('left_arm')
                        .setXRotDegrees(-90)
                        .setZRotDegrees(0)
                        .setYRotDegrees(20)
                    builder.get('right_arm')
                        .setXRotDegrees(-90)
                        .setZRotDegrees(0)
                        .setYRotDegrees(-20)
                }
            }
        }
    });
});