Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 79e85b6

Browse files
authored
Fix Zoom when OF is installed (1.8.9) (#94)
fixes #93 Fun fact: Zoom would've worked if in addition to OF Forge was installed as well. (now it doesn't matter)
2 parents 47d4306 + 685c54e commit 79e85b6

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

1.8.9/src/main/java/io/github/axolotlclient/mixin/GameRendererMixin.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
import org.objectweb.asm.Opcodes;
5757
import org.spongepowered.asm.mixin.Mixin;
5858
import org.spongepowered.asm.mixin.Shadow;
59+
import org.spongepowered.asm.mixin.Unique;
5960
import org.spongepowered.asm.mixin.injection.At;
6061
import org.spongepowered.asm.mixin.injection.At.Shift;
6162
import org.spongepowered.asm.mixin.injection.Inject;
@@ -79,7 +80,10 @@ public abstract class GameRendererMixin {
7980
private float fogBlue;
8081
@Shadow
8182
private boolean thickFog;
83+
@Unique
8284
private float cachedMouseFactor;
85+
@Shadow
86+
private boolean renderingPanorama;
8387

8488
@Inject(method = "render", at = @At(value = "FIELD", target = "Lnet/minecraft/client/MouseInput;x:I"), locals = LocalCapture.CAPTURE_FAILEXCEPTION)
8589
public void axolotlclient$rawMouseInput(float tickDelta, long nanoTime, CallbackInfo ci, boolean displayActive, float f,
@@ -171,8 +175,13 @@ public abstract class GameRendererMixin {
171175
@Shadow
172176
protected abstract FloatBuffer updateFogColorBuffer(float red, float green, float blue, float alpha);
173177

174-
@Inject(method = "getFov", at = @At(value = "RETURN", ordinal = 1), cancellable = true)
178+
@Inject(method = "getFov", at = @At(value = "RETURN"), cancellable = true)
175179
public void axolotlclient$setZoom(float tickDelta, boolean changingFov, CallbackInfoReturnable<Float> cir) {
180+
181+
if (renderingPanorama) {
182+
return;
183+
}
184+
176185
Zoom.update();
177186

178187
float returnValue = cir.getReturnValue();
@@ -298,8 +307,8 @@ public abstract class GameRendererMixin {
298307
}
299308

300309
@Inject(method = "bobViewWhenHurt", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;getCameraEntity()Lnet/minecraft/entity/Entity;", ordinal = 1), cancellable = true)
301-
private void axolotlclient$noHurtCam(float f, CallbackInfo ci){
302-
if(AxolotlClient.CONFIG.noHurtCam.get()){
310+
private void axolotlclient$noHurtCam(float f, CallbackInfo ci) {
311+
if (AxolotlClient.CONFIG.noHurtCam.get()) {
303312
ci.cancel();
304313
}
305314
}

0 commit comments

Comments
 (0)