feat: No Hurt Cam

This commit is contained in:
Linnea Gräf
2025-03-17 21:38:15 +01:00
parent 16cc3b2a7c
commit 4c3933a787
3 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
package moe.nea.firmament.mixins;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import moe.nea.firmament.features.fixes.Fixes;
import net.minecraft.client.render.GameRenderer;
import org.objectweb.asm.Opcodes;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
@Mixin(GameRenderer.class)
public class DisableHurtCam {
@ModifyExpressionValue(method = "tiltViewWhenHurt", at = @At(value = "FIELD", target = "Lnet/minecraft/entity/LivingEntity;hurtTime:I", opcode = Opcodes.GETFIELD))
private int replaceHurtTime(int original) {
if (Fixes.TConfig.INSTANCE.getNoHurtCam())
return 0;
return original;
}
}

View File

@@ -23,6 +23,7 @@ object Fixes : FirmamentFeature {
val autoSprintHud by position("auto-sprint-hud", 80, 10) { Point(0.0, 1.0) }
val peekChat by keyBindingWithDefaultUnbound("peek-chat")
val hidePotionEffects by toggle("hide-mob-effects") { false }
val noHurtCam by toggle("disable-hurt-cam") { false }
}
override val config: ManagedConfig