Search in sources :

Example 1 with ICamera

use of meteordevelopment.meteorclient.mixininterface.ICamera in project meteor-client by MeteorDevelopment.

the class MouseMixin method updateMouseChangeLookDirection.

@Redirect(method = "updateMouse", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;changeLookDirection(DD)V"))
private void updateMouseChangeLookDirection(ClientPlayerEntity player, double cursorDeltaX, double cursorDeltaY) {
    Freecam freecam = Modules.get().get(Freecam.class);
    FreeLook freeLook = Modules.get().get(FreeLook.class);
    if (freecam.isActive())
        freecam.changeLookDirection(cursorDeltaX * 0.15, cursorDeltaY * 0.15);
    else if (Modules.get().isActive(HighwayBuilder.class)) {
        Camera camera = client.gameRenderer.getCamera();
        ((ICamera) camera).setRot(camera.getYaw() + cursorDeltaX * 0.15, camera.getPitch() + cursorDeltaY * 0.15);
    } else if (freeLook.cameraMode()) {
        freeLook.cameraYaw += cursorDeltaX / freeLook.sensitivity.get().floatValue();
        freeLook.cameraPitch += cursorDeltaY / freeLook.sensitivity.get().floatValue();
        if (Math.abs(freeLook.cameraPitch) > 90.0F)
            freeLook.cameraPitch = freeLook.cameraPitch > 0.0F ? 90.0F : -90.0F;
    } else
        player.changeLookDirection(cursorDeltaX, cursorDeltaY);
}
Also used : HighwayBuilder(meteordevelopment.meteorclient.systems.modules.world.HighwayBuilder) Freecam(meteordevelopment.meteorclient.systems.modules.render.Freecam) ICamera(meteordevelopment.meteorclient.mixininterface.ICamera) Camera(net.minecraft.client.render.Camera) FreeLook(meteordevelopment.meteorclient.systems.modules.render.FreeLook) Redirect(org.spongepowered.asm.mixin.injection.Redirect)

Aggregations

ICamera (meteordevelopment.meteorclient.mixininterface.ICamera)1 FreeLook (meteordevelopment.meteorclient.systems.modules.render.FreeLook)1 Freecam (meteordevelopment.meteorclient.systems.modules.render.Freecam)1 HighwayBuilder (meteordevelopment.meteorclient.systems.modules.world.HighwayBuilder)1 Camera (net.minecraft.client.render.Camera)1 Redirect (org.spongepowered.asm.mixin.injection.Redirect)1