use of mathax.client.systems.modules.render.Freecam in project Client by MatHax.
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);
}
use of mathax.client.systems.modules.render.Freecam in project Client by MatHax.
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)));
}
}
use of mathax.client.systems.modules.render.Freecam in project Client by MatHax.
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));
}
}
use of mathax.client.systems.modules.render.Freecam in project Client by MatHax.
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);
}
}
Aggregations