├── src └── main │ ├── resources │ ├── assets │ │ ├── shaders │ │ │ └── menu │ │ │ │ ├── vert.vsh │ │ │ │ ├── jupiter.fsh │ │ │ │ └── redglow.fsh │ │ ├── fonts │ │ │ ├── FiraSans-Bold.ttf │ │ │ ├── FiraSans-Italic.ttf │ │ │ └── FiraSans-Regular.ttf │ │ └── minecraft │ │ │ ├── lambda │ │ │ ├── lambda_map.png │ │ │ ├── lambda_icon.png │ │ │ └── textures │ │ │ │ ├── capes │ │ │ │ ├── border.png │ │ │ │ ├── primary.png │ │ │ │ └── contributor.png │ │ │ │ └── hungeroverlay.png │ │ │ └── shaders │ │ │ ├── program │ │ │ ├── kawase_blur.fsh │ │ │ ├── grainy_blur.vsh │ │ │ ├── grainy_blur.fsh │ │ │ ├── kawase_blur.vsh │ │ │ ├── kawase_blur.json │ │ │ └── esp_outline.fsh │ │ │ └── post │ │ │ └── grainy_blur.json │ ├── lambda.png │ └── mcmod.info │ ├── kotlin │ └── com │ │ └── lambda │ │ └── client │ │ ├── util │ │ ├── math │ │ │ ├── Vec3f.kt │ │ │ └── CoordinateConverter.kt │ │ ├── TaskState.kt │ │ ├── TimedFlag.kt │ │ ├── Quad.kt │ │ ├── world │ │ │ ├── PlaceInfo.kt │ │ │ └── Block.kt │ │ ├── graphics │ │ │ ├── font │ │ │ │ ├── Style.kt │ │ │ │ ├── CharInfo.kt │ │ │ │ ├── Alignment.kt │ │ │ │ └── GlyphChunk.kt │ │ │ └── texture │ │ │ │ └── AbstractTexture.kt │ │ ├── text │ │ │ ├── RomanNumerals.kt │ │ │ ├── TextFormatting.kt │ │ │ └── Detectors.kt │ │ ├── TimeoutFlag.kt │ │ ├── KamiCheck.kt │ │ ├── threads │ │ │ ├── CoroutineUtils.kt │ │ │ └── BackgroundJob.kt │ │ ├── color │ │ │ ├── ColorConverter.kt │ │ │ ├── EnumTextColor.kt │ │ │ └── DyeColors.kt │ │ ├── Wrapper.kt │ │ ├── InfoCalculator.kt │ │ └── TimerUtils.kt │ │ ├── commons │ │ ├── interfaces │ │ │ ├── Nameable.kt │ │ │ ├── DisplayEnum.kt │ │ │ └── Alias.kt │ │ ├── extension │ │ │ ├── Any.kt │ │ │ ├── Enum.kt │ │ │ ├── Math.kt │ │ │ ├── Map.kt │ │ │ ├── String.kt │ │ │ └── Collection.kt │ │ ├── utils │ │ │ ├── StringUtils.kt │ │ │ ├── SystemUtils.kt │ │ │ └── ClassUtils.kt │ │ └── collections │ │ │ └── AliasSet.kt │ │ ├── manager │ │ ├── Manager.kt │ │ ├── managers │ │ │ ├── PluginUpdater.kt │ │ │ ├── OnlineTimeManager.kt │ │ │ ├── NetworkManager.kt │ │ │ ├── NotificationManager.kt │ │ │ └── UUIDManager.kt │ │ └── ManagerLoader.kt │ │ ├── setting │ │ ├── GenericConfigClass.kt │ │ ├── GenericConfig.kt │ │ ├── settings │ │ │ ├── impl │ │ │ │ ├── other │ │ │ │ │ └── ColorSetting.kt │ │ │ │ ├── primitive │ │ │ │ │ ├── BooleanSetting.kt │ │ │ │ │ ├── StringSetting.kt │ │ │ │ │ └── EnumSetting.kt │ │ │ │ ├── number │ │ │ │ │ ├── NumberSetting.kt │ │ │ │ │ ├── IntegerSetting.kt │ │ │ │ │ ├── DoubleSetting.kt │ │ │ │ │ └── FloatSetting.kt │ │ │ │ └── collection │ │ │ │ │ └── MapSetting.kt │ │ │ └── ImmutableSetting.kt │ │ ├── configs │ │ │ ├── NameableConfig.kt │ │ │ └── IConfig.kt │ │ └── ModuleConfig.kt │ │ ├── event │ │ ├── events │ │ │ ├── BaritoneCommandEvent.kt │ │ │ ├── PushOutOfBlocksEvent.kt │ │ │ ├── ResolutionUpdateEvent.kt │ │ │ ├── CriticalsUpdateWalkingEvent.kt │ │ │ ├── ConnectionEvent.kt │ │ │ ├── ModuleToggleEvent.kt │ │ │ ├── BlockBreakEvent.kt │ │ │ ├── PlayerAttackEvent.kt │ │ │ ├── ShutdownEvent.kt │ │ │ ├── RenderOverlayEvent.kt │ │ │ ├── ChunkDataEvent.kt │ │ │ ├── AddCollisionBoxToListEvent.kt │ │ │ ├── GuiEvent.kt │ │ │ ├── RenderRadarEvent.kt │ │ │ ├── WaypointUpdateEvent.kt │ │ │ ├── BaritoneSettingsInitEvent.kt │ │ │ ├── WindowClickEvent.kt │ │ │ ├── PlayerTravelEvent.kt │ │ │ ├── RunGameLoopEvent.kt │ │ │ ├── PacketEvent.kt │ │ │ ├── RenderWorldEvent.kt │ │ │ ├── RenderEntityEvent.kt │ │ │ └── PlayerMoveEvent.kt │ │ ├── eventbus │ │ │ ├── IMultiEventBus.kt │ │ │ ├── IAsyncEventBus.kt │ │ │ ├── AbstractAsyncEventBus.kt │ │ │ ├── AbstractEventBus.kt │ │ │ ├── IEventBus.kt │ │ │ └── EventBusImpl.kt │ │ ├── listener │ │ │ ├── IListener.kt │ │ │ └── AbstractListener.kt │ │ └── LambdaEvents.kt │ │ ├── plugin │ │ └── api │ │ │ ├── IPluginClass.kt │ │ │ ├── PluginHudElement.kt │ │ │ └── PluginModule.kt │ │ ├── command │ │ ├── args │ │ │ ├── ArgIdentifier.kt │ │ │ └── AutoComplete.kt │ │ ├── utils │ │ │ ├── Invokable.kt │ │ │ ├── Exceptions.kt │ │ │ └── BlockTypeAlias.kt │ │ ├── commands │ │ │ ├── SayCommand.kt │ │ │ ├── LicenseCommand.kt │ │ │ ├── FakeMessageCommand.kt │ │ │ ├── ToggleCommand.kt │ │ │ ├── PrefixCommand.kt │ │ │ ├── VanishCommand.kt │ │ │ └── SetBuildingBlockCommand.kt │ │ └── execute │ │ │ ├── IExecuteEvent.kt │ │ │ ├── ExecuteOption.kt │ │ │ └── ExecuteEvent.kt │ │ ├── module │ │ ├── modules │ │ │ ├── player │ │ │ │ ├── TpsSync.kt │ │ │ │ ├── NoGhostBlocks.kt │ │ │ │ ├── XCarry.kt │ │ │ │ ├── NoPacketKick.kt │ │ │ │ ├── NoSwing.kt │ │ │ │ └── PortalGodMode.kt │ │ │ ├── client │ │ │ │ ├── Tooltips.kt │ │ │ │ ├── Plugins.kt │ │ │ │ ├── ChatSetting.kt │ │ │ │ ├── Hud.kt │ │ │ │ ├── HudEditor.kt │ │ │ │ └── GuiColors.kt │ │ │ ├── misc │ │ │ │ ├── AntiDisconnect.kt │ │ │ │ ├── AntiWeather.kt │ │ │ │ ├── MountBypass.kt │ │ │ │ ├── NoSoundLag.kt │ │ │ │ ├── PingSpoof.kt │ │ │ │ └── BeaconSelector.kt │ │ │ ├── chat │ │ │ │ └── PortalChat.kt │ │ │ ├── render │ │ │ │ └── CameraClip.kt │ │ │ ├── combat │ │ │ │ ├── AntiDeathScreen.kt │ │ │ │ ├── AntiFriendHit.kt │ │ │ │ └── AimBot.kt │ │ │ └── movement │ │ │ │ ├── AutoJump.kt │ │ │ │ ├── IceSpeed.kt │ │ │ │ └── ElytraFastClose.kt │ │ ├── Category.kt │ │ └── Module.kt │ │ ├── gui │ │ ├── clickgui │ │ │ ├── component │ │ │ │ ├── PluginWindow.kt │ │ │ │ ├── ImportPluginButton.kt │ │ │ │ └── ModuleButton.kt │ │ │ └── window │ │ │ │ └── ModuleSettingWindow.kt │ │ ├── rgui │ │ │ ├── component │ │ │ │ ├── BooleanSlider.kt │ │ │ │ ├── CheckButton.kt │ │ │ │ ├── Button.kt │ │ │ │ └── SettingButton.kt │ │ │ └── windows │ │ │ │ ├── CleanWindow.kt │ │ │ │ └── TitledWindow.kt │ │ ├── hudgui │ │ │ ├── elements │ │ │ │ ├── misc │ │ │ │ │ ├── Ping.kt │ │ │ │ │ ├── OnlineTime.kt │ │ │ │ │ ├── MemoryUsage.kt │ │ │ │ │ └── ServerInfo.kt │ │ │ │ ├── world │ │ │ │ │ └── Biome.kt │ │ │ │ ├── player │ │ │ │ │ ├── TimerSpeed.kt │ │ │ │ │ ├── Rotation.kt │ │ │ │ │ ├── Direction.kt │ │ │ │ │ └── Effects.kt │ │ │ │ └── client │ │ │ │ │ ├── Username.kt │ │ │ │ │ └── BaritoneProcess.kt │ │ │ ├── window │ │ │ │ └── HudSettingWindow.kt │ │ │ ├── HudElement.kt │ │ │ ├── LabelHud.kt │ │ │ └── component │ │ │ │ └── HudButton.kt │ │ └── mc │ │ │ ├── LambdaGuiStoreButton.kt │ │ │ └── LambdaGuiStealButton.kt │ │ ├── mixin │ │ └── extension │ │ │ └── Player.kt │ │ ├── capeapi │ │ └── UUIDUtils.kt │ │ └── process │ │ └── AutoObsidianProcess.kt │ └── java │ └── com │ └── lambda │ └── mixin │ ├── accessor │ ├── AccessorItemTool.java │ ├── gui │ │ ├── AccessorGuiScreen.java │ │ ├── AccessorGuiEditSign.java │ │ ├── AccessorGuiChat.java │ │ ├── AccessorGuiDisconnected.java │ │ └── AccessorGuiBossOverlay.java │ ├── AccessorTimer.java │ ├── network │ │ ├── AccessorCPacketCloseWindow.java │ │ ├── AccessorSPacketCloseWindow.java │ │ ├── AccessorCPacketChatMessage.java │ │ ├── AccessorCPacketClientSettings.java │ │ ├── AccessorCPacketSpectate.java │ │ ├── AccessorCPacketConfirmTransaction.java │ │ ├── AccessorCPacketResourcePackStatus.java │ │ ├── AccessorSPacketChat.java │ │ ├── AccessorSPacketPosLook.java │ │ ├── AccessorSPacketEntityHeadLook.java │ │ ├── AccessorCPacketPlayerAbilities.java │ │ ├── AccessorSPacketEntity.java │ │ ├── AccessorCPacketUseEntity.java │ │ ├── AccessorNetHandlerPlayClient.java │ │ ├── AccessorSPacketExplosion.java │ │ ├── AccessorSPacketEntityVelocity.java │ │ ├── AccessorCPacketVehicleMove.java │ │ ├── AccessorSPacketMaps.java │ │ ├── AccessorSPacketWorldBorder.java │ │ └── AccessorCPacketPlayer.java │ ├── AccessorEntityFireworkRocket.java │ ├── render │ │ ├── AccessorRenderGlobal.java │ │ ├── AccessorViewFrustum.java │ │ ├── AccessorShaderGroup.java │ │ └── AccessorRenderManager.java │ ├── AccessorEntity.java │ ├── player │ │ ├── AccessorEntityPlayerSP.java │ │ └── AccessorPlayerControllerMP.java │ ├── AccessorAnvilChunkLoader.java │ └── AccessorMinecraft.java │ ├── MixinElytraSound.java │ ├── entity │ ├── MixinEntityLlama.java │ └── MixinEntityPig.java │ ├── baritone │ └── MixinBaritoneSettings.java │ ├── optifine │ └── MixinConfig.java │ ├── world │ ├── MixinBlock.java │ ├── MixinBlockDragonEgg.java │ ├── MixinBlockFluidRenderer.java │ ├── MixinBlockWeb.java │ ├── MixinBlockSoulSand.java │ ├── MixinItemBlock.java │ ├── MixinBlockModelRenderer.java │ └── MixinBlockLiquid.java │ ├── MixinTileEntityBeacon.java │ ├── render │ ├── MixinParticleManager.java │ ├── MixinRender.java │ ├── MixinMapItemRenderer.java │ ├── MixinDebugRendererChunkBorder.java │ ├── MixinTileRendererDispatcher.java │ ├── MixinTileEntityRendererDispatcher.java │ ├── MixinLayerArmorBase.java │ ├── MixinLayerCape.java │ └── MixinLayerElytra.java │ └── gui │ ├── MixinGuiMultiplayer.java │ └── MixinGuiChat.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── detekt.yml ├── .github ├── PULL_REQUEST_TEMPLATE.md ├── CONTRIBUTING.md └── ISSUE_TEMPLATE │ ├── INCOMPATIBILITY_REPORT.md │ ├── FEATURE_REQUEST.md │ ├── ENHANCEMENT.md │ └── BUG_REPORT.md ├── gradle.properties └── setupWorkspace.sh /src/main/resources/assets/shaders/menu/vert.vsh: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | void main() { 4 | gl_Position = gl_Vertex; 5 | } -------------------------------------------------------------------------------- /src/main/resources/lambda.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lambda-client/lambda-legacy/HEAD/src/main/resources/lambda.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lambda-client/lambda-legacy/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/math/Vec3f.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.math 2 | 3 | class Vec3f(val x: Float, val y: Float, val z: Float) -------------------------------------------------------------------------------- /src/main/resources/assets/fonts/FiraSans-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lambda-client/lambda-legacy/HEAD/src/main/resources/assets/fonts/FiraSans-Bold.ttf -------------------------------------------------------------------------------- /src/main/resources/assets/fonts/FiraSans-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lambda-client/lambda-legacy/HEAD/src/main/resources/assets/fonts/FiraSans-Italic.ttf -------------------------------------------------------------------------------- /src/main/resources/assets/fonts/FiraSans-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lambda-client/lambda-legacy/HEAD/src/main/resources/assets/fonts/FiraSans-Regular.ttf -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/interfaces/Nameable.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.interfaces 2 | 3 | interface Nameable { 4 | val name: String 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/lambda/lambda_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lambda-client/lambda-legacy/HEAD/src/main/resources/assets/minecraft/lambda/lambda_map.png -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/interfaces/DisplayEnum.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.interfaces 2 | 3 | interface DisplayEnum { 4 | val displayName: String 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/lambda/lambda_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lambda-client/lambda-legacy/HEAD/src/main/resources/assets/minecraft/lambda/lambda_icon.png -------------------------------------------------------------------------------- /detekt.yml: -------------------------------------------------------------------------------- 1 | complexity: 2 | active: true 3 | ComplexMethod: 4 | active: false 5 | 6 | style: 7 | active: true 8 | UnnecessaryParentheses: 9 | active: false 10 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/interfaces/Alias.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.interfaces 2 | 3 | interface Alias : Nameable { 4 | val alias: Array 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/lambda/textures/capes/border.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lambda-client/lambda-legacy/HEAD/src/main/resources/assets/minecraft/lambda/textures/capes/border.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/lambda/textures/capes/primary.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lambda-client/lambda-legacy/HEAD/src/main/resources/assets/minecraft/lambda/textures/capes/primary.png -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/lambda/textures/hungeroverlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lambda-client/lambda-legacy/HEAD/src/main/resources/assets/minecraft/lambda/textures/hungeroverlay.png -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/manager/Manager.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.manager 2 | 3 | import com.lambda.client.util.Wrapper 4 | 5 | interface Manager { 6 | val mc get() = Wrapper.minecraft 7 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/GenericConfigClass.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting 2 | 3 | import com.lambda.client.commons.interfaces.Nameable 4 | 5 | interface GenericConfigClass : Nameable -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/lambda/textures/capes/contributor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lambda-client/lambda-legacy/HEAD/src/main/resources/assets/minecraft/lambda/textures/capes/contributor.png -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/BaritoneCommandEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | 5 | class BaritoneCommandEvent(val command: String) : Event -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/TaskState.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util 2 | 3 | class TaskState(done: Boolean = false) { 4 | var done = done 5 | set(_) { 6 | field = true 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/extension/Any.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.extension 2 | 3 | inline fun Any?.ifType(block: (T) -> Unit) { 4 | if (this is T) block(this) 5 | } 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/PushOutOfBlocksEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.* 4 | 5 | class PushOutOfBlocksEvent : Event, ICancellable by Cancellable() 6 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/ResolutionUpdateEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | 5 | class ResolutionUpdateEvent(val width: Int, val height: Int) : Event -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/plugin/api/IPluginClass.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.plugin.api 2 | 3 | import com.lambda.client.commons.interfaces.Nameable 4 | 5 | interface IPluginClass : Nameable { 6 | val pluginMain: Plugin 7 | } -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/CriticalsUpdateWalkingEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | 5 | /** 6 | * @author Doogie13 7 | * @since 20/12/2022 8 | */ 9 | class CriticalsUpdateWalkingEvent : Event -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/ConnectionEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | 5 | abstract class ConnectionEvent : Event { 6 | class Connect : ConnectionEvent() 7 | class Disconnect : ConnectionEvent() 8 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/ModuleToggleEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | import com.lambda.client.module.AbstractModule 5 | 6 | class ModuleToggleEvent internal constructor(val module: AbstractModule) : Event -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/BlockBreakEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | import net.minecraft.util.math.BlockPos 5 | 6 | class BlockBreakEvent(val breakerID: Int, val position: BlockPos, val progress: Int) : Event -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/PlayerAttackEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Cancellable 4 | import com.lambda.client.event.Event 5 | import net.minecraft.entity.Entity 6 | 7 | class PlayerAttackEvent(val entity: Entity) : Event, Cancellable() -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/ShutdownEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | import com.lambda.client.event.LambdaEventBus 5 | import com.lambda.client.event.SingletonEvent 6 | 7 | object ShutdownEvent : Event, SingletonEvent(LambdaEventBus) -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/RenderOverlayEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | import com.lambda.client.event.ProfilerEvent 5 | 6 | class RenderOverlayEvent : Event, ProfilerEvent { 7 | override val profilerName: String = "kbRender2D" 8 | } -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **Describe the pull** 2 | 3 | 4 | **Describe how this pull is helpful** 5 | 6 | 7 | **Additional context** 8 | 9 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/args/ArgIdentifier.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.args 2 | 3 | import com.lambda.client.commons.interfaces.Nameable 4 | 5 | /** 6 | * The ID for an argument 7 | */ 8 | @Suppress("UNUSED") 9 | data class ArgIdentifier(override val name: String) : Nameable 10 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/ChunkDataEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | import net.minecraft.world.chunk.Chunk 5 | 6 | /** 7 | * Event emitted when chunk data is read 8 | */ 9 | class ChunkDataEvent(val isFullChunk: Boolean, val chunk: Chunk): Event -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx3G 2 | org.gradle.caching=true 3 | org.gradle.parallel=true 4 | 5 | modGroup=com.lambda 6 | modVersion=3.4.0 7 | 8 | minecraftVersion=1.12.2 9 | forgeVersion=14.23.5.2860 10 | mappingsChannel=stable 11 | mappingsVersion=39-1.12 12 | 13 | kotlinVersion=1.9.0 14 | kotlinxCoroutinesVersion=1.7.2 15 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/GenericConfig.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting 2 | 3 | import com.lambda.client.setting.configs.NameableConfig 4 | import com.lambda.client.util.FolderUtils 5 | 6 | internal object GenericConfig : NameableConfig( 7 | "generic", 8 | "${FolderUtils.lambdaFolder}config/" 9 | ) -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/TimedFlag.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util 2 | 3 | class TimedFlag>(valueIn: T) { 4 | var value = valueIn 5 | set(value) { 6 | lastUpdateTime = System.currentTimeMillis() 7 | field = value 8 | } 9 | var lastUpdateTime = 0L 10 | private set 11 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/Quad.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util 2 | 3 | import java.io.Serializable 4 | 5 | data class Quad( 6 | val first: A, 7 | val second: B, 8 | val third: C, 9 | val fourth: D 10 | ) : Serializable { 11 | override fun toString(): String = "($first, $second, $third, $fourth)" 12 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/AddCollisionBoxToListEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | import net.minecraft.util.math.AxisAlignedBB 5 | 6 | /** 7 | * @author Doogie13 8 | * @since 06/10/2022 9 | */ 10 | class AddCollisionBoxToListEvent(val collisionBoxList : MutableList) : Event -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/GuiEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | import net.minecraft.client.gui.GuiScreen 5 | 6 | abstract class GuiEvent(var screen: GuiScreen?) : Event { 7 | class Displayed(screen: GuiScreen?) : GuiEvent(screen) 8 | class Closed(screen: GuiScreen?) : GuiEvent(screen) 9 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/RenderRadarEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | import com.lambda.client.util.graphics.VertexHelper 5 | 6 | class RenderRadarEvent( 7 | val vertexHelper: VertexHelper, 8 | val radius: Float, 9 | val scale: Float, 10 | val chunkLines: Boolean 11 | ) : Event -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/player/TpsSync.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.player 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | 6 | object TpsSync : Module( 7 | name = "TpsSync", 8 | description = "Synchronizes block states with the server TPS", 9 | category = Category.PLAYER 10 | ) 11 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/WaypointUpdateEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | import com.lambda.client.manager.managers.WaypointManager.Waypoint 5 | 6 | class WaypointUpdateEvent(val type: Type, val waypoint: Waypoint?) : Event { 7 | enum class Type { 8 | GET, ADD, REMOVE, CLEAR, RELOAD 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/AccessorItemTool.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor; 2 | 3 | import net.minecraft.item.ItemTool; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(ItemTool.class) 8 | public interface AccessorItemTool { 9 | 10 | @Accessor("attackDamage") 11 | float getAttackDamage(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/utils/StringUtils.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.utils 2 | 3 | inline fun buildString(block: StringBuilder.() -> Unit) = 4 | StringBuilder().apply(block).toString() 5 | 6 | fun grammar(amount: Int, singular: String, plural: String): String { 7 | return if (amount == 1) { 8 | "$amount $singular" 9 | } else { 10 | "$amount $plural" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/BaritoneSettingsInitEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | import com.lambda.client.event.LambdaEventBus 5 | import com.lambda.client.event.SingletonEvent 6 | 7 | /** 8 | * Posted at the return of when Baritone's Settings are initialized. 9 | */ 10 | object BaritoneSettingsInitEvent : Event, SingletonEvent(LambdaEventBus) -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/WindowClickEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Cancellable 4 | import com.lambda.client.event.Event 5 | import com.lambda.client.event.ICancellable 6 | import net.minecraft.inventory.ClickType 7 | 8 | class WindowClickEvent(val windowId: Int, val slotId: Int, val mouseButton: Int, val type: ClickType) : Event, ICancellable by Cancellable() -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/world/PlaceInfo.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.world 2 | 3 | import net.minecraft.util.EnumFacing 4 | import net.minecraft.util.math.BlockPos 5 | import net.minecraft.util.math.Vec3d 6 | 7 | class PlaceInfo( 8 | val pos: BlockPos, 9 | val side: EnumFacing, 10 | val dist: Double, 11 | val hitVecOffset: Vec3d, 12 | val hitVec: Vec3d, 13 | val placedPos: BlockPos 14 | ) -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/gui/AccessorGuiScreen.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.gui; 2 | 3 | import net.minecraft.client.gui.GuiScreen; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(value = GuiScreen.class) 8 | public interface AccessorGuiScreen { 9 | 10 | @Accessor("eventButton") 11 | void setEventButton(final int eventButton); 12 | } 13 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/PlayerTravelEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Cancellable 4 | import com.lambda.client.event.Event 5 | import com.lambda.client.event.ICancellable 6 | import com.lambda.client.event.ProfilerEvent 7 | 8 | class PlayerTravelEvent : Event, ICancellable by Cancellable(), ProfilerEvent { 9 | override val profilerName: String = "kbPlayerTravel" 10 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/clickgui/component/PluginWindow.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.clickgui.component 2 | 3 | import com.lambda.client.gui.rgui.windows.ListWindow 4 | 5 | class PluginWindow( 6 | cname: String, 7 | cPosX: Float, 8 | cPosY: Float, 9 | ) : ListWindow(cname, cPosX, cPosY, 120.0f, 200.0f, SettingGroup.CLICK_GUI, drawHandle = true) { 10 | override val minHeight: Float 11 | get() = 100.0f 12 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/client/Tooltips.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.client 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | 6 | object Tooltips : Module( 7 | name = "Tooltips", 8 | description = "Displays handy module descriptions in the GUI", 9 | category = Category.CLIENT, 10 | showOnArray = false, 11 | enabledByDefault = true 12 | ) 13 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/AccessorTimer.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor; 2 | 3 | import net.minecraft.util.Timer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(Timer.class) 8 | public interface AccessorTimer { 9 | 10 | @Accessor("tickLength") 11 | float getTickLength(); 12 | 13 | @Accessor("tickLength") 14 | void setTickLength(float value); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorCPacketCloseWindow.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketCloseWindow; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(CPacketCloseWindow.class) 8 | public interface AccessorCPacketCloseWindow { 9 | 10 | @Accessor("windowId") 11 | int kbGetWindowID(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorSPacketCloseWindow.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketCloseWindow; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(value = SPacketCloseWindow.class) 8 | public interface AccessorSPacketCloseWindow { 9 | @Accessor(value = "windowId") 10 | int getWindowId(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/Category.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module 2 | 3 | import com.lambda.client.commons.interfaces.DisplayEnum 4 | 5 | enum class Category(override val displayName: String) : DisplayEnum { 6 | CHAT("Chat"), 7 | CLIENT("Client"), 8 | COMBAT("Combat"), 9 | MISC("Misc"), 10 | MOVEMENT("Movement"), 11 | PLAYER("Player"), 12 | RENDER("Render"); 13 | 14 | override fun toString() = displayName 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/misc/AntiDisconnect.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.misc 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | 6 | object AntiDisconnect : Module( 7 | name = "AntiDisconnect", 8 | description = "Prevents you from accidently disconnecting", 9 | category = Category.MISC 10 | ) { 11 | val presses by setting("Button Presses", 3, 1..20, 1) 12 | } 13 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/graphics/font/Style.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.graphics.font 2 | 3 | import java.awt.Font 4 | 5 | enum class Style(val code: String, val codeChar: Char, val fontPath: String, val styleConst: Int) { 6 | REGULAR("§r", 'r', "/assets/fonts/FiraSans-Regular.ttf", Font.PLAIN), 7 | BOLD("§l", 'l', "/assets/fonts/FiraSans-Bold.ttf", Font.BOLD), 8 | ITALIC("§o", 'o', "/assets/fonts/FiraSans-Italic.ttf", Font.ITALIC) 9 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/manager/managers/PluginUpdater.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.manager.managers 2 | 3 | import com.lambda.client.gui.clickgui.LambdaClickGui 4 | import com.lambda.client.manager.Manager 5 | import com.lambda.client.util.threads.BackgroundScope 6 | 7 | object PluginUpdater : Manager { 8 | init { 9 | BackgroundScope.launchLooping("plugin", 1000L) { 10 | LambdaClickGui.updatePlugins() 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorCPacketChatMessage.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketChatMessage; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(CPacketChatMessage.class) 8 | public interface AccessorCPacketChatMessage { 9 | 10 | @Accessor("message") 11 | void setMessage(String value); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorCPacketClientSettings.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketClientSettings; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(value = CPacketClientSettings.class) 8 | public interface AccessorCPacketClientSettings { 9 | @Accessor(value = "view") 10 | int getView(); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorCPacketSpectate.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketSpectate; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | import java.util.UUID; 8 | 9 | @Mixin(value = CPacketSpectate.class) 10 | public interface AccessorCPacketSpectate { 11 | @Accessor(value = "id") 12 | UUID getId(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/RunGameLoopEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | import com.lambda.client.event.ProfilerEvent 5 | 6 | sealed class RunGameLoopEvent(override val profilerName: String) : Event, ProfilerEvent { 7 | class Start : RunGameLoopEvent("start") 8 | class Tick : RunGameLoopEvent("tick") 9 | class Render : RunGameLoopEvent("render") 10 | class End : RunGameLoopEvent("end") 11 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorCPacketConfirmTransaction.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketConfirmTransaction; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(value = CPacketConfirmTransaction.class) 8 | public interface AccessorCPacketConfirmTransaction { 9 | @Accessor(value = "accepted") 10 | boolean getAccepted(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/utils/Invokable.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.utils 2 | 3 | import com.lambda.client.command.execute.IExecuteEvent 4 | 5 | /** 6 | * Interface for class that can be invoked with an [IExecuteEvent] 7 | * 8 | * @param E Type of [IExecuteEvent], can be itself or its subtype 9 | */ 10 | interface Invokable { 11 | 12 | /** 13 | * Invoke this with [event] 14 | */ 15 | suspend fun invoke(event: E) 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/eventbus/IMultiEventBus.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.eventbus 2 | 3 | /** 4 | * Event bus that allow subscribing another [IEventBus] to it 5 | */ 6 | interface IMultiEventBus : IEventBus { 7 | /** 8 | * Subscribe an [eventBus] to this event bus 9 | */ 10 | fun subscribe(eventBus: IEventBus) 11 | 12 | /** 13 | * unsubscribes an [eventBus] from this event bus 14 | */ 15 | fun unsubscribe(eventBus: IEventBus) 16 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/graphics/font/CharInfo.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.graphics.font 2 | 3 | class CharInfo( 4 | /** Character's width */ 5 | val width: Double, 6 | 7 | /** Character's height */ 8 | val height: Double, 9 | 10 | /** Upper left u */ 11 | val u1: Double, 12 | 13 | /** Upper left v */ 14 | val v1: Double, 15 | 16 | /** Lower right u */ 17 | val u2: Double, 18 | 19 | /** Lower right v */ 20 | val v2: Double 21 | ) -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/chat/PortalChat.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.chat 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | import com.lambda.mixin.player.MixinEntityPlayerSP 6 | 7 | /** 8 | * @see MixinEntityPlayerSP 9 | */ 10 | object PortalChat : Module( 11 | name = "PortalChat", 12 | description = "Allows you to open GUIs in portals", 13 | category = Category.CHAT, 14 | showOnArray = false 15 | ) 16 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/AccessorEntityFireworkRocket.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor; 2 | 3 | import net.minecraft.entity.EntityLivingBase; 4 | import net.minecraft.entity.item.EntityFireworkRocket; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(EntityFireworkRocket.class) 9 | public interface AccessorEntityFireworkRocket { 10 | 11 | @Accessor("boostedEntity") 12 | EntityLivingBase getBoostedEntity(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/render/AccessorRenderGlobal.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.render; 2 | 3 | import net.minecraft.client.renderer.RenderGlobal; 4 | import net.minecraft.client.shader.ShaderGroup; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(RenderGlobal.class) 9 | public interface AccessorRenderGlobal { 10 | 11 | @Accessor("entityOutlineShader") 12 | ShaderGroup getEntityOutlineShader(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /.github/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | You are free to clone, modify Lambda and make pull requests, provided you follow 2 | the [license](https://github.com/lambda-client/lambda/blob/master/LICENSE.md). 3 | 4 | Before contributing please see the [Code of Conduct](https://github.com/lambda-client/lambda/blob/master/.github/CODE_OF_CONDUCT.md). 5 | 6 | See [Support](https://github.com/lambda-client/lambda/issues) for help. 7 | 8 | See this [this](https://github.com/lambda-client/lambda#contributing) page for contributing instructions. 9 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/AccessorEntity.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor; 2 | 3 | import net.minecraft.entity.Entity; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | @Mixin(Entity.class) 9 | public interface AccessorEntity { 10 | 11 | @Accessor("isInWeb") 12 | boolean getIsInWeb(); 13 | 14 | @Invoker("setFlag") 15 | void invokeSetFlag(int flag, boolean set); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorCPacketResourcePackStatus.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketResourcePackStatus; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(value = CPacketResourcePackStatus.class) 8 | public interface AccessorCPacketResourcePackStatus { 9 | @Accessor(value = "action") 10 | CPacketResourcePackStatus.Action getAction(); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorSPacketChat.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketChat; 4 | import net.minecraft.util.text.ITextComponent; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(SPacketChat.class) 9 | public interface AccessorSPacketChat { 10 | 11 | @Accessor("chatComponent") 12 | void setChatComponent(ITextComponent value); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorSPacketPosLook.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketPlayerPosLook; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(SPacketPlayerPosLook.class) 8 | public interface AccessorSPacketPosLook { 9 | 10 | @Accessor("yaw") 11 | void setYaw(float value); 12 | 13 | @Accessor("pitch") 14 | void setPitch(float value); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/misc/AntiWeather.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.misc 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | import com.lambda.mixin.world.MixinWorld 6 | 7 | /** 8 | * @see MixinWorld.getThunderStrengthHead 9 | * @see MixinWorld.getRainStrengthHead 10 | */ 11 | object AntiWeather : Module( 12 | name = "AntiWeather", 13 | description = "Removes rain and thunder from your world", 14 | category = Category.MISC 15 | ) 16 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorSPacketEntityHeadLook.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketEntityHeadLook; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(SPacketEntityHeadLook.class) 8 | public interface AccessorSPacketEntityHeadLook { 9 | 10 | @Accessor("entityId") 11 | int getEntityId(); 12 | 13 | @Accessor("entityId") 14 | void setEntityId(int value); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/render/AccessorViewFrustum.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.render; 2 | 3 | import net.minecraft.client.renderer.ViewFrustum; 4 | import net.minecraft.client.renderer.chunk.RenderChunk; 5 | import net.minecraft.util.math.BlockPos; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Invoker; 8 | 9 | @Mixin(ViewFrustum.class) 10 | public interface AccessorViewFrustum { 11 | 12 | @Invoker 13 | RenderChunk invokeGetRenderChunk(BlockPos pos); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/gui/AccessorGuiEditSign.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.gui; 2 | 3 | import net.minecraft.client.gui.inventory.GuiEditSign; 4 | import net.minecraft.tileentity.TileEntitySign; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(GuiEditSign.class) 9 | public interface AccessorGuiEditSign { 10 | 11 | @Accessor("tileSign") 12 | TileEntitySign getTileSign(); 13 | 14 | @Accessor("editLine") 15 | int getEditLine(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorCPacketPlayerAbilities.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketPlayerAbilities; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(value = CPacketPlayerAbilities.class) 8 | public interface AccessorCPacketPlayerAbilities { 9 | @Accessor(value = "flySpeed") 10 | float getFlySpeed(); 11 | @Accessor(value = "walkSpeed") 12 | float getWalkSpeed(); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/player/AccessorEntityPlayerSP.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.player; 2 | 3 | import net.minecraft.client.entity.EntityPlayerSP; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(EntityPlayerSP.class) 8 | public interface AccessorEntityPlayerSP { 9 | 10 | @Accessor("handActive") 11 | void kbSetHandActive(boolean value); 12 | 13 | @Accessor("lastReportedPosY") 14 | void lcSetLastReportedPosY(double value); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/text/RomanNumerals.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.text 2 | 3 | object RomanNumerals { 4 | fun numberToRoman(number: Int): String { 5 | return when (number) { 6 | 1 -> "I" 7 | 2 -> "II" 8 | 3 -> "III" 9 | 4 -> "IV" 10 | 5 -> "V" 11 | 6 -> "VI" 12 | 7 -> "VII" 13 | 8 -> "VIII" 14 | 9 -> "IX" 15 | 10 -> "X" 16 | else -> number.toString() 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/player/NoGhostBlocks.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.player 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | import com.lambda.mixin.world.MixinItemBlock 6 | 7 | /** 8 | * @see MixinItemBlock.ignoreSetBlockState 9 | */ 10 | object NoGhostBlocks : Module( 11 | name = "NoGhostBlocks", 12 | alias = arrayOf("NoGlitchBlocks"), 13 | description = "Syncs block interactions for strict environments", 14 | category = Category.PLAYER 15 | ) -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/TimeoutFlag.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util 2 | 3 | class TimeoutFlag private constructor( 4 | val value: T, 5 | private val timeoutTime: Long 6 | ) { 7 | fun timeout() = 8 | System.currentTimeMillis() > timeoutTime 9 | 10 | companion object { 11 | fun relative(value: T, timeout: Long) = 12 | TimeoutFlag(value, System.currentTimeMillis() + timeout) 13 | 14 | fun absolute(value: T, timeout: Long) = 15 | TimeoutFlag(value, timeout) 16 | } 17 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/rgui/component/BooleanSlider.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.rgui.component 2 | 3 | import com.lambda.client.util.graphics.AnimationUtils 4 | 5 | open class BooleanSlider( 6 | name: String, 7 | valueIn: Double, 8 | description: String, 9 | visibility: (() -> Boolean)? = null 10 | ) : Slider(name, valueIn, description, visibility) { 11 | override val renderProgress: Double 12 | get() = AnimationUtils.exponent(AnimationUtils.toDeltaTimeDouble(prevValue.lastUpdateTime), 200.0, prevValue.value, value) 13 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorSPacketEntity.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketEntity; 4 | import net.minecraft.network.play.server.SPacketEntityVelocity; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(SPacketEntity.class) 9 | public interface AccessorSPacketEntity { 10 | 11 | @Accessor("entityId") 12 | int getEntityId(); 13 | 14 | @Accessor("entityId") 15 | void setEntityId(int value); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/KamiCheck.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util 2 | 3 | import com.lambda.client.LambdaMod 4 | import java.net.URL 5 | 6 | object KamiCheck { 7 | var isKami: Boolean = false 8 | var didDisplayWarning: Boolean = false 9 | fun runCheck() { 10 | val kamiCheckList: List = this.javaClass.classLoader.getResources("org/kamiblue/client/KamiMod.class").toList() 11 | if (kamiCheckList.isNotEmpty()) { 12 | LambdaMod.LOG.error("KAMI Blue detected!") 13 | isKami = true 14 | } 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorCPacketUseEntity.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketUseEntity; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(CPacketUseEntity.class) 8 | public interface AccessorCPacketUseEntity { 9 | @Accessor("entityId") 10 | int getId(); 11 | 12 | @Accessor("entityId") 13 | void setId(int value); 14 | 15 | @Accessor("action") 16 | void setAction(CPacketUseEntity.Action value); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/eventbus/IAsyncEventBus.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.eventbus 2 | 3 | import com.lambda.client.event.listener.AsyncListener 4 | 5 | interface IAsyncEventBus : IEventBus { 6 | 7 | /** 8 | * A map for events and their subscribed listeners 9 | * 10 | * > 11 | */ 12 | val subscribedListenersAsync: MutableMap, MutableSet>> 13 | 14 | /** 15 | * Called when putting a new set to the map 16 | */ 17 | fun newSetAsync(): MutableSet> 18 | 19 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/settings/impl/other/ColorSetting.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting.settings.impl.other 2 | 3 | import com.lambda.client.setting.settings.MutableSetting 4 | import com.lambda.client.util.color.ColorHolder 5 | 6 | class ColorSetting( 7 | name: String, 8 | value: ColorHolder, 9 | val hasAlpha: Boolean = true, 10 | visibility: () -> Boolean = { true }, 11 | description: String = "" 12 | ) : MutableSetting(name, value, visibility, { _, input -> if (!hasAlpha) input.apply { a = 255 } else input }, description, unit = "") -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/commands/SayCommand.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.commands 2 | 3 | import com.lambda.client.command.ClientCommand 4 | import com.lambda.client.util.text.MessageSendHelper.sendServerMessage 5 | 6 | object SayCommand : ClientCommand( 7 | name = "say", 8 | description = "Allows you to send any message, even with a prefix in it." 9 | ) { 10 | init { 11 | greedy("message") { messageArg -> 12 | executeSafe { 13 | sendServerMessage(messageArg.value.trim()) 14 | } 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorNetHandlerPlayClient.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.client.network.NetHandlerPlayClient; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(value = NetHandlerPlayClient.class) 8 | public interface AccessorNetHandlerPlayClient { 9 | 10 | @Accessor(value = "doneLoadingTerrain") 11 | boolean isDoneLoadingTerrain(); 12 | 13 | @Accessor(value = "doneLoadingTerrain") 14 | void setDoneLoadingTerrain(boolean loaded); 15 | } 16 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/commands/LicenseCommand.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.commands 2 | 3 | import com.lambda.client.command.ClientCommand 4 | import com.lambda.client.util.text.MessageSendHelper 5 | 6 | object LicenseCommand : ClientCommand( 7 | name = "license", 8 | description = "Information about Lambda's license" 9 | ) { 10 | init { 11 | execute { 12 | MessageSendHelper.sendChatMessage("You can view Lambda's &7client&f License (LGPLv3) at &9https://github.com/lambda-client/lambda/blob/master/LICENSE.md") 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorSPacketExplosion.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketExplosion; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(SPacketExplosion.class) 8 | public interface AccessorSPacketExplosion { 9 | 10 | @Accessor("motionX") 11 | void setMotionX(float value); 12 | 13 | @Accessor("motionY") 14 | void setMotionY(float value); 15 | 16 | @Accessor("motionZ") 17 | void setMotionZ(float value); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorSPacketEntityVelocity.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketEntityVelocity; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(SPacketEntityVelocity.class) 8 | public interface AccessorSPacketEntityVelocity { 9 | 10 | @Accessor("motionX") 11 | void setMotionX(int value); 12 | 13 | @Accessor("motionY") 14 | void setMotionY(int value); 15 | 16 | @Accessor("motionZ") 17 | void setMotionZ(int value); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/extension/Enum.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.extension 2 | 3 | import com.lambda.client.commons.interfaces.DisplayEnum 4 | import com.lambda.client.util.text.capitalize 5 | 6 | fun > E.next(): E = declaringJavaClass.enumConstants.run { 7 | get((ordinal + 1) % size) 8 | } 9 | 10 | fun > E.previous(): E = declaringJavaClass.enumConstants.run { 11 | get((ordinal - 1).mod(size)) 12 | } 13 | 14 | fun Enum<*>.readableName() = (this as? DisplayEnum)?.displayName 15 | ?: name.mapEach('_') { low -> low.lowercase().capitalize() }.joinToString(" ") -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/client/Plugins.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.client 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | 6 | object Plugins : Module( 7 | name = "Plugins", 8 | description = "Config for plugins", 9 | category = Category.CLIENT, 10 | showOnArray = false, 11 | alwaysEnabled = true 12 | ) { 13 | private val tokenSetting by setting("Github Token", "") 14 | // ToDo: Add setting for other remote repositories here and save load status of plugins 15 | 16 | val token get() = tokenSetting 17 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/rgui/component/CheckButton.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.rgui.component 2 | 3 | import com.lambda.client.util.math.Vec2f 4 | 5 | class CheckButton( 6 | name: String, 7 | stateIn: Boolean, 8 | description: String = "", 9 | visibility: (() -> Boolean)? = null 10 | ) : BooleanSlider(name, 0.0, description, visibility) { 11 | init { 12 | value = if (stateIn) 1.0 else 0.0 13 | } 14 | 15 | override fun onClick(mousePos: Vec2f, buttonId: Int) { 16 | super.onClick(mousePos, buttonId) 17 | value = if (value == 1.0) 0.0 else 1.0 18 | } 19 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/AccessorAnvilChunkLoader.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor; 2 | 3 | import net.minecraft.nbt.NBTTagCompound; 4 | import net.minecraft.world.World; 5 | import net.minecraft.world.chunk.Chunk; 6 | import net.minecraft.world.chunk.storage.AnvilChunkLoader; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.gen.Invoker; 9 | 10 | @Mixin(AnvilChunkLoader.class) 11 | public interface AccessorAnvilChunkLoader { 12 | 13 | @Invoker("writeChunkToNBT") 14 | void invokeWriteChunkToNBT(Chunk chunkIn, World worldIn, NBTTagCompound compound); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/PacketEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Cancellable 4 | import com.lambda.client.event.Event 5 | import com.lambda.client.event.ICancellable 6 | import net.minecraft.network.Packet 7 | 8 | abstract class PacketEvent(val packet: Packet<*>) : Event, ICancellable by Cancellable() { 9 | class Receive(packet: Packet<*>) : PacketEvent(packet) 10 | class PostReceive(packet: Packet<*>) : PacketEvent(packet) 11 | class Send(packet: Packet<*>) : PacketEvent(packet) 12 | class PostSend(packet: Packet<*>) : PacketEvent(packet) 13 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/threads/CoroutineUtils.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.threads 2 | 3 | import kotlinx.coroutines.* 4 | 5 | /** 6 | * Single thread scope to use in Lambda 7 | */ 8 | @OptIn(DelicateCoroutinesApi::class, ExperimentalCoroutinesApi::class) 9 | val mainScope = CoroutineScope(newSingleThreadContext("Lambda Main")) 10 | 11 | /** 12 | * Common scope with [Dispatchers.Default] 13 | */ 14 | val defaultScope = CoroutineScope(Dispatchers.Default) 15 | 16 | /** 17 | * Return true if the job is active, or false is not active or null 18 | */ 19 | val Job?.isActiveOrFalse get() = this?.isActive ?: false -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/kawase_blur.fsh: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | uniform sampler2D DiffuseSampler; 4 | 5 | varying vec2 fragCoord1; 6 | varying vec2 fragCoord2; 7 | varying vec2 fragCoord3; 8 | varying vec2 fragCoord4; 9 | varying vec2 fragCoord5; 10 | 11 | void main() { 12 | vec4 color = texture2D(DiffuseSampler, fragCoord1); 13 | color += texture2D(DiffuseSampler, fragCoord2); 14 | color += texture2D(DiffuseSampler, fragCoord3); 15 | color += texture2D(DiffuseSampler, fragCoord4); 16 | color += texture2D(DiffuseSampler, fragCoord5); 17 | 18 | gl_FragColor = color * 0.2; 19 | } 20 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/elements/misc/Ping.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.elements.misc 2 | 3 | import com.lambda.client.event.SafeClientEvent 4 | import com.lambda.client.gui.hudgui.LabelHud 5 | import com.lambda.client.util.InfoCalculator 6 | 7 | internal object Ping : LabelHud( 8 | name = "Ping", 9 | category = Category.MISC, 10 | description = "Delay between client and server" 11 | ) { 12 | 13 | override fun SafeClientEvent.updateText() { 14 | displayText.add(InfoCalculator.ping().toString(), primaryColor) 15 | displayText.add("ms", secondaryColor) 16 | } 17 | 18 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/configs/NameableConfig.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting.configs 2 | 3 | import com.lambda.client.commons.interfaces.Nameable 4 | import com.lambda.client.setting.settings.AbstractSetting 5 | 6 | open class NameableConfig( 7 | name: String, 8 | filePath: String 9 | ) : AbstractConfig(name, filePath) { 10 | 11 | override fun addSettingToConfig(owner: T, setting: AbstractSetting<*>) { 12 | getGroupOrPut(owner.name).addSetting(setting) 13 | } 14 | 15 | override fun getSettings(owner: T) = getGroup(owner.name)?.getSettings() ?: emptyList() 16 | } 17 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/graphics/font/Alignment.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.graphics.font 2 | 3 | import com.lambda.client.commons.interfaces.DisplayEnum 4 | 5 | enum class HAlign(override val displayName: String, val multiplier: Float, val offset: Float) : DisplayEnum { 6 | LEFT("Left", 0.0f, -1.0f), 7 | CENTER("Center", 0.5f, 0.0f), 8 | RIGHT("Right", 1.0f, 1.0f) 9 | } 10 | 11 | enum class VAlign(override val displayName: String, val multiplier: Float, val offset: Float) : DisplayEnum { 12 | TOP("Top", 0.0f, -1.0f), 13 | CENTER("Center", 0.5f, 0.0f), 14 | BOTTOM("Bottom", 1.0f, 1.0f) 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/window/HudSettingWindow.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.window 2 | 3 | import com.lambda.client.gui.hudgui.AbstractHudElement 4 | import com.lambda.client.gui.rgui.windows.SettingWindow 5 | import com.lambda.client.setting.settings.AbstractSetting 6 | 7 | class HudSettingWindow( 8 | hudElement: AbstractHudElement, 9 | posX: Float, 10 | posY: Float 11 | ) : SettingWindow(hudElement.name, hudElement, posX, posY, SettingGroup.NONE) { 12 | 13 | override fun getSettingList(): List> { 14 | return element.settingList 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/render/AccessorShaderGroup.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.render; 2 | 3 | import net.minecraft.client.shader.Framebuffer; 4 | import net.minecraft.client.shader.Shader; 5 | import net.minecraft.client.shader.ShaderGroup; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | import java.util.List; 10 | 11 | @Mixin(ShaderGroup.class) 12 | public interface AccessorShaderGroup { 13 | @Accessor("listShaders") 14 | List getListShaders(); 15 | 16 | @Accessor("listFramebuffers") 17 | List getListFramebuffers(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/configs/IConfig.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting.configs 2 | 3 | import com.lambda.client.commons.interfaces.Nameable 4 | import java.io.File 5 | 6 | /** 7 | * Setting group that can be saved to a .json file 8 | */ 9 | interface IConfig : Nameable { 10 | 11 | /** Main file of the config */ 12 | val file: File 13 | 14 | /** Backup file of the config */ 15 | val backup: File 16 | 17 | /** 18 | * Save this group to its .json file 19 | */ 20 | fun save() 21 | 22 | /** 23 | * Load all setting values in from its .json file 24 | */ 25 | fun load() 26 | 27 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/elements/world/Biome.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.elements.world 2 | 3 | import com.lambda.client.event.SafeClientEvent 4 | import com.lambda.client.gui.hudgui.LabelHud 5 | 6 | internal object Biome : LabelHud( 7 | name = "Biome", 8 | category = Category.WORLD, 9 | description = "Display the current biome you are in" 10 | ) { 11 | 12 | override fun SafeClientEvent.updateText() { 13 | val biome = world.getBiome(player.position).biomeName ?: "Unknown" 14 | 15 | displayText.add(biome, primaryColor) 16 | displayText.add("Biome", secondaryColor) 17 | } 18 | 19 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/client/ChatSetting.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.client 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | 6 | object ChatSetting : Module( 7 | name = "ChatSetting", 8 | description = "Configures chat message manager", 9 | category = Category.CLIENT, 10 | showOnArray = false, 11 | alwaysEnabled = true 12 | ) { 13 | val delay by setting("Message Speed Limit", 0.5f, 0.1f..20.0f, 0.1f, description = "Delay between each message", unit = "s") 14 | val maxMessageQueueSize by setting("Max Message Queue Size", 50, 10..200, 5) 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/HudElement.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui 2 | 3 | import com.lambda.client.gui.rgui.Component 4 | import com.lambda.client.setting.GuiConfig 5 | import com.lambda.client.setting.settings.SettingRegister 6 | 7 | internal abstract class HudElement( 8 | name: String, 9 | alias: Array = emptyArray(), 10 | category: Category, 11 | description: String, 12 | alwaysListening: Boolean = false, 13 | enabledByDefault: Boolean = false, 14 | ) : AbstractHudElement(name, alias, category, description, alwaysListening, enabledByDefault, GuiConfig), 15 | SettingRegister by GuiConfig -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/render/AccessorRenderManager.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.render; 2 | 3 | import net.minecraft.client.renderer.entity.RenderManager; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(RenderManager.class) 8 | public interface AccessorRenderManager { 9 | 10 | @Accessor("renderPosX") 11 | double getRenderPosX(); 12 | 13 | @Accessor("renderPosY") 14 | double getRenderPosY(); 15 | 16 | @Accessor("renderPosZ") 17 | double getRenderPosZ(); 18 | 19 | @Accessor("renderOutlines") 20 | boolean getRenderOutlines(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/mc/LambdaGuiStoreButton.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.mc 2 | 3 | import com.lambda.client.module.modules.player.ChestStealer 4 | import com.lambda.client.util.Wrapper 5 | import net.minecraft.client.gui.GuiButton 6 | 7 | class LambdaGuiStoreButton(x: Int, y: Int) : 8 | GuiButton(420420, x, y, 50, 20, "Store") { 9 | override fun mouseReleased(mouseX: Int, mouseY: Int) { 10 | if (ChestStealer.mode == ChestStealer.Mode.MANUAL) { 11 | ChestStealer.storing = false 12 | playPressSound(Wrapper.minecraft.soundHandler) 13 | } 14 | super.mouseReleased(mouseX, mouseY) 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/gui/AccessorGuiChat.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.gui; 2 | 3 | import net.minecraft.client.gui.GuiChat; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(GuiChat.class) 8 | public interface AccessorGuiChat { 9 | 10 | @Accessor("historyBuffer") 11 | String getHistoryBuffer(); 12 | 13 | @Accessor("historyBuffer") 14 | void setHistoryBuffer(String value); 15 | 16 | @Accessor("sentHistoryCursor") 17 | int getSentHistoryCursor(); 18 | 19 | @Accessor("sentHistoryCursor") 20 | void setSentHistoryCursor(int value); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/mc/LambdaGuiStealButton.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.mc 2 | 3 | import com.lambda.client.module.modules.player.ChestStealer 4 | import com.lambda.client.util.Wrapper 5 | import net.minecraft.client.gui.GuiButton 6 | 7 | class LambdaGuiStealButton(x: Int, y: Int) : 8 | GuiButton(696969, x, y, 50, 20, "Steal") { 9 | override fun mouseReleased(mouseX: Int, mouseY: Int) { 10 | if (ChestStealer.mode == ChestStealer.Mode.MANUAL) { 11 | ChestStealer.stealing = false 12 | playPressSound(Wrapper.minecraft.soundHandler) 13 | } 14 | super.mouseReleased(mouseX, mouseY) 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/gui/AccessorGuiDisconnected.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.gui; 2 | 3 | import net.minecraft.client.gui.GuiDisconnected; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import net.minecraft.util.text.ITextComponent; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | 9 | @Mixin(GuiDisconnected.class) 10 | public interface AccessorGuiDisconnected { 11 | 12 | @Accessor("parentScreen") 13 | GuiScreen getParentScreen(); 14 | 15 | @Accessor("reason") 16 | String getReason(); 17 | 18 | @Accessor("message") 19 | ITextComponent getMessage(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/extension/Math.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.extension 2 | 3 | import kotlin.math.PI 4 | import kotlin.math.ceil 5 | import kotlin.math.floor 6 | 7 | const val PI_FLOAT = 3.14159265358979323846f 8 | 9 | fun Double.floorToInt() = floor(this).toInt() 10 | 11 | fun Float.floorToInt() = floor(this).toInt() 12 | 13 | fun Double.ceilToInt() = ceil(this).toInt() 14 | 15 | fun Float.ceilToInt() = ceil(this).toInt() 16 | 17 | fun Float.toRadian() = this / 180.0f * PI_FLOAT 18 | 19 | fun Double.toRadian() = this / 180.0 * PI 20 | 21 | fun Float.toDegree() = this * 180.0f / PI_FLOAT 22 | 23 | fun Double.toDegree() = this * 180.0 / PI -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/ModuleConfig.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting 2 | 3 | import com.lambda.client.module.AbstractModule 4 | import com.lambda.client.module.modules.client.Configurations 5 | import com.lambda.client.setting.configs.NameableConfig 6 | import com.lambda.client.util.FolderUtils 7 | import java.io.File 8 | 9 | internal object ModuleConfig : NameableConfig( 10 | "modules", 11 | "${FolderUtils.lambdaFolder}config/modules", 12 | ) { 13 | override val file: File get() = File("$filePath/${Configurations.modulePreset}.json") 14 | override val backup get() = File("$filePath/${Configurations.modulePreset}.bak") 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/clickgui/window/ModuleSettingWindow.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.clickgui.window 2 | 3 | import com.lambda.client.gui.rgui.windows.SettingWindow 4 | import com.lambda.client.module.AbstractModule 5 | import com.lambda.client.setting.settings.AbstractSetting 6 | 7 | class ModuleSettingWindow( 8 | module: AbstractModule, 9 | posX: Float, 10 | posY: Float 11 | ) : SettingWindow(module.name, module, posX, posY, SettingGroup.NONE) { 12 | 13 | override fun getSettingList(): List> { 14 | return element.fullSettingList.filter { it.name != "Enabled" && it.name != "Clicks" } 15 | } 16 | 17 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/render/CameraClip.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.render 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | import com.lambda.mixin.render.MixinEntityRenderer 6 | 7 | /** 8 | * @see MixinEntityRenderer.orientCameraStoreRayTraceBlocks 9 | */ 10 | object CameraClip : Module( 11 | name = "CameraClip", 12 | description = "Allows your 3rd person camera to pass through blocks", 13 | category = Category.RENDER, 14 | showOnArray = false 15 | ) { 16 | val distance by setting("Distance", 4.0, 1.0..10.0, 0.1, description = "Distance to player", unit = " blocks") 17 | } 18 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/threads/BackgroundJob.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.threads 2 | 3 | import kotlinx.coroutines.CoroutineScope 4 | 5 | class BackgroundJob( 6 | val name: String, 7 | val delay: () -> Long, 8 | val block: suspend CoroutineScope.() -> Unit 9 | ) { 10 | constructor(name: String, delay: Long, block: suspend CoroutineScope.() -> Unit) : this(name, { delay }, block) 11 | 12 | override fun equals(other: Any?) = this === other 13 | || (other is BackgroundJob 14 | && name == other.name 15 | && delay() == other.delay()) 16 | 17 | override fun hashCode() = 31 * name.hashCode() + delay().hashCode() 18 | 19 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/post/grainy_blur.json: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [ 3 | "swap" 4 | ], 5 | "passes": [ 6 | { 7 | "name": "grainy_blur", 8 | "intarget": "minecraft:main", 9 | "outtarget": "swap", 10 | "uniforms": [ 11 | { 12 | "name": "radius", 13 | "values": [ 14 | 2.0 15 | ] 16 | }, 17 | { 18 | "name": "iterations", 19 | "values": [ 20 | 8.0 21 | ] 22 | } 23 | ] 24 | }, 25 | { 26 | "name": "blit", 27 | "intarget": "swap", 28 | "outtarget": "minecraft:main" 29 | } 30 | ] 31 | } 32 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/rgui/windows/CleanWindow.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.rgui.windows 2 | 3 | import com.lambda.client.commons.interfaces.Nameable 4 | import com.lambda.client.gui.rgui.WindowComponent 5 | import com.lambda.client.setting.GuiConfig 6 | import com.lambda.client.setting.configs.AbstractConfig 7 | 8 | /** 9 | * Window with no rendering 10 | */ 11 | open class CleanWindow( 12 | name: String, 13 | posX: Float, 14 | posY: Float, 15 | width: Float, 16 | height: Float, 17 | settingGroup: SettingGroup, 18 | config: AbstractConfig = GuiConfig 19 | ) : WindowComponent(name, posX, posY, width, height, settingGroup, config) -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/mixin/extension/Player.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.mixin.extension 2 | 3 | import com.lambda.mixin.accessor.player.AccessorPlayerControllerMP 4 | import net.minecraft.client.multiplayer.PlayerControllerMP 5 | 6 | var PlayerControllerMP.blockHitDelay: Int 7 | get() = (this as AccessorPlayerControllerMP).blockHitDelay 8 | set(value) { 9 | (this as AccessorPlayerControllerMP).blockHitDelay = value 10 | } 11 | 12 | val PlayerControllerMP.currentPlayerItem: Int get() = (this as AccessorPlayerControllerMP).currentPlayerItem 13 | 14 | fun PlayerControllerMP.syncCurrentPlayItem() = (this as AccessorPlayerControllerMP).synchronizeCurrentPlayItem() -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/LabelHud.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui 2 | 3 | import com.lambda.client.gui.rgui.Component 4 | import com.lambda.client.setting.GuiConfig 5 | import com.lambda.client.setting.settings.SettingRegister 6 | 7 | internal abstract class LabelHud( 8 | name: String, 9 | alias: Array = emptyArray(), 10 | category: Category, 11 | description: String, 12 | alwaysListening: Boolean = false, 13 | enabledByDefault: Boolean = false, 14 | separator: String = " ", 15 | ) : AbstractLabelHud(name, alias, category, description, alwaysListening, enabledByDefault, GuiConfig, separator), 16 | SettingRegister by GuiConfig -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/INCOMPATIBILITY_REPORT.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Incompatibility Report 3 | about: Module incompatibility or incompatible with another Forge mod 4 | labels: -incompatible 5 | --- 6 | 7 | **What mod/module causes an issue?** 8 | 9 | 10 | **What issue is caused?** 11 | 12 | 13 | **Please attach your Minecraft logs** 14 | 15 | 16 | **Additional context** 17 | 18 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/manager/managers/OnlineTimeManager.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.manager.managers 2 | 3 | import com.lambda.client.event.events.ConnectionEvent 4 | import com.lambda.client.event.listener.listener 5 | import com.lambda.client.manager.Manager 6 | import kotlin.time.Duration 7 | import kotlin.time.TimeSource 8 | 9 | object OnlineTimeManager: Manager { 10 | 11 | private var connectTime = TimeSource.Monotonic.markNow() 12 | 13 | init { 14 | listener { 15 | connectTime = TimeSource.Monotonic.markNow() 16 | } 17 | } 18 | 19 | fun getOnlineTime(): Duration { 20 | return connectTime.elapsedNow() 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/grainy_blur.vsh: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | attribute vec4 Position; 4 | 5 | uniform mat4 ProjMat; 6 | uniform vec2 InSize; 7 | uniform vec2 OutSize; 8 | uniform vec2 randomSeed; 9 | uniform float radius; 10 | 11 | varying vec2 fragCoord; 12 | varying vec2 uv; 13 | varying vec2 offset; 14 | 15 | void main(){ 16 | vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); 17 | gl_Position = vec4(outPos.xy, 0.2, 1.0); 18 | 19 | fragCoord = Position.xy / OutSize; 20 | fragCoord.y = 1.0 - fragCoord.y; 21 | 22 | uv = 1.0 / InSize * radius; 23 | offset = vec2(sin(dot(fragCoord, randomSeed)), sin(dot(vec2(fragCoord.y, fragCoord.x), randomSeed))); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/plugin/api/PluginHudElement.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.plugin.api 2 | 3 | import com.lambda.client.gui.hudgui.AbstractHudElement 4 | import com.lambda.client.setting.settings.SettingRegister 5 | 6 | abstract class PluginHudElement( 7 | final override val pluginMain: Plugin, 8 | name: String, 9 | alias: Array = emptyArray(), 10 | category: Category, 11 | description: String, 12 | alwaysListening: Boolean = false, 13 | enabledByDefault: Boolean = false 14 | ) : AbstractHudElement(name, alias, category, description, alwaysListening, enabledByDefault, pluginMain.config), 15 | IPluginClass, 16 | SettingRegister by pluginMain.config 17 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/Module.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module 2 | 3 | import com.lambda.client.setting.ModuleConfig 4 | 5 | abstract class Module( 6 | name: String, 7 | alias: Array = emptyArray(), 8 | category: Category, 9 | description: String, 10 | modulePriority: Int = -1, 11 | alwaysListening: Boolean = false, 12 | showOnArray: Boolean = true, 13 | alwaysEnabled: Boolean = false, 14 | enabledByDefault: Boolean = false 15 | ) : AbstractModule( 16 | name, 17 | alias, 18 | category, 19 | description, 20 | modulePriority, 21 | alwaysListening, 22 | showOnArray, 23 | alwaysEnabled, 24 | enabledByDefault, 25 | ModuleConfig 26 | ) -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorCPacketVehicleMove.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketVehicleMove; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(value = CPacketVehicleMove.class) 8 | public interface AccessorCPacketVehicleMove { 9 | @Accessor(value = "x") 10 | void setX(double x); 11 | 12 | @Accessor(value = "y") 13 | void setY(double y); 14 | 15 | @Accessor(value = "z") 16 | void setZ(double z); 17 | 18 | @Accessor(value = "yaw") 19 | void setYaw(float yaw); 20 | 21 | @Accessor(value = "pitch") 22 | void setPitch(float pitch); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/resources/assets/shaders/menu/jupiter.fsh: -------------------------------------------------------------------------------- 1 | #ifdef GL_ES 2 | precision mediump float; 3 | #endif 4 | 5 | uniform vec2 resolution; 6 | uniform float time; 7 | uniform vec2 mouse; 8 | 9 | const float color_intensity = 0.45; 10 | 11 | const float Pi = 3.14159; 12 | 13 | void main() 14 | { 15 | vec2 p=(2.0*gl_FragCoord.xy-resolution)/max(resolution.x, resolution.y); 16 | for (int i=1;i<64;i++) 17 | { 18 | vec2 newp=p; 19 | newp.x+=1./float(i)*sin(float(i)*.5*p.y+time*.1)+1.; 20 | newp.y+=1./float(i)*cos(float(i)*.5*p.x+time*.1)-1.; 21 | p=newp; 22 | } 23 | vec3 col=vec3(sin(p.x+p.y)*.5+.5, sin(p.x+p.y+6.)*.5+.5, sin(p.x+p.y+12.)*.5+.5); 24 | gl_FragColor=vec4(col, 1.0); 25 | } 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | labels: new, -module 5 | --- 6 | 7 | **Is your feature request related to a problem? Please elaborate.** 8 | 9 | 10 | **Describe the solution or feature you'd like implemented.** 11 | 12 | 13 | **Describe alternatives you've considered.** 14 | 15 | 16 | **Additional context:** 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/gui/AccessorGuiBossOverlay.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.gui; 2 | 3 | import net.minecraft.client.gui.BossInfoClient; 4 | import net.minecraft.client.gui.GuiBossOverlay; 5 | import net.minecraft.world.BossInfo; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.gen.Accessor; 8 | import org.spongepowered.asm.mixin.gen.Invoker; 9 | 10 | import java.util.Map; 11 | import java.util.UUID; 12 | 13 | @Mixin(GuiBossOverlay.class) 14 | public interface AccessorGuiBossOverlay { 15 | 16 | @Accessor("mapBossInfos") 17 | Map getMapBossInfos(); 18 | 19 | @Invoker("render") 20 | void invokeRender(int x, int y, BossInfo info); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/text/TextFormatting.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.text 2 | 3 | import com.lambda.client.util.color.EnumTextColor 4 | import net.minecraft.util.text.TextFormatting 5 | import java.util.* 6 | 7 | fun formatValue(value: String) = TextFormatting.GRAY format "[$value]" 8 | 9 | fun formatValue(value: Any) = TextFormatting.GRAY format "[$value]" 10 | 11 | fun formatValue(value: Int) = TextFormatting.GRAY format "($value)" 12 | 13 | infix fun TextFormatting.format(value: Any) = "$this$value${TextFormatting.RESET}" 14 | 15 | infix fun EnumTextColor.format(value: Any) = "$this$value${TextFormatting.RESET}" 16 | 17 | fun String.capitalize() = replaceFirstChar { if (it.isLowerCase()) it.titlecase(Locale.getDefault()) else it.toString() } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/MixinElytraSound.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin; 2 | 3 | import com.lambda.client.module.modules.movement.ElytraFlight; 4 | import net.minecraft.client.audio.ElytraSound; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 9 | 10 | @Mixin(ElytraSound.class) 11 | public class MixinElytraSound { 12 | @Inject(method = "update", at = @At("HEAD"), cancellable = true) 13 | public void update(CallbackInfo ci) { 14 | if (ElytraFlight.INSTANCE.isEnabled() && !ElytraFlight.INSTANCE.getElytraSounds()) { 15 | ci.cancel(); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/color/ColorConverter.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.color 2 | 3 | object ColorConverter { 4 | fun toF(i: Int): Float { 5 | return i / 255f 6 | } 7 | 8 | fun toF(d: Double): Float { 9 | return (d / 255f).toFloat() 10 | } 11 | 12 | fun rgbToHex(r: Int, g: Int, b: Int, a: Int): Int { 13 | return r shl 16 or (g shl 8) or b or (a shl 24) 14 | } 15 | 16 | fun rgbToHex(r: Int, g: Int, b: Int): Int { 17 | return r shl 16 or (g shl 8) or b 18 | } 19 | 20 | fun hexToRgb(hexColor: Int): ColorHolder { 21 | val r = hexColor shr 16 and 255 22 | val g = hexColor shr 8 and 255 23 | val b = hexColor and 255 24 | return ColorHolder(r, g, b) 25 | } 26 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/ENHANCEMENT.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Enhancement to an existing feature 3 | about: Suggest an idea for a feature 4 | labels: enhancement, -module 5 | --- 6 | 7 | **Is your enhancement request related to a problem? Please describe.** 8 | 9 | 10 | **Describe the solution you'd like in order to enchance your experience.** 11 | 12 | 13 | **Describe alternatives you've considered** 14 | 15 | 16 | **Additional context** 17 | 18 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/clickgui/component/ImportPluginButton.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.clickgui.component 2 | 3 | import com.lambda.client.gui.rgui.component.BooleanSlider 4 | import com.lambda.client.util.FolderUtils 5 | import com.lambda.client.util.math.Vec2f 6 | 7 | object ImportPluginButton : BooleanSlider("Import...", 0.0, "Import plugins to Lambda") { 8 | override fun onClick(mousePos: Vec2f, buttonId: Int) { 9 | super.onClick(mousePos, buttonId) 10 | if (buttonId == 0) FolderUtils.openFolder(FolderUtils.pluginFolder) 11 | } 12 | 13 | override fun onRelease(mousePos: Vec2f, buttonId: Int) { 14 | super.onRelease(mousePos, buttonId) 15 | if (buttonId == 1) FolderUtils.openFolder(FolderUtils.pluginFolder) 16 | } 17 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/BUG_REPORT.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | labels: bug, -module 5 | --- 6 | 7 | **Describe the bug** 8 | 9 | 10 | **Steps to reproduce the bug** 11 | 12 | 13 | 1. Go to '...' 14 | 2. Click on '....' 15 | 3. Scroll down to '....' 16 | 4. See error 17 | 18 | **Expected behavior** 19 | 20 | 21 | **Debug info** 22 | 23 | 24 | **Additional context / media** 25 | 26 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/entity/MixinEntityLlama.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.entity; 2 | 3 | import com.lambda.client.module.modules.movement.EntitySpeed; 4 | import net.minecraft.entity.passive.EntityLlama; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | 10 | @Mixin(EntityLlama.class) 11 | public class MixinEntityLlama { 12 | 13 | @Inject(method = "canBeSteered", at = @At("RETURN"), cancellable = true) 14 | public void canBeSteered(CallbackInfoReturnable returnable) { 15 | if (EntitySpeed.INSTANCE.isEnabled()) returnable.setReturnValue(true); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/elements/player/TimerSpeed.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.elements.player 2 | 3 | import com.lambda.client.commons.utils.MathUtils 4 | import com.lambda.client.event.SafeClientEvent 5 | import com.lambda.client.gui.hudgui.LabelHud 6 | import com.lambda.client.manager.managers.TimerManager 7 | 8 | internal object TimerSpeed : LabelHud( 9 | name = "TimerSpeed", 10 | category = Category.PLAYER, 11 | description = "Client side timer speed" 12 | ) { 13 | 14 | override fun SafeClientEvent.updateText() { 15 | val timerSpeed = MathUtils.round(50.0f / TimerManager.tickLength, 2) 16 | 17 | displayText.add("%.2f".format(timerSpeed), primaryColor) 18 | displayText.add("x", secondaryColor) 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/grainy_blur.fsh: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | uniform sampler2D DiffuseSampler; 4 | 5 | uniform vec2 randomSeed; 6 | uniform float iterations; 7 | 8 | varying vec2 fragCoord; 9 | varying vec2 uv; 10 | varying vec2 offset; 11 | 12 | void main() { 13 | int intIterations = int(iterations); 14 | vec2 randomOffset = offset; 15 | vec4 color = texture2D(DiffuseSampler, fragCoord + randomOffset * uv); 16 | 17 | for (int i = 1; i < intIterations; i++) { 18 | color += texture2D(DiffuseSampler, fragCoord + randomOffset * uv); 19 | randomOffset = vec2(sin(dot(randomOffset, randomSeed)), sin(dot(vec2(randomOffset.y, randomOffset.x), randomSeed))); 20 | } 21 | 22 | gl_FragColor = color / float(intIterations); 23 | } 24 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/player/XCarry.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.player 2 | 3 | import com.lambda.client.event.events.PacketEvent 4 | import com.lambda.client.event.listener.listener 5 | import com.lambda.client.mixin.extension.windowID 6 | import com.lambda.client.module.Category 7 | import com.lambda.client.module.Module 8 | import net.minecraft.network.play.client.CPacketCloseWindow 9 | 10 | object XCarry : Module( 11 | name = "XCarry", 12 | description = "Store items in crafting slots", 13 | category = Category.PLAYER 14 | ) { 15 | init { 16 | listener { 17 | if (it.packet is CPacketCloseWindow && it.packet.windowID == 0) { 18 | it.cancel() 19 | } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/utils/Exceptions.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.utils 2 | 3 | import com.lambda.client.command.AbstractCommandManager 4 | import com.lambda.client.command.Command 5 | 6 | /** 7 | * Exception throws when no command is found in a [AbstractCommandManager] 8 | * 9 | * @see AbstractCommandManager.getCommand 10 | */ 11 | class CommandNotFoundException(val command: String?) : 12 | Exception("Command not found: '$command'.") 13 | 14 | /** 15 | * Exception throws when no subcommand is found for a [Command] 16 | * 17 | * @see Command.invoke 18 | */ 19 | class SubCommandNotFoundException(args: Array, val command: Command<*>) : 20 | Exception("No matching sub command found for args: \"${args.sliceArray(1 until args.size).joinToString(" ")}\".") 21 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/elements/client/Username.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.elements.client 2 | 3 | import com.lambda.client.event.SafeClientEvent 4 | import com.lambda.client.gui.hudgui.LabelHud 5 | 6 | internal object Username : LabelHud( 7 | name = "Username", 8 | category = Category.CLIENT, 9 | description = "Player username" 10 | ) { 11 | 12 | private val prefix = setting("Prefix", "Welcome") 13 | private val suffix = setting("Suffix", "") 14 | 15 | override fun SafeClientEvent.updateText() { 16 | if (prefix.value != "") displayText.add(prefix.value, primaryColor) 17 | displayText.add(mc.session.username, secondaryColor) 18 | if (suffix.value != "") displayText.add(suffix.value, primaryColor) 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/listener/IListener.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.listener 2 | 3 | interface IListener : Comparable> { 4 | 5 | /** 6 | * Object of this listener belongs to 7 | */ 8 | val owner: Any? 9 | 10 | /** 11 | * Name of the [owner] 12 | */ 13 | val ownerName: String 14 | 15 | /** 16 | * Class of the target event 17 | */ 18 | val eventClass: Class 19 | 20 | /** 21 | * Priority of this listener when calling by event bus 22 | */ 23 | val priority: Int 24 | 25 | /** 26 | * Action to perform when this listener gets called by event bus 27 | */ 28 | val function: F 29 | 30 | /** 31 | * An unique id for a listener 32 | */ 33 | val id: Int 34 | 35 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/baritone/MixinBaritoneSettings.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.baritone; 2 | 3 | import baritone.api.Settings; 4 | import com.lambda.client.event.events.BaritoneSettingsInitEvent; 5 | import com.lambda.client.util.BaritoneUtils; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(value = Settings.class, remap = false) 12 | public class MixinBaritoneSettings { 13 | @Inject(method = "", at = @At("RETURN")) 14 | private void baritoneSettingsInit(CallbackInfo ci) { 15 | BaritoneUtils.INSTANCE.setInitialized(true); 16 | BaritoneSettingsInitEvent.INSTANCE.post(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/optifine/MixinConfig.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.optifine; 2 | 3 | import org.spongepowered.asm.mixin.Mixin; 4 | import org.spongepowered.asm.mixin.Pseudo; 5 | import org.spongepowered.asm.mixin.injection.At; 6 | import org.spongepowered.asm.mixin.injection.Inject; 7 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 8 | 9 | /** 10 | * Thanks optifine :wheelchair: 11 | */ 12 | @Pseudo 13 | @SuppressWarnings("UnresolvedMixinReference") 14 | @Mixin(targets = "Config", remap = false) 15 | public class MixinConfig { 16 | @Inject(method = "isFastRender", at = @At("HEAD"), cancellable = true, remap = false) 17 | private static void isFastRender(CallbackInfoReturnable isFastRender) { 18 | isFastRender.setReturnValue(false); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/utils/BlockTypeAlias.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.utils 2 | 3 | import com.lambda.client.command.CommandBuilder 4 | import com.lambda.client.command.args.AbstractArg 5 | import com.lambda.client.command.args.ArgIdentifier 6 | import com.lambda.client.command.execute.IExecuteEvent 7 | 8 | /** 9 | * Type alias for a block used for execution of a argument combination 10 | * 11 | * @param E Type of [IExecuteEvent], can be itself or its subtype 12 | * 13 | * @see CommandBuilder.execute 14 | */ 15 | typealias ExecuteBlock = suspend E.() -> Unit 16 | 17 | /** 18 | * Type alias for a block used for Argument building 19 | * 20 | * @param T Type of argument 21 | * 22 | * @see CommandBuilder 23 | */ 24 | typealias BuilderBlock = AbstractArg.(ArgIdentifier) -> Unit 25 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/manager/managers/NetworkManager.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.manager.managers 2 | 3 | import com.lambda.client.manager.Manager 4 | import com.lambda.client.util.threads.BackgroundScope 5 | import java.net.InetSocketAddress 6 | import java.net.Socket 7 | 8 | object NetworkManager : Manager { 9 | 10 | var isOffline = false; private set 11 | 12 | init { 13 | BackgroundScope.launchLooping("offline", 1500L) { 14 | isOffline = try { 15 | Socket().use { socket -> 16 | socket.connect(InetSocketAddress("1.1.1.1", 80), 100) 17 | false 18 | } 19 | } catch (e: Exception) { 20 | true // Either timeout or unreachable or failed DNS lookup. 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/settings/ImmutableSetting.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting.settings 2 | 3 | /** 4 | * Basic ImmutableSetting class 5 | * 6 | * @param T Type of this setting 7 | * @param name Name of this setting 8 | * @param visibility Called by [isVisible] 9 | * @param consumer Called on setting [value] to process the value input 10 | * @param description Description of this setting 11 | */ 12 | abstract class ImmutableSetting( 13 | override val name: String, 14 | valueIn: T, 15 | override val visibility: () -> Boolean, 16 | val consumer: (prev: T, input: T) -> T, 17 | override val description: String, 18 | override val unit: String 19 | ) : AbstractSetting() { 20 | override val value: T = valueIn 21 | override val valueClass: Class = valueIn.javaClass 22 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/settings/impl/primitive/BooleanSetting.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting.settings.impl.primitive 2 | 3 | import com.google.gson.JsonElement 4 | import com.google.gson.JsonPrimitive 5 | import com.lambda.client.setting.settings.MutableSetting 6 | 7 | open class BooleanSetting( 8 | name: String, 9 | value: Boolean, 10 | visibility: () -> Boolean = { true }, 11 | consumer: (prev: Boolean, input: Boolean) -> Boolean = { _, input -> input }, 12 | description: String = "" 13 | ) : MutableSetting(name, value, visibility, consumer, description, unit = "") { 14 | 15 | override fun write(): JsonElement = JsonPrimitive(value) 16 | 17 | override fun read(jsonElement: JsonElement?) { 18 | jsonElement?.asJsonPrimitive?.asBoolean?.let { value = it } 19 | } 20 | 21 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/combat/AntiDeathScreen.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.combat 2 | 3 | import com.lambda.client.event.events.GuiEvent 4 | import com.lambda.client.module.Category 5 | import com.lambda.client.module.Module 6 | import com.lambda.client.util.threads.safeListener 7 | import net.minecraft.client.gui.GuiGameOver 8 | 9 | object AntiDeathScreen : Module( 10 | name = "AntiDeathScreen", 11 | description = "Fixes random death screen glitches", 12 | category = Category.COMBAT 13 | ) { 14 | init { 15 | safeListener { 16 | if (it.screen !is GuiGameOver) return@safeListener 17 | if (player.health > 0) { 18 | player.respawnPlayer() 19 | mc.displayGuiScreen(null) 20 | } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/manager/managers/NotificationManager.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.manager.managers 2 | 3 | import com.lambda.client.manager.Manager 4 | import com.lambda.client.util.text.MessageSendHelper 5 | import com.lambda.client.util.threads.safeListener 6 | import net.minecraftforge.fml.common.gameevent.TickEvent 7 | import java.util.* 8 | 9 | object NotificationManager : Manager { 10 | private val pendingNotifications: Queue = LinkedList() 11 | 12 | init { 13 | safeListener { 14 | while (pendingNotifications.isNotEmpty()) { 15 | MessageSendHelper.sendErrorMessage(pendingNotifications.poll()) 16 | } 17 | } 18 | } 19 | 20 | fun registerNotification(message: String) { 21 | pendingNotifications.add(message) 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/world/MixinBlock.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.world; 2 | 3 | import com.lambda.client.module.modules.render.Xray; 4 | import net.minecraft.block.Block; 5 | import net.minecraft.block.state.IBlockState; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 10 | 11 | @Mixin(Block.class) 12 | public class MixinBlock { 13 | @Inject(method = "getLightValue(Lnet/minecraft/block/state/IBlockState;)I", at = @At("HEAD"), cancellable = true) 14 | public void getLightValue(IBlockState state, CallbackInfoReturnable cir) { 15 | if (Xray.INSTANCE.isEnabled()) { 16 | cir.setReturnValue(15); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/utils/SystemUtils.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.utils 2 | 3 | import java.awt.Toolkit 4 | import java.awt.datatransfer.Clipboard 5 | import java.awt.datatransfer.DataFlavor 6 | import java.awt.datatransfer.StringSelection 7 | 8 | object SystemUtils { 9 | 10 | fun setClipboard(text: String) { 11 | val selection = StringSelection(text) 12 | val clipboard: Clipboard = Toolkit.getDefaultToolkit().systemClipboard 13 | clipboard.setContents(selection, null) 14 | } 15 | 16 | fun getClipboard(): String? { 17 | val clipboard: Clipboard = Toolkit.getDefaultToolkit().systemClipboard 18 | return try { 19 | clipboard.getData(DataFlavor.stringFlavor)?.toString() 20 | } catch (e: Exception) { 21 | null 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/plugin/api/PluginModule.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.plugin.api 2 | 3 | import com.lambda.client.module.AbstractModule 4 | import com.lambda.client.module.Category 5 | 6 | abstract class PluginModule( 7 | final override val pluginMain: Plugin, 8 | name: String, 9 | alias: Array = emptyArray(), 10 | category: Category, 11 | description: String, 12 | modulePriority: Int = -1, 13 | alwaysListening: Boolean = false, 14 | showOnArray: Boolean = true, 15 | alwaysEnabled: Boolean = false, 16 | enabledByDefault: Boolean = false 17 | ) : IPluginClass, AbstractModule( 18 | name, 19 | alias, 20 | category, 21 | description, 22 | modulePriority, 23 | alwaysListening, 24 | showOnArray, 25 | alwaysEnabled, 26 | enabledByDefault, 27 | pluginMain.config 28 | ) -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/args/AutoComplete.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.args 2 | 3 | interface AutoComplete { 4 | fun completeForInput(string: String): String? 5 | } 6 | 7 | class DynamicPrefixMatch( 8 | private val matchList: () -> Collection? 9 | ) : AutoComplete { 10 | override fun completeForInput(string: String): String? { 11 | if (string.isBlank()) return null 12 | val list = matchList() ?: return null 13 | 14 | return list.find { it.startsWith(string, true) } 15 | } 16 | } 17 | 18 | class StaticPrefixMatch( 19 | private val matchList: Collection 20 | ) : AutoComplete { 21 | override fun completeForInput(string: String): String? { 22 | if (string.isBlank()) return null 23 | 24 | return matchList.find { it.startsWith(string, true) } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/RenderWorldEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Event 4 | import com.lambda.client.event.ProfilerEvent 5 | import com.lambda.client.mixin.extension.renderPosX 6 | import com.lambda.client.mixin.extension.renderPosY 7 | import com.lambda.client.mixin.extension.renderPosZ 8 | import com.lambda.client.util.Wrapper 9 | import com.lambda.client.util.graphics.LambdaTessellator 10 | 11 | class RenderWorldEvent : Event, ProfilerEvent { 12 | override val profilerName: String = "kbRender3D" 13 | 14 | init { 15 | LambdaTessellator.buffer.setTranslation( 16 | -Wrapper.minecraft.renderManager.renderPosX, 17 | -Wrapper.minecraft.renderManager.renderPosY, 18 | -Wrapper.minecraft.renderManager.renderPosZ 19 | ) 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/commands/FakeMessageCommand.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.commands 2 | 3 | import com.lambda.client.command.ClientCommand 4 | import com.lambda.client.module.modules.chat.ChatTimestamp 5 | import com.lambda.client.util.text.MessageSendHelper 6 | 7 | object FakeMessageCommand : ClientCommand( 8 | name = "fakemsg", 9 | alias = arrayOf("fm", "fakemsg"), 10 | description = "Send a client side fake message, use & with formatting codes." 11 | ) { 12 | init { 13 | greedy("message") { messageArg -> 14 | execute("Use & for color formatting") { 15 | MessageSendHelper.sendRawChatMessage(getTime() + messageArg.value.replace('&', '§')) 16 | } 17 | } 18 | } 19 | 20 | private fun getTime() = if (ChatTimestamp.isEnabled) ChatTimestamp.formattedTime else "" 21 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/client/Hud.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.client 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | import com.lambda.client.util.color.ColorHolder 6 | 7 | object Hud : Module( 8 | name = "Hud", 9 | description = "Toggles Hud displaying and settings", 10 | category = Category.CLIENT, 11 | showOnArray = false, 12 | enabledByDefault = true 13 | ) { 14 | val hudFrame by setting("Hud Frame", false) 15 | val primaryColor by setting("Primary Color", ColorHolder(255, 240, 246), false) 16 | val secondaryColor by setting("Secondary Color", ColorHolder(108, 0, 43), false) 17 | val textShadow by setting("Text Shadow", true) 18 | val chatSnap by setting("Chat Snap", true) 19 | val collisionSnapping by setting("Collision Snapping", true) 20 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/player/NoPacketKick.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.player 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | import com.lambda.client.util.text.MessageSendHelper.sendWarningMessage 6 | import com.lambda.mixin.network.MixinNetworkManager 7 | 8 | /** 9 | * @see MixinNetworkManager 10 | */ 11 | object NoPacketKick : Module( 12 | name = "NoPacketKick", 13 | description = "Suppress network exceptions and prevent getting kicked", 14 | category = Category.PLAYER, 15 | showOnArray = false, 16 | enabledByDefault = true 17 | ) { 18 | @JvmStatic 19 | fun sendWarning(throwable: Throwable) { 20 | sendWarningMessage("$chatName Caught exception - \"$throwable\" check log for more info.") 21 | throwable.printStackTrace() 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/Wrapper.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util 2 | 3 | import com.lambda.client.LambdaMod 4 | import com.lambda.client.event.events.ShutdownEvent 5 | import com.lambda.client.util.ConfigUtils.saveAll 6 | import net.minecraft.client.Minecraft 7 | import net.minecraft.client.entity.EntityPlayerSP 8 | import net.minecraft.client.multiplayer.WorldClient 9 | 10 | object Wrapper { 11 | @JvmStatic 12 | val minecraft: Minecraft 13 | get() = Minecraft.getMinecraft() 14 | 15 | @JvmStatic 16 | val player: EntityPlayerSP? 17 | get() = minecraft.player 18 | 19 | @JvmStatic 20 | val world: WorldClient? 21 | get() = minecraft.world 22 | 23 | @JvmStatic 24 | fun saveAndShutdown() { 25 | if (!LambdaMod.ready) return 26 | 27 | ShutdownEvent.post() 28 | saveAll() 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/MixinTileEntityBeacon.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin; 2 | 3 | import com.lambda.client.module.modules.render.NoRender; 4 | import net.minecraft.tileentity.TileEntityBeacon; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | 10 | @Mixin(TileEntityBeacon.class) 11 | public class MixinTileEntityBeacon { 12 | @Inject(method = "shouldBeamRender", at = @At("HEAD"), cancellable = true) 13 | public void shouldBeamRender(CallbackInfoReturnable returnable) { 14 | if (NoRender.INSTANCE.isEnabled() && NoRender.INSTANCE.getBeacon()) { 15 | returnable.setReturnValue(0.0F); 16 | returnable.cancel(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/render/MixinParticleManager.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.render; 2 | 3 | import com.lambda.client.module.modules.render.NoRender; 4 | import net.minecraft.client.particle.Particle; 5 | import net.minecraft.client.particle.ParticleManager; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(ParticleManager.class) 12 | public class MixinParticleManager { 13 | 14 | @Inject(method = "addEffect", at = @At("HEAD"), cancellable = true) 15 | public void addEffect(Particle effect, CallbackInfo ci) { 16 | if (NoRender.INSTANCE.isEnabled() && NoRender.INSTANCE.handleParticle(effect)) { 17 | ci.cancel(); 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/RenderEntityEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.* 4 | import net.minecraft.entity.Entity 5 | 6 | sealed class RenderEntityEvent( 7 | val entity: Entity, 8 | override val phase: Phase 9 | ) : Event, ICancellable by Cancellable(), IMultiPhase, ProfilerEvent { 10 | 11 | override val profilerName: String get() = "kbRenderEntity${phase.displayName}" 12 | 13 | override fun nextPhase(): RenderEntityEvent { 14 | throw UnsupportedOperationException() 15 | } 16 | 17 | class All(entity: Entity, phase: Phase) : RenderEntityEvent(entity, phase) 18 | 19 | class Model(entity: Entity, phase: Phase) : RenderEntityEvent(entity, phase) 20 | 21 | companion object { 22 | @JvmStatic 23 | var renderingEntities = false 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/elements/misc/OnlineTime.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.elements.misc 2 | 3 | import com.lambda.client.event.SafeClientEvent 4 | import com.lambda.client.gui.hudgui.LabelHud 5 | import com.lambda.client.manager.managers.OnlineTimeManager 6 | import kotlin.math.roundToInt 7 | import kotlin.time.DurationUnit 8 | import kotlin.time.toDuration 9 | 10 | internal object OnlineTime: LabelHud( 11 | name = "OnlineTime", 12 | category = Category.MISC, 13 | description = "Displays how long you have been online" 14 | ) { 15 | override fun SafeClientEvent.updateText() { 16 | val onlineTime = OnlineTimeManager.getOnlineTime().toDouble(DurationUnit.SECONDS).roundToInt() 17 | displayText.add("Online:", secondaryColor) 18 | displayText.add(onlineTime.toDuration(DurationUnit.SECONDS).toString(), primaryColor) 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/kawase_blur.vsh: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | attribute vec4 Position; 4 | 5 | uniform mat4 ProjMat; 6 | uniform vec2 InSize; 7 | uniform float multiplier; 8 | uniform float baseOffset; 9 | 10 | varying vec2 fragCoord1; 11 | varying vec2 fragCoord2; 12 | varying vec2 fragCoord3; 13 | varying vec2 fragCoord4; 14 | varying vec2 fragCoord5; 15 | 16 | void main(){ 17 | vec4 outPos = ProjMat * vec4(Position.xy, 0.0, 1.0); 18 | gl_Position = vec4(outPos.xy, 0.2, 1.0); 19 | 20 | vec2 uv = 1.0 / InSize; 21 | float offset = baseOffset * multiplier; 22 | 23 | fragCoord1 = Position.xy * uv; 24 | fragCoord2 = fragCoord1 + vec2(-offset, -offset) * uv; 25 | fragCoord3 = fragCoord1 + vec2(-offset, offset) * uv; 26 | fragCoord4 = fragCoord1 + vec2(offset, offset) * uv; 27 | fragCoord5 = fragCoord1 + vec2(offset, -offset) * uv; 28 | } 29 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/eventbus/AbstractAsyncEventBus.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.eventbus 2 | 3 | import com.lambda.client.event.ListenerManager 4 | 5 | /** 6 | * [IAsyncEventBus] with some basic implementation 7 | * Must be used with Kotlinx Coroutine and overridden [post] method 8 | */ 9 | abstract class AbstractAsyncEventBus : AbstractEventBus(), IAsyncEventBus { 10 | override fun subscribe(objs: Any) { 11 | super.subscribe(objs) 12 | 13 | ListenerManager.getAsyncListeners(objs)?.forEach { 14 | subscribedListenersAsync.getOrPut(it.eventClass, ::newSetAsync).add(it) 15 | } 16 | } 17 | 18 | override fun unsubscribe(objs: Any) { 19 | super.unsubscribe(objs) 20 | 21 | ListenerManager.getAsyncListeners(objs)?.forEach { 22 | subscribedListenersAsync[it.eventClass]?.remove(it) 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/rgui/component/Button.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.rgui.component 2 | 3 | import com.lambda.client.util.math.Vec2f 4 | 5 | class Button( 6 | name: String, 7 | private val action: (Button) -> Unit, 8 | description: String = "", 9 | visibility: (() -> Boolean)? = null 10 | ) : BooleanSlider(name, 0.0, description, visibility) { 11 | override fun onClick(mousePos: Vec2f, buttonId: Int) { 12 | super.onClick(mousePos, buttonId) 13 | value = 1.0 14 | } 15 | 16 | override fun onRelease(mousePos: Vec2f, buttonId: Int) { 17 | super.onRelease(mousePos, buttonId) 18 | if (prevState != MouseState.DRAG) { 19 | value = 0.0 20 | action(this) 21 | } 22 | } 23 | 24 | override fun onLeave(mousePos: Vec2f) { 25 | super.onLeave(mousePos) 26 | value = 0.0 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/entity/MixinEntityPig.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.entity; 2 | 3 | import com.lambda.client.module.modules.movement.EntitySpeed; 4 | import net.minecraft.entity.passive.EntityPig; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.injection.At; 7 | import org.spongepowered.asm.mixin.injection.Inject; 8 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 9 | 10 | /** 11 | * Created by 086 on 16/12/2017. 12 | */ 13 | @Mixin(EntityPig.class) 14 | public class MixinEntityPig { 15 | 16 | @Inject(method = "canBeSteered", at = @At("HEAD"), cancellable = true) 17 | public void canBeSteered(CallbackInfoReturnable returnable) { 18 | if (EntitySpeed.INSTANCE.isEnabled()) { 19 | returnable.setReturnValue(true); 20 | returnable.cancel(); 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/rgui/component/SettingButton.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.rgui.component 2 | 3 | import com.lambda.client.module.modules.client.ClickGUI 4 | import com.lambda.client.setting.settings.impl.primitive.BooleanSetting 5 | import com.lambda.client.util.math.Vec2f 6 | 7 | class SettingButton(val setting: BooleanSetting) : BooleanSlider(setting.name, 0.0, setting.description, setting.visibility) { 8 | 9 | override val isBold 10 | get() = setting.isModified && ClickGUI.showModifiedInBold 11 | 12 | init { 13 | if (setting.value) value = 1.0 14 | } 15 | 16 | override fun onTick() { 17 | super.onTick() 18 | value = if (setting.value) 1.0 else 0.0 19 | } 20 | 21 | override fun onClick(mousePos: Vec2f, buttonId: Int) { 22 | super.onClick(mousePos, buttonId) 23 | setting.value = !setting.value 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/capeapi/UUIDUtils.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.capeapi 2 | 3 | import java.util.* 4 | 5 | object UUIDUtils { 6 | private val uuidRegex = "[a-z0-9].{7}-[a-z0-9].{3}-[a-z0-9].{3}-[a-z0-9].{3}-[a-z0-9].{11}".toRegex() 7 | 8 | fun fixUUID(string: String): UUID? { 9 | if (isUUID(string)) return UUID.fromString(string) 10 | if (string.length < 32) return null 11 | val fixed = insertDashes(string) 12 | return if (isUUID(fixed)) UUID.fromString(fixed) 13 | else null 14 | } 15 | 16 | fun isUUID(string: String) = uuidRegex.matches(string) 17 | 18 | fun removeDashes(string: String) = string.replace("-", "") 19 | 20 | private fun insertDashes(string: String) = StringBuilder(string) 21 | .insert(8, '-') 22 | .insert(13, '-') 23 | .insert(18, '-') 24 | .insert(23, '-') 25 | .toString() 26 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/settings/impl/primitive/StringSetting.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting.settings.impl.primitive 2 | 3 | import com.google.gson.JsonElement 4 | import com.google.gson.JsonPrimitive 5 | import com.lambda.client.setting.settings.MutableSetting 6 | 7 | class StringSetting( 8 | name: String, 9 | value: String, 10 | visibility: () -> Boolean = { true }, 11 | consumer: (prev: String, input: String) -> String = { _, input -> input }, 12 | description: String = "" 13 | ) : MutableSetting(name, value, visibility, consumer, description, unit = "") { 14 | 15 | override fun setValue(valueIn: String) { 16 | value = valueIn 17 | } 18 | 19 | override fun write() = JsonPrimitive(value) 20 | 21 | override fun read(jsonElement: JsonElement?) { 22 | jsonElement?.asJsonPrimitive?.asString?.let { value = it } 23 | } 24 | 25 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/gui/MixinGuiMultiplayer.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.gui; 2 | 3 | import net.minecraft.client.gui.GuiMultiplayer; 4 | import net.minecraft.client.gui.GuiScreen; 5 | import net.minecraft.client.multiplayer.ServerData; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(GuiMultiplayer.class) 12 | public class MixinGuiMultiplayer extends GuiScreen { 13 | 14 | @Inject(method = "connectToServer", at = @At("HEAD")) 15 | public void connectToServer(ServerData serverData, CallbackInfo ci) { 16 | if (mc.getCurrentServerData() != null && mc.world != null) { 17 | mc.world.sendQuittingDisconnectingPacket(); 18 | mc.loadWorld(null); 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/render/MixinRender.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.render; 2 | 3 | import com.lambda.client.module.modules.render.Nametags; 4 | import net.minecraft.client.renderer.entity.Render; 5 | import net.minecraft.entity.Entity; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(Render.class) 12 | abstract class MixinRender { 13 | @Inject(method = "renderLivingLabel", at = @At("HEAD"), cancellable = true) 14 | protected void renderNamePre(T entityIn, String str, double x, double y, double z, int maxDistance, CallbackInfo ci) { 15 | if (Nametags.INSTANCE.isEnabled() && Nametags.INSTANCE.checkEntityType(entityIn)) { 16 | ci.cancel(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/player/AccessorPlayerControllerMP.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.player; 2 | 3 | import net.minecraft.client.multiplayer.PlayerControllerMP; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | import org.spongepowered.asm.mixin.gen.Invoker; 7 | 8 | @Mixin(PlayerControllerMP.class) 9 | public interface AccessorPlayerControllerMP { 10 | 11 | @Accessor("blockHitDelay") 12 | int getBlockHitDelay(); 13 | 14 | @Accessor("blockHitDelay") 15 | void setBlockHitDelay(int value); 16 | 17 | @Accessor("isHittingBlock") 18 | void setIsHittingBlockFun(boolean value); 19 | 20 | @Accessor("currentPlayerItem") 21 | int getCurrentPlayerItem(); 22 | 23 | @Invoker("syncCurrentPlayItem") 24 | void synchronizeCurrentPlayItem(); // Mixin bug #430 https://github.com/SpongePowered/Mixin/issues/430 25 | } 26 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/LambdaEvents.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event 2 | 3 | import com.lambda.client.commons.interfaces.DisplayEnum 4 | import com.lambda.client.event.eventbus.IEventBus 5 | 6 | interface Event 7 | 8 | interface ProfilerEvent { 9 | val profilerName: String 10 | } 11 | 12 | open class SingletonEvent(val eventBus: IEventBus) { 13 | fun post() { 14 | eventBus.post(this) 15 | } 16 | } 17 | 18 | interface IMultiPhase { 19 | val phase: Phase 20 | 21 | fun nextPhase(): T 22 | } 23 | 24 | interface ICancellable { 25 | var cancelled: Boolean 26 | 27 | fun cancel() { 28 | cancelled = true 29 | } 30 | } 31 | 32 | open class Cancellable : ICancellable { 33 | override var cancelled = false 34 | } 35 | 36 | enum class Phase(override val displayName: String) : DisplayEnum { 37 | PRE("Pre"), 38 | PERI("Peri"), 39 | POST("Post") 40 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/render/MixinMapItemRenderer.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.render; 2 | 3 | import com.lambda.client.module.modules.render.NoRender; 4 | import net.minecraft.client.gui.MapItemRenderer; 5 | import net.minecraft.world.storage.MapData; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(MapItemRenderer.class) 12 | public class MixinMapItemRenderer { 13 | @Inject(method = "renderMap", at = @At(value = "HEAD"), cancellable = true) 14 | public void renderMap(MapData mapdataIn, boolean noOverlayRendering, CallbackInfo ci) { 15 | if (NoRender.INSTANCE.isEnabled() && NoRender.INSTANCE.getMap()) { 16 | ci.cancel(); 17 | NoRender.INSTANCE.renderFakeMap(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/extension/Map.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.extension 2 | 3 | import java.util.* 4 | 5 | 6 | fun SortedMap.firstKeyOrNull(): K? = 7 | if (this.isNotEmpty()) firstKey() else null 8 | 9 | fun NavigableMap.firstValueOrNull(): V? = 10 | this.firstEntryOrNull()?.value 11 | 12 | fun NavigableMap.firstValue(): V = 13 | this.firstEntry().value 14 | 15 | fun NavigableMap.firstEntryOrNull(): MutableMap.MutableEntry? = 16 | if (this.isNotEmpty()) firstEntry() else null 17 | 18 | fun MutableMap.synchronized(): MutableMap = 19 | Collections.synchronizedMap(this) 20 | 21 | fun SortedMap.synchronized(): SortedMap = 22 | Collections.synchronizedSortedMap(this) 23 | 24 | fun NavigableMap.synchronized(): NavigableMap = 25 | Collections.synchronizedNavigableMap(this) -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/execute/IExecuteEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.execute 2 | 3 | import com.lambda.client.command.AbstractCommandManager 4 | import com.lambda.client.command.Command 5 | import com.lambda.client.command.args.AbstractArg 6 | import com.lambda.client.command.args.ArgIdentifier 7 | 8 | /** 9 | * Event being used for executing the [Command] 10 | */ 11 | interface IExecuteEvent { 12 | 13 | val commandManager: AbstractCommandManager<*> 14 | 15 | /** 16 | * Parsed arguments 17 | */ 18 | val args: Array 19 | 20 | /** 21 | * Maps argument for the [argTree] 22 | */ 23 | suspend fun mapArgs(argTree: List>) 24 | 25 | /** 26 | * Gets mapped value for an [ArgIdentifier] 27 | * 28 | * @throws NullPointerException If this [ArgIdentifier] isn't mapped 29 | */ 30 | val ArgIdentifier.value: T 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/InfoCalculator.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util 2 | 3 | import com.lambda.client.event.SafeClientEvent 4 | import com.lambda.client.manager.managers.TimerManager 5 | import com.lambda.client.util.MovementUtils.realSpeed 6 | 7 | object InfoCalculator { 8 | private val mc = Wrapper.minecraft 9 | 10 | fun getServerType() = if (mc.isIntegratedServerRunning) "Singleplayer" else mc.currentServerData?.serverIP 11 | ?: "Main Menu" 12 | 13 | fun ping() = mc.player?.let { mc.connection?.getPlayerInfo(it.uniqueID)?.responseTime ?: 1 } ?: -1 14 | 15 | fun SafeClientEvent.speed(): Double { 16 | val tps = 1000.0 / TimerManager.tickLength 17 | return player.realSpeed * tps 18 | } 19 | 20 | fun dimension() = when (mc.player?.dimension) { 21 | -1 -> "Nether" 22 | 0 -> "Overworld" 23 | 1 -> "End" 24 | else -> "No Dimension" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/misc/MountBypass.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.misc 2 | 3 | import com.lambda.client.event.events.PacketEvent 4 | import com.lambda.client.module.Category 5 | import com.lambda.client.module.Module 6 | import com.lambda.client.util.threads.safeListener 7 | import net.minecraft.entity.passive.AbstractChestHorse 8 | import net.minecraft.network.play.client.CPacketUseEntity 9 | 10 | object MountBypass : Module( 11 | name = "MountBypass", 12 | description = "Attempts to allow you to mount chested animals on servers that block it", 13 | category = Category.MISC 14 | ) { 15 | init { 16 | safeListener { 17 | if (it.packet !is CPacketUseEntity || it.packet.action != CPacketUseEntity.Action.INTERACT_AT) return@safeListener 18 | if (it.packet.getEntityFromWorld(world) is AbstractChestHorse) it.cancel() 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/settings/impl/number/NumberSetting.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting.settings.impl.number 2 | 3 | import com.google.gson.JsonPrimitive 4 | import com.lambda.client.setting.settings.MutableSetting 5 | 6 | abstract class NumberSetting( 7 | name: String, 8 | value: T, 9 | val range: ClosedRange, 10 | val step: T, 11 | visibility: () -> Boolean, 12 | consumer: (prev: T, input: T) -> T, 13 | description: String = "", 14 | unit: String = "", 15 | val fineStep: T 16 | ) : MutableSetting(name, value, visibility, consumer, description, unit) 17 | where T : Number, T : Comparable { 18 | 19 | override fun write() = JsonPrimitive(value) 20 | 21 | final override fun setValue(valueIn: String) { 22 | valueIn.toDoubleOrNull()?.let { 23 | setValue(it) 24 | } 25 | } 26 | 27 | abstract fun setValue(valueIn: Double) 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/AccessorMinecraft.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.util.Timer; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | import org.spongepowered.asm.mixin.gen.Invoker; 8 | 9 | @Mixin(Minecraft.class) 10 | public interface AccessorMinecraft { 11 | 12 | @Accessor("timer") 13 | Timer getTimer(); 14 | 15 | @Accessor("renderPartialTicksPaused") 16 | float getRenderPartialTicksPaused(); 17 | 18 | @Accessor("rightClickDelayTimer") 19 | int getRightClickDelayTimer(); 20 | 21 | @Accessor("rightClickDelayTimer") 22 | void setRightClickDelayTimer(int value); 23 | 24 | @Invoker("rightClickMouse") 25 | void invokeRightClickMouse(); 26 | 27 | @Invoker("sendClickBlockToController") 28 | void invokeSendClickBlockToController(boolean leftClick); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorSPacketMaps.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketMaps; 4 | import net.minecraft.world.storage.MapDecoration; 5 | import org.spongepowered.asm.mixin.Mixin; 6 | import org.spongepowered.asm.mixin.gen.Accessor; 7 | 8 | @Mixin(value = SPacketMaps.class) 9 | public interface AccessorSPacketMaps { 10 | @Accessor(value = "mapScale") 11 | byte getMapScale(); 12 | @Accessor(value = "trackingPosition") 13 | boolean getTrackingPosition(); 14 | @Accessor(value = "icons") 15 | MapDecoration[] getIcons(); 16 | @Accessor(value = "minX") 17 | int getMinX(); 18 | @Accessor(value = "minZ") 19 | int getMinZ(); 20 | @Accessor(value = "columns") 21 | int getColumns(); 22 | @Accessor(value = "rows") 23 | int getRows(); 24 | @Accessor(value = "mapDataBytes") 25 | byte[] getMapDataBytes(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/misc/NoSoundLag.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.misc 2 | 3 | import com.lambda.client.event.events.PacketEvent 4 | import com.lambda.client.event.listener.listener 5 | import com.lambda.client.module.Category 6 | import com.lambda.client.module.Module 7 | import net.minecraft.init.SoundEvents 8 | import net.minecraft.network.play.server.SPacketSoundEffect 9 | import net.minecraft.util.SoundCategory 10 | 11 | object NoSoundLag : Module( 12 | name = "NoSoundLag", 13 | description = "Prevents lag caused by sound machines", 14 | category = Category.MISC 15 | ) { 16 | init { 17 | listener { 18 | if (it.packet !is SPacketSoundEffect) return@listener 19 | if (it.packet.category == SoundCategory.PLAYERS && it.packet.sound == SoundEvents.ITEM_ARMOR_EQUIP_GENERIC) { 20 | it.cancel() 21 | } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/render/MixinDebugRendererChunkBorder.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.render; 2 | 3 | import com.lambda.client.util.Wrapper; 4 | import net.minecraft.client.renderer.debug.DebugRendererChunkBorder; 5 | import net.minecraft.entity.player.EntityPlayer; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.ModifyVariable; 9 | 10 | @Mixin(DebugRendererChunkBorder.class) 11 | public class MixinDebugRendererChunkBorder { 12 | 13 | @ModifyVariable(method = "render", at = @At(value = "STORE", ordinal = 0)) 14 | public EntityPlayer render(EntityPlayer entityPlayer) { 15 | if (Wrapper.getMinecraft().getRenderViewEntity() instanceof EntityPlayer) { 16 | return (EntityPlayer) Wrapper.getMinecraft().getRenderViewEntity(); 17 | } else { 18 | return Wrapper.getMinecraft().player; 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/utils/ClassUtils.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.utils 2 | 3 | import org.reflections.Reflections 4 | 5 | object ClassUtils { 6 | 7 | inline fun findClasses( 8 | pack: String, 9 | noinline block: Sequence>.() -> Sequence> = { this } 10 | ): List> { 11 | return findClasses(pack, T::class.java, block) 12 | } 13 | 14 | fun findClasses( 15 | pack: String, 16 | subType: Class, 17 | block: Sequence>.() -> Sequence> = { this } 18 | ): List> { 19 | return Reflections(pack).getSubTypesOf(subType).asSequence() 20 | .run(block) 21 | .sortedBy { it.simpleName } 22 | .toList() 23 | } 24 | 25 | @Suppress("UNCHECKED_CAST") 26 | val Class.instance 27 | get() = this.getDeclaredField("INSTANCE")[null] as T 28 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/movement/AutoJump.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.movement 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | import com.lambda.client.util.TickTimer 6 | import com.lambda.client.util.TimeUnit 7 | import com.lambda.client.util.threads.safeListener 8 | import net.minecraftforge.fml.common.gameevent.TickEvent 9 | 10 | object AutoJump : Module( 11 | name = "AutoJump", 12 | description = "Automatically jumps if possible", 13 | category = Category.MOVEMENT 14 | ) { 15 | private val delay by setting("Delay", 10, 0..40, 1, unit = " ticks") 16 | 17 | private val timer = TickTimer(TimeUnit.TICKS) 18 | 19 | init { 20 | safeListener { 21 | if (player.isInWater || player.isInLava) player.motionY = 0.1 22 | else if (player.onGround && timer.tick(delay.toLong())) player.jump() 23 | } 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/color/EnumTextColor.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.color 2 | 3 | import net.minecraft.util.text.TextFormatting 4 | 5 | @Suppress("UNUSED") 6 | enum class EnumTextColor(val textFormatting: TextFormatting) { 7 | BLACK(TextFormatting.BLACK), 8 | DARK_BLUE(TextFormatting.DARK_BLUE), 9 | DARK_GREEN(TextFormatting.DARK_GREEN), 10 | DARK_AQUA(TextFormatting.DARK_AQUA), 11 | DARK_RED(TextFormatting.DARK_RED), 12 | DARK_PURPLE(TextFormatting.DARK_PURPLE), 13 | GOLD(TextFormatting.GOLD), 14 | GRAY(TextFormatting.GRAY), 15 | DARK_GRAY(TextFormatting.DARK_GRAY), 16 | BLUE(TextFormatting.BLUE), 17 | GREEN(TextFormatting.GREEN), 18 | AQUA(TextFormatting.AQUA), 19 | RED(TextFormatting.RED), 20 | LIGHT_PURPLE(TextFormatting.LIGHT_PURPLE), 21 | YELLOW(TextFormatting.YELLOW), 22 | WHITE(TextFormatting.WHITE); 23 | 24 | override fun toString(): String = this.textFormatting.toString() 25 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/settings/impl/number/IntegerSetting.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting.settings.impl.number 2 | 3 | import com.google.gson.JsonElement 4 | 5 | class IntegerSetting( 6 | name: String, 7 | value: Int, 8 | range: IntRange, 9 | step: Int, 10 | visibility: () -> Boolean = { true }, 11 | consumer: (prev: Int, input: Int) -> Int = { _, input -> input }, 12 | description: String = "", 13 | unit: String = "", 14 | fineStep: Int = step 15 | ) : NumberSetting(name, value, range, step, visibility, consumer, description, unit, fineStep) { 16 | 17 | init { 18 | consumers.add(0) { _, it -> 19 | it.coerceIn(range) 20 | } 21 | } 22 | 23 | override fun read(jsonElement: JsonElement?) { 24 | jsonElement?.asJsonPrimitive?.asInt?.let { value = it } 25 | } 26 | 27 | override fun setValue(valueIn: Double) { 28 | value = valueIn.toInt() 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/collections/AliasSet.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.collections 2 | 3 | import com.lambda.client.commons.interfaces.Alias 4 | import java.util.concurrent.ConcurrentHashMap 5 | 6 | class AliasSet( 7 | map: MutableMap = ConcurrentHashMap() 8 | ) : NameableSet(map) { 9 | 10 | override fun add(element: T): Boolean { 11 | var modified = super.add(element) 12 | element.alias.forEach { alias -> 13 | val prevValue = map.put(alias.lowercase(), element) 14 | prevValue?.let { remove(it) } 15 | modified = prevValue == null || modified 16 | } 17 | return modified 18 | } 19 | 20 | override fun remove(element: T): Boolean { 21 | var modified = super.remove(element) 22 | element.alias.forEach { 23 | modified = map.remove(it.lowercase()) != null || modified 24 | } 25 | return modified 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/render/MixinTileRendererDispatcher.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.render; 2 | 3 | import com.lambda.client.module.modules.render.Xray; 4 | import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; 5 | import net.minecraft.tileentity.TileEntity; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(TileEntityRendererDispatcher.class) 12 | public class MixinTileRendererDispatcher { 13 | 14 | @Inject(method = "render(Lnet/minecraft/tileentity/TileEntity;FI)V", at = @At("HEAD"), cancellable = true) 15 | public void render(TileEntity tileEntityIn, float partialTicks, int destroyStage, CallbackInfo ci) { 16 | if (Xray.shouldReplace(tileEntityIn.getBlockType().getDefaultState())) { 17 | ci.cancel(); 18 | } 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/eventbus/AbstractEventBus.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.eventbus 2 | 3 | import com.lambda.client.event.ListenerManager 4 | import com.lambda.client.event.listener.Listener 5 | 6 | /** 7 | * [IEventBus] with some basic implementation 8 | */ 9 | abstract class AbstractEventBus : IEventBus { 10 | override fun subscribe(objs: Any) { 11 | ListenerManager.getListeners(objs)?.forEach { 12 | subscribedListeners.getOrPut(it.eventClass, ::newSet).add(it) 13 | } 14 | } 15 | 16 | override fun unsubscribe(objs: Any) { 17 | ListenerManager.getListeners(objs)?.forEach { 18 | subscribedListeners[it.eventClass]?.remove(it) 19 | } 20 | } 21 | 22 | override fun post(event: Any) { 23 | subscribedListeners[event.javaClass]?.let { 24 | @Suppress("UNCHECKED_CAST") // IDE meme 25 | for (listener in it) (listener as Listener).function.invoke(event) 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/world/MixinBlockDragonEgg.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.world; 2 | 3 | import com.lambda.client.module.modules.movement.Prevent; 4 | import net.minecraft.block.BlockDragonEgg; 5 | import net.minecraft.util.math.BlockPos; 6 | import net.minecraft.world.World; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(BlockDragonEgg.class) 13 | public class MixinBlockDragonEgg { 14 | @Inject(method = "teleport", at = @At("HEAD"), cancellable = true) 15 | public void onTeleport(World worldIn, BlockPos pos, CallbackInfo ci) { 16 | // if prevent is enabled, and the dragon egg setting is toggled, cancel the "teleport" function, so no particles spawn 17 | if (Prevent.INSTANCE.isEnabled() && Prevent.INSTANCE.getDragonEgg()) { 18 | ci.cancel(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/settings/impl/number/DoubleSetting.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting.settings.impl.number 2 | 3 | import com.google.gson.JsonElement 4 | 5 | class DoubleSetting( 6 | name: String, 7 | value: Double, 8 | range: ClosedFloatingPointRange, 9 | step: Double, 10 | visibility: () -> Boolean = { true }, 11 | consumer: (prev: Double, input: Double) -> Double = { _, input -> input }, 12 | description: String = "", 13 | unit: String = "", 14 | fineStep: Double = step 15 | ) : NumberSetting(name, value, range, step, visibility, consumer, description, unit, fineStep) { 16 | 17 | init { 18 | consumers.add(0) { _, it -> 19 | it.coerceIn(range) 20 | } 21 | } 22 | 23 | override fun read(jsonElement: JsonElement?) { 24 | jsonElement?.asJsonPrimitive?.asDouble?.let { value = it } 25 | } 26 | 27 | override fun setValue(valueIn: Double) { 28 | value = valueIn 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/settings/impl/number/FloatSetting.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting.settings.impl.number 2 | 3 | import com.google.gson.JsonElement 4 | 5 | class FloatSetting( 6 | name: String, 7 | value: Float, 8 | range: ClosedFloatingPointRange, 9 | step: Float, 10 | visibility: () -> Boolean = { true }, 11 | consumer: (prev: Float, input: Float) -> Float = { _, input -> input }, 12 | description: String = "", 13 | unit: String = "", 14 | fineStep: Float = step 15 | ) : NumberSetting(name, value, range, step, visibility, consumer, description, unit, fineStep) { 16 | 17 | init { 18 | consumers.add(0) { _, it -> 19 | it.coerceIn(range) 20 | } 21 | } 22 | 23 | override fun read(jsonElement: JsonElement?) { 24 | jsonElement?.asJsonPrimitive?.asFloat?.let { value = it } 25 | } 26 | 27 | override fun setValue(valueIn: Double) { 28 | value = valueIn.toFloat() 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/eventbus/IEventBus.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.eventbus 2 | 3 | import com.lambda.client.event.listener.Listener 4 | 5 | /** 6 | * The basic Interface for an event bus 7 | */ 8 | interface IEventBus { 9 | /** 10 | * A map for events and their subscribed listeners 11 | * 12 | * > 13 | */ 14 | val subscribedListeners: MutableMap, MutableSet>> 15 | 16 | /** 17 | * Subscribe an [objs]'s listeners to this event bus 18 | */ 19 | fun subscribe(objs: Any) 20 | 21 | 22 | /** 23 | * unsubscribes an [objs]'s listeners from this event bus 24 | */ 25 | fun unsubscribe(objs: Any) 26 | 27 | 28 | /** 29 | * Posts an event to this event bus, and calls 30 | * All the listeners of this event 31 | */ 32 | fun post(event: Any) 33 | 34 | 35 | /** 36 | * Called when putting a new set to the map 37 | */ 38 | fun newSet(): MutableSet> 39 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/clickgui/component/ModuleButton.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.clickgui.component 2 | 3 | import com.lambda.client.gui.clickgui.LambdaClickGui 4 | import com.lambda.client.gui.rgui.component.BooleanSlider 5 | import com.lambda.client.module.AbstractModule 6 | import com.lambda.client.util.math.Vec2f 7 | 8 | class ModuleButton(val module: AbstractModule) : BooleanSlider(module.name, 0.0, module.description) { 9 | init { 10 | if (module.isEnabled) value = 1.0 11 | } 12 | 13 | override fun onTick() { 14 | super.onTick() 15 | value = if (module.isEnabled) 1.0 else 0.0 16 | } 17 | 18 | override fun onClick(mousePos: Vec2f, buttonId: Int) { 19 | super.onClick(mousePos, buttonId) 20 | if (buttonId == 0) module.toggle() 21 | } 22 | 23 | override fun onRelease(mousePos: Vec2f, buttonId: Int) { 24 | super.onRelease(mousePos, buttonId) 25 | if (buttonId == 1) LambdaClickGui.displaySettingWindow(module) 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/extension/String.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.extension 2 | 3 | /** 4 | * Limit the length of this string to [max] 5 | */ 6 | fun String.max(max: Int) = this.substring(0, this.length.coerceAtMost(max)) 7 | 8 | /** 9 | * Limit the length to this string [max] with [suffix] appended 10 | */ 11 | fun String.max(max: Int, suffix: String): String { 12 | return if (this.length > max) { 13 | this.max(max - suffix.length) + suffix 14 | } else { 15 | this.max(max) 16 | } 17 | } 18 | 19 | fun String.surroundedBy(prefix: CharSequence, suffix: CharSequence, ignoreCase: Boolean = false) = 20 | this.startsWith(prefix, ignoreCase) && this.endsWith(suffix, ignoreCase) 21 | 22 | fun String.surroundedBy(prefix: Char, suffix: Char, ignoreCase: Boolean = false) = 23 | this.startsWith(prefix, ignoreCase) && this.endsWith(suffix, ignoreCase) 24 | 25 | fun String.mapEach(vararg delimiters: Char, transformer: (String) -> String) = 26 | split(*delimiters).map(transformer) -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorSPacketWorldBorder.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.server.SPacketWorldBorder; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(value = SPacketWorldBorder.class) 8 | public interface AccessorSPacketWorldBorder { 9 | @Accessor(value = "action") 10 | SPacketWorldBorder.Action getAction(); 11 | @Accessor(value = "size") 12 | int getSize(); 13 | @Accessor(value = "centerX") 14 | double getCenterX(); 15 | @Accessor(value = "centerZ") 16 | double getCenterZ(); 17 | @Accessor(value = "targetSize") 18 | double getTargetSize(); 19 | @Accessor(value = "diameter") 20 | double getDiameter(); 21 | @Accessor(value = "timeUntilTarget") 22 | long getTimeUntilTarget(); 23 | @Accessor(value = "warningTime") 24 | int getWarningTime(); 25 | @Accessor(value = "warningDistance") 26 | int getWarningDistance(); 27 | } 28 | -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "lambda", 4 | "name": "Lambda", 5 | "description": "λ\nLambda v${version} is a free, open-source, Minecraft ${mcversion} utility mod made for the anarchy experience.\nA visionary plugin system that allows additional modules to be added, without the need to create a Lambda fork!\nCustomize your experience, and improve your efficiency!", 6 | "version": "${version}", 7 | "mcversion": "${mcversion}", 8 | "url": "https://github.com/lambda-client/lambda", 9 | "updateUrl": "", 10 | "authorList": [ 11 | "@_constructor", 12 | "@huddy987", 13 | "@czho_", 14 | "@toxicaven", 15 | "@nepnepcat", 16 | "@scorbett", 17 | "@hlsl.", 18 | "@itcamefr0mmars", 19 | "@romtec", 20 | "@save_g", 21 | "@enigma_008" 22 | ], 23 | "credits": "Thanks to 086 for the original KAMI\nThanks to the team of KAMI Blue\nSpecial thanks to all contributors", 24 | "logoFile": "lambda.png", 25 | "dependencies": [] 26 | } 27 | ] 28 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/accessor/network/AccessorCPacketPlayer.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.accessor.network; 2 | 3 | import net.minecraft.network.play.client.CPacketPlayer; 4 | import org.spongepowered.asm.mixin.Mixin; 5 | import org.spongepowered.asm.mixin.gen.Accessor; 6 | 7 | @Mixin(CPacketPlayer.class) 8 | public interface AccessorCPacketPlayer { 9 | 10 | @Accessor("x") 11 | void setX(double value); 12 | 13 | @Accessor("y") 14 | void setY(double value); 15 | 16 | @Accessor("z") 17 | void setZ(double value); 18 | 19 | @Accessor("yaw") 20 | void setYaw(float value); 21 | 22 | @Accessor("pitch") 23 | void setPitch(float value); 24 | 25 | @Accessor("onGround") 26 | void setOnGround(boolean value); 27 | 28 | @Accessor("moving") 29 | boolean getMoving(); 30 | 31 | @Accessor("moving") 32 | void setMoving(boolean value); 33 | 34 | @Accessor("rotating") 35 | boolean getRotating(); 36 | 37 | @Accessor("rotating") 38 | void setRotating(boolean value); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/graphics/font/GlyphChunk.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.graphics.font 2 | 3 | import com.lambda.client.util.graphics.texture.MipmapTexture 4 | import org.lwjgl.opengl.GL11 5 | import org.lwjgl.opengl.GL14 6 | 7 | class GlyphChunk( 8 | /** Id of this chunk */ 9 | val chunk: Int, 10 | 11 | /** [MipmapTexture] object */ 12 | val texture: MipmapTexture, 13 | 14 | /** Array for all characters' info in this chunk */ 15 | val charInfoArray: Array 16 | ) { 17 | private var lodbias = 0.0f 18 | 19 | fun updateLodBias(input: Float) { 20 | if (input != lodbias) { 21 | lodbias = input 22 | GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL14.GL_TEXTURE_LOD_BIAS, input) 23 | } 24 | } 25 | 26 | override fun equals(other: Any?) = 27 | this === other 28 | || other is GlyphChunk 29 | && chunk == other.chunk 30 | && texture == other.texture 31 | 32 | override fun hashCode() = 31 * chunk + texture.hashCode() 33 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/component/HudButton.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.component 2 | 3 | import com.lambda.client.gui.hudgui.AbstractHudElement 4 | import com.lambda.client.gui.hudgui.LambdaHudGui 5 | import com.lambda.client.gui.rgui.component.BooleanSlider 6 | import com.lambda.client.util.math.Vec2f 7 | 8 | class HudButton(val hudElement: AbstractHudElement) : BooleanSlider(hudElement.name, 0.0, hudElement.description) { 9 | init { 10 | if (hudElement.visible) value = 1.0 11 | } 12 | 13 | override fun onTick() { 14 | super.onTick() 15 | value = if (hudElement.visible) 1.0 else 0.0 16 | } 17 | 18 | override fun onClick(mousePos: Vec2f, buttonId: Int) { 19 | super.onClick(mousePos, buttonId) 20 | if (buttonId == 0) hudElement.visible = !hudElement.visible 21 | } 22 | 23 | override fun onRelease(mousePos: Vec2f, buttonId: Int) { 24 | super.onRelease(mousePos, buttonId) 25 | if (buttonId == 1) LambdaHudGui.displaySettingWindow(hudElement) 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/combat/AntiFriendHit.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.combat 2 | 3 | import com.lambda.client.event.events.PacketEvent 4 | import com.lambda.client.manager.managers.FriendManager 5 | import com.lambda.client.module.Category 6 | import com.lambda.client.module.Module 7 | import com.lambda.client.util.threads.safeListener 8 | import net.minecraft.entity.player.EntityPlayer 9 | import net.minecraft.network.play.client.CPacketUseEntity 10 | 11 | object AntiFriendHit : Module( 12 | name = "AntiFriendHit", 13 | description = "Prevents hitting friends", 14 | category = Category.COMBAT 15 | ) { 16 | init { 17 | safeListener { 18 | if (it.packet !is CPacketUseEntity || it.packet.action != CPacketUseEntity.Action.ATTACK) return@safeListener 19 | val entity = it.packet.getEntityFromWorld(world) 20 | if (entity is EntityPlayer && FriendManager.isFriend(entity.name)) { 21 | it.cancel() 22 | } 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/resources/assets/shaders/menu/redglow.fsh: -------------------------------------------------------------------------------- 1 | #ifdef GL_ES 2 | precision highp float; 3 | #endif 4 | 5 | uniform float time; 6 | uniform vec2 mouse; 7 | uniform vec2 resolution; 8 | 9 | const float COUNT = 10.0; 10 | 11 | //MythicalFire by CuriousChettai@gmail.com 12 | 13 | void main(void) { 14 | vec2 uPos = (gl_FragCoord.xy / resolution.y);//normalize wrt y axis 15 | uPos -= vec2((resolution.x/resolution.y)/2.0, 0.5);//shift origin to center 16 | 17 | float y = uPos.y; 18 | 19 | float vertColor = 0.0; 20 | for (float i=0.0; i { 31 | disable() 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/world/MixinBlockFluidRenderer.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.world; 2 | 3 | import com.lambda.client.module.modules.render.Xray; 4 | import net.minecraft.block.state.IBlockState; 5 | import net.minecraft.client.renderer.BlockFluidRenderer; 6 | import net.minecraft.client.renderer.BufferBuilder; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.IBlockAccess; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 13 | 14 | @Mixin(BlockFluidRenderer.class) 15 | public class MixinBlockFluidRenderer { 16 | @Inject(method = "renderFluid", at = @At("HEAD"), cancellable = true) 17 | public void renderFluid(IBlockAccess blockAccess, IBlockState blockStateIn, BlockPos blockPosIn, BufferBuilder bufferBuilderIn, CallbackInfoReturnable ci) { 18 | if (Xray.shouldReplace(blockStateIn)) { 19 | ci.cancel(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/world/MixinBlockWeb.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.world; 2 | 3 | import com.lambda.client.module.modules.movement.NoSlowDown; 4 | import net.minecraft.block.BlockWeb; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.entity.Entity; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 | 14 | @Mixin(BlockWeb.class) 15 | public class MixinBlockWeb { 16 | 17 | @Inject(method = "onEntityCollision", at = @At("HEAD"), cancellable = true) 18 | public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn, CallbackInfo info) { 19 | // If noslowdown is on, just don't do anything else in this method (slow the player) 20 | if (NoSlowDown.INSTANCE.isEnabled() && NoSlowDown.INSTANCE.getCobweb()) info.cancel(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/color/DyeColors.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.color 2 | 3 | /** 4 | * @author Xiaro 5 | * 6 | * Colors based on Minecraft colors, modified for better visibility. 7 | * 8 | * Created by Xiaro on 08/08/20 9 | */ 10 | enum class DyeColors(val color: ColorHolder) { 11 | BLACK(ColorHolder(0, 0, 0)), 12 | RED(ColorHolder(250, 32, 32)), 13 | GREEN(ColorHolder(32, 250, 32)), 14 | BROWN(ColorHolder(180, 100, 48)), 15 | BLUE(ColorHolder(48, 48, 255)), 16 | PURPLE(ColorHolder(137, 50, 184)), 17 | CYAN(ColorHolder(64, 230, 250)), 18 | LIGHT_GRAY(ColorHolder(160, 160, 160)), 19 | GRAY(ColorHolder(80, 80, 80)), 20 | PINK(ColorHolder(255, 128, 172)), 21 | LIME(ColorHolder(132, 240, 32)), 22 | YELLOW(ColorHolder(255, 232, 0)), 23 | LIGHT_BLUE(ColorHolder(100, 160, 255)), 24 | MAGENTA(ColorHolder(220, 64, 220)), 25 | ORANGE(ColorHolder(255, 132, 32)), 26 | WHITE(ColorHolder(255, 255, 255)), 27 | LAMBDA(ColorHolder(155, 144, 255)), 28 | RAINBOW(ColorHolder(Int.MIN_VALUE, Int.MIN_VALUE, Int.MIN_VALUE)); 29 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/render/MixinTileEntityRendererDispatcher.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.render; 2 | 3 | import com.lambda.client.module.modules.render.NoRender; 4 | import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; 5 | import net.minecraft.tileentity.TileEntity; 6 | import org.spongepowered.asm.mixin.Mixin; 7 | import org.spongepowered.asm.mixin.injection.At; 8 | import org.spongepowered.asm.mixin.injection.Inject; 9 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 10 | 11 | @Mixin(TileEntityRendererDispatcher.class) 12 | public class MixinTileEntityRendererDispatcher { 13 | @Inject(method = "render(Lnet/minecraft/tileentity/TileEntity;FI)V", at = @At("HEAD"), cancellable = true) 14 | public void render(TileEntity entity, float partialTicks, int destroyStage, CallbackInfo ci) { 15 | if (NoRender.INSTANCE.isEnabled()) { 16 | if (NoRender.INSTANCE.tryReplaceEnchantingTable(entity) || NoRender.INSTANCE.getEntityList().contains(entity.getClass())) { 17 | ci.cancel(); 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/world/MixinBlockSoulSand.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.world; 2 | 3 | import com.lambda.client.module.modules.movement.NoSlowDown; 4 | import net.minecraft.block.BlockSoulSand; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.entity.Entity; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 | 14 | @Mixin(BlockSoulSand.class) 15 | public class MixinBlockSoulSand { 16 | 17 | @Inject(method = "onEntityCollision", at = @At("HEAD"), cancellable = true) 18 | public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn, CallbackInfo info) { 19 | // If noslowdown is on, just don't do anything else in this method (slow the player) 20 | if (NoSlowDown.INSTANCE.isEnabled() && NoSlowDown.INSTANCE.getSoulSand()) info.cancel(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/render/MixinLayerArmorBase.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.render; 2 | 3 | import com.lambda.client.module.modules.render.NoRender; 4 | import net.minecraft.client.renderer.entity.layers.LayerArmorBase; 5 | import net.minecraft.entity.EntityLivingBase; 6 | import net.minecraft.inventory.EntityEquipmentSlot; 7 | import org.spongepowered.asm.mixin.Mixin; 8 | import org.spongepowered.asm.mixin.injection.At; 9 | import org.spongepowered.asm.mixin.injection.Inject; 10 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 11 | 12 | @Mixin(LayerArmorBase.class) 13 | public abstract class MixinLayerArmorBase { 14 | @Inject(method = "renderArmorLayer", at = @At("HEAD"), cancellable = true) 15 | public void renderArmorLayerPre(EntityLivingBase entityLivingBaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, EntityEquipmentSlot slotIn, CallbackInfo ci) { 16 | if (NoRender.INSTANCE.isEnabled() && NoRender.shouldHide(slotIn, entityLivingBaseIn)) { 17 | ci.cancel(); 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/commands/ToggleCommand.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.commands 2 | 3 | import com.lambda.client.command.ClientCommand 4 | import com.lambda.client.module.modules.client.ClickGUI 5 | import com.lambda.client.module.modules.client.CommandConfig 6 | import com.lambda.client.util.text.MessageSendHelper.sendChatMessage 7 | import net.minecraft.util.text.TextFormatting 8 | 9 | object ToggleCommand : ClientCommand( 10 | name = "toggle", 11 | alias = arrayOf("switch", "t"), 12 | description = "Toggle a module on and off!" 13 | ) { 14 | init { 15 | module("module") { moduleArg -> 16 | execute { 17 | val module = moduleArg.value 18 | module.toggle() 19 | if (module !is ClickGUI && !CommandConfig.toggleMessages) { 20 | sendChatMessage(module.name + 21 | if (module.isEnabled) " ${TextFormatting.GREEN}enabled" 22 | else " ${TextFormatting.RED}disabled" 23 | ) 24 | } 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/graphics/texture/AbstractTexture.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.graphics.texture 2 | 3 | import net.minecraft.client.renderer.GlStateManager 4 | import org.lwjgl.opengl.GL11.glGenTextures 5 | 6 | abstract class AbstractTexture { 7 | 8 | var textureID: Int = -1; private set 9 | 10 | abstract val width: Int 11 | abstract val height: Int 12 | 13 | fun genTexture() { 14 | textureID = glGenTextures() 15 | } 16 | 17 | fun bindTexture() { 18 | if (textureID != -1) { 19 | GlStateManager.bindTexture(textureID) 20 | } 21 | } 22 | 23 | fun unbindTexture() { 24 | GlStateManager.bindTexture(0) 25 | } 26 | 27 | fun deleteTexture() { 28 | if (textureID != -1) { 29 | GlStateManager.deleteTexture(textureID) 30 | textureID = -1 31 | } 32 | } 33 | 34 | override fun equals(other: Any?) = 35 | this === other 36 | || other is AbstractTexture 37 | && this.textureID == other.textureID 38 | 39 | override fun hashCode() = textureID 40 | 41 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/commons/extension/Collection.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.commons.extension 2 | 3 | import java.util.* 4 | 5 | fun MutableCollection.add(e: E?) { 6 | if (e != null) this.add(e) 7 | } 8 | 9 | /** 10 | * Returns the sum of all values produced by [selector] function applied to each element in the collection. 11 | */ 12 | inline fun Iterable.sumByFloat(selector: (T) -> Float): Float { 13 | var sum = 0.0f 14 | for (element in this) { 15 | sum += selector(element) 16 | } 17 | return sum 18 | } 19 | 20 | fun MutableCollection.synchronized(): MutableCollection = 21 | Collections.synchronizedCollection(this) 22 | 23 | fun MutableList.synchronized(): MutableList = 24 | Collections.synchronizedList(this) 25 | 26 | fun MutableSet.synchronized(): MutableSet = 27 | Collections.synchronizedSet(this) 28 | 29 | fun SortedSet.synchronized(): SortedSet = 30 | Collections.synchronizedSortedSet(this) 31 | 32 | fun NavigableSet.synchronized(): NavigableSet = 33 | Collections.synchronizedNavigableSet(this) -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/movement/IceSpeed.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.movement 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | import com.lambda.client.util.threads.safeListener 6 | import net.minecraft.init.Blocks 7 | import net.minecraftforge.fml.common.gameevent.TickEvent 8 | 9 | object IceSpeed : Module( 10 | name = "IceSpeed", 11 | description = "Changes how slippery ice is", 12 | category = Category.MOVEMENT 13 | ) { 14 | private val slipperiness by setting("Slipperiness", 0.4f, 0.3f..0.5f, 0.005f) 15 | 16 | init { 17 | safeListener { 18 | Blocks.ICE.setDefaultSlipperiness(slipperiness) 19 | Blocks.PACKED_ICE.setDefaultSlipperiness(slipperiness) 20 | Blocks.FROSTED_ICE.setDefaultSlipperiness(slipperiness) 21 | } 22 | 23 | onDisable { 24 | Blocks.ICE.setDefaultSlipperiness(0.98f) 25 | Blocks.PACKED_ICE.setDefaultSlipperiness(0.98f) 26 | Blocks.FROSTED_ICE.setDefaultSlipperiness(0.98f) 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /setupWorkspace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Used to setup workspace and fix building on unix / Git BASH 4 | # 5 | # Usage: "./setupWorkspace.sh" 6 | 7 | SECONDS=0 8 | 9 | # To allow use from outside the lambda directory 10 | cd "$(dirname "$0")" || exit 11 | 12 | echo "Running gradlew classes without daemon..." 13 | ./gradlew --no-daemon classes || { 14 | echo "ERROR: Running gradlew build failed! Run './gradlew --no-daemon classes' manually" 15 | exit 1 16 | } 17 | 18 | # Generates InteliJ runs so the user doesn't have to do that manually 19 | echo "Generating InteliJ runs" 20 | ./gradlew --no-daemon genIntellijRuns || { 21 | echo "ERROR: Failure generating InteliJ runs! try generating them manually from within IntelliJ" 22 | exit 1 23 | } 24 | 25 | cat logo_ascii.txt 2>/dev/null 26 | echo "==========================================================================" 27 | echo "" 28 | # shellcheck disable=SC2039 29 | echo "Build succeeded in $((SECONDS / 60)) minutes and $((SECONDS % 60)) seconds! All checks passed, you can build normally now! Welcome to Lambda." 30 | echo "" 31 | echo "==========================================================================" 32 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/elements/player/Rotation.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.elements.player 2 | 3 | import com.lambda.client.commons.utils.MathUtils 4 | import com.lambda.client.event.SafeClientEvent 5 | import com.lambda.client.gui.hudgui.LabelHud 6 | import com.lambda.client.util.math.RotationUtils 7 | 8 | internal object Rotation : LabelHud( 9 | name = "Rotation", 10 | category = Category.PLAYER, 11 | description = "Player rotation" 12 | ) { 13 | private val yaw by setting("Yaw", true) 14 | private val pitch by setting("Pitch", true) 15 | 16 | override fun SafeClientEvent.updateText() { 17 | if (yaw) { 18 | val yawVal = MathUtils.round(RotationUtils.normalizeAngle(mc.player?.rotationYaw ?: 0.0f), 1) 19 | displayText.add("Yaw", secondaryColor) 20 | displayText.add(yawVal.toString(), primaryColor) 21 | } 22 | if (pitch) { 23 | val pitchVal = MathUtils.round(mc.player?.rotationPitch ?: 0.0f, 1) 24 | displayText.add("Pitch", secondaryColor) 25 | displayText.add(pitchVal.toString(), primaryColor) 26 | } 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/execute/ExecuteOption.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.execute 2 | 3 | import com.lambda.client.command.args.FinalArg 4 | 5 | /** 6 | * Used to check if a [FinalArg] can be invoke with an [IExecuteEvent]. 7 | * The default behavior is all [ExecuteOption]'s [canExecute] must returns true. 8 | * 9 | * @param E Type of [IExecuteEvent] 10 | */ 11 | interface ExecuteOption { 12 | /** 13 | * A predicate to check if the [event] can be used to invoke a [FinalArg] 14 | */ 15 | suspend fun canExecute(event: E): Boolean 16 | 17 | /** 18 | * Action to perform if [canExecute] returns false 19 | */ 20 | suspend fun onFailed(event: E) 21 | } 22 | 23 | /** 24 | * A wrapper for allowing `or` operation check on multiple [ExecuteOption] 25 | */ 26 | class AnyOption(private vararg val options: ExecuteOption) : ExecuteOption { 27 | override suspend fun canExecute(event: E): Boolean { 28 | return options.any { it.canExecute(event) } 29 | } 30 | 31 | override suspend fun onFailed(event: E) { 32 | options.last().onFailed(event) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/rgui/windows/TitledWindow.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.rgui.windows 2 | 3 | import com.lambda.client.module.modules.client.CustomFont 4 | import com.lambda.client.module.modules.client.GuiColors 5 | import com.lambda.client.util.graphics.VertexHelper 6 | import com.lambda.client.util.graphics.font.FontRenderAdapter 7 | import com.lambda.client.util.math.Vec2f 8 | 9 | /** 10 | * Window with rectangle and title rendering 11 | */ 12 | open class TitledWindow( 13 | name: String, 14 | posX: Float, 15 | posY: Float, 16 | width: Float, 17 | height: Float, 18 | settingGroup: SettingGroup 19 | ) : BasicWindow(name, posX, posY, width, height, settingGroup) { 20 | override val draggableHeight: Float get() = FontRenderAdapter.getFontHeight() + 5.0f 21 | 22 | override val minimizable get() = true 23 | 24 | override fun onRender(vertexHelper: VertexHelper, absolutePos: Vec2f) { 25 | super.onRender(vertexHelper, absolutePos) 26 | FontRenderAdapter.drawString(componentName, (width - FontRenderAdapter.getStringWidth(componentName)) / 2, 3.0f, color = GuiColors.text, drawShadow = CustomFont.shadow) 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/events/PlayerMoveEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.events 2 | 3 | import com.lambda.client.event.Cancellable 4 | import com.lambda.client.event.Event 5 | import net.minecraft.client.entity.EntityPlayerSP 6 | 7 | class PlayerMoveEvent( 8 | private val player: EntityPlayerSP 9 | ) : Event, Cancellable() { 10 | private val prevX = player.motionX 11 | private val prevY = player.motionY 12 | private val prevZ = player.motionZ 13 | 14 | val isModified: Boolean 15 | get() = player.motionX != prevX 16 | || player.motionY != prevY 17 | || player.motionZ != prevZ 18 | 19 | var x: Double 20 | get() = if (cancelled) 0.0 else player.motionX 21 | set(value) { 22 | if (!cancelled) player.motionX = value 23 | } 24 | 25 | var y: Double 26 | get() = if (cancelled) 0.0 else player.motionY 27 | set(value) { 28 | if (!cancelled) player.motionY = value 29 | } 30 | 31 | var z: Double 32 | get() = if (cancelled) 0.0 else player.motionZ 33 | set(value) { 34 | if (!cancelled) player.motionZ = value 35 | } 36 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/elements/client/BaritoneProcess.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.elements.client 2 | 3 | import com.lambda.client.event.SafeClientEvent 4 | import com.lambda.client.gui.hudgui.LabelHud 5 | import com.lambda.client.module.modules.movement.AutoWalk 6 | import com.lambda.client.process.PauseProcess 7 | import com.lambda.client.util.BaritoneUtils 8 | 9 | internal object BaritoneProcess : LabelHud( 10 | name = "BaritoneProcess", 11 | category = Category.CLIENT, 12 | description = "Shows what Baritone is doing" 13 | ) { 14 | 15 | override fun SafeClientEvent.updateText() { 16 | val process = BaritoneUtils.primary?.pathingControlManager?.mostRecentInControl()?.orElse(null) ?: return 17 | 18 | when { 19 | process == PauseProcess -> { 20 | displayText.addLine(process.displayName0()) 21 | } 22 | AutoWalk.baritoneWalk -> { 23 | displayText.addLine("AutoWalk (${AutoWalk.direction.displayName})") 24 | } 25 | else -> { 26 | displayText.addLine("Process: ${process.displayName()}") 27 | } 28 | } 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/player/NoSwing.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.player 2 | 3 | import com.lambda.client.event.events.PacketEvent 4 | import com.lambda.client.event.listener.listener 5 | import com.lambda.client.module.Category 6 | import com.lambda.client.module.Module 7 | import com.lambda.client.util.threads.safeListener 8 | import net.minecraft.network.play.client.CPacketAnimation 9 | import net.minecraftforge.fml.common.gameevent.TickEvent 10 | 11 | object NoSwing : Module( 12 | name = "NoSwing", 13 | description = "Cancels server or client swing animation", 14 | category = Category.PLAYER 15 | ) { 16 | private val mode by setting("Mode", Mode.CLIENT) 17 | 18 | private enum class Mode { 19 | CLIENT, SERVER 20 | } 21 | 22 | init { 23 | listener { 24 | if (mode == Mode.SERVER && it.packet is CPacketAnimation) it.cancel() 25 | } 26 | 27 | safeListener { 28 | player.isSwingInProgress = false 29 | player.swingProgressInt = 0 30 | player.swingProgress = 0.0f 31 | player.prevSwingProgress = 0.0f 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/elements/misc/MemoryUsage.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.elements.misc 2 | 3 | import com.lambda.client.event.SafeClientEvent 4 | import com.lambda.client.gui.hudgui.LabelHud 5 | 6 | internal object MemoryUsage : LabelHud( 7 | name = "MemoryUsage", 8 | category = Category.MISC, 9 | description = "Display the used, allocated and max memory" 10 | ) { 11 | 12 | private val showAllocated = setting("Show Allocated", false) 13 | private val showMax = setting("Show Max", false) 14 | 15 | override fun SafeClientEvent.updateText() { 16 | val memory = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1048576L 17 | displayText.add(memory.toString(), primaryColor) 18 | if (showAllocated.value) { 19 | val allocatedMemory = Runtime.getRuntime().totalMemory() / 1048576L 20 | displayText.add(allocatedMemory.toString(), primaryColor) 21 | } 22 | if (showMax.value) { 23 | val maxMemory = Runtime.getRuntime().maxMemory() / 1048576L 24 | displayText.add(maxMemory.toString(), primaryColor) 25 | } 26 | displayText.add("MB", secondaryColor) 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/render/MixinLayerCape.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.render; 2 | 3 | import com.lambda.client.module.modules.client.Capes; 4 | import net.minecraft.client.entity.AbstractClientPlayer; 5 | import net.minecraft.client.renderer.entity.RenderPlayer; 6 | import net.minecraft.client.renderer.entity.layers.LayerCape; 7 | import org.spongepowered.asm.mixin.Final; 8 | import org.spongepowered.asm.mixin.Mixin; 9 | import org.spongepowered.asm.mixin.Shadow; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Inject; 12 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 13 | 14 | @Mixin(LayerCape.class) 15 | public class MixinLayerCape { 16 | @Shadow @Final private RenderPlayer playerRenderer; 17 | 18 | @Inject(method = "doRenderLayer(Lnet/minecraft/client/entity/AbstractClientPlayer;FFFFFFF)V", at = @At("HEAD"), cancellable = true) 19 | public void doRenderLayer(AbstractClientPlayer player, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, CallbackInfo ci) { 20 | if (Capes.INSTANCE.tryRenderCape(playerRenderer, player, partialTicks)) 21 | ci.cancel(); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/player/PortalGodMode.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.player 2 | 3 | import com.lambda.client.event.events.PacketEvent 4 | import com.lambda.client.event.listener.listener 5 | import com.lambda.client.module.Category 6 | import com.lambda.client.module.Module 7 | import com.lambda.client.util.threads.runSafe 8 | import net.minecraft.network.play.client.CPacketConfirmTeleport 9 | 10 | object PortalGodMode : Module( 11 | name = "PortalGodMode", 12 | description = "Prevents taking damage in portals", 13 | category = Category.PLAYER 14 | ) { 15 | private val instantTeleport by setting("Instant Teleport", true) 16 | 17 | private var packet: CPacketConfirmTeleport? = null 18 | 19 | init { 20 | onEnable { 21 | packet = null 22 | } 23 | 24 | onDisable { 25 | runSafe { 26 | if (instantTeleport) packet?.let { 27 | connection.sendPacket(it) 28 | } 29 | } 30 | } 31 | 32 | listener { 33 | if (it.packet !is CPacketConfirmTeleport) return@listener 34 | it.cancel() 35 | packet = it.packet 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/world/MixinItemBlock.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.world; 2 | 3 | import com.lambda.client.module.modules.player.NoGhostBlocks; 4 | import net.minecraft.block.state.IBlockState; 5 | import net.minecraft.client.Minecraft; 6 | import net.minecraft.item.ItemBlock; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.injection.At; 11 | import org.spongepowered.asm.mixin.injection.Redirect; 12 | 13 | @Mixin(ItemBlock.class) 14 | public class MixinItemBlock { 15 | 16 | private final Minecraft mc = Minecraft.getMinecraft(); 17 | 18 | @Redirect(method = "placeBlockAt", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/state/IBlockState;I)Z")) 19 | private boolean ignoreSetBlockState(World instance, BlockPos p_setBlockState_1_, IBlockState p_setBlockState_2_, int p_setBlockState_3_) { 20 | if (NoGhostBlocks.INSTANCE.isEnabled() && !mc.isSingleplayer()) { 21 | return true; 22 | } else { 23 | return instance.setBlockState(p_setBlockState_1_, p_setBlockState_2_, p_setBlockState_3_); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/world/Block.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.world 2 | 3 | import com.lambda.client.util.Wrapper 4 | import com.lambda.client.util.items.blockBlacklist 5 | import net.minecraft.block.Block 6 | import net.minecraft.block.state.IBlockState 7 | import net.minecraft.client.multiplayer.WorldClient 8 | import net.minecraft.init.Blocks 9 | import net.minecraft.util.math.AxisAlignedBB 10 | import net.minecraft.util.math.BlockPos 11 | 12 | val IBlockState.isBlacklisted: Boolean 13 | get() = blockBlacklist.contains(this.block) 14 | 15 | val IBlockState.isLiquid: Boolean 16 | get() = this.material.isLiquid 17 | 18 | val IBlockState.isWater: Boolean 19 | get() = this.block == Blocks.WATER 20 | 21 | val IBlockState.isReplaceable: Boolean 22 | get() = this.material.isReplaceable 23 | 24 | val IBlockState.isFullBox: Boolean 25 | get() = Wrapper.world?.let { 26 | this.getCollisionBoundingBox(it, BlockPos.ORIGIN) 27 | } == Block.FULL_BLOCK_AABB 28 | 29 | fun WorldClient.getSelectedBox(pos: BlockPos): AxisAlignedBB = 30 | this.getBlockState(pos).getSelectedBoundingBox(this, pos) 31 | 32 | fun WorldClient.getCollisionBox(pos: BlockPos): AxisAlignedBB? = 33 | this.getBlockState(pos).getCollisionBoundingBox(this, pos) -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/manager/ManagerLoader.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.manager 2 | 3 | import com.lambda.client.LambdaMod 4 | import com.lambda.client.commons.utils.ClassUtils 5 | import com.lambda.client.commons.utils.ClassUtils.instance 6 | import com.lambda.client.event.LambdaEventBus 7 | import com.lambda.client.util.StopTimer 8 | import kotlinx.coroutines.Deferred 9 | 10 | internal object ManagerLoader : com.lambda.client.AsyncLoader>> { 11 | override var deferred: Deferred>>? = null 12 | 13 | override fun preLoad0(): List> { 14 | val stopTimer = StopTimer() 15 | 16 | val list = ClassUtils.findClasses("com.lambda.client.manager.managers") 17 | 18 | val time = stopTimer.stop() 19 | 20 | LambdaMod.LOG.info("${list.size} managers found, took ${time}ms") 21 | return list 22 | } 23 | 24 | override fun load0(input: List>) { 25 | val stopTimer = StopTimer() 26 | 27 | for (clazz in input) { 28 | LambdaEventBus.subscribe(clazz.instance) 29 | } 30 | 31 | val time = stopTimer.stop() 32 | LambdaMod.LOG.info("${input.size} managers loaded, took ${time}ms") 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/combat/AimBot.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.combat 2 | 3 | import com.lambda.client.manager.managers.CombatManager 4 | import com.lambda.client.module.Category 5 | import com.lambda.client.module.Module 6 | import com.lambda.client.util.items.swapToItem 7 | import com.lambda.client.util.math.RotationUtils.faceEntityClosest 8 | import com.lambda.client.util.threads.safeListener 9 | import net.minecraft.init.Items 10 | import net.minecraftforge.fml.common.gameevent.TickEvent 11 | 12 | @CombatManager.CombatModule 13 | object AimBot : Module( 14 | name = "AimBot", 15 | description = "Automatically aims at entities for you", 16 | category = Category.COMBAT, 17 | modulePriority = 20 18 | ) { 19 | private val bowOnly by setting("Bow Only", true) 20 | private val autoSwap by setting("Auto Swap", false) 21 | 22 | init { 23 | safeListener { 24 | if (player.heldItemMainhand.item != Items.BOW) { 25 | if (autoSwap) swapToItem(Items.BOW) 26 | if (bowOnly) return@safeListener 27 | } 28 | 29 | CombatManager.target?.let { 30 | faceEntityClosest(it) 31 | } 32 | } 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/process/AutoObsidianProcess.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.process 2 | 3 | import baritone.api.process.IBaritoneProcess 4 | import baritone.api.process.PathingCommand 5 | import baritone.api.process.PathingCommandType 6 | import com.lambda.client.module.modules.misc.AutoObsidian 7 | 8 | object AutoObsidianProcess : IBaritoneProcess { 9 | 10 | override fun isTemporary(): Boolean { 11 | return true 12 | } 13 | 14 | override fun priority(): Double { 15 | return 3.0 16 | } 17 | 18 | override fun onLostControl() {} 19 | 20 | override fun displayName0(): String { 21 | return if (AutoObsidian.state != AutoObsidian.State.SEARCHING) { 22 | "AutoObsidian: ${AutoObsidian.state.displayName}" 23 | } else { 24 | "AutoObsidian: Searching-${AutoObsidian.searchingState.displayName}" 25 | } 26 | } 27 | 28 | override fun isActive(): Boolean { 29 | return AutoObsidian.isActive() 30 | } 31 | 32 | override fun onTick(p0: Boolean, p1: Boolean): PathingCommand { 33 | return AutoObsidian.goal?.let { 34 | PathingCommand(it, PathingCommandType.SET_GOAL_AND_PATH) 35 | } ?: PathingCommand(null, PathingCommandType.REQUEST_PAUSE) 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/elements/misc/ServerInfo.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.elements.misc 2 | 3 | import com.lambda.client.event.SafeClientEvent 4 | import com.lambda.client.gui.hudgui.LabelHud 5 | 6 | internal object ServerInfo : LabelHud( 7 | name = "ServerInfo", 8 | category = Category.MISC, 9 | description = "Brand / type and ip of the server" 10 | ) { 11 | private val showBrand by setting("Show Brand", true) 12 | private val showIP by setting("Show full server ip", false) 13 | 14 | override fun SafeClientEvent.updateText() { 15 | if (mc.isIntegratedServerRunning) { 16 | displayText.add("Singleplayer: " + mc.player?.serverBrand) 17 | } else { 18 | if (showBrand) { 19 | val serverBrand = player.serverBrand ?: "Unknown Server Type" 20 | displayText.add("Brand", secondaryColor) 21 | displayText.addLine(serverBrand, primaryColor) 22 | } 23 | 24 | if (showIP) { 25 | val serverIp = player.connection.networkManager.remoteAddress.toString() 26 | displayText.add("IP", secondaryColor) 27 | displayText.addLine(serverIp, primaryColor) 28 | } 29 | } 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/commands/PrefixCommand.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.commands 2 | 3 | import com.lambda.client.command.ClientCommand 4 | import com.lambda.client.module.modules.client.CommandConfig 5 | import com.lambda.client.util.text.MessageSendHelper 6 | import com.lambda.client.util.text.formatValue 7 | 8 | object PrefixCommand : ClientCommand( 9 | name = "prefix", 10 | description = "Change command prefix" 11 | ) { 12 | init { 13 | literal("reset") { 14 | execute("Reset the prefix to ;") { 15 | CommandConfig.prefix = ";" 16 | MessageSendHelper.sendChatMessage("Reset prefix to [&7;&f]!") 17 | } 18 | } 19 | 20 | string("new prefix") { prefixArg -> 21 | execute("Set a new prefix") { 22 | if (prefixArg.value.isEmpty() || prefixArg.value == "\\") { 23 | CommandConfig.prefix = ";" 24 | MessageSendHelper.sendChatMessage("Reset prefix to [&7;&f]!") 25 | return@execute 26 | } 27 | 28 | CommandConfig.prefix = prefixArg.value 29 | MessageSendHelper.sendChatMessage("Set prefix to ${formatValue(prefixArg.value)}!") 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/eventbus/EventBusImpl.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.eventbus 2 | 3 | import com.lambda.client.event.listener.Listener 4 | import java.util.* 5 | import java.util.concurrent.ConcurrentHashMap 6 | import java.util.concurrent.ConcurrentSkipListSet 7 | 8 | /** 9 | * A concurrent implementation of [AbstractEventBus] 10 | */ 11 | open class ConcurrentEventBus : AbstractEventBus() { 12 | final override val subscribedListeners = ConcurrentHashMap, MutableSet>>() 13 | 14 | override fun newSet() = ConcurrentSkipListSet>(Comparator.reverseOrder()) 15 | } 16 | 17 | /** 18 | * A concurrent implementation of [AbstractEventBus] and [IMultiEventBus] 19 | */ 20 | open class MultiEventBus : ConcurrentEventBus(), IMultiEventBus { 21 | private val subscribedEventBus = Collections.newSetFromMap(ConcurrentHashMap()) 22 | 23 | final override fun subscribe(eventBus: IEventBus) { 24 | subscribedEventBus.add(eventBus) 25 | } 26 | 27 | final override fun unsubscribe(eventBus: IEventBus) { 28 | subscribedEventBus.remove(eventBus) 29 | } 30 | 31 | final override fun post(event: Any) { 32 | super.post(event) 33 | for (eventBus in subscribedEventBus) eventBus.post(event) 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/elements/player/Direction.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.elements.player 2 | 3 | import com.lambda.client.commons.interfaces.DisplayEnum 4 | import com.lambda.client.event.SafeClientEvent 5 | import com.lambda.client.gui.hudgui.LabelHud 6 | import com.lambda.client.util.math.Direction 7 | 8 | internal object Direction : LabelHud( 9 | name = "Direction", 10 | category = Category.PLAYER, 11 | description = "Displays the direction you are facing" 12 | ) { 13 | private val directionDisplayMode by setting("Direction Format", DirectionFormat.XZ) 14 | 15 | enum class DirectionFormat(override val displayName: String): DisplayEnum { 16 | NAME("Name"), XZ("XZ"), BOTH("Both") 17 | } 18 | 19 | override fun SafeClientEvent.updateText() { 20 | val entity = mc.renderViewEntity ?: player 21 | val direction = Direction.fromEntity(entity) 22 | if (directionDisplayMode == DirectionFormat.NAME || directionDisplayMode == DirectionFormat.BOTH) 23 | displayText.add(direction.displayName, secondaryColor) 24 | if (directionDisplayMode == DirectionFormat.XZ || directionDisplayMode == DirectionFormat.BOTH) 25 | displayText.add("(${direction.displayNameXY})", primaryColor) 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/misc/PingSpoof.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.misc 2 | 3 | import com.lambda.client.event.events.PacketEvent 4 | import com.lambda.client.event.listener.listener 5 | import com.lambda.client.module.Category 6 | import com.lambda.client.module.Module 7 | import com.lambda.client.util.threads.defaultScope 8 | import com.lambda.client.util.threads.onMainThreadSafe 9 | import kotlinx.coroutines.delay 10 | import kotlinx.coroutines.launch 11 | import net.minecraft.network.play.client.CPacketKeepAlive 12 | import net.minecraft.network.play.server.SPacketKeepAlive 13 | 14 | object PingSpoof : Module( 15 | name = "PingSpoof", 16 | description = "Adds delay to your packets", 17 | category = Category.MISC 18 | ) { 19 | private val delay by setting("Delay", 100, 0..2000, 25, unit = "ms") 20 | 21 | init { 22 | listener { 23 | if (it.packet is SPacketKeepAlive) { 24 | it.cancel() 25 | defaultScope.launch { 26 | delay(delay.toLong()) 27 | onMainThreadSafe { 28 | connection.sendPacket(CPacketKeepAlive(it.packet.id)) 29 | } 30 | } 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/text/Detectors.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.text 2 | 3 | interface Detector { 4 | infix fun detect(input: CharSequence): Boolean 5 | 6 | infix fun detectNot(input: CharSequence) = !detect(input) 7 | } 8 | 9 | interface RemovableDetector { 10 | fun removedOrNull(input: CharSequence): CharSequence? 11 | } 12 | 13 | interface PlayerDetector { 14 | fun playerName(input: CharSequence): String? 15 | } 16 | 17 | interface PrefixDetector : Detector, RemovableDetector { 18 | val prefixes: Array 19 | 20 | override fun detect(input: CharSequence) = prefixes.any { input.startsWith(it) } 21 | 22 | override fun removedOrNull(input: CharSequence) = prefixes.firstOrNull(input::startsWith)?.let { 23 | input.removePrefix(it) 24 | } 25 | } 26 | 27 | interface RegexDetector : Detector, RemovableDetector { 28 | val regexes: Array 29 | 30 | override infix fun detect(input: CharSequence) = regexes.any { it.containsMatchIn(input) } 31 | 32 | fun matchedRegex(input: CharSequence) = regexes.find { it.containsMatchIn(input) } 33 | 34 | override fun removedOrNull(input: CharSequence): CharSequence? = matchedRegex(input)?.let { regex -> 35 | input.replace(regex, "").takeIf { it.isNotBlank() } 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/kawase_blur.json: -------------------------------------------------------------------------------- 1 | { 2 | "blend": { 3 | "func": "add", 4 | "srcrgb": "srcalpha", 5 | "dstrgb": "1-srcalpha" 6 | }, 7 | "vertex": "kawase_blur", 8 | "fragment": "kawase_blur", 9 | "attributes": [ 10 | "Position" 11 | ], 12 | "samplers": [ 13 | { 14 | "name": "DiffuseSampler" 15 | } 16 | ], 17 | "uniforms": [ 18 | { 19 | "name": "ProjMat", 20 | "type": "matrix4x4", 21 | "count": 16, 22 | "values": [ 23 | 1.0, 24 | 0.0, 25 | 0.0, 26 | 0.0, 27 | 0.0, 28 | 1.0, 29 | 0.0, 30 | 0.0, 31 | 0.0, 32 | 0.0, 33 | 1.0, 34 | 0.0, 35 | 0.0, 36 | 0.0, 37 | 0.0, 38 | 1.0 39 | ] 40 | }, 41 | { 42 | "name": "InSize", 43 | "type": "float", 44 | "count": 2, 45 | "values": [ 46 | 1.0, 47 | 1.0 48 | ] 49 | }, 50 | { 51 | "name": "multiplier", 52 | "type": "float", 53 | "count": 1, 54 | "values": [ 55 | 1.0 56 | ] 57 | }, 58 | { 59 | "name": "baseOffset", 60 | "type": "float", 61 | "count": 1, 62 | "values": [ 63 | 0.5 64 | ] 65 | } 66 | ] 67 | } 68 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/manager/managers/UUIDManager.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.manager.managers 2 | 3 | import com.lambda.client.LambdaMod 4 | import com.lambda.client.capeapi.AbstractUUIDManager 5 | import com.lambda.client.capeapi.PlayerProfile 6 | import com.lambda.client.capeapi.UUIDUtils 7 | import com.lambda.client.manager.Manager 8 | import com.lambda.client.util.FolderUtils 9 | import com.lambda.client.util.Wrapper 10 | 11 | object UUIDManager : AbstractUUIDManager(FolderUtils.lambdaFolder + "uuid_cache.json", LambdaMod.LOG, maxCacheSize = 1000), Manager { 12 | 13 | override fun getOrRequest(nameOrUUID: String): PlayerProfile? { 14 | return Wrapper.minecraft.connection?.playerInfoMap?.let { playerInfoMap -> 15 | val infoMap = ArrayList(playerInfoMap) 16 | val isUUID = UUIDUtils.isUUID(nameOrUUID) 17 | val withOutDashes = UUIDUtils.removeDashes(nameOrUUID) 18 | 19 | infoMap.find { 20 | isUUID && UUIDUtils.removeDashes(it.gameProfile.id.toString()).equals(withOutDashes, ignoreCase = true) 21 | || !isUUID && it.gameProfile.name.equals(nameOrUUID, ignoreCase = true) 22 | }?.gameProfile?.let { 23 | PlayerProfile(it.id, it.name) 24 | } 25 | } ?: super.getOrRequest(nameOrUUID) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/client/GuiColors.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.client 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | import com.lambda.client.util.color.ColorHolder 6 | 7 | object GuiColors : Module( 8 | name = "GuiColors", 9 | description = "Customize gui colors", 10 | category = Category.CLIENT, 11 | showOnArray = false, 12 | alwaysEnabled = true 13 | ) { 14 | private val primarySetting by setting("Primary Color", ColorHolder(108, 0, 43, 255)) 15 | private val outlineSetting by setting("Outline Color", ColorHolder(78, 0, 31, 200)) 16 | private val backgroundSetting by setting("Background Color", ColorHolder(31, 10, 18, 235)) 17 | private val textSetting by setting("Text Color", ColorHolder(255, 205, 225, 255)) 18 | private val aHover by setting("Hover Alpha", 32, 0..255, 1) 19 | 20 | val primary get() = primarySetting.clone() 21 | val idle get() = if (primary.averageBrightness < 0.8f) ColorHolder(255, 255, 255, 0) else ColorHolder(0, 0, 0, 0) 22 | val hover get() = idle.apply { a = aHover } 23 | val click get() = idle.apply { a = aHover * 2 } 24 | val backGround get() = backgroundSetting.clone() 25 | val outline get() = outlineSetting.clone() 26 | val text get() = textSetting.clone() 27 | } 28 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/settings/impl/collection/MapSetting.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting.settings.impl.collection 2 | 3 | import com.google.gson.JsonElement 4 | import com.google.gson.reflect.TypeToken 5 | import com.lambda.client.setting.settings.ImmutableSetting 6 | 7 | class MapSetting>( 8 | name: String, 9 | override val value: T, 10 | visibility: () -> Boolean = { true }, 11 | description: String = "", 12 | unit: String = "" 13 | ) : ImmutableSetting(name, value, visibility, { _, input -> input }, description, unit) { 14 | override val defaultValue: T = valueClass.newInstance() 15 | private val type = object : TypeToken>() {}.type 16 | 17 | init { 18 | value.toMap(defaultValue) 19 | } 20 | 21 | override fun resetValue() { 22 | value.clear() 23 | value.putAll(defaultValue) 24 | } 25 | 26 | override fun write(): JsonElement = gson.toJsonTree(value) 27 | 28 | override fun read(jsonElement: JsonElement?) { 29 | jsonElement?.let { 30 | val cacheMap = gson.fromJson>(it, type) 31 | value.clear() 32 | value.putAll(cacheMap) 33 | } 34 | } 35 | 36 | override fun toString() = value.entries.joinToString { "${it.key} to ${it.value}" } 37 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/commands/VanishCommand.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.commands 2 | 3 | import com.lambda.client.command.ClientCommand 4 | import com.lambda.client.util.text.MessageSendHelper.sendChatMessage 5 | import com.lambda.client.util.text.formatValue 6 | import net.minecraft.entity.Entity 7 | 8 | object VanishCommand : ClientCommand( 9 | name = "vanish", 10 | description = "Allows you to vanish using an entity." 11 | ) { 12 | private var vehicle: Entity? = null 13 | 14 | init { 15 | executeSafe { 16 | if (player.ridingEntity != null && vehicle == null) { 17 | vehicle = player.ridingEntity?.also { 18 | player.dismountRidingEntity() 19 | world.removeEntityFromWorld(it.entityId) 20 | sendChatMessage("Vehicle " + formatValue(it.name) + " removed") 21 | } 22 | } else { 23 | vehicle?.let { 24 | it.isDead = false 25 | world.addEntityToWorld(it.entityId, it) 26 | player.startRiding(it, true) 27 | sendChatMessage("Vehicle " + formatValue(it.name) + " created") 28 | vehicle = null 29 | } ?: sendChatMessage("Not riding any vehicles") 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/setting/settings/impl/primitive/EnumSetting.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.setting.settings.impl.primitive 2 | 3 | import com.google.gson.JsonElement 4 | import com.google.gson.JsonPrimitive 5 | import com.lambda.client.commons.extension.next 6 | import com.lambda.client.setting.settings.MutableSetting 7 | 8 | class EnumSetting>( 9 | name: String, 10 | value: T, 11 | visibility: () -> Boolean = { true }, 12 | consumer: (prev: T, input: T) -> T = { _, input -> input }, 13 | description: String = "", 14 | unit: String = "" 15 | ) : MutableSetting(name, value, visibility, consumer, description, unit) { 16 | 17 | private val enumClass: Class = value.declaringJavaClass 18 | val enumValues: Array = enumClass.enumConstants 19 | 20 | fun nextValue() { 21 | value = value.next() 22 | } 23 | 24 | override fun setValue(valueIn: String) { 25 | super.setValue(valueIn.uppercase().replace(' ', '_')) 26 | } 27 | 28 | override fun write(): JsonElement = JsonPrimitive(value.name) 29 | 30 | override fun read(jsonElement: JsonElement?) { 31 | jsonElement?.asJsonPrimitive?.asString?.let { element -> 32 | enumValues.firstOrNull { it.name.equals(element, true) }?.let { 33 | value = it 34 | } 35 | } 36 | } 37 | 38 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/world/MixinBlockModelRenderer.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.world; 2 | 3 | import com.lambda.client.module.modules.render.Xray; 4 | import net.minecraft.block.state.IBlockState; 5 | import net.minecraft.client.renderer.BlockModelRenderer; 6 | import net.minecraft.client.renderer.BufferBuilder; 7 | import net.minecraft.client.renderer.block.model.IBakedModel; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.world.IBlockAccess; 10 | import org.spongepowered.asm.mixin.Mixin; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 14 | 15 | @Mixin(BlockModelRenderer.class) 16 | public class MixinBlockModelRenderer { 17 | @Inject(method = "renderModel(Lnet/minecraft/world/IBlockAccess;Lnet/minecraft/client/renderer/block/model/IBakedModel;Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/renderer/BufferBuilder;ZJ)Z", at = @At("HEAD"), cancellable = true) 18 | public void renderModel(IBlockAccess worldIn, IBakedModel modelIn, IBlockState stateIn, BlockPos posIn, BufferBuilder buffer, boolean checkSides, long rand, CallbackInfoReturnable ci) { 19 | if (Xray.shouldReplace(stateIn)) { 20 | ci.cancel(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/render/MixinLayerElytra.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.render; 2 | 3 | import com.lambda.client.module.modules.client.Capes; 4 | import net.minecraft.client.model.ModelElytra; 5 | import net.minecraft.client.renderer.entity.RenderLivingBase; 6 | import net.minecraft.client.renderer.entity.layers.LayerElytra; 7 | import net.minecraft.entity.EntityLivingBase; 8 | import org.spongepowered.asm.mixin.Final; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | @Mixin(LayerElytra.class) 16 | public class MixinLayerElytra { 17 | 18 | @Shadow @Final protected RenderLivingBase renderPlayer; 19 | @Shadow @Final private ModelElytra modelElytra; 20 | 21 | @Inject(method = "doRenderLayer", at = @At("HEAD"), cancellable = true) 22 | public void doRenderLayer(EntityLivingBase entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale, CallbackInfo ci) { 23 | if (Capes.INSTANCE.tryRenderElytra(renderPlayer, modelElytra, entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale, partialTicks)) 24 | ci.cancel(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/commands/SetBuildingBlockCommand.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.commands 2 | 3 | import com.lambda.client.command.ClientCommand 4 | import com.lambda.client.module.modules.player.InventoryManager 5 | import com.lambda.client.util.items.block 6 | import com.lambda.client.util.items.id 7 | import com.lambda.client.util.text.MessageSendHelper 8 | import net.minecraft.block.BlockAir 9 | 10 | // TODO: Remove once GUI has Block settings 11 | object SetBuildingBlockCommand : ClientCommand( 12 | name = "setbuildingblock", 13 | description = "Set the default building block" 14 | ) { 15 | init { 16 | executeSafe { 17 | val heldItem = player.inventory.getCurrentItem() 18 | when { 19 | heldItem.isEmpty -> { 20 | InventoryManager.buildingBlockID = 0 21 | MessageSendHelper.sendChatMessage("Building block has been reset") 22 | } 23 | heldItem.item.block !is BlockAir -> { 24 | InventoryManager.buildingBlockID = heldItem.item.id 25 | MessageSendHelper.sendChatMessage("Building block has been set to ${heldItem.displayName}") 26 | } 27 | else -> { 28 | MessageSendHelper.sendChatMessage("You are not holding a valid block") 29 | } 30 | } 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/gui/hudgui/elements/player/Effects.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.gui.hudgui.elements.player 2 | 3 | import com.lambda.client.event.SafeClientEvent 4 | import com.lambda.client.gui.hudgui.LabelHud 5 | import com.lambda.client.util.color.ColorConverter 6 | import com.lambda.client.util.text.RomanNumerals 7 | import net.minecraft.client.resources.I18n 8 | import net.minecraft.potion.Potion 9 | 10 | internal object Effects : LabelHud( 11 | name = "Effects", 12 | category = Category.PLAYER, 13 | description = "Displays active effects" 14 | ) { 15 | 16 | private val romanNumerals by setting("Roman Numerals", true) 17 | private val coloredEffectNames by setting("Colored Effect Names", true) 18 | 19 | override fun SafeClientEvent.updateText() { 20 | player.activePotionEffects.sortedBy { it.duration }.forEach { 21 | val amplifier = if (romanNumerals) RomanNumerals.numberToRoman(it.amplifier + 1) else (it.amplifier + 1).toString() 22 | val duration = Potion.getPotionDurationString(it, 1f) 23 | val color = if (coloredEffectNames) ColorConverter.hexToRgb(it.potion.liquidColor) else secondaryColor 24 | val name = I18n.format(it.potion.name) 25 | 26 | displayText.add(name, color) 27 | displayText.add(amplifier, primaryColor) 28 | displayText.addLine("(${duration})", primaryColor) 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/movement/ElytraFastClose.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.movement 2 | 3 | import com.lambda.client.module.Category 4 | import com.lambda.client.module.Module 5 | import com.lambda.client.util.threads.safeListener 6 | import com.lambda.mixin.accessor.AccessorEntity 7 | import net.minecraft.network.play.client.CPacketPlayer 8 | import net.minecraftforge.fml.common.gameevent.TickEvent 9 | 10 | object ElytraFastClose : Module( 11 | name = "ElytraFastClose", 12 | description = "Closes elytra on ground without waiting for the server", 13 | category = Category.MOVEMENT 14 | ) { 15 | private val stopMotion by setting("Stop Motion", true) 16 | private val yThreshold by setting ("Y Distance", 0.05, 0.0..1.0, 0.01) 17 | 18 | init { 19 | safeListener { 20 | if (it.phase != TickEvent.Phase.START || !player.isElytraFlying) return@safeListener 21 | if (world.collidesWithAnyBlock(player.entityBoundingBox.offset(0.0, -yThreshold, 0.0))) { 22 | if (stopMotion) { 23 | player.motionX = 0.0 24 | player.motionY = 0.0 25 | player.motionZ = 0.0 26 | } 27 | (player as AccessorEntity).invokeSetFlag(7, false) 28 | connection.sendPacket(CPacketPlayer(true)) 29 | } 30 | } 31 | } 32 | 33 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/TimerUtils.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util 2 | 3 | open class Timer { 4 | var time = currentTime; protected set 5 | 6 | protected val currentTime get() = System.currentTimeMillis() 7 | 8 | fun reset(offset: Int) { 9 | reset(offset.toLong()) 10 | } 11 | 12 | fun reset(offset: Long = 0L) { 13 | time = currentTime + offset 14 | } 15 | 16 | fun skipTime(delay: Int) { 17 | skipTime(delay.toLong()) 18 | } 19 | 20 | fun skipTime(delay: Long) { 21 | time = currentTime - delay 22 | } 23 | } 24 | 25 | class TickTimer(val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : Timer() { 26 | fun tick(delay: Int, resetIfTick: Boolean = true): Boolean { 27 | return tick(delay.toLong(), resetIfTick) 28 | } 29 | 30 | fun tick(delay: Long, resetIfTick: Boolean = true): Boolean { 31 | return if (currentTime - time > delay * timeUnit.multiplier) { 32 | if (resetIfTick) time = currentTime 33 | true 34 | } else { 35 | false 36 | } 37 | } 38 | } 39 | 40 | class StopTimer(val timeUnit: TimeUnit = TimeUnit.MILLISECONDS) : Timer() { 41 | fun stop(): Long { 42 | return (currentTime - time) / timeUnit.multiplier 43 | } 44 | } 45 | 46 | enum class TimeUnit(val multiplier: Long) { 47 | MILLISECONDS(1L), 48 | TICKS(50L), 49 | SECONDS(1000L), 50 | MINUTES(60000L); 51 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/gui/MixinGuiChat.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.gui; 2 | 3 | import com.lambda.client.command.CommandManager; 4 | import com.lambda.client.gui.mc.LambdaGuiChat; 5 | import com.lambda.client.util.Wrapper; 6 | import net.minecraft.client.gui.GuiChat; 7 | import net.minecraft.client.gui.GuiScreen; 8 | import net.minecraft.client.gui.GuiTextField; 9 | import org.spongepowered.asm.mixin.Mixin; 10 | import org.spongepowered.asm.mixin.Shadow; 11 | import org.spongepowered.asm.mixin.injection.At; 12 | import org.spongepowered.asm.mixin.injection.Inject; 13 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 14 | 15 | @Mixin(GuiChat.class) 16 | public abstract class MixinGuiChat extends GuiScreen { 17 | 18 | @Shadow protected GuiTextField inputField; 19 | @Shadow private String historyBuffer; 20 | @Shadow private int sentHistoryCursor; 21 | 22 | @Inject(method = "keyTyped(CI)V", at = @At("RETURN")) 23 | public void returnKeyTyped(char typedChar, int keyCode, CallbackInfo info) { 24 | GuiScreen currentScreen = Wrapper.getMinecraft().currentScreen; 25 | if (currentScreen instanceof GuiChat && !(currentScreen instanceof LambdaGuiChat) 26 | && inputField.getText().startsWith(CommandManager.INSTANCE.getPrefix())) { 27 | Wrapper.getMinecraft().displayGuiScreen(new LambdaGuiChat(inputField.getText(), historyBuffer, sentHistoryCursor)); 28 | } 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/resources/assets/minecraft/shaders/program/esp_outline.fsh: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | uniform sampler2D DiffuseSampler; 4 | uniform sampler2D PrevSampler; 5 | 6 | varying vec2 texCoord; 7 | varying vec2 oneTexel; 8 | 9 | uniform vec3 color; 10 | uniform float outlineAlpha; 11 | uniform float filledAlpha; 12 | uniform float width; 13 | 14 | void main(){ 15 | int intWidth = int(width); 16 | vec4 center = texture2D(DiffuseSampler, texCoord); 17 | 18 | if (center.a == 0.0) { 19 | // Scan pixels nearby 20 | for (int sampleX = -intWidth; sampleX <= intWidth; sampleX++) { 21 | for (int sampleY = -intWidth; sampleY <= intWidth; sampleY++) { 22 | vec2 sampleCoord = vec2(float(sampleX), float(sampleY)) * oneTexel; 23 | vec4 sampleColor = texture2D(DiffuseSampler, texCoord + sampleCoord); 24 | if (sampleColor.a > 0.0) { 25 | // If we find a pixel that isn't transparent, set the frag color to it and replace the alpha. 26 | center = vec4(color, outlineAlpha); 27 | } 28 | } 29 | } 30 | } else { 31 | // Replace the color 32 | center = vec4(color, 1.0); 33 | 34 | // Mix it with the blured background 35 | vec4 backgroundColor = texture2D(PrevSampler, texCoord); 36 | center = mix(backgroundColor, center, filledAlpha); 37 | } 38 | 39 | gl_FragColor = center; 40 | } 41 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/util/math/CoordinateConverter.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.util.math 2 | 3 | import com.lambda.client.manager.managers.WaypointManager 4 | import net.minecraft.util.math.BlockPos 5 | 6 | object CoordinateConverter { 7 | /** 8 | * More efficient impl of [BlockPos.toString] 9 | */ 10 | fun BlockPos.asString(): String { 11 | return "${this.x}, ${this.y}, ${this.z}" 12 | } 13 | 14 | fun toCurrent(dimension: Int, pos: BlockPos): BlockPos { 15 | return if (dimension == WaypointManager.genDimension()) { 16 | pos 17 | } else { 18 | when (dimension) { 19 | -1 -> toOverworld(pos) // Nether to overworld 20 | 0 -> toNether(pos) // Overworld to nether 21 | else -> pos // End or custom dimension by server 22 | } 23 | } 24 | } 25 | 26 | fun bothConverted(dimension: Int, pos: BlockPos): String { 27 | return when (dimension) { 28 | -1 -> "${toOverworld(pos).asString()} (${pos.asString()})" 29 | 0 -> "${pos.asString()} (${toNether(pos).asString()})" 30 | else -> pos.asString() 31 | } 32 | } 33 | 34 | private fun toNether(pos: BlockPos): BlockPos { 35 | return BlockPos(pos.x / 8, pos.y, pos.z / 8) 36 | } 37 | 38 | private fun toOverworld(pos: BlockPos): BlockPos { 39 | return BlockPos(pos.x * 8, pos.y, pos.z * 8) 40 | } 41 | } -------------------------------------------------------------------------------- /src/main/java/com/lambda/mixin/world/MixinBlockLiquid.java: -------------------------------------------------------------------------------- 1 | package com.lambda.mixin.world; 2 | 3 | import com.lambda.client.module.modules.movement.Velocity; 4 | import com.lambda.client.module.modules.player.BlockInteraction; 5 | import net.minecraft.block.BlockLiquid; 6 | import net.minecraft.block.state.IBlockState; 7 | import net.minecraft.entity.Entity; 8 | import net.minecraft.util.math.BlockPos; 9 | import net.minecraft.util.math.Vec3d; 10 | import net.minecraft.world.World; 11 | import org.spongepowered.asm.mixin.Mixin; 12 | import org.spongepowered.asm.mixin.injection.At; 13 | import org.spongepowered.asm.mixin.injection.Inject; 14 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 15 | 16 | @Mixin(BlockLiquid.class) 17 | public class MixinBlockLiquid { 18 | @Inject(method = "modifyAcceleration", at = @At("HEAD"), cancellable = true) 19 | public void modifyAcceleration(World worldIn, BlockPos pos, Entity entityIn, Vec3d motion, CallbackInfoReturnable cir) { 20 | if (Velocity.getCancelLiquidVelocity()) { 21 | cir.setReturnValue(motion); 22 | } 23 | } 24 | 25 | @Inject(method = "canCollideCheck", at = @At("HEAD"), cancellable = true) 26 | public void canCollideCheck(IBlockState blockState, boolean hitIfLiquid, CallbackInfoReturnable cir) { 27 | if (BlockInteraction.isLiquidInteractEnabled()) { 28 | cir.setReturnValue(true); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/command/execute/ExecuteEvent.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.command.execute 2 | 3 | import com.lambda.client.command.AbstractCommandManager 4 | import com.lambda.client.command.args.AbstractArg 5 | import com.lambda.client.command.args.ArgIdentifier 6 | import com.lambda.client.command.args.GreedyStringArg 7 | 8 | /** 9 | * Default implementation of [IExecuteEvent] 10 | */ 11 | open class ExecuteEvent( 12 | override val commandManager: AbstractCommandManager<*>, 13 | override val args: Array 14 | ) : IExecuteEvent { 15 | 16 | /** 17 | * Mapping [ArgIdentifier] to their converted arguments 18 | */ 19 | private val mappedArgs = HashMap, Any>() 20 | 21 | override suspend fun mapArgs(argTree: List>) { 22 | for ((index, arg) in argTree.withIndex()) { 23 | if (arg is GreedyStringArg) { 24 | arg.convertToType(args.slice(index until args.size).joinToString(" "))?.let { 25 | mappedArgs[arg.identifier] = it 26 | } 27 | break 28 | } else { 29 | arg.convertToType(args.getOrNull(index))?.let { 30 | mappedArgs[arg.identifier] = it 31 | } 32 | } 33 | } 34 | } 35 | 36 | @Suppress("UNCHECKED_CAST") 37 | override val ArgIdentifier.value: T 38 | get() = mappedArgs[this] as T 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/event/listener/AbstractListener.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.event.listener 2 | 3 | import com.lambda.client.commons.interfaces.Nameable 4 | import java.lang.ref.WeakReference 5 | import java.util.concurrent.atomic.AtomicInteger 6 | import kotlin.reflect.KProperty 7 | 8 | abstract class AbstractListener(owner: Any) : IListener { 9 | final override val id: Int = listenerId.getAndIncrement() 10 | final override val owner: Any? by WeakReference(owner) 11 | final override val ownerName: String = if (owner is Nameable) owner.name else owner.javaClass.simpleName 12 | 13 | operator fun WeakReference.getValue(thisRef: Any?, property: KProperty<*>) = get() 14 | 15 | override fun compareTo(other: IListener<*, *>): Int { 16 | val result = priority.compareTo(other.priority) 17 | return if (result != 0) result 18 | else id.compareTo(other.id) // :monkey: code for getting around TreeSet duplicated check 19 | } 20 | 21 | override fun equals(other: Any?): Boolean { 22 | return this === other 23 | || (other is IListener<*, *> 24 | && other.eventClass == this.eventClass 25 | && other.id == this.id) 26 | } 27 | 28 | override fun hashCode(): Int { 29 | return 31 * eventClass.hashCode() + id.hashCode() 30 | } 31 | 32 | companion object { 33 | private val listenerId = AtomicInteger(Int.MIN_VALUE) 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/lambda/client/module/modules/misc/BeaconSelector.kt: -------------------------------------------------------------------------------- 1 | package com.lambda.client.module.modules.misc 2 | 3 | import com.lambda.client.event.events.PacketEvent 4 | import com.lambda.client.module.Category 5 | import com.lambda.client.module.Module 6 | import com.lambda.client.util.threads.safeListener 7 | import io.netty.buffer.Unpooled 8 | import net.minecraft.network.PacketBuffer 9 | import net.minecraft.network.play.client.CPacketCustomPayload 10 | 11 | object BeaconSelector : Module( 12 | name = "BeaconSelector", 13 | description = "Choose any of the 5 beacon effects regardless of beacon base height", 14 | category = Category.MISC 15 | ) { 16 | private var doCancelPacket = true 17 | var effect = -1 18 | 19 | init { 20 | safeListener { 21 | if (it.packet !is CPacketCustomPayload || !doCancelPacket || it.packet.channelName != "MC|Beacon") return@safeListener 22 | doCancelPacket = false 23 | it.packet.bufferData.readInt() // primary 24 | val secondary = it.packet.bufferData.readInt() // secondary 25 | it.cancel() 26 | PacketBuffer(Unpooled.buffer()).apply { 27 | writeInt(effect) 28 | writeInt(secondary) 29 | }.also { buffer -> 30 | connection.sendPacket(CPacketCustomPayload("MC|Beacon", buffer)) 31 | } 32 | doCancelPacket = true 33 | } 34 | } 35 | } --------------------------------------------------------------------------------