Skip to content

Commit

Permalink
Add setting to toggle arm rotation lock whilst blocking <= 1.20.2 (#651)
Browse files Browse the repository at this point in the history
  • Loading branch information
lowercasebtw authored Dec 9, 2024
1 parent 5b677af commit 24f5812
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
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;
} else {
return MathHelper.clamp(value, min, max);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public void onValueChanged() {
// 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));

// 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
public final VersionedBooleanSetting changeBodyRotationInterpolation = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.change_body_rotation_interpolation"), VersionRange.andOlder(ProtocolVersion.v1_19_3));

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/assets/viafabricplus/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
"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.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",

"force_version.viafabricplus.title": "Please select the version with which the server should be pinged/connected",
Expand Down

0 comments on commit 24f5812

Please sign in to comment.