Add setting for body rotation interpolation fix

Some mods changing the player rotation will break with this fix since they hook into the getYaw() call of the original function which we don't account for.
This commit is contained in:
FlorianMichael 2024-10-22 18:23:03 +02:00
parent bf7bc8f0ca
commit 2cb50a1719
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
4 changed files with 6 additions and 1 deletions

View File

@ -116,7 +116,7 @@ public abstract class MixinLivingEntity extends Entity {
@Redirect(method = "turnHead", at = @At(value = "INVOKE", target = "Ljava/lang/Math;abs(F)F"))
private float changeBodyRotationInterpolation(float g) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_19_3)) {
if (VisualSettings.global().changeBodyRotationInterpolation.isEnabled()) {
g = MathHelper.clamp(g, -75.0F, 75.0F);
this.bodyYaw = this.getYaw() - g;
if (Math.abs(g) > 50.0F) {

View File

@ -57,6 +57,9 @@ public class VisualSettings extends SettingGroup {
// 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.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));
// 1.19.2 -> 1.19
public final VersionedBooleanSetting disableSecureChatWarning = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.disable_secure_chat_warning"), VersionRange.andOlder(ProtocolVersion.v1_19));

View File

@ -107,6 +107,7 @@
"visual_settings.viafabricplus.force_unicode_font_for_non_ascii_languages": "Unicode-Schriftart für Nicht-ASCII-Sprachen erzwingen",
"visual_settings.viafabricplus.filter_non_existing_glyphs": "Nicht vorhandene Glyphen filtern",
"visual_settings.viafabricplus.sneak_instantly": "Sofort schleichen",
"visual_settings.viafabricplus.change_body_rotation_interpolation": "Interpolation der Körperdrehung ändern",
"force_version.viafabricplus.title": "Bitte wähle die Version, mit der der Server gepingt/verbunden werden soll",

View File

@ -107,6 +107,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.change_body_rotation_interpolation": "Change body rotation interpolation",
"force_version.viafabricplus.title": "Please select the version with which the server should be pinged/connected",