From af5791a59395b7512d569ce0d10d40b949ee2584 Mon Sep 17 00:00:00 2001 From: chadi <107775591+chaaadii@users.noreply.github.com> Date: Tue, 6 Jan 2026 13:23:34 -0500 Subject: [PATCH 1/2] Added 'Client' module with the ability to toggle the custom splash screen and client sounds. --- .../mixin/render/SplashOverlayMixin.java | 23 ++++++++++---- .../lambda/module/modules/client/Client.kt | 30 +++++++++++++++++++ .../kotlin/com/lambda/sound/SoundManager.kt | 2 ++ 3 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 src/main/kotlin/com/lambda/module/modules/client/Client.kt diff --git a/src/main/java/com/lambda/mixin/render/SplashOverlayMixin.java b/src/main/java/com/lambda/mixin/render/SplashOverlayMixin.java index 59702b7a1..7c64f5ee4 100644 --- a/src/main/java/com/lambda/mixin/render/SplashOverlayMixin.java +++ b/src/main/java/com/lambda/mixin/render/SplashOverlayMixin.java @@ -17,6 +17,7 @@ package com.lambda.mixin.render; +import com.lambda.module.modules.client.Client; import com.lambda.util.LambdaResourceKt; import net.minecraft.client.gui.screen.SplashOverlay; import net.minecraft.client.texture.ReloadableTexture; @@ -25,10 +26,7 @@ import net.minecraft.util.math.ColorHelper; import com.llamalad7.mixinextras.injector.wrapoperation.Operation; import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Mutable; -import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.*; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -43,13 +41,21 @@ public class SplashOverlayMixin { @Final public static Identifier LOGO; + @Unique + private static Identifier VANILLA_LOGO; + @Inject(method = "", at = @At("RETURN")) private void onInit(CallbackInfo ci) { - LOGO = Identifier.of("lambda", "textures/lambda_banner.png"); + if (VANILLA_LOGO == null) VANILLA_LOGO = LOGO; + + LOGO = (Client.INSTANCE.getLoadScreen()) + ? Identifier.of("lambda", "textures/lambda_banner.png") + : VANILLA_LOGO; } @WrapOperation(method = "render", at = @At(value = "INVOKE", target = "Ljava/util/function/IntSupplier;getAsInt()I")) private int wrapBrandArgb(IntSupplier originalSupplier, Operation original) { + if (!Client.INSTANCE.getLoadScreen()) return original.call(originalSupplier); return ColorHelper.getArgb(255, 35, 35, 35); } @@ -61,7 +67,12 @@ public LogoTextureMixin(Identifier location) { @WrapOperation(method = "loadContents", at = @At(value = "INVOKE", target = "Lnet/minecraft/resource/ResourceFactory;open(Lnet/minecraft/util/Identifier;)Ljava/io/InputStream;")) InputStream wrapLoadTextureData(ResourceFactory instance, Identifier id, Operation original) { - return LambdaResourceKt.getStream("textures/lambda_banner.png"); + if ("lambda".equals(id.getNamespace()) + && "textures/lambda_banner.png".equals(id.getPath())) { + return LambdaResourceKt.getStream("textures/lambda_banner.png"); + } + + return original.call(instance, id); } } } diff --git a/src/main/kotlin/com/lambda/module/modules/client/Client.kt b/src/main/kotlin/com/lambda/module/modules/client/Client.kt new file mode 100644 index 000000000..c1b12dcf8 --- /dev/null +++ b/src/main/kotlin/com/lambda/module/modules/client/Client.kt @@ -0,0 +1,30 @@ +/* + * 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 . + */ + +package com.lambda.module.modules.client + +import com.lambda.module.Module +import com.lambda.module.tag.ModuleTag + +object Client : Module( + name = "Client", + description = "Customize various client features.", + tag = ModuleTag.CLIENT, +) { + val loadScreen by setting("Custom Loading Screen", true) + val toggleSounds by setting("Toggle Sounds", true) +} \ No newline at end of file diff --git a/src/main/kotlin/com/lambda/sound/SoundManager.kt b/src/main/kotlin/com/lambda/sound/SoundManager.kt index 1e485a457..cd92d27fc 100644 --- a/src/main/kotlin/com/lambda/sound/SoundManager.kt +++ b/src/main/kotlin/com/lambda/sound/SoundManager.kt @@ -19,6 +19,7 @@ package com.lambda.sound import com.lambda.Lambda.mc import com.lambda.core.Loadable +import com.lambda.module.modules.client.Client import com.lambda.util.math.random import net.minecraft.client.sound.PositionedSoundInstance import net.minecraft.registry.Registries @@ -34,6 +35,7 @@ object SoundManager : Loadable { } fun playSoundRandomly(event: SoundEvent, pitch: Double = 1.0, pitchRange: Double = 0.05) { + if (!Client.toggleSounds) return val actualPitch = (pitch - pitchRange..pitch + pitchRange).random() mc.soundManager.play( From ca1594390a78e9052f15983d5794b55af9cbcba4 Mon Sep 17 00:00:00 2001 From: chadi <107775591+chaaadii@users.noreply.github.com> Date: Wed, 7 Jan 2026 17:28:23 -0500 Subject: [PATCH 2/2] Added 'Client' module with the ability to toggle the custom splash screen and client sounds. --- src/main/kotlin/com/lambda/module/Module.kt | 10 ++++++---- src/main/kotlin/com/lambda/sound/SoundManager.kt | 1 - 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/com/lambda/module/Module.kt b/src/main/kotlin/com/lambda/module/Module.kt index 2ba08c91b..2efb26b7c 100644 --- a/src/main/kotlin/com/lambda/module/Module.kt +++ b/src/main/kotlin/com/lambda/module/Module.kt @@ -36,6 +36,7 @@ import com.lambda.event.listener.Listener import com.lambda.event.listener.SafeListener import com.lambda.event.listener.SafeListener.Companion.listen import com.lambda.event.listener.UnsafeListener +import com.lambda.module.modules.client.Client import com.lambda.module.tag.ModuleTag import com.lambda.sound.LambdaSound import com.lambda.sound.SoundManager.play @@ -155,11 +156,12 @@ abstract class Module( else if (event.isReleased && disableOnRelease) disable() } - onEnable { LambdaSound.ModuleOn.play() } - onDisable { LambdaSound.ModuleOff.play() } + onEnable { if (Client.toggleSounds) LambdaSound.ModuleOn.play() } + onDisable { if (Client.toggleSounds) LambdaSound.ModuleOff.play() } - onEnableUnsafe { LambdaSound.ModuleOn.play() } - onDisableUnsafe { LambdaSound.ModuleOff.play() } + //not sure if these should also be effected, remove if not. + onEnableUnsafe { if (Client.toggleSounds) LambdaSound.ModuleOn.play() } + onDisableUnsafe { if (Client.toggleSounds) LambdaSound.ModuleOff.play() } listen { if (autoDisable) disable() } listen { if (autoDisable) disable() } diff --git a/src/main/kotlin/com/lambda/sound/SoundManager.kt b/src/main/kotlin/com/lambda/sound/SoundManager.kt index cd92d27fc..33e040cda 100644 --- a/src/main/kotlin/com/lambda/sound/SoundManager.kt +++ b/src/main/kotlin/com/lambda/sound/SoundManager.kt @@ -35,7 +35,6 @@ object SoundManager : Loadable { } fun playSoundRandomly(event: SoundEvent, pitch: Double = 1.0, pitchRange: Double = 0.05) { - if (!Client.toggleSounds) return val actualPitch = (pitch - pitchRange..pitch + pitchRange).random() mc.soundManager.play(