Skip to content

Commit

Permalink
new: remove vertical view bobbing (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oondanomala authored Mar 16, 2024
1 parent a32c2c0 commit 05bd4c2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/club/sk1er/patcher/config/PatcherConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}

0 comments on commit 05bd4c2

Please sign in to comment.