|
21 | 21 | import com.lambda.event.events.RenderEvent; |
22 | 22 | import com.lambda.graphics.RenderMain; |
23 | 23 | import com.lambda.gui.DearImGui; |
| 24 | +import com.lambda.module.modules.render.Bobbing; |
24 | 25 | import com.lambda.module.modules.render.NoRender; |
25 | 26 | import com.lambda.module.modules.render.Zoom; |
26 | 27 | import com.llamalad7.mixinextras.injector.ModifyExpressionValue; |
|
39 | 40 | import org.spongepowered.asm.mixin.Mixin; |
40 | 41 | import org.spongepowered.asm.mixin.injection.At; |
41 | 42 | import org.spongepowered.asm.mixin.injection.Inject; |
| 43 | +import org.spongepowered.asm.mixin.injection.ModifyVariable; |
42 | 44 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
43 | 45 |
|
44 | 46 | @Mixin(GameRenderer.class) |
@@ -76,4 +78,18 @@ private float modifyGetFov(float original) { |
76 | 78 | private void onGuiRenderComplete(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci) { |
77 | 79 | DearImGui.INSTANCE.render(); |
78 | 80 | } |
| 81 | + |
| 82 | + @ModifyVariable(method = "bobView", at = @At("STORE"), ordinal = 1) |
| 83 | + private float modifyBobbingSpeed(float f) { |
| 84 | + return Bobbing.INSTANCE.isEnabled() |
| 85 | + ? f * (float) Bobbing.INSTANCE.getSpeed() |
| 86 | + : f; |
| 87 | + } |
| 88 | + |
| 89 | + @ModifyVariable(method = "bobView", at = @At("STORE"), ordinal = 2) |
| 90 | + private float modifyBobbingMagnitude(float g) { |
| 91 | + return Bobbing.INSTANCE.isEnabled() |
| 92 | + ? g * (float) Bobbing.INSTANCE.getMagnitude() |
| 93 | + : g; |
| 94 | + } |
79 | 95 | } |
0 commit comments