32 lines
1.3 KiB
Java
32 lines
1.3 KiB
Java
package io.gitlab.jfronny.combit.mixin;
|
|
|
|
import io.gitlab.jfronny.combit.*;
|
|
import net.minecraft.client.*;
|
|
import net.minecraft.client.gui.hud.*;
|
|
import net.minecraft.client.option.*;
|
|
import net.minecraft.client.util.math.*;
|
|
import org.spongepowered.asm.mixin.*;
|
|
import org.spongepowered.asm.mixin.injection.*;
|
|
import org.spongepowered.asm.mixin.injection.callback.*;
|
|
|
|
@Mixin(InGameHud.class)
|
|
public class InGameHudMixin {
|
|
@Shadow @Final private MinecraftClient client;
|
|
private AttackIndicator combit$attackIndicator;
|
|
|
|
@Inject(at = @At("HEAD"), method = "renderCrosshair(Lnet/minecraft/client/util/math/MatrixStack;)V")
|
|
private void renderCrosshair(MatrixStack matrices, CallbackInfo info) {
|
|
if (CombitConfig.cooldownProgressOverride >= 0) {
|
|
combit$attackIndicator = this.client.options.getAttackIndicator().getValue();
|
|
this.client.options.getAttackIndicator().setValue(AttackIndicator.OFF);
|
|
}
|
|
}
|
|
|
|
@Inject(at = @At("RETURN"), method = "renderCrosshair(Lnet/minecraft/client/util/math/MatrixStack;)V")
|
|
private void renderCrosshairPost(MatrixStack matrices, CallbackInfo info) {
|
|
if (CombitConfig.cooldownProgressOverride >= 0) {
|
|
this.client.options.getAttackIndicator().setValue(combit$attackIndicator);
|
|
}
|
|
}
|
|
}
|