aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2025-03-17 21:38:15 +0100
committerLinnea Gräf <nea@nea.moe>2025-03-17 21:38:15 +0100
commit4c3933a787b017dd115e0c908f2b56da22a85bf1 (patch)
tree475d96e0a66b7f1d3b5fb1719ed44bb05c9a0733
parent16cc3b2a7cf9ccb3a5c06e379d7272ddfa310bbe (diff)
downloadFirmament-4c3933a787b017dd115e0c908f2b56da22a85bf1.tar.gz
Firmament-4c3933a787b017dd115e0c908f2b56da22a85bf1.tar.bz2
Firmament-4c3933a787b017dd115e0c908f2b56da22a85bf1.zip
feat: No Hurt Cam
-rw-r--r--src/main/java/moe/nea/firmament/mixins/DisableHurtCam.java18
-rw-r--r--src/main/kotlin/features/fixes/Fixes.kt1
-rw-r--r--translations/en_us.json2
3 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/DisableHurtCam.java b/src/main/java/moe/nea/firmament/mixins/DisableHurtCam.java
new file mode 100644
index 0000000..ed7a2d4
--- /dev/null
+++ b/src/main/java/moe/nea/firmament/mixins/DisableHurtCam.java
@@ -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;
+ }
+}
diff --git a/src/main/kotlin/features/fixes/Fixes.kt b/src/main/kotlin/features/fixes/Fixes.kt
index 7030319..3dae233 100644
--- a/src/main/kotlin/features/fixes/Fixes.kt
+++ b/src/main/kotlin/features/fixes/Fixes.kt
@@ -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
diff --git a/translations/en_us.json b/translations/en_us.json
index ac557f3..3baab79 100644
--- a/translations/en_us.json
+++ b/translations/en_us.json
@@ -119,6 +119,8 @@
"firmament.config.fixes.auto-sprint-keybinding": "Auto Sprint KeyBinding",
"firmament.config.fixes.auto-sprint-keybinding.description": "Toggle auto sprint via this keybinding.",
"firmament.config.fixes.auto-sprint.description": "This is different from vanilla sprint in the way that it only marks the keybinding pressed for the first tick of walking.",
+ "firmament.config.fixes.disable-hurt-cam": "No Hurt Cam",
+ "firmament.config.fixes.disable-hurt-cam.description": "Disable the damage screen shake animation.",
"firmament.config.fixes.hide-mob-effects": "Hide Potion Effects",
"firmament.config.fixes.hide-mob-effects.description": "Hide Potion effects on the right side of your player inventory.",
"firmament.config.fixes.peek-chat": "Peek Chat",