diff --git a/README.md b/README.md index 7c7d993be..622186b6d 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Customize your experience, and improve your efficiency! Find our plugins [here](https://github.com/lambda-plugins).

- lambda-3.2.jar + lambda-3.2.1.jar

## Installation diff --git a/gradle.properties b/gradle.properties index 4380dbae4..099a235fe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.caching=true org.gradle.parallel=true modGroup=com.lambda -modVersion=3.2 +modVersion=3.2.1 minecraftVersion=1.12.2 forgeVersion=14.23.5.2860 diff --git a/src/main/java/com/lambda/mixin/entity/MixinEntityLivingBase.java b/src/main/java/com/lambda/mixin/entity/MixinEntityLivingBase.java index 347d3431e..8d5386504 100644 --- a/src/main/java/com/lambda/mixin/entity/MixinEntityLivingBase.java +++ b/src/main/java/com/lambda/mixin/entity/MixinEntityLivingBase.java @@ -1,7 +1,6 @@ package com.lambda.mixin.entity; import com.lambda.client.module.modules.movement.ElytraFlight; -import com.lambda.mixin.accessor.AccessorEntityFireworkRocket; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -9,6 +8,7 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; +import net.minecraftforge.fml.common.ObfuscationReflectionHelper; import org.objectweb.asm.Opcodes; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; @@ -19,10 +19,19 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; +import java.lang.reflect.Field; + @Mixin(EntityLivingBase.class) public abstract class MixinEntityLivingBase extends Entity { @Unique private Vec3d modifiedVec = null; + // This is a bit silly and bad for performance but fixes compatibility with old mixin versions like the one used by impact + @Unique + private static final Field boostedEntity; + + static { + boostedEntity = ObfuscationReflectionHelper.findField(EntityFireworkRocket.class, "field_191513_e"); + } public MixinEntityLivingBase(World worldIn) { super(worldIn); @@ -117,8 +126,12 @@ private boolean shouldWork() { private boolean shouldModify() { return shouldWork() && world.loadedEntityList.stream().anyMatch(entity -> { if (entity instanceof EntityFireworkRocket) { - EntityLivingBase boosted = ((AccessorEntityFireworkRocket) entity).getBoostedEntity(); - return boosted != null && boosted.equals(this); + try { + EntityLivingBase boosted = (EntityLivingBase) boostedEntity.get(entity); + return boosted != null && boosted.equals(this); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); // This should absolutely never happen + } } return false; } diff --git a/src/main/kotlin/com/lambda/client/LambdaMod.kt b/src/main/kotlin/com/lambda/client/LambdaMod.kt index 781b0c981..5a3271f4d 100644 --- a/src/main/kotlin/com/lambda/client/LambdaMod.kt +++ b/src/main/kotlin/com/lambda/client/LambdaMod.kt @@ -29,7 +29,7 @@ class LambdaMod { const val ID = "lambda" const val DIRECTORY = "lambda" - const val VERSION = "3.2" + const val VERSION = "3.2.1" const val APP_ID = 835368493150502923 // DiscordIPC const val DEPENDENCIES = "required-after:forge@[14.23.5.2860,);" diff --git a/src/main/kotlin/com/lambda/client/gui/hudgui/elements/client/Username.kt b/src/main/kotlin/com/lambda/client/gui/hudgui/elements/client/Username.kt index 99f5b044f..bcee2ec82 100644 --- a/src/main/kotlin/com/lambda/client/gui/hudgui/elements/client/Username.kt +++ b/src/main/kotlin/com/lambda/client/gui/hudgui/elements/client/Username.kt @@ -13,9 +13,9 @@ internal object Username : LabelHud( private val suffix = setting("Suffix", "") override fun SafeClientEvent.updateText() { - displayText.add(prefix.value, primaryColor) + if (prefix.value != "") displayText.add(prefix.value, primaryColor) displayText.add(mc.session.username, secondaryColor) - displayText.add(suffix.value, primaryColor) + if (suffix.value != "") displayText.add(suffix.value, primaryColor) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/com/lambda/client/gui/hudgui/elements/player/InventoryViewer.kt b/src/main/kotlin/com/lambda/client/gui/hudgui/elements/player/InventoryViewer.kt index 98a204626..cc35214c2 100644 --- a/src/main/kotlin/com/lambda/client/gui/hudgui/elements/player/InventoryViewer.kt +++ b/src/main/kotlin/com/lambda/client/gui/hudgui/elements/player/InventoryViewer.kt @@ -1,7 +1,10 @@ package com.lambda.client.gui.hudgui.elements.player import com.lambda.client.event.SafeClientEvent +import com.lambda.client.event.events.ConnectionEvent +import com.lambda.client.event.events.PacketEvent import com.lambda.client.gui.hudgui.HudElement +import com.lambda.client.mixin.extension.windowID import com.lambda.client.module.modules.client.ClickGUI import com.lambda.client.module.modules.client.GuiColors import com.lambda.client.util.graphics.GlStateUtils @@ -10,6 +13,7 @@ import com.lambda.client.util.graphics.VertexHelper import com.lambda.client.util.items.storageSlots import com.lambda.client.util.math.Vec2d import com.lambda.client.util.threads.runSafe +import com.lambda.client.util.threads.safeListener import net.minecraft.client.gui.inventory.GuiContainer import net.minecraft.client.renderer.GlStateManager import net.minecraft.client.renderer.Tessellator @@ -18,7 +22,10 @@ import net.minecraft.init.Blocks import net.minecraft.inventory.ContainerChest import net.minecraft.inventory.InventoryBasic import net.minecraft.item.ItemStack +import net.minecraft.network.play.client.CPacketCloseWindow +import net.minecraft.network.play.server.SPacketOpenWindow import net.minecraft.util.ResourceLocation +import net.minecraft.util.text.TextComponentTranslation import org.lwjgl.opengl.GL11.* internal object InventoryViewer : HudElement( @@ -39,6 +46,8 @@ internal object InventoryViewer : HudElement( override val hudWidth: Float = 162.0f override val hudHeight: Float = 54.0f + private var openedEnderChest: Int = -1 + override fun renderHud(vertexHelper: VertexHelper) { super.renderHud(vertexHelper) runSafe { @@ -93,14 +102,40 @@ internal object InventoryViewer : HudElement( } + init { + safeListener { + openedEnderChest = -1 + } + + safeListener { + if (it.packet !is SPacketOpenWindow) return@safeListener + if (it.packet.guiId != "minecraft:container") return@safeListener + val title = it.packet.windowTitle + if (title !is TextComponentTranslation) return@safeListener + if (title.key != "container.enderchest") return@safeListener + + openedEnderChest = it.packet.windowId + } + + safeListener { + if (it.packet !is CPacketCloseWindow) return@safeListener + if (it.packet.windowID != openedEnderChest) return@safeListener + + checkEnderChest() + openedEnderChest = -1 + } + } + private fun checkEnderChest() { - if (mc.currentScreen is GuiContainer) { - val container = (mc.currentScreen as GuiContainer).inventorySlots - if (container is ContainerChest && container.lowerChestInventory is InventoryBasic) { - val inv = (container.lowerChestInventory as InventoryBasic) - if (inv.name.equals("Ender Chest", true)) { - for (i in 0..26) enderChestContents[i] = container.inventory[i] - } + val guiScreen = mc.currentScreen + + if (guiScreen !is GuiContainer) return + + val container = guiScreen.inventorySlots + + if (container is ContainerChest && container.lowerChestInventory is InventoryBasic) { + if (container.windowId == openedEnderChest) { + for (i in 0..26) enderChestContents[i] = container.inventory[i] } } } diff --git a/src/main/kotlin/com/lambda/client/gui/hudgui/elements/world/EntityList.kt b/src/main/kotlin/com/lambda/client/gui/hudgui/elements/world/EntityList.kt index ecba09000..9e5a19fd9 100644 --- a/src/main/kotlin/com/lambda/client/gui/hudgui/elements/world/EntityList.kt +++ b/src/main/kotlin/com/lambda/client/gui/hudgui/elements/world/EntityList.kt @@ -14,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer import net.minecraft.entity.projectile.EntityEgg import net.minecraft.entity.projectile.EntitySnowball import net.minecraft.entity.projectile.EntityWitherSkull +import net.minecraft.tileentity.TileEntityLockable import java.util.* internal object EntityList : LabelHud( @@ -26,10 +27,15 @@ internal object EntityList : LabelHud( private val passive by setting("Passive Mobs", true) private val neutral by setting("Neutral Mobs", true) private val hostile by setting("Hostile Mobs", true) + private val tileEntities by setting("Tile Entities", true) + private val onlyContainer by setting("Only Containers", true, { tileEntities }) private val maxEntries by setting("Max Entries", 8, 4..32, 1) private val range by setting("Range", 64, 16..256, 16, fineStep = 1) - private val cacheMap by AsyncCachedValue(50L) { + private var remainingEntriesEntity = 0 + private var remainingEntriesTileEntity = 0 + + private val entityCacheMap by AsyncCachedValue(50L) { val map = TreeMap() runSafe { @@ -54,18 +60,46 @@ internal object EntityList : LabelHud( } } - remainingEntries = map.size - maxEntries + remainingEntriesEntity = map.size - maxEntries + map.entries.take(maxEntries) + } + + private val tileEntityCacheMap by AsyncCachedValue(50L) { + val map = TreeMap() + + runSafe { + if (tileEntities) world.loadedTileEntityList.filter { + if (onlyContainer) it is TileEntityLockable else true + }.mapNotNull { + map[it.blockType.localizedName] = map.getOrDefault(it.blockType.localizedName, 0) + 1 + } + } + + remainingEntriesTileEntity = map.size - maxEntries map.entries.take(maxEntries) } - private var remainingEntries = 0 override fun SafeClientEvent.updateText() { - for ((name, count) in cacheMap) { - displayText.add(name, primaryColor) - displayText.addLine("x$count", secondaryColor) + if (entityCacheMap.isNotEmpty()) { + if (tileEntities) displayText.addLine("Entities", secondaryColor) + for ((name, count) in entityCacheMap) { + displayText.add(name, primaryColor) + displayText.addLine("x$count", secondaryColor) + } + if (remainingEntriesEntity > 0) { + displayText.addLine("...and $remainingEntriesEntity more") + } } - if (remainingEntries > 0) { - displayText.addLine("...and $remainingEntries more") + + if (tileEntityCacheMap.isNotEmpty()) { + displayText.addLine("TileEntities", secondaryColor) + for ((name, count) in tileEntityCacheMap) { + displayText.add(name, primaryColor) + displayText.addLine("x$count", secondaryColor) + } + if (remainingEntriesTileEntity > 0) { + displayText.addLine("...and $remainingEntriesTileEntity more") + } } } diff --git a/src/main/kotlin/com/lambda/client/module/modules/combat/AntiFriendHit.kt b/src/main/kotlin/com/lambda/client/module/modules/combat/AntiFriendHit.kt index 59c1aef5b..4b6844fe7 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/combat/AntiFriendHit.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/combat/AntiFriendHit.kt @@ -10,7 +10,7 @@ import net.minecraft.network.play.client.CPacketUseEntity object AntiFriendHit : Module( name = "AntiFriendHit", - description = "Don't hit your friends", + description = "Prevents hitting friends", category = Category.COMBAT ) { init { @@ -22,4 +22,4 @@ object AntiFriendHit : Module( } } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/com/lambda/client/module/modules/misc/AntiAFK.kt b/src/main/kotlin/com/lambda/client/module/modules/misc/AntiAFK.kt index 904666272..911127dfb 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/misc/AntiAFK.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/misc/AntiAFK.kt @@ -28,7 +28,7 @@ import kotlin.random.Random */ object AntiAFK : Module( name = "AntiAFK", - description = "Prevents being kicked for AFK", + description = "Prevents being kicked while AFK", category = Category.MISC ) { private val delay by setting("Action Delay", 50, 5..100, 5, unit = " ticks") @@ -40,7 +40,7 @@ object AntiAFK : Module( private val turn = setting("Turn", true) private val walk = setting("Walk", true) private val radius by setting("Radius", 64, 8..128, 8, fineStep = 1) - private val inputTimeout by setting("Idle Timeout", 0, 0..15, 1, description = "Starts AntiAFK after being idle for longer than specific minutes, 0 to disable", unit = "m") + private val inputTimeout by setting("Idle Timeout", 0, 0..15, 1, description = "Starts AntiAFK after being idle longer than the selected time in minutes, 0 to disable", unit = "m") private val allowBreak by setting("Allow Breaking Blocks", false, { walk.value }) private var startPos: BlockPos? = null diff --git a/src/main/kotlin/com/lambda/client/module/modules/misc/AntiDisconnect.kt b/src/main/kotlin/com/lambda/client/module/modules/misc/AntiDisconnect.kt index a3eafca14..4c3950b46 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/misc/AntiDisconnect.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/misc/AntiDisconnect.kt @@ -5,8 +5,8 @@ import com.lambda.client.module.Module object AntiDisconnect : Module( name = "AntiDisconnect", - description = "Are you sure you want to disconnect?", + description = "Prevents you from accidently disconnecting", category = Category.MISC ) { val presses by setting("Button Presses", 3, 1..20, 1) -} \ No newline at end of file +} diff --git a/src/main/kotlin/com/lambda/client/module/modules/misc/MapDownloader.kt b/src/main/kotlin/com/lambda/client/module/modules/misc/MapDownloader.kt index 8657e8ae3..55b82cb74 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/misc/MapDownloader.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/misc/MapDownloader.kt @@ -30,7 +30,7 @@ import javax.imageio.ImageIO internal object MapDownloader : Module( name = "MapDownloader", category = Category.MISC, - description = "Downloads maps in item frames in your render distance to file." + description = "Downloads maps in item frames within your render distance to file" ) { private val scale by setting("Scale", 1, 1..20, 1, description = "Higher scale results in higher storage use!") diff --git a/src/main/kotlin/com/lambda/client/module/modules/misc/MidClickFriends.kt b/src/main/kotlin/com/lambda/client/module/modules/misc/MidClickFriends.kt index 9a8aa3dcb..5947a3e7e 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/misc/MidClickFriends.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/misc/MidClickFriends.kt @@ -15,7 +15,7 @@ import org.lwjgl.input.Mouse object MidClickFriends : Module( name = "MidClickFriends", - description = "Logs when a player leaves the game", + description = "Adds a player as a friend upon middle clicking on their hitbox", category = Category.MISC, showOnArray = false ) { @@ -49,4 +49,4 @@ object MidClickFriends : Module( else MessageSendHelper.sendChatMessage("Failed to find UUID of $name") } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/com/lambda/client/module/modules/misc/MountBypass.kt b/src/main/kotlin/com/lambda/client/module/modules/misc/MountBypass.kt index 878ae49e3..48417e92e 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/misc/MountBypass.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/misc/MountBypass.kt @@ -9,7 +9,7 @@ import net.minecraft.network.play.client.CPacketUseEntity object MountBypass : Module( name = "MountBypass", - description = "Might allow you to mount chested animals on servers that block it", + description = "Attempts to allow you to mount chested animals on servers that block it", category = Category.MISC ) { init { @@ -18,4 +18,4 @@ object MountBypass : Module( if (it.packet.getEntityFromWorld(world) is AbstractChestHorse) it.cancel() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/com/lambda/client/module/modules/misc/PingSpoof.kt b/src/main/kotlin/com/lambda/client/module/modules/misc/PingSpoof.kt index ba8cfb20d..260e6d877 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/misc/PingSpoof.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/misc/PingSpoof.kt @@ -13,7 +13,7 @@ import net.minecraft.network.play.server.SPacketKeepAlive object PingSpoof : Module( name = "PingSpoof", - description = "Cancels or adds delay to your ping packets", + description = "Adds delay to your packets", category = Category.MISC ) { private val delay by setting("Delay", 100, 0..2000, 25, unit = "ms") diff --git a/src/main/kotlin/com/lambda/client/module/modules/misc/SkinFlicker.kt b/src/main/kotlin/com/lambda/client/module/modules/misc/SkinFlicker.kt index 55290a7f0..abc83f1c7 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/misc/SkinFlicker.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/misc/SkinFlicker.kt @@ -9,7 +9,7 @@ import net.minecraft.entity.player.EnumPlayerModelParts object SkinFlicker : Module( name = "SkinFlicker", - description = "Toggle your skin layers rapidly for a cool skin effect", + description = "Toggles your skin layers rapidly", category = Category.MISC ) { private val mode by setting("Mode", FlickerMode.HORIZONTAL) @@ -61,4 +61,4 @@ object SkinFlicker : Module( EnumPlayerModelParts.LEFT_PANTS_LEG, EnumPlayerModelParts.RIGHT_PANTS_LEG ) -} \ No newline at end of file +} diff --git a/src/main/kotlin/com/lambda/client/module/modules/movement/EntitySpeed.kt b/src/main/kotlin/com/lambda/client/module/modules/movement/EntitySpeed.kt index 449814a69..cfeea6baa 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/movement/EntitySpeed.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/movement/EntitySpeed.kt @@ -11,7 +11,7 @@ import net.minecraft.entity.passive.EntityPig object EntitySpeed : Module( name = "EntitySpeed", - description = "Abuse client-sided movement to shape sound barrier breaking rideables", + description = "Abuses client-sided movement to change the speed of rideable entities", category = Category.MOVEMENT ) { private val boatSpeed by setting("Boat Speed", 1.4f, 0.1f..10.0f, 0.05f) diff --git a/src/main/kotlin/com/lambda/client/module/modules/render/Breadcrumbs.kt b/src/main/kotlin/com/lambda/client/module/modules/render/Breadcrumbs.kt index 98b34df1c..68985c59e 100644 --- a/src/main/kotlin/com/lambda/client/module/modules/render/Breadcrumbs.kt +++ b/src/main/kotlin/com/lambda/client/module/modules/render/Breadcrumbs.kt @@ -26,7 +26,7 @@ import kotlin.math.sin object Breadcrumbs : Module( name = "Breadcrumbs", - description = "Draws a tail behind as you move", + description = "Draws a trail behind as you move", category = Category.RENDER, alwaysListening = true ) { @@ -69,7 +69,7 @@ object Breadcrumbs : Module( } if (!shouldRecord(true)) return@safeListener - /* Adding server and dimension to the map if they are not exist */ + /* Adding server and dimension to the map if they don't exist */ val serverIP = getServerIP() val dimension = player.dimension @@ -162,4 +162,4 @@ object Breadcrumbs : Module( } } } -} \ No newline at end of file +}