diff --git a/src/main/java/club/sk1er/patcher/config/PatcherConfig.java b/src/main/java/club/sk1er/patcher/config/PatcherConfig.java index 0f222bfe..f706b827 100644 --- a/src/main/java/club/sk1er/patcher/config/PatcherConfig.java +++ b/src/main/java/club/sk1er/patcher/config/PatcherConfig.java @@ -548,6 +548,13 @@ public class PatcherConfig extends Vigilant { ) public static boolean removeViewBobbing; + @Property( + type = PropertyType.SWITCH, name = "Remove Vertical Bobbing", + description = "While using View Bobbing, remove the vertical bobbing like in 1.14+.", + category = "Miscellaneous", subcategory = "General" + ) + public static boolean removeVerticalViewBobbing; + @Property( type = PropertyType.SWITCH, name = "Remove Map Bobbing", description = "While using View Bobbing, remove the hand bobbing when holding a map.", diff --git a/src/main/java/club/sk1er/patcher/mixins/features/EntityRendererMixin_ViewBobbing.java b/src/main/java/club/sk1er/patcher/mixins/features/EntityRendererMixin_ViewBobbing.java index 1d04589f..c2b2b032 100644 --- a/src/main/java/club/sk1er/patcher/mixins/features/EntityRendererMixin_ViewBobbing.java +++ b/src/main/java/club/sk1er/patcher/mixins/features/EntityRendererMixin_ViewBobbing.java @@ -2,6 +2,7 @@ import club.sk1er.patcher.config.PatcherConfig; import club.sk1er.patcher.hooks.EntityRendererHook; +import gg.essential.lib.mixinextras.injector.WrapWithCondition; import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.settings.GameSettings; import org.spongepowered.asm.mixin.Dynamic; @@ -25,4 +26,9 @@ public class EntityRendererMixin_ViewBobbing { private boolean patcher$viewBobbing(GameSettings instance) { return instance.viewBobbing && !PatcherConfig.removeViewBobbing; } + + @WrapWithCondition(method = "setupViewBobbing", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;rotate(FFFF)V", ordinal = 2)) + public boolean patcher$verticalViewBobbing(float angle, float x, float y, float z) { + return !PatcherConfig.removeVerticalViewBobbing; + } }