Skip to content

Commit

Permalink
Clean up mixins
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander01998 committed Sep 24, 2023
1 parent 9dacce5 commit 51723ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@

import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.resource.SynchronousResourceReloader;
import net.wurstclient.zoom.WiZoom;

@Mixin(GameRenderer.class)
public abstract class GameRendererMixin
implements AutoCloseable, SynchronousResourceReloader
public abstract class GameRendererMixin implements AutoCloseable
{
@Inject(at = @At(value = "RETURN", ordinal = 1),
method = {"getFov(Lnet/minecraft/client/render/Camera;FZ)D"},
method = "getFov(Lnet/minecraft/client/render/Camera;FZ)D",
cancellable = true)
private void onGetFov(Camera camera, float tickDelta, boolean changingFov,
CallbackInfoReturnable<Double> cir)
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/net/wurstclient/zoom/mixin/MouseMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
@Mixin(Mouse.class)
public class MouseMixin
{
@Inject(at = {@At("RETURN")}, method = {"onMouseScroll(JDD)V"})
private void onOnMouseScroll(long long_1, double double_1, double double_2,
CallbackInfo ci)
@Inject(at = @At("RETURN"), method = "onMouseScroll(JDD)V")
private void onOnMouseScroll(long window, double horizontal,
double vertical, CallbackInfo ci)
{
WiZoom.INSTANCE.onMouseScroll(double_2);
WiZoom.INSTANCE.onMouseScroll(vertical);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
@Mixin(PlayerInventory.class)
public class PlayerInventoryMixin
{
@Inject(at = {@At("HEAD")},
method = {"scrollInHotbar(D)V"},
cancellable = true)
@Inject(at = @At("HEAD"), method = "scrollInHotbar(D)V", cancellable = true)
private void onScrollInHotbar(double scrollAmount, CallbackInfo ci)
{
if(WiZoom.INSTANCE.getZoomKey().isPressed())
Expand Down

0 comments on commit 51723ae

Please sign in to comment.