Skip to content

Commit

Permalink
Use a mixin instead of ASM for GetFovEvent
Browse files Browse the repository at this point in the history
fix compatibility with liquidbounce
  • Loading branch information
Wide-Cat committed Dec 27, 2024
1 parent fbdc927 commit 0a17672
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 70 deletions.
5 changes: 2 additions & 3 deletions src/main/java/meteordevelopment/meteorclient/asm/Asm.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

package meteordevelopment.meteorclient.asm;

import meteordevelopment.meteorclient.asm.transformers.GameRendererTransformer;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.asm.transformers.PacketInflaterTransformer;
import net.fabricmc.loader.api.FabricLoader;
import org.objectweb.asm.ClassReader;
Expand Down Expand Up @@ -41,7 +41,6 @@ public static void init() {
if (INSTANCE != null) return;

INSTANCE = new Asm(System.getProperty("meteor.asm.export") != null);
INSTANCE.add(new GameRendererTransformer());
INSTANCE.add(new PacketInflaterTransformer());
}

Expand Down Expand Up @@ -76,7 +75,7 @@ private void export(String name, byte[] bytes) {
new File(path.toUri()).getParentFile().mkdirs();
Files.write(path, bytes);
} catch (IOException e) {
e.printStackTrace();
MeteorClient.LOG.error("Failed to export transformer '{}': ", name, e);
}
}
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.llamalad7.mixinextras.sugar.Local;
import com.mojang.blaze3d.systems.RenderSystem;
import meteordevelopment.meteorclient.MeteorClient;
import meteordevelopment.meteorclient.events.render.GetFovEvent;
import meteordevelopment.meteorclient.events.render.Render3DEvent;
import meteordevelopment.meteorclient.events.render.RenderAfterWorldEvent;
import meteordevelopment.meteorclient.mixininterface.IVec3d;
Expand Down Expand Up @@ -150,6 +151,11 @@ private float applyCameraTransformationsMathHelperLerpProxy(float original) {
return Modules.get().get(NoRender.class).noNausea() ? 0 : original;
}

@ModifyReturnValue(method = "getFov",at = @At("RETURN"))
private float modifyFov(float original) {
return MeteorClient.EVENT_BUS.post(GetFovEvent.get(original)).fov;
}

// Freecam

@Unique
Expand Down

0 comments on commit 0a17672

Please sign in to comment.