Search in sources :

Example 1 with Freecam

use of meteordevelopment.meteorclient.systems.modules.render.Freecam in project meteor-client by MeteorDevelopment.

the class ComeCommandMixin method getComeCommandTarget.

@ModifyArgs(method = "execute", at = @At(value = "INVOKE", target = "Lbaritone/api/process/ICustomGoalProcess;setGoalAndPath(Lbaritone/api/pathing/goals/Goal;)V"), remap = false)
private void getComeCommandTarget(Args args) {
    Freecam freecam = Modules.get().get(Freecam.class);
    if (freecam.isActive()) {
        float tickDelta = mc.getTickDelta();
        args.set(0, new GoalBlock((int) freecam.getX(tickDelta), (int) freecam.getY(tickDelta), (int) freecam.getZ(tickDelta)));
    }
}
Also used : GoalBlock(baritone.api.pathing.goals.GoalBlock) Freecam(meteordevelopment.meteorclient.systems.modules.render.Freecam) ModifyArgs(org.spongepowered.asm.mixin.injection.ModifyArgs)

Example 2 with Freecam

use of meteordevelopment.meteorclient.systems.modules.render.Freecam in project meteor-client by MeteorDevelopment.

the class GameRendererMixin method updateTargetedEntityInvoke.

@Inject(method = "updateTargetedEntity", at = @At("HEAD"), cancellable = true)
private void updateTargetedEntityInvoke(float tickDelta, CallbackInfo info) {
    Freecam freecam = Modules.get().get(Freecam.class);
    boolean highwayBuilder = Modules.get().isActive(HighwayBuilder.class);
    if ((freecam.isActive() || highwayBuilder) && client.getCameraEntity() != null && !freecamSet) {
        info.cancel();
        Entity cameraE = client.getCameraEntity();
        double x = cameraE.getX();
        double y = cameraE.getY();
        double z = cameraE.getZ();
        double prevX = cameraE.prevX;
        double prevY = cameraE.prevY;
        double prevZ = cameraE.prevZ;
        float yaw = cameraE.getYaw();
        float pitch = cameraE.getPitch();
        float prevYaw = cameraE.prevYaw;
        float prevPitch = cameraE.prevPitch;
        if (highwayBuilder) {
            cameraE.setYaw(camera.getYaw());
            cameraE.setPitch(camera.getPitch());
        } else {
            ((IVec3d) cameraE.getPos()).set(freecam.pos.x, freecam.pos.y - cameraE.getEyeHeight(cameraE.getPose()), freecam.pos.z);
            cameraE.prevX = freecam.prevPos.x;
            cameraE.prevY = freecam.prevPos.y - cameraE.getEyeHeight(cameraE.getPose());
            cameraE.prevZ = freecam.prevPos.z;
            cameraE.setYaw(freecam.yaw);
            cameraE.setPitch(freecam.pitch);
            cameraE.prevYaw = freecam.prevYaw;
            cameraE.prevPitch = freecam.prevPitch;
        }
        freecamSet = true;
        updateTargetedEntity(tickDelta);
        freecamSet = false;
        ((IVec3d) cameraE.getPos()).set(x, y, z);
        cameraE.prevX = prevX;
        cameraE.prevY = prevY;
        cameraE.prevZ = prevZ;
        cameraE.setYaw(yaw);
        cameraE.setPitch(pitch);
        cameraE.prevYaw = prevYaw;
        cameraE.prevPitch = prevPitch;
    }
}
Also used : Entity(net.minecraft.entity.Entity) IVec3d(meteordevelopment.meteorclient.mixininterface.IVec3d) Freecam(meteordevelopment.meteorclient.systems.modules.render.Freecam)

Example 3 with Freecam

use of meteordevelopment.meteorclient.systems.modules.render.Freecam in project meteor-client by MeteorDevelopment.

the class CameraMixin method onUpdateSetPosArgs.

@ModifyArgs(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/Camera;setPos(DDD)V"))
private void onUpdateSetPosArgs(Args args) {
    Freecam freecam = Modules.get().get(Freecam.class);
    if (freecam.isActive()) {
        args.set(0, freecam.getX(tickDelta));
        args.set(1, freecam.getY(tickDelta));
        args.set(2, freecam.getZ(tickDelta));
    }
}
Also used : Freecam(meteordevelopment.meteorclient.systems.modules.render.Freecam) ModifyArgs(org.spongepowered.asm.mixin.injection.ModifyArgs)

Example 4 with Freecam

use of meteordevelopment.meteorclient.systems.modules.render.Freecam 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)

Example 5 with Freecam

use of meteordevelopment.meteorclient.systems.modules.render.Freecam in project meteor-client by MeteorDevelopment.

the class CameraMixin method onUpdateSetRotationArgs.

@ModifyArgs(method = "update", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/Camera;setRotation(FF)V"))
private void onUpdateSetRotationArgs(Args args) {
    Freecam freecam = Modules.get().get(Freecam.class);
    FreeLook freeLook = Modules.get().get(FreeLook.class);
    if (freecam.isActive()) {
        args.set(0, (float) freecam.getYaw(tickDelta));
        args.set(1, (float) freecam.getPitch(tickDelta));
    } else if (Modules.get().isActive(HighwayBuilder.class)) {
        args.set(0, yaw);
        args.set(1, pitch);
    } else if (freeLook.isActive()) {
        args.set(0, freeLook.cameraYaw);
        args.set(1, freeLook.cameraPitch);
    }
}
Also used : HighwayBuilder(meteordevelopment.meteorclient.systems.modules.world.HighwayBuilder) Freecam(meteordevelopment.meteorclient.systems.modules.render.Freecam) FreeLook(meteordevelopment.meteorclient.systems.modules.render.FreeLook) ModifyArgs(org.spongepowered.asm.mixin.injection.ModifyArgs)

Aggregations

Freecam (meteordevelopment.meteorclient.systems.modules.render.Freecam)5 ModifyArgs (org.spongepowered.asm.mixin.injection.ModifyArgs)3 FreeLook (meteordevelopment.meteorclient.systems.modules.render.FreeLook)2 HighwayBuilder (meteordevelopment.meteorclient.systems.modules.world.HighwayBuilder)2 GoalBlock (baritone.api.pathing.goals.GoalBlock)1 ICamera (meteordevelopment.meteorclient.mixininterface.ICamera)1 IVec3d (meteordevelopment.meteorclient.mixininterface.IVec3d)1 Camera (net.minecraft.client.render.Camera)1 Entity (net.minecraft.entity.Entity)1 Redirect (org.spongepowered.asm.mixin.injection.Redirect)1