|
15 | 15 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
16 | 16 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; |
17 | 17 |
|
| 18 | +import com.llamalad7.mixinextras.injector.ModifyReturnValue; |
18 | 19 | import com.llamalad7.mixinextras.injector.wrapoperation.Operation; |
19 | 20 | import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; |
20 | 21 |
|
21 | | -import net.minecraft.client.render.Camera; |
22 | 22 | import net.minecraft.client.render.GameRenderer; |
23 | 23 | import net.minecraft.client.render.RenderTickCounter; |
24 | 24 | import net.minecraft.client.util.math.MatrixStack; |
@@ -84,14 +84,12 @@ private void onRenderHand(float tickDelta, boolean bl, Matrix4f matrix4f, |
84 | 84 | cancelNextBobView = false; |
85 | 85 | } |
86 | 86 |
|
87 | | - @Inject(at = @At(value = "RETURN", ordinal = 1), |
88 | | - method = "getFov(Lnet/minecraft/client/render/Camera;FZ)F", |
89 | | - cancellable = true) |
90 | | - private void onGetFov(Camera camera, float tickDelta, boolean changingFov, |
91 | | - CallbackInfoReturnable<Float> cir) |
| 87 | + @ModifyReturnValue(at = @At("RETURN"), |
| 88 | + method = "getFov(Lnet/minecraft/client/render/Camera;FZ)F") |
| 89 | + private float onGetFov(float original) |
92 | 90 | { |
93 | | - cir.setReturnValue(WurstClient.INSTANCE.getOtfs().zoomOtf |
94 | | - .changeFovBasedOnZoom(cir.getReturnValueF())); |
| 91 | + return WurstClient.INSTANCE.getOtfs().zoomOtf |
| 92 | + .changeFovBasedOnZoom(original); |
95 | 93 | } |
96 | 94 |
|
97 | 95 | /** |
|
0 commit comments