(feature) shaking intensity

This commit is contained in:
kirillsaint 2024-01-19 20:15:35 +06:00
parent 8ae19788e0
commit edbd40c970
2 changed files with 12 additions and 1 deletions

View File

@ -155,6 +155,16 @@ public abstract class EntityRendererMixin implements EntityRendererExt {
} }
} }
@Redirect(method = "hurtCameraEffect", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V", ordinal = 2))
public void changeIntensity(float angle, float x, float y, float z) {
if(!Client.getInstance().getModInstances().getOldAnimationsMod().isEnabled() || Client.getInstance().getSettingsManager().getSettingByClass(AnimationsMod.class, "No Shaking").getValBoolean()) {
GlStateManager.rotate(angle, x, y, z);
return;
}
float intensity = Client.getInstance().getSettingsManager().getSettingByClass(AnimationsMod.class, "Shaking Intensity").getValFloat();
GlStateManager.rotate(angle * (intensity / 14), x, y, z);
}
@Redirect(method = "setupCameraTransform", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/EntityRenderer;setupViewBobbing(F)V")) @Redirect(method = "setupCameraTransform", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/EntityRenderer;setupViewBobbing(F)V"))
public void modelBobbing(EntityRenderer instance, float f) { public void modelBobbing(EntityRenderer instance, float f) {
if(!Client.getInstance().getSettingsManager().getSettingByClass(RenderMod.class, "Model Bobbing Only").getValBoolean()) { if(!Client.getInstance().getSettingsManager().getSettingByClass(RenderMod.class, "Model Bobbing Only").getValBoolean()) {

View File

@ -20,8 +20,9 @@ public class AnimationsMod extends Mod {
this.addBooleanSetting("1.7 Throwing", this, true); this.addBooleanSetting("1.7 Throwing", this, true);
this.addBooleanSetting("1.7 Enchant Glint", this, true); this.addBooleanSetting("1.7 Enchant Glint", this, true);
this.addBooleanSetting("1.7 Skins", this, false); this.addBooleanSetting("1.7 Skins", this, false);
this.addBooleanSetting("Smooth Sneaking", this, true);
this.addBooleanSetting("No Shaking", this, true); this.addBooleanSetting("No Shaking", this, true);
this.addSliderSetting("Shaking Intensity", this, 14, 0, 100, true);
this.addBooleanSetting("Smooth Sneaking", this, true);
this.addBooleanSetting("Consume Animation", this, true); this.addBooleanSetting("Consume Animation", this, true);
this.addBooleanSetting("Block-Hitting Animation", this, true); this.addBooleanSetting("Block-Hitting Animation", this, true);
this.addBooleanSetting("Red Armor", this, true); this.addBooleanSetting("Red Armor", this, true);