← 输入框|github.com|刷新
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Find our backup matrix space at [\#lambda-client:matrix.org](https://app.element

### Sophisticated User Experience
* **Fine-Grained Control:** Access over **1000+ settings**, allowing you to tune every aspect of the client to your exact needs.
* **Advanced GUI:** The **Dear ImGui** interface is designed for clarity and depth, featuring quick search, context menus, and easy keybind editing.
* **Advanced GUI:** The **Jetpack Compose** interface is designed for clarity and depth, featuring quick search, context menus, and easy keybind editing.
* **Automation Profiles:** Use linkable configs to apply complex configurations across multiple modules instantly.

### Stability & Safety
Expand Down
28 changes: 22 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ val kotlinVersion: String by project
val ktorVersion: String by project
val jacksonVersion: String by project
val mockkVersion: String by project
val spairVersion: String by project
val lwjglVersion: String by project
val sodiumVersion: String by project
val litematicaVersion: String by project
val maLiLibVersion: String by project
val composeVersion: String by project
val skikoVersion: String by project

val skikoPlatforms = listOf("windows-x64", "windows-arm64", "linux-x64", "linux-arm64", "macos-x64", "macos-arm64")

val libs = file("libs")
val targets = listOf("fabric.mod.json")
Expand All @@ -46,6 +49,7 @@ val replacements = file("gradle.properties").inputStream().use { stream ->

plugins {
kotlin("jvm") version "2.3.21"
kotlin("plugin.compose") version "2.3.21"
id("org.jetbrains.dokka") version "2.1.0"
id("fabric-loom") version "1.17-SNAPSHOT"
id("com.gradleup.shadow") version "9.3.0"
Expand All @@ -72,6 +76,9 @@ configurations.all {
if (requested.group == "org.lwjgl") {
useVersion(lwjglVersion)
}
if (requested.group == "org.jetbrains.skiko") {
useVersion(skikoVersion)
}
}
}

Expand All @@ -81,6 +88,7 @@ repositories {
maven("https://maven.2b2t.vc/releases") // Baritone
maven("https://jitpack.io") // KDiscordIPC
maven("https://api.modrinth.com/maven")
google()
mavenCentral()

// Allow the use of local libraries
Expand Down Expand Up @@ -169,11 +177,19 @@ dependencies {
includeLib("com.github.beanbag44:KDiscordIPC:$discordIPCVersion")
includeLib("com.pngencoder:pngencoder:$pngEncoderVersion")

includeLib("com.lambda:lambda-imgui-java-binding:$spairVersion")
includeLib("com.lambda:lambda-imgui-java-lwjgl3:$spairVersion")
includeLib("com.lambda:lambda-imgui-java-natives-windows:$spairVersion")
includeLib("com.lambda:lambda-imgui-java-natives-linux:$spairVersion")
includeLib("com.lambda:lambda-imgui-java-natives-macos:$spairVersion")

listOf("runtime:runtime", "ui:ui", "foundation:foundation").forEach { module ->
shadowLib("org.jetbrains.compose.$module-desktop:$composeVersion") {
exclude(group = "org.jetbrains.kotlin")
exclude(group = "org.jetbrains.kotlinx")
}
}
skikoPlatforms.forEach { platform ->
shadowLib("org.jetbrains.skiko:skiko-awt-runtime-$platform:$skikoVersion") {
exclude(group = "org.jetbrains.kotlin")
exclude(group = "org.jetbrains.kotlinx")
}
}

// Ktor
includeLib("io.ktor:ktor-client-core:$ktorVersion")
Expand Down
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ classGraphVersion=4.8.184
ktorVersion=3.3.3
jacksonVersion=3.1.4
mockkVersion=1.14.7
spairVersion=1.90.0
composeVersion=1.12.2
# Must be the skiko version the Compose version above depends on
skikoVersion=0.150.2

# Fabric https://fabricmc.net/develop/
fabricLoaderVersion=0.19.5
Expand Down
10 changes: 2 additions & 8 deletions src/main/java/com/lambda/mixin/MinecraftClientMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

import com.lambda.event.EventFlow;
import com.lambda.event.events.*;
import com.lambda.gui.DearImGui;
import com.lambda.gui.components.ClickGuiLayout;
import com.lambda.gui.GuiConfig;
import com.lambda.interaction.handler.handlers.TimerHandler;
import com.lambda.module.modules.movement.BetterFirework;
import com.lambda.module.modules.player.Interact;
Expand Down Expand Up @@ -65,11 +64,6 @@ public class MinecraftClientMixin {
@Shadow
public int itemUseCooldown;

@Inject(method = "close", at = @At("HEAD"))
void closeImGui(CallbackInfo ci) {
DearImGui.INSTANCE.destroy();
}

@WrapMethod(method = "render")
void onLoopTick(boolean tick, Operation<Void> original) {
com.lambda.graphics.RenderMain.preRender();
Expand Down Expand Up @@ -201,7 +195,7 @@ float getTargetMillisPerTick(float millis, Operation<Float> original) {

@Inject(method = "updateWindowTitle", at = @At("HEAD"), cancellable = true)
void updateWindowTitle(CallbackInfo ci) {
if (!ClickGuiLayout.getSetLambdaWindowTitle()) return;
if (!GuiConfig.getSetLambdaWindowTitle()) return;
WindowUtils.setLambdaTitle();
ci.cancel();
}
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/lambda/mixin/input/KeyboardMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@
import net.minecraft.client.input.KeyInput;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import org.lwjgl.glfw.GLFW;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(Keyboard.class)
public class KeyboardMixin {
@WrapMethod(method = "onKey")
private void onKey(long window, int action, KeyInput input, Operation<Void> original) {
EventFlow.post(new ButtonEvent.Keyboard.Press(input.key(), input.scancode(), action, input.modifiers()));
if (EventFlow.post(new ButtonEvent.Keyboard.Press(input.key(), input.scancode(), action, input.modifiers())).isCanceled()) return;
original.call(window, action, input);
int key = input.key();
if (!InventoryMove.getShouldMove() || !InventoryMove.isKeyMovementRelated(key)) return;
if (!InventoryMove.isKeyMovementRelated(key)) return;
if (action != GLFW.GLFW_RELEASE && !InventoryMove.getShouldMove()) return;
InputUtil.Key fromCode = InputUtil.fromKeyCode(input);
KeyBinding.setKeyPressed(fromCode, action != 0);
}
Expand Down
35 changes: 35 additions & 0 deletions src/main/java/com/lambda/mixin/render/ComposeDelayMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright 2026 Lambda
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.lambda.mixin.render;

import androidx.compose.ui.Actuals_skikoKt;
import com.lambda.gui.core.RenderThread;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(value = Actuals_skikoKt.class, remap = false)
public class ComposeDelayMixin {
@Inject(method = "postDelayed", at = @At("HEAD"), cancellable = true, require = 1)
private static void delayOnRenderThread(long delayMillis, Function0<Unit> block, CallbackInfoReturnable<Object> cir) {
cir.setReturnValue(RenderThread.after(delayMillis, block));
}
}
6 changes: 3 additions & 3 deletions src/main/java/com/lambda/mixin/render/GameRendererMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import com.lambda.event.events.RenderEvent;
import com.lambda.graphics.RenderMain;
import com.lambda.graphics.outline.OutlineCapturingQueue;
import com.lambda.gui.DearImGui;
import com.lambda.gui.LambdaGui;
import com.lambda.module.modules.render.BlockOutline;
import com.lambda.module.modules.render.Bobbing;
import com.lambda.module.modules.render.NoRender;
Expand Down Expand Up @@ -91,7 +91,7 @@ private float modifyGetFov(float original) {

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/render/GuiRenderer;render(Lcom/mojang/blaze3d/buffers/GpuBufferSlice;)V", shift = At.Shift.AFTER))
private void onGuiRenderComplete(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci) {
DearImGui.INSTANCE.render();
LambdaGui.INSTANCE.render();
}

@WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;applyCursorTo(Lnet/minecraft/client/util/Window;)V"))
Expand All @@ -102,7 +102,7 @@ private void applyCursorOverride(DrawContext context, Window window, Operation<V
Cursor cursor = provider.getCursorOverride(mouseX, mouseY);

if (cursor != null) {
cursor.applyTo(window);
window.setCursor(cursor);
return;
}
}
Expand Down
54 changes: 54 additions & 0 deletions src/main/java/com/lambda/mixin/render/GuiRendererMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright 2026 Lambda
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.lambda.mixin.render;

import com.lambda.gui.render.ItemAtlas;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gl.Framebuffer;
import net.minecraft.client.gui.render.GuiRenderer;
import net.minecraft.client.util.Window;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(GuiRenderer.class)
public class GuiRendererMixin {
@WrapOperation(method = "renderPreparedDraws", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/MinecraftClient;getFramebuffer()Lnet/minecraft/client/gl/Framebuffer;"), require = 1)
private Framebuffer drawIntoItemAtlas(MinecraftClient client, Operation<Framebuffer> original) {
Framebuffer atlas = ItemAtlas.getTarget();
return atlas != null ? atlas : original.call(client);
}

@WrapOperation(method = "renderPreparedDraws", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getFramebufferWidth()I"), require = 1)
private int itemAtlasWidth(Window window, Operation<Integer> original) {
Framebuffer atlas = ItemAtlas.getTarget();
return atlas != null ? atlas.textureWidth : original.call(window);
}

@WrapOperation(method = "renderPreparedDraws", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getFramebufferHeight()I"), require = 1)
private int itemAtlasHeight(Window window, Operation<Integer> original) {
Framebuffer atlas = ItemAtlas.getTarget();
return atlas != null ? atlas.textureHeight : original.call(window);
}

@WrapOperation(method = {"renderPreparedDraws", "getWindowScaleFactor"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/Window;getScaleFactor()I"), require = 1)
private int itemAtlasScale(Window window, Operation<Integer> original) {
return ItemAtlas.getTarget() != null ? ItemAtlas.getScale() : original.call(window);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright 2026 Lambda
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

package com.lambda.mixin.render;

import com.lambda.gui.GuiScreen;
import com.lambda.gui.LambdaGui;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.InactivityFpsLimiter;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(InactivityFpsLimiter.class)
public class InactivityFpsLimiterMixin {
@Shadow
@Final
private MinecraftClient client;

@ModifyReturnValue(method = "getLimitReason", at = @At("RETURN"))
private InactivityFpsLimiter.LimitReason liftMenuLimit(InactivityFpsLimiter.LimitReason reason) {
boolean shown = client.currentScreen == GuiScreen.INSTANCE || LambdaGui.INSTANCE.getLeaving();
if (reason == InactivityFpsLimiter.LimitReason.OUT_OF_LEVEL_MENU && shown) {
return InactivityFpsLimiter.LimitReason.NONE;
}
return reason;
}
}
26 changes: 0 additions & 26 deletions src/main/java/com/lambda/mixin/render/ScreenMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,46 +17,20 @@

package com.lambda.mixin.render;

import com.lambda.gui.components.QuickSearch;
import com.lambda.module.modules.client.AutoUpdater;
import com.lambda.module.modules.render.ContainerPreview;
import com.lambda.module.modules.render.NoRender;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.input.KeyInput;
import org.lwjgl.glfw.GLFW;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(Screen.class)
public class ScreenMixin {
@Inject(method = "keyPressed", at = @At("HEAD"), cancellable = true)
private void onKeyPressed(KeyInput input, CallbackInfoReturnable<Boolean> cir) {
if (input.key() == GLFW.GLFW_KEY_ESCAPE) {
if (QuickSearch.INSTANCE.isOpen()) {
QuickSearch.INSTANCE.close();
cir.setReturnValue(true);
} else if (AutoUpdater.getShowFirstLaunchModal()) {
AutoUpdater.dismissFirstLaunchPrompt();
cir.setReturnValue(true);
} else if (AutoUpdater.getShowInstallModal()) {
AutoUpdater.INSTANCE.disable();
AutoUpdater.setShowInstallModal(false);
cir.setReturnValue(true);
} else if (AutoUpdater.getShowUninstallModal()) {
AutoUpdater.INSTANCE.enable();
AutoUpdater.setShowUninstallModal(false);
cir.setReturnValue(true);
}
}
}

@Inject(method = "renderInGameBackground", at = @At("HEAD"), cancellable = true)
private void injectRenderInGameBackground(DrawContext context, CallbackInfo ci) {
if (NoRender.INSTANCE.isEnabled() && NoRender.getNoGuiShadow()) ci.cancel();
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/com/lambda/Lambda.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import com.lambda.config.Serializer
import com.lambda.core.Loader
import com.lambda.event.events.ClientEvent
import com.lambda.event.listener.UnsafeListener.Companion.listenOnceUnsafe
import com.lambda.gui.components.ClickGuiLayout
import com.lambda.gui.GuiConfig
import com.lambda.util.ReflectionUtils.getInstances
import com.lambda.util.WindowUtils.setLambdaWindowIcon
import net.fabricmc.api.ClientModInitializer
Expand Down Expand Up @@ -114,7 +114,7 @@ object Lambda : ClientModInitializer {
// We want the opengl context to be created
listenOnceUnsafe<ClientEvent.Startup>({ Int.MAX_VALUE }) {
LOG.info("$MOD_NAME $VERSION initialized in ${Loader.initialize()} ms\n")
if (ClickGuiLayout.setLambdaWindowIcon) setLambdaWindowIcon()
if (GuiConfig.setLambdaWindowIcon) setLambdaWindowIcon()
true
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/main/kotlin/com/lambda/config/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import com.lambda.config.settings.numeric.FloatSetting
import com.lambda.config.settings.numeric.IntegerSetting
import com.lambda.config.settings.numeric.LongSetting
import com.lambda.event.Muteable
import com.lambda.imgui.flag.ImGuiInputTextFlags
import com.lambda.util.KeyCode
import com.lambda.util.Nameable
import net.minecraft.block.Block
Expand Down Expand Up @@ -217,10 +216,9 @@ abstract class Config(
name: String,
defaultValue: String,
multiline: Boolean = false,
flags: Int = ImGuiInputTextFlags.None,
description: String = "",
visibility: () -> Boolean = { true }
) = setting(name) { layer -> StringSetting(name, description, this, layer, defaultValue, visibility, multiline, flags) }
) = setting(name) { layer -> StringSetting(name, description, this, layer, defaultValue, visibility, multiline) }

@ConfigEntryDsl
@JvmName("collectionSetting1")
Expand Down
Loading