feat: No Hurt Cam
This commit is contained in:
18
src/main/java/moe/nea/firmament/mixins/DisableHurtCam.java
Normal file
18
src/main/java/moe/nea/firmament/mixins/DisableHurtCam.java
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -23,6 +23,7 @@ object Fixes : FirmamentFeature {
|
|||||||
val autoSprintHud by position("auto-sprint-hud", 80, 10) { Point(0.0, 1.0) }
|
val autoSprintHud by position("auto-sprint-hud", 80, 10) { Point(0.0, 1.0) }
|
||||||
val peekChat by keyBindingWithDefaultUnbound("peek-chat")
|
val peekChat by keyBindingWithDefaultUnbound("peek-chat")
|
||||||
val hidePotionEffects by toggle("hide-mob-effects") { false }
|
val hidePotionEffects by toggle("hide-mob-effects") { false }
|
||||||
|
val noHurtCam by toggle("disable-hurt-cam") { false }
|
||||||
}
|
}
|
||||||
|
|
||||||
override val config: ManagedConfig
|
override val config: ManagedConfig
|
||||||
|
|||||||
@@ -119,6 +119,8 @@
|
|||||||
"firmament.config.fixes.auto-sprint-keybinding": "Auto Sprint KeyBinding",
|
"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-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.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": "Hide Potion Effects",
|
||||||
"firmament.config.fixes.hide-mob-effects.description": "Hide Potion effects on the right side of your player inventory.",
|
"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",
|
"firmament.config.fixes.peek-chat": "Peek Chat",
|
||||||
|
|||||||
Reference in New Issue
Block a user