summaryrefslogtreecommitdiff
path: root/src/main/java/com/arslaancodes/arslaansmagichax/mixin/PlayerEntityMixin.java
blob: 73583e9d5eda30d867122fbe65a8314e4ce98879 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package com.arslaancodes.arslaansmagichax.mixin;

import com.arslaancodes.arslaansmagichax.ArslaansMagicHaxClient;
import com.arslaancodes.arslaansmagichax.modules.impl.NoAttackCooldown;
import net.minecraft.world.entity.player.Player;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(Player.class)
public abstract class PlayerEntityMixin {
    @Inject(method = "getAttackStrengthScale", at = @At("HEAD"), cancellable = true)
    private void onGetAttackCooldownProgress(CallbackInfoReturnable<Float> cir) {
        if (ArslaansMagicHaxClient.noAttackCooldown.isEnabled()) cir.setReturnValue(1.0F);
    }
}