29 lines
999 B
Java
29 lines
999 B
Java
package b;
|
|
|
|
import defpackage.*;
|
|
import net.minecraft.client.Minecraft;
|
|
import net.minecraft.world.InteractionHand;
|
|
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.CallbackInfo;
|
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|
|
|
@Mixin(Minecraft.class)
|
|
public abstract class ah {
|
|
@Inject(method = "startAttack", at = @At("HEAD"))
|
|
private void evo$meleePrimaryAttack(CallbackInfoReturnable<Boolean> callback) {
|
|
if (sz.handlesAnyHand()) {
|
|
ahl.getInstance().onAttack(true);
|
|
}
|
|
}
|
|
|
|
@Inject(method = "startUseItem", at = @At("RETURN"))
|
|
private void evo$meleeSecondaryAttack(CallbackInfo callback) {
|
|
if (!sz.usesHand(Minecraft.getInstance().player, InteractionHand.OFF_HAND)) {
|
|
if (sz.handlesAnyHand()) {
|
|
ahl.getInstance().onAttack(false);
|
|
}
|
|
}
|
|
}
|
|
}
|