Add setting to toggle arm rotation lock whilst blocking <= 1.20.2 (#651)

This commit is contained in:
lowercasebtw 2024-12-09 18:11:06 -05:00 committed by GitHub
parent 5b677af35d
commit 24f5812b4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 1 deletions

View File

@ -47,7 +47,7 @@ public abstract class MixinBipedEntityModel<T extends BipedEntityRenderState> {
@Redirect(method = "positionBlockingArm", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F")) @Redirect(method = "positionBlockingArm", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;clamp(FFF)F"))
private float preventArmFollowingThirdPersonRotation(float value, float min, float max) { private float preventArmFollowingThirdPersonRotation(float value, float min, float max) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_2)) { if (VisualSettings.global().lockBlockingArmRotation.isEnabled()) {
return 0.0F; return 0.0F;
} else { } else {
return MathHelper.clamp(value, min, max); return MathHelper.clamp(value, min, max);

View File

@ -59,6 +59,9 @@ public class VisualSettings extends SettingGroup {
// 1.21 -> 1.20.5 // 1.21 -> 1.20.5
public final VersionedBooleanSetting hideDownloadTerrainScreenTransitionEffects = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.hide_download_terrain_screen_transition_effects"), VersionRange.andOlder(ProtocolVersion.v1_20_5)); public final VersionedBooleanSetting hideDownloadTerrainScreenTransitionEffects = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.hide_download_terrain_screen_transition_effects"), VersionRange.andOlder(ProtocolVersion.v1_20_5));
// 1.20.3 -> 1.20.2
public final VersionedBooleanSetting lockBlockingArmRotation = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.lock_blocking_arm_rotation"), VersionRange.andOlder(ProtocolVersion.v1_20_2));
// 1.19.4 -> 1.19.3 // 1.19.4 -> 1.19.3
public final VersionedBooleanSetting changeBodyRotationInterpolation = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.change_body_rotation_interpolation"), VersionRange.andOlder(ProtocolVersion.v1_19_3)); public final VersionedBooleanSetting changeBodyRotationInterpolation = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.change_body_rotation_interpolation"), VersionRange.andOlder(ProtocolVersion.v1_19_3));

View File

@ -110,6 +110,7 @@
"visual_settings.viafabricplus.force_unicode_font_for_non_ascii_languages": "Force Unicode font for non-ASCII languages", "visual_settings.viafabricplus.force_unicode_font_for_non_ascii_languages": "Force Unicode font for non-ASCII languages",
"visual_settings.viafabricplus.filter_non_existing_glyphs": "Filter non existing glyphs", "visual_settings.viafabricplus.filter_non_existing_glyphs": "Filter non existing glyphs",
"visual_settings.viafabricplus.sneak_instantly": "Sneak instantly", "visual_settings.viafabricplus.sneak_instantly": "Sneak instantly",
"visual_settings.viafabricplus.lock_blocking_arm_rotation": "Lock third-person arm rotation whilst blocking",
"visual_settings.viafabricplus.change_body_rotation_interpolation": "Change body rotation interpolation", "visual_settings.viafabricplus.change_body_rotation_interpolation": "Change body rotation interpolation",
"force_version.viafabricplus.title": "Please select the version with which the server should be pinged/connected", "force_version.viafabricplus.title": "Please select the version with which the server should be pinged/connected",