diff --git a/src/minecraft/kevin/command/commands/SayCommand.kt b/src/minecraft/kevin/command/commands/SayCommand.kt index 50b9dc3b..19c12d0e 100644 --- a/src/minecraft/kevin/command/commands/SayCommand.kt +++ b/src/minecraft/kevin/command/commands/SayCommand.kt @@ -11,6 +11,11 @@ class SayCommand : ICommand { ChatUtils.messageWithStart("§cUsage: .say ") return } - Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(C01PacketChatMessage(args[0])) + var tmp = "" + for (t in args) { + tmp += " $t" + } + tmp = tmp.removePrefix(" ") + Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(C01PacketChatMessage(tmp)) } } \ No newline at end of file diff --git a/src/minecraft/kevin/file/ConfigManager.kt b/src/minecraft/kevin/file/ConfigManager.kt index d5cc7a60..fe882c49 100644 --- a/src/minecraft/kevin/file/ConfigManager.kt +++ b/src/minecraft/kevin/file/ConfigManager.kt @@ -5,7 +5,9 @@ import com.google.gson.JsonNull import com.google.gson.JsonObject import com.google.gson.JsonParser import kevin.main.KevinClient +import kevin.module.Module import kevin.module.Value +import kevin.utils.ChatUtils import org.apache.commons.io.FileUtils import java.io.* import java.util.function.Consumer @@ -33,6 +35,8 @@ object ConfigManager { val jsonMod = JsonObject() jsonMod.addProperty("State", it.state) jsonMod.addProperty("KeyBind", it.keyBind) + jsonMod.addProperty("Hide", !it.array) + jsonMod.addProperty("AutoDisable", if (it.autoDisable.first) it.autoDisable.second else "Disable") it.values.forEach(Consumer { value: Value<*> -> jsonMod.add(value.name, value.toJson())}) modulesConfig.add(it.name, jsonMod) } @@ -52,6 +56,8 @@ object ConfigManager { val modulesConfig = config[0] val hudConfig = File(configDir,"$name-HUD.json") var returnValue = 0 + val warns = mutableMapOf() + val setModules = arrayListOf() //LoadModules if (modulesConfig.exists()&&modulesConfig.isFile){ val jsonElement = JsonParser().parse(BufferedReader(FileReader(modulesConfig))) @@ -62,17 +68,40 @@ object ConfigManager { val (key, value) = entryIterator.next() val module = KevinClient.moduleManager.getModule(key) if (module != null) { + setModules.add(module) val jsonModule = value as JsonObject module.state = jsonModule["State"].asBoolean module.keyBind = jsonModule["KeyBind"].asInt + if (jsonModule["Hide"] != null) + module.array = !jsonModule["Hide"].asBoolean + else + warns["$key-HideValue"] = "The hide attribute of the module is not saved in the config file(OldConfig?)." + if (jsonModule["AutoDisable"] != null) + module.autoDisable = Pair( + jsonModule["AutoDisable"].asString != "Disable", + if (jsonModule["AutoDisable"].asString == "Disable") "" else jsonModule["AutoDisable"].asString + ) + else + warns["$key-AutoDisableValue"] = "The AutoDisable attribute of the module is not saved in the config file(OldConfig?)." for (moduleValue in module.values) { val element = jsonModule[moduleValue.name] - if (element != null) moduleValue.fromJson(element) + if (element != null) moduleValue.fromJson(element) else warns["$key-$moduleValue"] = "The config file does not have a value for this option." } - } + } else warns[key] = "Module does not exist." } } } else returnValue = 1 + KevinClient.moduleManager.getModules().forEach { + if (it !in setModules) { + warns[it.name] = "The parameters for this module are not saved in the config file(OldConfig?)." + } + } + if (warns.isNotEmpty()) { + ChatUtils.messageWithStart("There were some warnings when loading the configuration:") + warns.forEach { (t, u) -> + ChatUtils.message("§7[§9$t§7]: §e$u") + } + } //LoadHUD if (hudConfig.exists()&&modulesConfig.isFile){ KevinClient.hud.clearElements() diff --git a/src/minecraft/kevin/hud/HUD.kt b/src/minecraft/kevin/hud/HUD.kt index 3a5026dd..b5807480 100644 --- a/src/minecraft/kevin/hud/HUD.kt +++ b/src/minecraft/kevin/hud/HUD.kt @@ -3,6 +3,8 @@ package kevin.hud import kevin.hud.designer.GuiHudDesigner import kevin.hud.element.Element import kevin.hud.element.elements.* +import kevin.main.KevinClient +import kevin.module.modules.misc.NoScoreboard import kevin.utils.* import net.minecraft.client.gui.ScaledResolution import org.lwjgl.opengl.GL11 @@ -25,7 +27,7 @@ open class HUD : MinecraftInstance() { Information::class.java, //TabGUI::class.java, Text::class.java, - //ScoreboardElement::class.java, + ScoreboardElement::class.java, TargetHUD::class.java, Radar::class.java, InvItem::class.java @@ -38,8 +40,8 @@ open class HUD : MinecraftInstance() { fun createDefault() = HUD() .addElement(Text.defaultClient()) .addElement(Text.defaultClientVersion()) - /**.addElement(TabGUI()) - .addElement(ScoreboardElement())**/ + /**.addElement(TabGUI())**/ + .addElement(ScoreboardElement()) .addElement(Notifications()) .addElement(Armor()) .addElement(Arraylist()) @@ -48,6 +50,37 @@ open class HUD : MinecraftInstance() { } + fun disableMinecraftScoreboard() = + (elements.filterIsInstance().isNotEmpty() && (KevinClient.moduleManager.getModule("HUD")!!.state || (KevinClient.moduleManager.getModule("HUD")!! as kevin.module.modules.render.HUD).keepScoreboard.get())) || NoScoreboard.state + + fun renderScoreboardOnly() { + elements.filterIsInstance() + .forEach { + GL11.glPushMatrix() + + if (!it.info.disableScale) + GL11.glScalef(it.scale, it.scale, it.scale) + + GL11.glTranslated(it.renderX, it.renderY, 0.0) + + try { + it.border = it.drawElement() + } catch (ex: Exception) { + println("Something went wrong while drawing ${it.name} element in HUD. $ex") + } + + GL11.glEnable(GL11.GL_BLEND) + GL11.glColor4f(1F,1F,1F,1F) + GL11.glPopMatrix() + } + } + + fun updateScoreboardOnly() { + elements.filterIsInstance() + .forEach { + it.updateElement() + } + } /** * Render all elements */ diff --git a/src/minecraft/kevin/hud/element/elements/ScoreboardElement.kt b/src/minecraft/kevin/hud/element/elements/ScoreboardElement.kt new file mode 100644 index 00000000..81120819 --- /dev/null +++ b/src/minecraft/kevin/hud/element/elements/ScoreboardElement.kt @@ -0,0 +1,176 @@ +package kevin.hud.element.elements + +import com.google.common.collect.Iterables +import com.google.common.collect.Lists +import kevin.hud.element.Border +import kevin.hud.element.Element +import kevin.hud.element.ElementInfo +import kevin.hud.element.Side +import kevin.main.KevinClient +import kevin.module.BooleanValue +import kevin.module.IntegerValue +import kevin.module.ListValue +import kevin.module.modules.misc.NoScoreboard +import kevin.utils.ColorUtils +import kevin.utils.FontManager +import kevin.utils.RenderUtils +import net.minecraft.scoreboard.* +import net.minecraft.util.EnumChatFormatting +import org.lwjgl.opengl.GL11 +import java.awt.Color + +/** + * CustomHUD scoreboard + * + * Allows to move and customize minecraft scoreboard + */ +@ElementInfo(name = "Scoreboard") +class ScoreboardElement(x: Double = 5.0, y: Double = 0.0, scale: Float = 1F, + side: Side = Side(Side.Horizontal.RIGHT, Side.Vertical.MIDDLE)) : Element(x, y, scale, side) { + + private val textRedValue = IntegerValue("Text-R", 255, 0, 255) + private val textGreenValue = IntegerValue("Text-G", 255, 0, 255) + private val textBlueValue = IntegerValue("Text-B", 255, 0, 255) + + private val backgroundColorRedValue = IntegerValue("Background-R", 0, 0, 255) + private val backgroundColorGreenValue = IntegerValue("Background-G", 0, 0, 255) + private val backgroundColorBlueValue = IntegerValue("Background-B", 0, 0, 255) + private val backgroundColorAlphaValue = IntegerValue("Background-Alpha", 95, 0, 255) + + private val rectValue = BooleanValue("Rect", false) + private val rectColorModeValue = ListValue("Rect-Color", arrayOf("Custom", "Rainbow"), "Custom") + private val rectColorRedValue = IntegerValue("Rect-R", 0, 0, 255) + private val rectColorGreenValue = IntegerValue("Rect-G", 111, 0, 255) + private val rectColorBlueValue = IntegerValue("Rect-B", 255, 0, 255) + private val rectColorBlueAlpha = IntegerValue("Rect-Alpha", 255, 0, 255) + + private val clientFont = BooleanValue("ClientFont", false) + + private val shadowValue = BooleanValue("Shadow", false) + + private val clientName = BooleanValue("ClientName", false) + + /** + * Draw element + */ + override fun drawElement(): Border? { + if (NoScoreboard.state) + return null + + val textColor = textColor().rgb + val backColor = backgroundColor().rgb + + val rectColorMode = rectColorModeValue.get() + val rectCustomColor = Color(rectColorRedValue.get(), rectColorGreenValue.get(), rectColorBlueValue.get(), + rectColorBlueAlpha.get()).rgb + + val worldScoreboard = mc.theWorld!!.scoreboard + var currObjective: ScoreObjective? = null + val playerTeam = worldScoreboard.getPlayersTeam(mc.thePlayer!!.name) + + if (playerTeam != null) { + val colorIndex = playerTeam.chatFormat.colorIndex + + if (colorIndex >= 0) + currObjective = worldScoreboard.getObjectiveInDisplaySlot(3 + colorIndex) + } + + val objective = currObjective ?: worldScoreboard.getObjectiveInDisplaySlot(1) ?: return null + + val scoreboard = objective.scoreboard + var scoreCollection = scoreboard.getSortedScores(objective) + val scores = Lists.newArrayList(Iterables.filter(scoreCollection) { input -> + input?.playerName != null && !input.playerName.startsWith("#") + }) + + fun clientname(): Score { + val s = Score(Scoreboard(), ScoreObjective(Scoreboard(),"", IScoreObjectiveCriteria.health),"§3§l§nKevin§6§l§nClient") + s.scorePoints = -114514 + return s + } + + if(clientName.get()) scores.add(0,clientname()) + + scoreCollection = if (scores.size > 15) + Lists.newArrayList(Iterables.skip(scores, scoreCollection.size - 15)) + else + scores + + var maxWidth = getStringWidth(objective.displayName) + + for (score in scoreCollection) { + val scorePlayerTeam = scoreboard.getPlayersTeam(score.playerName) + val width = "${scoreboardFormatPlayerName(scorePlayerTeam, score.playerName)}: ${EnumChatFormatting.RED}${score.scorePoints}" + maxWidth = maxWidth.coerceAtLeast(getStringWidth(width)) + } + + val maxHeight = scoreCollection.size * FONT_HEIGHT + val l1 = -maxWidth - 3 - if (rectValue.get()) 3 else 0 + + + + RenderUtils.drawRect(l1 - 2, -2, 5, (maxHeight + FONT_HEIGHT), backColor) + + scoreCollection.forEachIndexed { index, score -> + val team = scoreboard.getPlayersTeam(score.playerName) + + val name = scoreboardFormatPlayerName(team, score.playerName) + val scorePoints = "${EnumChatFormatting.RED}${score.scorePoints}" + + val width = 5 - if (rectValue.get()) 4 else 0 + val height = maxHeight - index * FONT_HEIGHT.toFloat() + + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f) + + //if(clientName.get()&&name.toLowerCase().contains(".net")) name = name + " §3§l§nKevin§6§l§nClient" + + if(name != "§3§l§nKevin§6§l§nClient"){ + drawString(name, l1.toFloat(), height, textColor, shadowValue.get()) + }else{ + FontManager.RainbowFontShader.begin(true,1.0F / 1000,1.0F / 1000,System.currentTimeMillis() % 10000 / 10000F).use { + drawString("§lKevin§lClient", l1.toFloat(), height, 0, shadowValue.get()) + } + } + + drawString(scorePoints, (width - getStringWidth(scorePoints)).toFloat(), height, textColor, shadowValue.get()) + + if (index == scoreCollection.size - 1) { + val displayName = objective.displayName + + GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f) + + drawString(displayName, (l1 + maxWidth / 2 - getStringWidth(displayName) / 2).toFloat(), (height - + FONT_HEIGHT), textColor, shadowValue.get()) + } + + if (rectValue.get()) { + val rectColor = when { + rectColorMode.equals("Rainbow", ignoreCase = true) -> ColorUtils.rainbow(400000000L * index).rgb + else -> rectCustomColor + } + + RenderUtils.drawRect(2F, if (index == scoreCollection.size - 1) -2F else height, 5F, if (index == 0) FONT_HEIGHT.toFloat() else height + FONT_HEIGHT * 2F, rectColor) + } + } + + return Border(-maxWidth.toFloat() - 5 - if (rectValue.get()) 3 else 0, -2F, 5F, maxHeight + FONT_HEIGHT.toFloat()) + } + + private fun backgroundColor() = Color(backgroundColorRedValue.get(), backgroundColorGreenValue.get(), + backgroundColorBlueValue.get(), backgroundColorAlphaValue.get()) + + private fun textColor() = Color(textRedValue.get(), textGreenValue.get(), + textBlueValue.get()) + + private fun scoreboardFormatPlayerName(scorePlayerTeam: Team?, playerName: String) = + ScorePlayerTeam.formatPlayerName(scorePlayerTeam, playerName) + + private fun drawString(string: String?, x: Float, y: Float, color: Int, shadow: Boolean) = + if (clientFont.get()) KevinClient.fontManager.font35!!.drawString(string, x, y, color, shadow) else KevinClient.fontManager.minecraftFont.drawString(string, x, y, color, shadow) + + private val FONT_HEIGHT + get() = if (clientFont.get()) KevinClient.fontManager.font35!!.fontHeight else KevinClient.fontManager.minecraftFont.FONT_HEIGHT + + private fun getStringWidth(string: String) = + if (clientFont.get()) KevinClient.fontManager.font35!!.getStringWidth(string) else KevinClient.fontManager.minecraftFont.getStringWidth(string) +} \ No newline at end of file diff --git a/src/minecraft/kevin/hud/element/elements/TargetHUD.kt b/src/minecraft/kevin/hud/element/elements/TargetHUD.kt index 3a756041..77afd5e5 100644 --- a/src/minecraft/kevin/hud/element/elements/TargetHUD.kt +++ b/src/minecraft/kevin/hud/element/elements/TargetHUD.kt @@ -39,7 +39,6 @@ class TargetHUD : Element() { override fun drawElement(): Border? { val target = (KevinClient.moduleManager.getModule("KillAura") as KillAura).target - if (target !is EntityLivingBase) return null when(mode.get()){ "Liquid" -> { if ((target) is EntityPlayer) { @@ -81,11 +80,11 @@ class TargetHUD : Element() { } "Kevin" -> { if (target!=null){ - val health = String.format("%.2f",target.health).toFloat() - val maxHealth = String.format("%.2f",target.maxHealth).toFloat() + val health = if (target is EntityLivingBase) String.format("%.2f",target.health).toFloat() else 1F + val maxHealth = if (target is EntityLivingBase) String.format("%.2f",target.maxHealth).toFloat() else 1F val healthPercent = (health/maxHealth)*100f - val hurtTime = target.hurtTime + val hurtTime = if (target is EntityLivingBase) target.hurtTime else 0 val ping = if (target is EntityPlayer) target.getPing() else 0 val yaw = String.format("%.2f",target.rotationYaw).toFloat() val pitch = String.format("%.2f",target.rotationPitch).toFloat() @@ -100,18 +99,18 @@ class TargetHUD : Element() { val rotationText = "Yaw: $yaw | Pitch: $pitch" val distanceOnGroundText = "Distance: $distance | OnGround: $onGround" - val itemInHand = target.heldItem - val armor1 = target.getCurrentArmor(0) - val armor2 = target.getCurrentArmor(1) - val armor3 = target.getCurrentArmor(2) - val armor4 = target.getCurrentArmor(3) + val itemInHand = if (target is EntityLivingBase) target.heldItem else null + val armor1 = if (target is EntityLivingBase) target.getCurrentArmor(0) else null + val armor2 = if (target is EntityLivingBase) target.getCurrentArmor(1) else null + val armor3 = if (target is EntityLivingBase) target.getCurrentArmor(2) else null + val armor4 = if (target is EntityLivingBase) target.getCurrentArmor(3) else null val textList = arrayListOf(nameText,healthText,hurtTimeText,pingText,rotationText,distanceOnGroundText) val textListSorted = textList.toMutableList() textListSorted.sortBy{KevinClient.fontManager.font40!!.getStringWidth(it)} val width = KevinClient.fontManager.font35!!.getStringWidth(textListSorted.last()) val x2 = if (0.25F+width/2+3F>18*5)0.25F+width/2+3F else 18*5F - val text = "A:${target.totalArmorValue} ${(target.totalArmorValue/20F)*100}%" + val text = if (target is EntityLivingBase) "A:${target.totalArmorValue} ${(target.totalArmorValue/20F)*100}%" else "A:? ?%" RenderUtils.drawBorderedRect(-8.5F,-12.5F,14.75F+x2,54.5F,1F,Color.white.rgb,Color(0,0,0,150).rgb) drawEntityOnScreen(3.0,20.0,15F,target) @@ -152,7 +151,7 @@ class TargetHUD : Element() { linesEnd() linesStart(5F,Color(0,111,255)) - val arv = (14.0+x2+6.5-(KevinClient.fontManager.font35!!.getStringWidth(text))*0.8)*(target.totalArmorValue/20F) + val arv = if (target is EntityLivingBase) (14.0+x2+6.5-(KevinClient.fontManager.font35!!.getStringWidth(text))*0.8)*(target.totalArmorValue/20F) else .0 GL11.glVertex2d(-7.75,52.5) GL11.glVertex2d(-7.75+arv,52.5) @@ -236,40 +235,40 @@ class TargetHUD : Element() { 64F, 64F) } - private fun drawEntityOnScreen(X: Double, Y: Double, S: Float, entityLivingBase: EntityLivingBase){ + private fun drawEntityOnScreen(X: Double, Y: Double, S: Float, entity: Entity){ GlStateManager.enableColorMaterial() GlStateManager.pushMatrix() GlStateManager.translate(X, Y, 50.0) GlStateManager.scale((-S), S, S) GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F) - val renderYawOffset = entityLivingBase.renderYawOffset - val rotationYaw = entityLivingBase.rotationYaw - val rotationPitch = entityLivingBase.rotationPitch - val prevRotationYawHead = entityLivingBase.prevRotationYawHead - val rotationYawHead = entityLivingBase.rotationYawHead + val renderYawOffset = if (entity is EntityLivingBase) entity.renderYawOffset else 0F + val rotationYaw = entity.rotationYaw + val rotationPitch = entity.rotationPitch + val prevRotationYawHead = if (entity is EntityLivingBase) entity.prevRotationYawHead else 0F + val rotationYawHead = entity.rotationYawHead GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F) RenderHelper.enableStandardItemLighting() GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F) - entityLivingBase.renderYawOffset = atan(entityLivingBase.rotationYaw / 40F) * 20F - entityLivingBase.rotationYaw = atan(entityLivingBase.rotationYaw / 40F) * 40F - entityLivingBase.rotationPitch = -atan((if (entityLivingBase.rotationPitch > 0) -entityLivingBase.rotationPitch else abs(entityLivingBase.rotationPitch)) / 40F) * 20F - entityLivingBase.rotationYawHead = entityLivingBase.rotationYaw - entityLivingBase.prevRotationYawHead = entityLivingBase.rotationYaw + if (entity is EntityLivingBase) entity.renderYawOffset = atan(entity.rotationYaw / 40F) * 20F + entity.rotationYaw = atan(entity.rotationYaw / 40F) * 40F + entity.rotationPitch = -atan((if (entity.rotationPitch > 0) -entity.rotationPitch else abs(entity.rotationPitch)) / 40F) * 20F + entity.rotationYawHead = entity.rotationYaw + if (entity is EntityLivingBase) entity.prevRotationYawHead = entity.rotationYaw GlStateManager.translate(0.0, 0.0, 0.0) val renderManager = mc.renderManager renderManager.playerViewY = 180.0F renderManager.isRenderShadow = false - renderManager.renderEntityWithPosYaw(entityLivingBase, 0.0, 0.0, 0.0, 0.0F, 1.0F) + renderManager.renderEntityWithPosYaw(entity, 0.0, 0.0, 0.0, 0.0F, 1.0F) renderManager.isRenderShadow = true - entityLivingBase.renderYawOffset = renderYawOffset - entityLivingBase.rotationYaw = rotationYaw - entityLivingBase.rotationPitch = rotationPitch - entityLivingBase.prevRotationYawHead = prevRotationYawHead - entityLivingBase.rotationYawHead = rotationYawHead + if (entity is EntityLivingBase) entity.renderYawOffset = renderYawOffset + entity.rotationYaw = rotationYaw + entity.rotationPitch = rotationPitch + if (entity is EntityLivingBase) entity.prevRotationYawHead = prevRotationYawHead + entity.rotationYawHead = rotationYawHead GlStateManager.popMatrix() RenderHelper.disableStandardItemLighting() diff --git a/src/minecraft/kevin/main/KevinClient.kt b/src/minecraft/kevin/main/KevinClient.kt index 97970de0..6de535e7 100644 --- a/src/minecraft/kevin/main/KevinClient.kt +++ b/src/minecraft/kevin/main/KevinClient.kt @@ -22,7 +22,7 @@ import org.lwjgl.opengl.Display object KevinClient { var name = "Kevin" - var version = "b1.8" + var version = "b2.0" var isStarting = true diff --git a/src/minecraft/kevin/module/ModuleManager.kt b/src/minecraft/kevin/module/ModuleManager.kt index b7a41c95..e891efb0 100644 --- a/src/minecraft/kevin/module/ModuleManager.kt +++ b/src/minecraft/kevin/module/ModuleManager.kt @@ -64,15 +64,18 @@ class ModuleManager : Listenable { AdminDetector, AntiBot(), AntiInvalidBlockPlacement(), + AntiShop(), AutoCommand(), AutoDisable, AutoL(), + ChatControl, ComponentOnHover(), Diastimeter(), HideAndSeekHack, KillerDetector(), NameProtect(), NoRotateSet(), + NoScoreboard, ResourcePackSpoof(), SuperSpammer(), Teams(), diff --git a/src/minecraft/kevin/module/modules/combat/KillAura.kt b/src/minecraft/kevin/module/modules/combat/KillAura.kt index a6055a17..b6d14e23 100644 --- a/src/minecraft/kevin/module/modules/combat/KillAura.kt +++ b/src/minecraft/kevin/module/modules/combat/KillAura.kt @@ -4,6 +4,7 @@ import kevin.event.* import kevin.main.KevinClient import kevin.module.* import kevin.module.modules.exploit.TP +import kevin.module.modules.misc.AntiShop import kevin.module.modules.misc.HideAndSeekHack import kevin.module.modules.misc.Teams import kevin.utils.* @@ -505,8 +506,11 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", if (player.isClientFriend() && !LiquidBounce.moduleManager[NoFriends::class.java].state) return false **/ - val teams = KevinClient.moduleManager.getModule("Teams") as Teams + val antiShop = KevinClient.moduleManager.getModule("AntiShop") as AntiShop + if (antiShop.isShop(entity)) + return false + val teams = KevinClient.moduleManager.getModule("Teams") as Teams return !teams.state || !teams.isInYourTeam(entity) } diff --git a/src/minecraft/kevin/module/modules/exploit/TP.kt b/src/minecraft/kevin/module/modules/exploit/TP.kt index 803e5fb7..e76fbcfa 100644 --- a/src/minecraft/kevin/module/modules/exploit/TP.kt +++ b/src/minecraft/kevin/module/modules/exploit/TP.kt @@ -2,14 +2,12 @@ package kevin.module.modules.exploit import kevin.event.EventTarget import kevin.event.PacketEvent +import kevin.event.Render3DEvent import kevin.event.UpdateEvent import kevin.main.KevinClient import kevin.module.* import kevin.module.modules.misc.Teams -import kevin.utils.BlockUtils -import kevin.utils.ChatUtils -import kevin.utils.MovementUtils -import kevin.utils.PathUtils +import kevin.utils.* import net.minecraft.client.entity.EntityOtherPlayerMP import net.minecraft.init.Blocks import net.minecraft.network.play.client.C03PacketPlayer @@ -18,6 +16,8 @@ import net.minecraft.network.play.client.C0APacketAnimation import net.minecraft.network.play.client.C0BPacketEntityAction import net.minecraft.util.BlockPos import net.minecraft.util.Vec3 +import org.lwjgl.opengl.GL11 +import java.awt.Color import java.lang.Thread.sleep import kotlin.math.abs import kotlin.math.max @@ -31,6 +31,15 @@ class TP : Module("TP","Allows you to teleport around.",category = ModuleCategor private val aacFlySpeedValue = FloatValue("Speed", 0.8f, 0.1f, 2f) private val aacPathFindMode = ListValue("AACPathFindMode", arrayOf("Direct","FindPath"),"Direct") + private val showPath = BooleanValue("ShowPath", true) + private val colorModeV = ListValue("ColorMode", arrayOf("Custom","Rainbow"),"Custom") + private val colorR = IntegerValue("R",255,0,255) + private val colorG = IntegerValue("G",255,0,255) + private val colorB = IntegerValue("B",255,0,255) + private val posList = ArrayList() + private val aliveTicks = IntegerValue("AliveTicks",20,10,50) + private val glLineWidthValue = FloatValue("LineWidth",2F,1F,4F) + private val aliveTimer = MSTimer() private var fakePlayer: EntityOtherPlayerMP? = null private var flagTPState = 0 private var playerPos = Vec3(.0,.0,.0) @@ -72,9 +81,13 @@ class TP : Module("TP","Allows you to teleport around.",category = ModuleCategor thePlayer.motionY = 0.0 thePlayer.motionZ = 0.0 + val savePath = showPath.get() + //Do teleport val packetY = arrayOf(1.1,1.1,1.2,1.2,.8,.8,.4,.0,.0,1.1,1.1) repeat(11){ + if (savePath) + posList.add(Vec3(playerPos.xCoord,playerPos.yCoord+packetY[it],playerPos.zCoord)) mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(playerPos.xCoord,playerPos.yCoord+packetY[it],playerPos.zCoord,true)) } when(aacPathFindMode.get()){ @@ -84,17 +97,25 @@ class TP : Module("TP","Allows you to teleport around.",category = ModuleCategor val yV = ((thePlayer.posY - playerPos.yCoord)) / packets.toDouble() val zV = ((thePlayer.posZ - playerPos.zCoord)) / packets.toDouble() repeat(packets){ + if (savePath) + posList.add(Vec3(playerPos.xCoord+xV*(it+1),playerPos.yCoord+yV*(it+1),playerPos.zCoord+zV*(it+1))) mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(playerPos.xCoord+xV*(it+1),playerPos.yCoord+yV*(it+1),playerPos.zCoord+zV*(it+1),true)) } } "FindPath" -> { val path = PathUtils.findBlinkPath2(playerPos.xCoord,playerPos.yCoord,playerPos.zCoord,thePlayer.posX,thePlayer.posY,thePlayer.posZ,thePlayer.getDistance(playerPos.xCoord,playerPos.yCoord,playerPos.zCoord) % 10.0) path.forEach { + if (savePath) + posList.add(it) mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(it.xCoord,it.yCoord,it.zCoord,true)) } } } + if (savePath) + posList.add(Vec3(thePlayer.posX,thePlayer.posY-1,thePlayer.posZ)) mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(thePlayer.posX,thePlayer.posY-1,thePlayer.posZ,true)) + if (savePath) + posList.add(Vec3(playerPos.xCoord,playerPos.yCoord,playerPos.zCoord)) mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(playerPos.xCoord,playerPos.yCoord,playerPos.zCoord,true)) Thread({ sleep(50L) @@ -118,6 +139,7 @@ class TP : Module("TP","Allows you to teleport around.",category = ModuleCategor ) ) },"Teleport-SendPacket").start() + aliveTimer.reset() } } } @@ -175,4 +197,74 @@ class TP : Module("TP","Allows you to teleport around.",category = ModuleCategor } } } + @EventTarget(true) fun onRender3D(event: Render3DEvent) { + if (showPath.get() && posList.isNotEmpty()) { + if (aliveTimer.hasTimePassed(50L*aliveTicks.get())) { + posList.clear() + return + } + synchronized(posList) { + val renderPosX = mc.renderManager.viewerPosX + val renderPosY = mc.renderManager.viewerPosY + val renderPosZ = mc.renderManager.viewerPosZ + + GL11.glPushMatrix() + GL11.glEnable(GL11.GL_BLEND) + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA) + GL11.glShadeModel(GL11.GL_SMOOTH) + GL11.glDisable(GL11.GL_TEXTURE_2D) + GL11.glEnable(GL11.GL_LINE_SMOOTH) + GL11.glDisable(GL11.GL_DEPTH_TEST) + GL11.glDisable(GL11.GL_LIGHTING) + GL11.glDepthMask(false) + GL11.glHint(GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST) + + val colorD = if (colorModeV.get() == "Custom") Color(colorR.get(),colorG.get(),colorB.get()) else ColorUtils.rainbow() + + for (vec in posList){ + val x = vec.xCoord - renderPosX + val y = vec.yCoord - renderPosY + val z = vec.zCoord - renderPosZ + val width = 0.3 + val height = mc.thePlayer!!.eyeHeight.toDouble() + GL11.glLoadIdentity() + mc.entityRenderer.setupCameraTransform(mc.timer.renderPartialTicks, 2) + RenderUtils.glColor(colorD) + GL11.glLineWidth(glLineWidthValue.get()) + GL11.glBegin(GL11.GL_LINE_STRIP) + GL11.glVertex3d(x - width, y, z - width) + GL11.glVertex3d(x - width, y, z - width) + GL11.glVertex3d(x - width, y + height, z - width) + GL11.glVertex3d(x + width, y + height, z - width) + GL11.glVertex3d(x + width, y, z - width) + GL11.glVertex3d(x - width, y, z - width) + GL11.glVertex3d(x - width, y, z + width) + GL11.glEnd() + GL11.glBegin(GL11.GL_LINE_STRIP) + GL11.glVertex3d(x + width, y, z + width) + GL11.glVertex3d(x + width, y + height, z + width) + GL11.glVertex3d(x - width, y + height, z + width) + GL11.glVertex3d(x - width, y, z + width) + GL11.glVertex3d(x + width, y, z + width) + GL11.glVertex3d(x + width, y, z - width) + GL11.glEnd() + GL11.glBegin(GL11.GL_LINE_STRIP) + GL11.glVertex3d(x + width, y + height, z + width) + GL11.glVertex3d(x + width, y + height, z - width) + GL11.glEnd() + GL11.glBegin(GL11.GL_LINE_STRIP) + GL11.glVertex3d(x - width, y + height, z + width) + GL11.glVertex3d(x - width, y + height, z - width) + GL11.glEnd() + } + GL11.glDepthMask(true) + GL11.glEnable(GL11.GL_DEPTH_TEST) + GL11.glDisable(GL11.GL_LINE_SMOOTH) + GL11.glEnable(GL11.GL_TEXTURE_2D) + GL11.glDisable(GL11.GL_BLEND) + GL11.glPopMatrix() + GL11.glColor4f(1F, 1F, 1F, 1F) + } + } + } } \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/misc/AntiShop.kt b/src/minecraft/kevin/module/modules/misc/AntiShop.kt new file mode 100644 index 00000000..df4659cb --- /dev/null +++ b/src/minecraft/kevin/module/modules/misc/AntiShop.kt @@ -0,0 +1,42 @@ +package kevin.module.modules.misc + +import kevin.module.BooleanValue +import kevin.module.Module +import kevin.module.TextValue +import net.minecraft.entity.EntityLivingBase + +class AntiShop : Module("AntiShop", "Attack modules will not attack the store.") { + private val nameDetect = BooleanValue("NameDetect", false) + private val nameDetectName = TextValue("NameDetectName", "NPC | SHOP||NPC | UPGRADES") + private val armorDetect = BooleanValue("NoArmorDetect", true) + fun isShop(entityLivingBase: EntityLivingBase): Boolean{ + if (!this.state) + return false + if (nameDetect.get()) { + val names = nameDetectName.get().split("||").filter { it.isNotEmpty() && it.isNotBlank() } + val displayName = entityLivingBase.displayName?.formattedText + if (displayName != null) { + var name = displayName + val set = mutableSetOf() + for (i in 0 until name.length-1) { + if (name[i] == '§') + set += "${name[i]}${name[i+1]}" + } + set.forEach { + name = name!!.replace(it, "") + } + if (names.contains(name)) + return true + } + } + if (armorDetect.get()) { + val first = entityLivingBase.getCurrentArmor(0)?.item + val second = entityLivingBase.getCurrentArmor(1)?.item + val third = entityLivingBase.getCurrentArmor(2)?.item + val fourth = entityLivingBase.getCurrentArmor(3)?.item + if (first == null && second == null && third == null && fourth == null) + return true + } + return false + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/misc/ChatControl.kt b/src/minecraft/kevin/module/modules/misc/ChatControl.kt new file mode 100644 index 00000000..f9bb3cf7 --- /dev/null +++ b/src/minecraft/kevin/module/modules/misc/ChatControl.kt @@ -0,0 +1,11 @@ +package kevin.module.modules.misc + +import kevin.module.BooleanValue +import kevin.module.Module + +object ChatControl : Module("ChatControl", "Chat settings.") { + private val noLengthLimit = BooleanValue("NoLengthLimit", true) + private val noChatClear = BooleanValue("NoChatClear", true) + fun noLengthLimit() = this.state && noLengthLimit.get() + fun noChatClear() = this.state && noChatClear.get() +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/misc/NoScoreboard.kt b/src/minecraft/kevin/module/modules/misc/NoScoreboard.kt new file mode 100644 index 00000000..e6dab8d9 --- /dev/null +++ b/src/minecraft/kevin/module/modules/misc/NoScoreboard.kt @@ -0,0 +1,5 @@ +package kevin.module.modules.misc + +import kevin.module.Module + +object NoScoreboard : Module("NoScoreboard", "Disable Scoreboard.") \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/misc/Teams.kt b/src/minecraft/kevin/module/modules/misc/Teams.kt index d6158160..6545767c 100644 --- a/src/minecraft/kevin/module/modules/misc/Teams.kt +++ b/src/minecraft/kevin/module/modules/misc/Teams.kt @@ -8,13 +8,19 @@ import kevin.main.KevinClient import kevin.module.* import kevin.utils.BlockUtils.getBlock import kevin.utils.MSTimer +import kevin.utils.RandomUtils import net.minecraft.entity.EntityLivingBase +import net.minecraft.entity.player.EntityPlayer import net.minecraft.init.Blocks +import net.minecraft.item.ItemArmor +import net.minecraft.item.ItemStack import net.minecraft.util.BlockPos import java.util.concurrent.CopyOnWriteArrayList class Teams : Module("Teams","Prevents Killaura from attacking team mates.", category = ModuleCategory.MISC) { private val scoreboardValue = BooleanValue("ScoreboardTeam", true) + private val armorColorValue = BooleanValue("ArmorColor", false) + private val armorColorArmorValue = ListValue("ArmorColorArmor", arrayOf("Helmet", "Plate", "Legs", "Boots", "Random", "First", "First(IgnoreNotCorresponding)"), "First") private val colorValue = BooleanValue("Color", true) private val gommeSWValue = BooleanValue("GommeSW", false) @@ -46,6 +52,35 @@ class Teams : Module("Teams","Prevents Killaura from attacking team mates.", cat return targetName[1] == clientName[1] } + if (armorColorValue.get()) { + when(armorColorArmorValue.get()) { + "Helmet" -> if (checkArmor(0, entity to thePlayer)) return true + "Plate" -> if (checkArmor(1, entity to thePlayer)) return true + "Legs" -> if (checkArmor(2, entity to thePlayer)) return true + "Boots" -> if (checkArmor(3, entity to thePlayer)) return true + "Random" -> if (checkArmor(RandomUtils.nextInt(0, 3), entity to thePlayer)) return true + "First" -> for (i in 1..3) + if (checkArmor(i, entity to thePlayer)) + return true + "First(IgnoreNotCorresponding)" -> { + val targetColors = arrayListOf() + val playerColors = arrayListOf() + for (i in 0..3) { + val targetArmor = entity.getCurrentArmor(i) + if (targetArmor != null && targetArmor.item is ItemArmor && (targetArmor.item as ItemArmor).armorMaterial == ItemArmor.ArmorMaterial.LEATHER) + targetColors.add(targetArmor.getArmorColor()) + + val playerArmor = thePlayer.getCurrentArmor(i) + if (playerArmor != null && playerArmor.item is ItemArmor && (targetArmor.item as ItemArmor).armorMaterial == ItemArmor.ArmorMaterial.LEATHER) + playerColors.add(playerArmor.getArmorColor()) + } + for (c in targetColors) + if (playerColors.contains(c)) + return true + } + } + } + if (colorValue.get() && displayName != null && entity.displayName != null) { val targetName = entity.displayName!!.formattedText.replace("§r", "") val clientName = displayName.formattedText.replace("§r", "") @@ -54,6 +89,17 @@ class Teams : Module("Teams","Prevents Killaura from attacking team mates.", cat return false } + fun ItemStack.getArmorColor() = + (this.item as ItemArmor).getColor(this) + fun checkArmor(i: Int, entities: Pair): Boolean { + val firstEntityArmor = entities.first.getCurrentArmor(i) ?: return false + val secondEntityArmor = entities.second.getCurrentArmor(i) ?: return false + val firstItem = firstEntityArmor.item + val secondItem = secondEntityArmor.item + if (firstItem !is ItemArmor || secondItem !is ItemArmor) return false + if (firstItem.armorMaterial != ItemArmor.ArmorMaterial.LEATHER || secondItem.armorMaterial != ItemArmor.ArmorMaterial.LEATHER) return false + return firstEntityArmor.getArmorColor() == secondEntityArmor.getArmorColor() + } @EventTarget fun onWorld(event: WorldEvent){ if (event.worldClient==null) return diff --git a/src/minecraft/kevin/module/modules/movement/Fly.kt b/src/minecraft/kevin/module/modules/movement/Fly.kt index f6785134..d16f8229 100644 --- a/src/minecraft/kevin/module/modules/movement/Fly.kt +++ b/src/minecraft/kevin/module/modules/movement/Fly.kt @@ -4,12 +4,17 @@ import kevin.event.* import kevin.module.* import kevin.module.modules.movement.flys.FlyMode import kevin.module.modules.movement.flys.aac.AAC5 +import kevin.module.modules.movement.flys.ncp.NCPFly +import kevin.module.modules.movement.flys.ncp.NCPNew +import kevin.module.modules.movement.flys.ncp.OldNCP +import kevin.module.modules.movement.flys.other.Matrix import kevin.module.modules.movement.flys.other.Teleport import kevin.module.modules.movement.flys.vanilla.Creative import kevin.module.modules.movement.flys.vanilla.Vanilla import kevin.module.modules.movement.flys.verus.VerusAuto import kevin.utils.* import org.lwjgl.input.Keyboard +import java.awt.Color class Fly : Module("Fly","Allow you fly", Keyboard.KEY_F,ModuleCategory.MOVEMENT) { private val flys = arrayListOf( @@ -17,7 +22,11 @@ class Fly : Module("Fly","Allow you fly", Keyboard.KEY_F,ModuleCategory.MOVEMENT Creative, AAC5, Teleport, - VerusAuto + VerusAuto, + //NCPNew, (未完成) + NCPFly, + OldNCP, + Matrix ) private val names: Array @@ -35,13 +44,17 @@ class Fly : Module("Fly","Allow you fly", Keyboard.KEY_F,ModuleCategory.MOVEMENT val keepAlive = BooleanValue("KeepAlive",false) private val resetMotion = BooleanValue("ResetMotion",false) private val fakeDamageValue = BooleanValue("FakeDamage", true) + private val markValue = ListValue("Mark", arrayOf("Up", "Down", "Off"), "Up") private var isFlying = false val flyTimer = MSTimer() + var launchY = 0.0 + override fun onEnable() { isFlying = mc.thePlayer.capabilities.isFlying if(mc.thePlayer.onGround&&fakeDamageValue.get()) mc.thePlayer.handleStatusUpdate(2) + launchY = mc.thePlayer.posY nowMode.onEnable() } override fun onDisable() { @@ -54,6 +67,18 @@ class Fly : Module("Fly","Allow you fly", Keyboard.KEY_F,ModuleCategory.MOVEMENT nowMode.onDisable() } + @EventTarget + fun onRender3d(event: Render3DEvent) { + if (markValue equal "Off") { + return + } + + RenderUtils.drawPlatform( + if (markValue equal "Up") launchY + 2.0 else launchY, + if (mc.thePlayer.entityBoundingBox.maxY < launchY + 2.0) Color(0, 255, 0, 90) else Color(255, 0, 0, 90), + 1.0) + } + @EventTarget fun onMotion(event: MotionEvent) = nowMode.onMotion(event) @EventTarget fun onRender3D(event: Render3DEvent) = nowMode.onRender3D(event) @EventTarget fun onWorld(event: WorldEvent) = nowMode.onWorld(event) @@ -62,6 +87,7 @@ class Fly : Module("Fly","Allow you fly", Keyboard.KEY_F,ModuleCategory.MOVEMENT @EventTarget fun onJump(event: JumpEvent) = nowMode.onJump(event) @EventTarget fun onUpdate(event: UpdateEvent) = nowMode.onUpdate(event) @EventTarget fun onPacket(event: PacketEvent) = nowMode.onPacket(event) + @EventTarget fun onMove(event: MoveEvent) = nowMode.onMove(event) override val values: List> get() { @@ -72,5 +98,5 @@ class Fly : Module("Fly","Allow you fly", Keyboard.KEY_F,ModuleCategory.MOVEMENT } override val tag: String - get() = mode.get() + get() = "${mode.get()}${if (nowMode.tagV!=null) "(${nowMode.tagV})" else ""}" } \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/KeepSprint.kt b/src/minecraft/kevin/module/modules/movement/KeepSprint.kt index 322e6287..e6d7551f 100644 --- a/src/minecraft/kevin/module/modules/movement/KeepSprint.kt +++ b/src/minecraft/kevin/module/modules/movement/KeepSprint.kt @@ -1,6 +1,59 @@ package kevin.module.modules.movement +import kevin.event.AttackEvent +import kevin.event.EventTarget +import kevin.event.UpdateEvent +import kevin.module.IntegerValue import kevin.module.Module import kevin.module.ModuleCategory +import kevin.utils.MSTimer +import kevin.utils.TimeUtils +import net.minecraft.entity.EntityLivingBase -class KeepSprint : Module("KeepSprint","Keep sprint when you attack entity.",category = ModuleCategory.MOVEMENT) \ No newline at end of file +class KeepSprint : Module("KeepSprint","Keep sprint when you attack entity.",category = ModuleCategory.MOVEMENT) { + private val maxDelay: IntegerValue = object : IntegerValue("MaxDelay", 200, 0, 500) { + override fun onChanged(oldValue: Int, newValue: Int) { + val i = minDelay.get() + if (i > newValue) set(i) + + delay = TimeUtils.randomDelay(minDelay.get(), this.get()) + } + } + + private val minDelay: IntegerValue = object : IntegerValue("MinDelay", 50, 0, 500) { + override fun onChanged(oldValue: Int, newValue: Int) { + val i = maxDelay.get() + if (i < newValue) set(i) + + delay = TimeUtils.randomDelay(this.get(), maxDelay.get()) + } + } + + var delay = 0L + var stopSprint = false + val stopTimer = MSTimer() + private var isHit = false + private val attackTimer = MSTimer() + + override fun onEnable() { + isHit = false + } + + @EventTarget + fun onAttack(event: AttackEvent) { + if (event.targetEntity is EntityLivingBase && !isHit) { + isHit = true + attackTimer.reset() + delay = TimeUtils.randomDelay(minDelay.get(), maxDelay.get()) + } + } + @EventTarget + fun onUpdate(event: UpdateEvent) { + if (isHit && attackTimer.hasTimePassed(delay/2)) { + isHit = false + mc.thePlayer.isSprinting = false + stopSprint = true + stopTimer.reset() + } + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/Sprint.kt b/src/minecraft/kevin/module/modules/movement/Sprint.kt index 29b2383b..29b1c78c 100644 --- a/src/minecraft/kevin/module/modules/movement/Sprint.kt +++ b/src/minecraft/kevin/module/modules/movement/Sprint.kt @@ -2,6 +2,7 @@ package kevin.module.modules.movement import kevin.event.EventTarget import kevin.event.UpdateEvent +import kevin.main.KevinClient import kevin.module.BooleanValue import kevin.module.Module import kevin.module.ModuleCategory @@ -22,6 +23,11 @@ class Sprint : Module("Sprint","Automatically sprints all the time.", Keyboard.K @EventTarget fun onUpdate(event: UpdateEvent?) { + val keepSprint = KevinClient.moduleManager.getModule("KeepSprint") as KeepSprint + if (keepSprint.stopSprint && keepSprint.stopTimer.hasTimePassed(keepSprint.delay/2+50)) { + keepSprint.stopSprint = false + } + if (!MovementUtils.isMoving || mc.thePlayer.isSneaking || blindnessValue.get() && mc.thePlayer .isPotionActive(Potion.blindness) || @@ -29,7 +35,7 @@ class Sprint : Module("Sprint","Automatically sprints all the time.", Keyboard.K || (checkServerSide.get() && (mc.thePlayer.onGround || !checkServerSideGround.get()) && !allDirectionsValue.get() && RotationUtils.targetRotation != null && RotationUtils.getRotationDifference( Rotation(mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch) - ) > 30)) { + ) > 30) || keepSprint.stopSprint) { mc.thePlayer.isSprinting = false return } diff --git a/src/minecraft/kevin/module/modules/movement/Step.kt b/src/minecraft/kevin/module/modules/movement/Step.kt index 5d090dfb..e1a9d9e8 100644 --- a/src/minecraft/kevin/module/modules/movement/Step.kt +++ b/src/minecraft/kevin/module/modules/movement/Step.kt @@ -9,15 +9,17 @@ import kevin.utils.MovementUtils import net.minecraft.block.Block import net.minecraft.block.BlockLiquid import net.minecraft.network.play.client.C03PacketPlayer +import net.minecraft.network.play.client.C03PacketPlayer.C04PacketPlayerPosition import net.minecraft.stats.StatList import net.minecraft.util.AxisAlignedBB +import kotlin.math.abs import kotlin.math.cos import kotlin.math.sin class Step : Module("Step", "Allows you to step up/down blocks.", category = ModuleCategory.MOVEMENT) { private val modeValue = ListValue("Mode", arrayOf( - "Vanilla", "Jump", "NCP", "MotionNCP", "OldNCP", "AAC", "LAAC", "AAC3.3.4", "Spartan", "Rewinside" + "Vanilla", "Jump", "NCP", "SigmaNCP", "MotionNCP", "OldNCP", "AAC", "LAAC", "AAC3.3.4", "Spartan", "Rewinside" ), "NCP") private val heightValue = FloatValue("Height", 1F, 0.6F, 10F) @@ -26,6 +28,9 @@ class Step : Module("Step", "Allows you to step up/down blocks.", category = Mod private val reverse = BooleanValue("ReverseStep",false) private val motionValue = FloatValue("Motion", 1f, 0.21f, 1f) + + private val sigmaNCPTimer = FloatValue("SigmaNCPTimer", 0.37f, 0.2f, 1f) + private var jumped = false @EventTarget(ignoreCondition = true) @@ -46,11 +51,17 @@ class Step : Module("Step", "Allows you to step up/down blocks.", category = Mod private var spartanSwitch = false private var isAACStep = false + private var resetTimer = false + private val timer = MSTimer() + override fun onEnable() { + resetTimer = false + } + override fun onDisable() { val thePlayer = mc.thePlayer ?: return - + mc.timer.timerSpeed = 1f // Change step height back to default (0.5 is default) thePlayer.stepHeight = 0.5F } @@ -126,6 +137,11 @@ class Step : Module("Step", "Allows you to step up/down blocks.", category = Mod val mode = modeValue.get() val thePlayer = mc.thePlayer ?: return + if (resetTimer) { + resetTimer = false + mc.timer.timerSpeed = 1f + } + // Motion steps when { mode.equals("motionncp", true) && thePlayer.isCollidedHorizontally && !mc.gameSettings.keyBindJump.isKeyDown -> { @@ -160,6 +176,11 @@ class Step : Module("Step", "Allows you to step up/down blocks.", category = Mod fun onStep(event: StepEvent) { val thePlayer = mc.thePlayer ?: return + if (resetTimer) { + resetTimer = false + mc.timer.timerSpeed = 1f + } + // Phase should disable step if (KevinClient.moduleManager.getModule("Phase")!!.state) { event.stepHeight = 0F @@ -208,23 +229,44 @@ class Step : Module("Step", "Allows you to step up/down blocks.", category = Mod @EventTarget(ignoreCondition = true) fun onStepConfirm(event: StepConfirmEvent) { + if (resetTimer) { + resetTimer = false + mc.timer.timerSpeed = 1f + } + val thePlayer = mc.thePlayer if (thePlayer == null || !isStep) // Check if step return - if (thePlayer.entityBoundingBox.minY - stepY > 0.5) { // Check if full block step + val rheight = thePlayer.entityBoundingBox.minY - stepY + + if (rheight > 0.5) { // Check if full block step val mode = modeValue.get() when { + mode.equals("SigmaNCP", ignoreCase = true) -> { + mc.timer.timerSpeed = + sigmaNCPTimer.get() - if (rheight >= 1) abs(1 - rheight.toFloat()) * (sigmaNCPTimer.get() * 0.55f) else 0f + if (mc.timer.timerSpeed <= 0.05f) { + mc.timer.timerSpeed = 0.05f + } + resetTimer = true + ncpStep(rheight) + } + mode.equals("NCP", ignoreCase = true) || mode.equals("AAC", ignoreCase = true) -> { fakeJump() // Half legit step (1 packet missing) [COULD TRIGGER TOO MANY PACKETS] - mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(stepX, - stepY + 0.41999998688698, stepZ, false)) - mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(stepX, - stepY + 0.7531999805212, stepZ, false)) + mc.netHandler.addToSendQueue( + C04PacketPlayerPosition(stepX, + stepY + 0.41999998688698, stepZ, false) + ) + mc.netHandler.addToSendQueue( + C04PacketPlayerPosition(stepX, + stepY + 0.7531999805212, stepZ, false) + ) timer.reset() } @@ -233,15 +275,23 @@ class Step : Module("Step", "Allows you to step up/down blocks.", category = Mod if (spartanSwitch) { // Vanilla step (3 packets) [COULD TRIGGER TOO MANY PACKETS] - mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(stepX, - stepY + 0.41999998688698, stepZ, false)) - mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(stepX, - stepY + 0.7531999805212, stepZ, false)) - mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(stepX, - stepY + 1.001335979112147, stepZ, false)) + mc.netHandler.addToSendQueue( + C04PacketPlayerPosition(stepX, + stepY + 0.41999998688698, stepZ, false) + ) + mc.netHandler.addToSendQueue( + C04PacketPlayerPosition(stepX, + stepY + 0.7531999805212, stepZ, false) + ) + mc.netHandler.addToSendQueue( + C04PacketPlayerPosition(stepX, + stepY + 1.001335979112147, stepZ, false) + ) } else // Force step - mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(stepX, - stepY + 0.6, stepZ, false)) + mc.netHandler.addToSendQueue( + C04PacketPlayerPosition(stepX, + stepY + 0.6, stepZ, false) + ) // Spartan allows one unlegit step so just swap between legit and unlegit spartanSwitch = !spartanSwitch @@ -254,12 +304,18 @@ class Step : Module("Step", "Allows you to step up/down blocks.", category = Mod fakeJump() // Vanilla step (3 packets) [COULD TRIGGER TOO MANY PACKETS] - mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(stepX, - stepY + 0.41999998688698, stepZ, false)) - mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(stepX, - stepY + 0.7531999805212, stepZ, false)) - mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(stepX, - stepY + 1.001335979112147, stepZ, false)) + mc.netHandler.addToSendQueue( + C04PacketPlayerPosition(stepX, + stepY + 0.41999998688698, stepZ, false) + ) + mc.netHandler.addToSendQueue( + C04PacketPlayerPosition(stepX, + stepY + 0.7531999805212, stepZ, false) + ) + mc.netHandler.addToSendQueue( + C04PacketPlayerPosition(stepX, + stepY + 1.001335979112147, stepZ, false) + ) // Reset timer timer.reset() @@ -300,6 +356,57 @@ class Step : Module("Step", "Allows you to step up/down blocks.", category = Mod .isEmpty() } + private fun ncpStep(height: Double) { + val offset = listOf(0.42, 0.333, 0.248, 0.083, -0.078) + val posX = mc.thePlayer.posX + val posZ = mc.thePlayer.posZ + var y = mc.thePlayer.posY + if (height < 1.1) { + var first = 0.42 + var second = 0.75 + if (height != 1.0) { + first *= height + second *= height + if (first > 0.425) { + first = 0.425 + } + if (second > 0.78) { + second = 0.78 + } + if (second < 0.49) { + second = 0.49 + } + } + if (first == 0.42) first = 0.41999998688698 + mc.thePlayer.sendQueue.addToSendQueue(C04PacketPlayerPosition(posX, y + first, posZ, false)) + if (y + second < y + height) mc.thePlayer.sendQueue.addToSendQueue( + C04PacketPlayerPosition( + posX, + y + second, + posZ, + false + ) + ) + return + } else if (height < 1.6) { + for (i in offset.indices) { + val off = offset[i] + y += off + mc.thePlayer.sendQueue.addToSendQueue(C04PacketPlayerPosition(posX, y, posZ, false)) + } + } else if (height < 2.1) { + val heights = doubleArrayOf(0.425, 0.821, 0.699, 0.599, 1.022, 1.372, 1.652, 1.869) + for (off in heights) { + mc.thePlayer.sendQueue.addToSendQueue(C04PacketPlayerPosition(posX, y + off, posZ, false)) + } + } else { + val heights = doubleArrayOf(0.425, 0.821, 0.699, 0.599, 1.022, 1.372, 1.652, 1.869, 2.019, 1.907) + for (off in heights) { + mc.thePlayer.sendQueue.addToSendQueue(C04PacketPlayerPosition(posX, y + off, posZ, false)) + } + } + } + override val tag: String get() = modeValue.get() } \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/flys/FlyMode.kt b/src/minecraft/kevin/module/modules/movement/flys/FlyMode.kt index 86adafb5..3f3ff420 100644 --- a/src/minecraft/kevin/module/modules/movement/flys/FlyMode.kt +++ b/src/minecraft/kevin/module/modules/movement/flys/FlyMode.kt @@ -23,4 +23,6 @@ abstract class FlyMode(val modeName: String): MinecraftInstance() { open fun onJump(event: JumpEvent) {} open fun onUpdate(event: UpdateEvent) {} open fun onPacket(event: PacketEvent) {} + open fun onMove(event: MoveEvent) {} + open val tagV: String? = null } \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/flys/ncp/NCPFly.kt b/src/minecraft/kevin/module/modules/movement/flys/ncp/NCPFly.kt new file mode 100644 index 00000000..f023b7b4 --- /dev/null +++ b/src/minecraft/kevin/module/modules/movement/flys/ncp/NCPFly.kt @@ -0,0 +1,64 @@ +package kevin.module.modules.movement.flys.ncp + +import kevin.event.PacketEvent +import kevin.event.UpdateEvent +import kevin.module.FloatValue +import kevin.module.modules.movement.flys.FlyMode +import kevin.utils.MovementUtils +import net.minecraft.network.play.client.C03PacketPlayer + +object NCPFly : FlyMode("NCPFly") { + private val motionValue = FloatValue("${valuePrefix}Motion", 0f, 0f, 1f) + + override fun onEnable() { + if (!mc.thePlayer.onGround) { + return + } + + repeat(65) { + mc.netHandler.addToSendQueue( + C03PacketPlayer.C04PacketPlayerPosition( + mc.thePlayer.posX, + mc.thePlayer.posY + 0.049, + mc.thePlayer.posZ, + false + ) + ) + mc.netHandler.addToSendQueue( + C03PacketPlayer.C04PacketPlayerPosition( + mc.thePlayer.posX, + mc.thePlayer.posY, + mc.thePlayer.posZ, + false + ) + ) + } + mc.netHandler.addToSendQueue( + C03PacketPlayer.C04PacketPlayerPosition( + mc.thePlayer.posX, + mc.thePlayer.posY + 0.1, + mc.thePlayer.posZ, + true + ) + ) + + mc.thePlayer.motionX *= 0.1 + mc.thePlayer.motionZ *= 0.1 + mc.thePlayer.swingItem() + } + + override fun onUpdate(event: UpdateEvent) { + mc.thePlayer.motionY = (-motionValue.get()).toDouble() + + if (mc.gameSettings.keyBindSneak.isKeyDown) mc.thePlayer.motionY = -0.5 + MovementUtils.strafe() + } + + override fun onPacket(event: PacketEvent) { + val packet = event.packet + + if (packet is C03PacketPlayer) { + packet.onGround = true + } + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/flys/ncp/NCPNew.kt b/src/minecraft/kevin/module/modules/movement/flys/ncp/NCPNew.kt new file mode 100644 index 00000000..76a33fe4 --- /dev/null +++ b/src/minecraft/kevin/module/modules/movement/flys/ncp/NCPNew.kt @@ -0,0 +1,25 @@ +package kevin.module.modules.movement.flys.ncp + +import kevin.event.UpdateEvent +import kevin.module.modules.movement.flys.FlyMode + +object NCPNew : FlyMode("NCPNew") { + override fun onEnable() { + if (mc.thePlayer.onGround && mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer,mc.thePlayer.entityBoundingBox.offset(.0, .2, .0).expand(.0, .0, .0)).isEmpty()) { + mc.thePlayer.setPosition(mc.thePlayer.posX, mc.thePlayer.posY + .2, mc.thePlayer.posZ) + } + mc.thePlayer.motionX = .0 + mc.thePlayer.motionY = .0 + mc.thePlayer.motionZ = .0 + mc.thePlayer.speedInAir = 0F + } + + override fun onDisable() { + mc.thePlayer.speedInAir = .02F + } + override fun onUpdate(event: UpdateEvent) { + mc.thePlayer.motionX = .0 + mc.thePlayer.motionY = .0 + mc.thePlayer.motionZ = .0 + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/flys/ncp/OldNCP.kt b/src/minecraft/kevin/module/modules/movement/flys/ncp/OldNCP.kt new file mode 100644 index 00000000..b29f32e1 --- /dev/null +++ b/src/minecraft/kevin/module/modules/movement/flys/ncp/OldNCP.kt @@ -0,0 +1,52 @@ +package kevin.module.modules.movement.flys.ncp + +import kevin.event.UpdateEvent +import kevin.module.modules.movement.flys.FlyMode +import kevin.utils.MovementUtils +import net.minecraft.network.play.client.C03PacketPlayer + +object OldNCP : FlyMode("OldNCPFly") { + override fun onEnable() { + if (!mc.thePlayer.onGround) { + return + } + + repeat(3) { + mc.netHandler.addToSendQueue( + C03PacketPlayer.C04PacketPlayerPosition( + mc.thePlayer.posX, + mc.thePlayer.posY + 1.01, + mc.thePlayer.posZ, + false + ) + ) + mc.netHandler.addToSendQueue( + C03PacketPlayer.C04PacketPlayerPosition( + mc.thePlayer.posX, + mc.thePlayer.posY, + mc.thePlayer.posZ, + false + ) + ) + } + + mc.thePlayer.jump() + mc.thePlayer.swingItem() + } + + override fun onUpdate(event: UpdateEvent) { + if (fly.launchY > mc.thePlayer.posY) { + mc.thePlayer.motionY = -0.000000000000000000000000000000001 + } + + if (mc.gameSettings.keyBindSneak.isKeyDown) { + mc.thePlayer.motionY = -0.2 + } + + if (mc.gameSettings.keyBindJump.isKeyDown && mc.thePlayer.posY < fly.launchY - 0.1) { + mc.thePlayer.motionY = 0.2 + } + + MovementUtils.strafe() + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/flys/other/Matrix.kt b/src/minecraft/kevin/module/modules/movement/flys/other/Matrix.kt new file mode 100644 index 00000000..c7df0af0 --- /dev/null +++ b/src/minecraft/kevin/module/modules/movement/flys/other/Matrix.kt @@ -0,0 +1,77 @@ +package kevin.module.modules.movement.flys.other + +import kevin.event.* +import kevin.module.modules.movement.flys.FlyMode +import kevin.utils.PacketUtils +import net.minecraft.block.BlockAir +import net.minecraft.network.play.client.C03PacketPlayer +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement +import net.minecraft.network.play.client.C09PacketHeldItemChange +import net.minecraft.util.AxisAlignedBB +import net.minecraft.util.BlockPos + +object Matrix : FlyMode("Matrix") { + private var dontPlace = false + private var airCount = 0 + + override fun onEnable() { + dontPlace = true + } + + override fun onDisable() { + mc.timer.timerSpeed = 1f + mc.addScheduledTask { + mc.netHandler.addToSendQueue(C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem)) + } + } + + override fun onMotion(event: MotionEvent) { + if(event.eventState == EventState.PRE) { + if(mc.thePlayer.posY < fly.launchY + 0.15 && mc.thePlayer.posY > fly.launchY + 0.05) { + airCount++ + if(airCount >= 3) { + PacketUtils.sendPacketNoEvent(C03PacketPlayer.C06PacketPlayerPosLook(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ, mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, true)) + mc.netHandler.addToSendQueue(C08PacketPlayerBlockPlacement(BlockPos(-1, -1, -1), -1, null, 0f, 0f, 0f)) + } + } + } + } + + override fun onUpdate(event: UpdateEvent) { + for(i in 0..8) { + // find a empty inventory slot + if(mc.thePlayer.inventory.mainInventory[i] == null) { + mc.netHandler.addToSendQueue(C09PacketHeldItemChange(i)) + break + } + } + if(!dontPlace || mc.thePlayer.posY + 1 > fly.launchY) { + dontPlace = true + mc.netHandler.addToSendQueue(C08PacketPlayerBlockPlacement(BlockPos(-1, -1, -1), -1, null, 0f, 0f, 0f)) + } + if(mc.thePlayer.onGround) { + mc.thePlayer.jump() + dontPlace = true + mc.netHandler.addToSendQueue(C08PacketPlayerBlockPlacement(BlockPos(-1, -1, -1), -1, null, 0f, 0f, 0f)) + } + mc.thePlayer.onGround = false + if(mc.thePlayer.motionY < 0) { + mc.thePlayer.motionX *= 0.7 + mc.thePlayer.motionZ *= 0.7 + } + mc.timer.timerSpeed = 1.7f + } + + override fun onPacket(event: PacketEvent) { + val packet = event.packet + if(packet is C03PacketPlayer) { + packet.onGround = false + } + } + + override fun onBB(event: BlockBBEvent) { + if (event.block is BlockAir && event.y <= fly.launchY) { + event.boundingBox = AxisAlignedBB.fromBounds(event.x.toDouble(), event.y.toDouble(), event.z.toDouble(), event.x + 1.0, fly.launchY, event.z + 1.0) + } + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/flys/verus/VerusAuto.kt b/src/minecraft/kevin/module/modules/movement/flys/verus/VerusAuto.kt index 90bc36ad..fda40dc4 100644 --- a/src/minecraft/kevin/module/modules/movement/flys/verus/VerusAuto.kt +++ b/src/minecraft/kevin/module/modules/movement/flys/verus/VerusAuto.kt @@ -10,6 +10,7 @@ import kevin.module.modules.exploit.Disabler import kevin.module.modules.movement.flys.FlyMode import kevin.utils.MovementUtils import kevin.utils.TickTimer +import net.minecraft.block.BlockAir import net.minecraft.client.settings.GameSettings import net.minecraft.init.Blocks import net.minecraft.network.play.client.C00PacketKeepAlive @@ -19,6 +20,7 @@ import kotlin.math.round object VerusAuto : FlyMode("VerusAuto") { + private val verusMode = ListValue("VerusMode", arrayOf("FakeGround", "FDP-5"),"FakeGround") private val verusMoveMode = ListValue("VerusMoveMode", arrayOf("Walk","Jump"),"Walk") private val verusMoveJump: Boolean get() = verusMoveMode equal "Jump" @@ -33,6 +35,7 @@ object VerusAuto : FlyMode("VerusAuto") { private val verusTimer = TickTimer() private var playerY = .0 private var y = 0 + private var ticks = 0 override fun onEnable() { y = round(mc.thePlayer.posY).toInt() @@ -81,51 +84,100 @@ object VerusAuto : FlyMode("VerusAuto") { mc.thePlayer.hurtTime = 0 mc.thePlayer.onGround = false } + ticks = 0 } override fun onDisable() { verusState = 0 mc.thePlayer.speedInAir = .02F + when(verusMode.get()) { + "FDP-5" -> { + mc.timer.timerSpeed = 1F + } + } } override fun onMotion(event: MotionEvent) { - if ( - verusMoveJump&& - !verusVanilla&& - verusState!=1&& - event.eventState== EventState.PRE&& - !mc.gameSettings.keyBindJump.isKeyDown&& - mc.thePlayer.jumpTicks==0&& - !mc.thePlayer.isInWater&& - !mc.thePlayer.isInLava&& - !mc.thePlayer.isInWeb&& - !mc.thePlayer.isOnLadder&& - mc.thePlayer.posY == round(mc.thePlayer.posY) - ) mc.thePlayer.jump() + if (!verusVanilla&&verusState!=1) when(verusMode.get()) { + "FakeGround" -> if ( + verusMoveJump&& + !verusVanilla&& + verusState!=1&& + event.eventState== EventState.PRE&& + !mc.gameSettings.keyBindJump.isKeyDown&& + mc.thePlayer.jumpTicks==0&& + !mc.thePlayer.isInWater&& + !mc.thePlayer.isInLava&& + !mc.thePlayer.isInWeb&& + !mc.thePlayer.isOnLadder&& + mc.thePlayer.posY == round(mc.thePlayer.posY) + ) mc.thePlayer.jump() + } + } + + override fun onMove(event: MoveEvent) { + when(verusMode.get()) { + "FDP-5" -> { + if (ticks % 10 == 0 && mc.thePlayer.onGround) { + MovementUtils.strafe(1f) + event.y = 0.42 + ticks = 0 + mc.thePlayer.motionY = 0.0 + mc.timer.timerSpeed = 4f + } else { + if (mc.gameSettings.keyBindJump.isKeyDown && ticks % 2 == 1) { + event.y = 0.5 + MovementUtils.strafe(0.48f) + fly.launchY += 0.5 + mc.timer.timerSpeed = 1f + return + } + mc.timer.timerSpeed = 1f + if (mc.thePlayer.onGround) { + MovementUtils.strafe(0.8f) + } else { + MovementUtils.strafe(0.72f) + } + } + ticks++ + } + } } override fun onBB(event: BlockBBEvent) { - if (!verusVanilla&& - verusState!=1&& - event.block== Blocks.air&& - if (verusMoveJump) (event.y < y&&event.y < mc.thePlayer!!.posY) else event.y < mc.thePlayer!!.posY&& - mc.thePlayer.getDistance(event.x.toDouble(),event.y.toDouble(),event.z.toDouble()) < 1.5) event.boundingBox = - AxisAlignedBB( - event.x.toDouble(), - event.y.toDouble(), - event.z.toDouble(), - event.x + 1.0, - (if (verusMoveJump) (if (y.toDouble() > mc.thePlayer.posY) mc.thePlayer.posY.toInt().toDouble() else y.toDouble()) else mc.thePlayer.posY.toInt().toDouble()) - if (verusDown.get()&& GameSettings.isKeyDown(mc.gameSettings.keyBindSneak)) 1.0 else .0, - event.z + 1.0 - ) + if (!verusVanilla&&verusState!=1) when(verusMode.get()) { + "FakeGround" -> if (!verusVanilla&& + verusState!=1&& + event.block== Blocks.air&& + if (verusMoveJump) (event.y < y&&event.y < mc.thePlayer!!.posY) else event.y < mc.thePlayer!!.posY&& + mc.thePlayer.getDistance(event.x.toDouble(),event.y.toDouble(),event.z.toDouble()) < 1.5) event.boundingBox = + AxisAlignedBB( + event.x.toDouble(), + event.y.toDouble(), + event.z.toDouble(), + event.x + 1.0, + (if (verusMoveJump) (if (y.toDouble() > mc.thePlayer.posY) mc.thePlayer.posY.toInt().toDouble() else y.toDouble()) else mc.thePlayer.posY.toInt().toDouble()) - if (verusDown.get()&& GameSettings.isKeyDown(mc.gameSettings.keyBindSneak)) 1.0 else .0, + event.z + 1.0 + ) + "FDP-5" -> { + if (event.block is BlockAir && event.y <= fly.launchY) { + event.boundingBox = AxisAlignedBB.fromBounds(event.x.toDouble(), event.y.toDouble(), event.z.toDouble(), event.x + 1.0, fly.launchY, event.z + 1.0) + } + } + } } override fun onStep(event: StepEvent) { - if (!verusVanilla&&verusState!=1) event.stepHeight = 0f + if (!verusVanilla&&verusState!=1) when(verusMode.get()) { + "FakeGround" -> if (!verusVanilla&&verusState!=1) event.stepHeight = 0f + } } override fun onJump(event: JumpEvent) { - if (!verusVanilla&&verusState!=1&&!(verusJump.get()&& MovementUtils.isMoving)) event.cancelEvent() + if (!verusVanilla&&verusState!=1) when(verusMode.get()) { + "FakeGround" -> if (!verusVanilla&&verusState!=1&&!(verusJump.get()&& MovementUtils.isMoving)) event.cancelEvent() + "FDP-5" -> event.cancelEvent() + } } override fun onUpdate(event: UpdateEvent) { @@ -171,15 +223,23 @@ object VerusAuto : FlyMode("VerusAuto") { mc.thePlayer.speedInAir = .02F verusTimer.reset() } + if (!verusVanilla&&verusState!=1) when(verusMode.get()) { + + } } override fun onPacket(event: PacketEvent) { val packet = event.packet if (packet is C03PacketPlayer){ - if (!verusVanilla&&mc.thePlayer.posY == round(mc.thePlayer.posY)) packet.onGround = true + when(verusMode.get()) { + "FakeGround" -> if (!verusVanilla&&mc.thePlayer.posY == round(mc.thePlayer.posY)) packet.onGround = true + } } } + override val tagV: String + get() = verusMode.get() + private val verusVanilla: Boolean get() = (Disabler.modeValue.get().contains("verusmove",true)&& Disabler.state) || (verusState == 2&&!verusTimer.hasTimePassed(verusBoostTicks.get()+1)) } \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/render/HUD.kt b/src/minecraft/kevin/module/modules/render/HUD.kt index 8d8a851d..3642145a 100644 --- a/src/minecraft/kevin/module/modules/render/HUD.kt +++ b/src/minecraft/kevin/module/modules/render/HUD.kt @@ -2,11 +2,15 @@ package kevin.module.modules.render import kevin.event.* import kevin.hud.designer.GuiHudDesigner +import kevin.hud.element.elements.ScoreboardElement import kevin.main.KevinClient +import kevin.module.BooleanValue import kevin.module.Module import kevin.module.ModuleCategory class HUD : Module("HUD","Toggles visibility of the HUD.",category = ModuleCategory.RENDER) { + var keepScoreboard = BooleanValue("KeepScoreboard", true) + @EventTarget fun onRender2D(event: Render2DEvent?) { if ((mc.currentScreen) is GuiHudDesigner) @@ -15,6 +19,13 @@ class HUD : Module("HUD","Toggles visibility of the HUD.",category = ModuleCateg KevinClient.hud.render(false) } + @EventTarget(true) + fun renderScoreboard(event: Render2DEvent) { + if (!this.state && keepScoreboard.get() && KevinClient.hud.elements.filterIsInstance().isNotEmpty()) { + KevinClient.hud.renderScoreboardOnly() + } + } + @EventTarget fun onUpdate(event: UpdateEvent?) { @@ -23,6 +34,13 @@ class HUD : Module("HUD","Toggles visibility of the HUD.",category = ModuleCateg KevinClient.hud.update() } + @EventTarget(true) + fun updateScoreboard(event: UpdateEvent) { + if (!this.state && keepScoreboard.get() && KevinClient.hud.elements.filterIsInstance().isNotEmpty()) { + KevinClient.hud.updateScoreboardOnly() + } + } + @EventTarget fun onKey(event: KeyEvent) { KevinClient.hud.handleKey('a', event.key) diff --git a/src/minecraft/kevin/module/modules/render/XRay.kt b/src/minecraft/kevin/module/modules/render/XRay.kt index 671a8e9b..0cda3d3e 100644 --- a/src/minecraft/kevin/module/modules/render/XRay.kt +++ b/src/minecraft/kevin/module/modules/render/XRay.kt @@ -1,8 +1,6 @@ package kevin.module.modules.render -import kevin.module.ListValue -import kevin.module.Module -import kevin.module.ModuleCategory +import kevin.module.* import net.minecraft.init.Blocks class XRay : Module(name = "XRay", description = "Allows you to see through walls.", category = ModuleCategory.RENDER) { @@ -10,6 +8,9 @@ class XRay : Module(name = "XRay", description = "Allows you to see through wall mc.renderGlobal.loadRenderers() } val mode = ListValue("Mode", arrayOf("Simple","Translucent"),"Simple") + val opacity = IntegerValue("Opacity", 160, 0, 255) + val noBlock = BooleanValue("NoBlock", false) + val cave = BooleanValue("OnlyInAir", false) override val tag: String get() = mode.get() val xrayBlocks = mutableListOf( diff --git a/src/minecraft/kevin/module/modules/world/Breaker.kt b/src/minecraft/kevin/module/modules/world/Breaker.kt index c3a2e2c9..7046dec5 100644 --- a/src/minecraft/kevin/module/modules/world/Breaker.kt +++ b/src/minecraft/kevin/module/modules/world/Breaker.kt @@ -90,7 +90,7 @@ class Breaker : Module("Breaker",description = "Destroys selected blocks around // BedCheck val teams = KevinClient.moduleManager.getModule("Teams") as Teams - if (Block.getBlockById(targetId)==Blocks.bed&&teams.bedCheckValue.get()&&pos in teams.teamBed){ + if (Block.getBlockById(targetId)==Blocks.bed&&teams.bedCheckValue.get()&&(pos in teams.teamBed||(bypassValue.get()&&teams.teamBed.any { pos == it.up() }))){ pos = null currentDamage = 0F return diff --git a/src/minecraft/kevin/utils/EntityUtils.kt b/src/minecraft/kevin/utils/EntityUtils.kt index e724ea53..aee8f924 100644 --- a/src/minecraft/kevin/utils/EntityUtils.kt +++ b/src/minecraft/kevin/utils/EntityUtils.kt @@ -1,6 +1,7 @@ package kevin.utils import kevin.main.KevinClient +import kevin.module.modules.misc.AntiShop import kevin.module.modules.misc.Teams import net.minecraft.entity.Entity import net.minecraft.entity.EntityLivingBase @@ -37,7 +38,13 @@ object EntityUtils : MinecraftInstance() { if (entity.isClientFriend() /***&& !LiquidBounce.moduleManager.getModule(NoFriends::class.java).state***/ ) return false - if (entity.isSpectator) return false + if (entity.isSpectator) + return false + + val antiShop = KevinClient.moduleManager.getModule("AntiShop") as AntiShop + if (antiShop.isShop(entity)) + return false + val teams = KevinClient.moduleManager.getModule("Teams") as Teams return !teams.state || !teams.isInYourTeam(entity) } diff --git a/src/minecraft/kevin/utils/RenderUtils.java b/src/minecraft/kevin/utils/RenderUtils.java index f32cdac0..78fe44da 100644 --- a/src/minecraft/kevin/utils/RenderUtils.java +++ b/src/minecraft/kevin/utils/RenderUtils.java @@ -511,6 +511,42 @@ public static void drawAxisAlignedBB(final AxisAlignedBB axisAlignedBB, final Co glDepthMask(true); glDisable(GL_BLEND); } + + public static void drawPlatform(final double y, final Color color, final double size) { + final RenderManager renderManager = mc.getRenderManager(); + final double renderY = y - renderManager.getRenderPosY(); + + drawAxisAlignedBB(new AxisAlignedBB(size, renderY + 0.02D, size, -size, renderY, -size), color,false,true,2F); + } + + public static void drawAxisAlignedBB(final AxisAlignedBB axisAlignedBB, final Color color, final boolean outline, final boolean box, final float outlineWidth) { + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glLineWidth(outlineWidth); + glDisable(GL_TEXTURE_2D); + glDisable(GL_DEPTH_TEST); + glDepthMask(false); + glColor(color); + + if (outline) { + glLineWidth(outlineWidth); + enableGlCap(GL_LINE_SMOOTH); + glColor(color.getRed(), color.getGreen(), color.getBlue(), 95); + drawSelectionBoundingBox(axisAlignedBB); + } + + if(box) { + glColor(color.getRed(), color.getGreen(), color.getBlue(), outline ? 26 : 35); + drawFilledBox(axisAlignedBB); + } + + GlStateManager.resetColor(); + glEnable(GL_TEXTURE_2D); + glEnable(GL_DEPTH_TEST); + glDepthMask(true); + glDisable(GL_BLEND); + } + public static void drawPlatform(final Entity entity, final Color color) { final RenderManager renderManager = mc.getRenderManager(); final Timer timer = mc.getTimer(); diff --git a/src/minecraft/net/minecraft/block/Block.java b/src/minecraft/net/minecraft/block/Block.java index 63c7c6af..1c8b3790 100644 --- a/src/minecraft/net/minecraft/block/Block.java +++ b/src/minecraft/net/minecraft/block/Block.java @@ -472,7 +472,13 @@ public int getMixedBrightnessForBlock(IBlockAccess worldIn, BlockPos pos) public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side) { XRay xRay = (XRay) KevinClient.moduleManager.getModule("XRay"); - if (xRay.getState()&&xRay.getMode().get().equalsIgnoreCase("Simple")) return xRay.getXrayBlocks().contains(this); + if (xRay.getState()) { + if (xRay.getMode().get().equalsIgnoreCase("Translucent")) { + if (xRay.getXrayBlocks().contains(this)&&!xRay.getNoBlock().get()&&!xRay.getCave().get()) { + return true; + } + } else return xRay.getXrayBlocks().contains(this); + } if (side == EnumFacing.DOWN && this.minY > 0.0D) { @@ -915,7 +921,7 @@ public EnumWorldBlockLayer getBlockLayer() { final XRay xRay = (XRay) KevinClient.moduleManager.getModule("XRay"); if (xRay.getState()&&xRay.getMode().get().equalsIgnoreCase("Translucent")) - return EnumWorldBlockLayer.TRANSLUCENT; + return xRay.getNoBlock().get() ? EnumWorldBlockLayer.TRANSLUCENT : (xRay.getXrayBlocks().contains(this) ? EnumWorldBlockLayer.SOLID : EnumWorldBlockLayer.TRANSLUCENT); return EnumWorldBlockLayer.SOLID; } diff --git a/src/minecraft/net/minecraft/block/BlockGrass.java b/src/minecraft/net/minecraft/block/BlockGrass.java index 71a858dd..3346d34e 100644 --- a/src/minecraft/net/minecraft/block/BlockGrass.java +++ b/src/minecraft/net/minecraft/block/BlockGrass.java @@ -1,6 +1,9 @@ package net.minecraft.block; import java.util.Random; + +import kevin.main.KevinClient; +import kevin.module.modules.render.XRay; import net.minecraft.block.material.Material; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.state.BlockState; @@ -155,6 +158,9 @@ public void grow(World worldIn, Random rand, BlockPos pos, IBlockState state) public EnumWorldBlockLayer getBlockLayer() { + final XRay xRay = (XRay) KevinClient.moduleManager.getModule("XRay"); + if (xRay.getState()&&xRay.getMode().get().equalsIgnoreCase("Translucent")) + return super.getBlockLayer(); return EnumWorldBlockLayer.CUTOUT_MIPPED; } diff --git a/src/minecraft/net/minecraft/client/gui/GuiIngame.java b/src/minecraft/net/minecraft/client/gui/GuiIngame.java index e3e9e84e..1aa70c0c 100644 --- a/src/minecraft/net/minecraft/client/gui/GuiIngame.java +++ b/src/minecraft/net/minecraft/client/gui/GuiIngame.java @@ -564,6 +564,11 @@ public void renderStreamIndicator(ScaledResolution scaledRes) private void renderScoreboard(ScoreObjective objective, ScaledResolution scaledRes) { + if (!KevinClient.INSTANCE.isStarting()) { + if (KevinClient.hud.disableMinecraftScoreboard()) + return; + } + Scoreboard scoreboard = objective.getScoreboard(); Collection collection = scoreboard.getSortedScores(objective); List list = Lists.newArrayList(Iterables.filter(collection, new Predicate() diff --git a/src/minecraft/net/minecraft/client/gui/GuiNewChat.java b/src/minecraft/net/minecraft/client/gui/GuiNewChat.java index 38e414e1..a0c2fa64 100644 --- a/src/minecraft/net/minecraft/client/gui/GuiNewChat.java +++ b/src/minecraft/net/minecraft/client/gui/GuiNewChat.java @@ -3,6 +3,9 @@ import com.google.common.collect.Lists; import java.util.Iterator; import java.util.List; + +import kevin.main.KevinClient; +import kevin.module.modules.misc.ChatControl; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.player.EntityPlayer; @@ -118,6 +121,10 @@ public void drawChat(int updateCounter) */ public void clearChatMessages() { + if (ChatControl.INSTANCE.noChatClear()) { + printChatMessage(new ChatComponentText(KevinClient.INSTANCE.getCStart() + " Chat clear canceled.")); + return; + } this.drawnChatLines.clear(); this.chatLines.clear(); this.sentMessages.clear(); @@ -159,7 +166,7 @@ private void setChatLine(IChatComponent chatComponent, int chatLineId, int updat this.drawnChatLines.add(0, new ChatLine(updateCounter, ichatcomponent, chatLineId)); } - while (this.drawnChatLines.size() > 100) + if (!ChatControl.INSTANCE.noLengthLimit()) while (this.drawnChatLines.size() > 100) { this.drawnChatLines.remove(this.drawnChatLines.size() - 1); } @@ -168,7 +175,7 @@ private void setChatLine(IChatComponent chatComponent, int chatLineId, int updat { this.chatLines.add(0, new ChatLine(updateCounter, chatComponent, chatLineId)); - while (this.chatLines.size() > 100) + if (!ChatControl.INSTANCE.noLengthLimit()) while (this.chatLines.size() > 100) { this.chatLines.remove(this.chatLines.size() - 1); } diff --git a/src/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java b/src/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java index 7e10dc23..c8235195 100644 --- a/src/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java +++ b/src/minecraft/net/minecraft/client/network/NetHandlerPlayClient.java @@ -532,35 +532,37 @@ public void handleEntityMetadata(S1CPacketEntityMetadata packetIn) */ public void handleSpawnPlayer(S0CPacketSpawnPlayer packetIn) { - PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); - double d0 = (double)packetIn.getX() / 32.0D; - double d1 = (double)packetIn.getY() / 32.0D; - double d2 = (double)packetIn.getZ() / 32.0D; - float f = (float)(packetIn.getYaw() * 360) / 256.0F; - float f1 = (float)(packetIn.getPitch() * 360) / 256.0F; - EntityOtherPlayerMP entityotherplayermp = new EntityOtherPlayerMP(this.gameController.theWorld, this.getPlayerInfo(packetIn.getPlayer()).getGameProfile()); - entityotherplayermp.prevPosX = entityotherplayermp.lastTickPosX = (double)(entityotherplayermp.serverPosX = packetIn.getX()); - entityotherplayermp.prevPosY = entityotherplayermp.lastTickPosY = (double)(entityotherplayermp.serverPosY = packetIn.getY()); - entityotherplayermp.prevPosZ = entityotherplayermp.lastTickPosZ = (double)(entityotherplayermp.serverPosZ = packetIn.getZ()); - int i = packetIn.getCurrentItemID(); + try { + PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController); + double d0 = (double)packetIn.getX() / 32.0D; + double d1 = (double)packetIn.getY() / 32.0D; + double d2 = (double)packetIn.getZ() / 32.0D; + float f = (float)(packetIn.getYaw() * 360) / 256.0F; + float f1 = (float)(packetIn.getPitch() * 360) / 256.0F; + EntityOtherPlayerMP entityotherplayermp = new EntityOtherPlayerMP(this.gameController.theWorld, this.getPlayerInfo(packetIn.getPlayer()).getGameProfile()); + entityotherplayermp.prevPosX = entityotherplayermp.lastTickPosX = (double)(entityotherplayermp.serverPosX = packetIn.getX()); + entityotherplayermp.prevPosY = entityotherplayermp.lastTickPosY = (double)(entityotherplayermp.serverPosY = packetIn.getY()); + entityotherplayermp.prevPosZ = entityotherplayermp.lastTickPosZ = (double)(entityotherplayermp.serverPosZ = packetIn.getZ()); + int i = packetIn.getCurrentItemID(); - if (i == 0) - { - entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = null; - } - else - { - entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = new ItemStack(Item.getItemById(i), 1, 0); - } + if (i == 0) + { + entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = null; + } + else + { + entityotherplayermp.inventory.mainInventory[entityotherplayermp.inventory.currentItem] = new ItemStack(Item.getItemById(i), 1, 0); + } - entityotherplayermp.setPositionAndRotation(d0, d1, d2, f, f1); - this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entityotherplayermp); - List list = packetIn.func_148944_c(); + entityotherplayermp.setPositionAndRotation(d0, d1, d2, f, f1); + this.clientWorldController.addEntityToWorld(packetIn.getEntityID(), entityotherplayermp); + List list = packetIn.func_148944_c(); - if (list != null) - { - entityotherplayermp.getDataWatcher().updateWatchedObjectsFromList(list); - } + if (list != null) + { + entityotherplayermp.getDataWatcher().updateWatchedObjectsFromList(list); + } + } catch (Exception ignored) {} } /** diff --git a/src/minecraft/net/minecraft/client/network/OldServerPinger.java b/src/minecraft/net/minecraft/client/network/OldServerPinger.java index 30deb9e1..1c6dce8b 100644 --- a/src/minecraft/net/minecraft/client/network/OldServerPinger.java +++ b/src/minecraft/net/minecraft/client/network/OldServerPinger.java @@ -137,7 +137,7 @@ public void handleServerInfo(S00PacketServerInfo packetIn) } else { - OldServerPinger.logger.error("Invalid server icon (unknown format)"); + if (!s.equals("")) OldServerPinger.logger.error("Invalid server icon (unknown format)"); } } else diff --git a/src/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java b/src/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java index 3f69427d..791daef9 100644 --- a/src/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java +++ b/src/minecraft/net/minecraft/client/renderer/BlockModelRenderer.java @@ -65,7 +65,8 @@ public boolean renderModel(IBlockAccess blockAccessIn, IBakedModel modelIn, IBlo RenderEnv renderenv = worldRendererIn.getRenderEnv(blockStateIn, blockPosIn); modelIn = BlockModelCustomizer.getRenderModel(modelIn, blockStateIn, renderenv); - boolean flag1 = flag ? this.renderModelSmooth(blockAccessIn, modelIn, blockStateIn, blockPosIn, worldRendererIn, checkSides) : this.renderModelFlat(blockAccessIn, modelIn, blockStateIn, blockPosIn, worldRendererIn, checkSides); + final XRay xRay = (XRay) KevinClient.moduleManager.getModule("XRay"); + boolean flag1 = (xRay.getState()&&xRay.getMode().get().equalsIgnoreCase("Translucent")) ? this.renderModelSmooth(blockAccessIn, modelIn, blockStateIn, blockPosIn, worldRendererIn, checkSides) : (flag ? this.renderModelSmooth(blockAccessIn, modelIn, blockStateIn, blockPosIn, worldRendererIn, checkSides) : this.renderModelFlat(blockAccessIn, modelIn, blockStateIn, blockPosIn, worldRendererIn, checkSides)); if (flag1) { diff --git a/src/minecraft/net/minecraft/client/renderer/WorldRenderer.java b/src/minecraft/net/minecraft/client/renderer/WorldRenderer.java index 4605612a..ad12c8f5 100644 --- a/src/minecraft/net/minecraft/client/renderer/WorldRenderer.java +++ b/src/minecraft/net/minecraft/client/renderer/WorldRenderer.java @@ -9,6 +9,9 @@ import java.util.Arrays; import java.util.BitSet; import java.util.Comparator; + +import kevin.main.KevinClient; +import kevin.module.modules.render.XRay; import net.minecraft.block.state.IBlockState; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; @@ -439,21 +442,35 @@ public void putColorMultiplier(float red, float green, float blue, int p_178978_ { j = this.rawIntBuffer.get(i); + int iR; + int iG; + int iB; + if (ByteOrder.nativeOrder() == ByteOrder.LITTLE_ENDIAN) { - int k = (int)((float)(j & 255) * red); - int l = (int)((float)(j >> 8 & 255) * green); - int i1 = (int)((float)(j >> 16 & 255) * blue); + iR = (int)((float)(j & 255) * red); + iG = (int)((float)(j >> 8 & 255) * green); + iB = (int)((float)(j >> 16 & 255) * blue); j = j & -16777216; - j = j | i1 << 16 | l << 8 | k; + j = j | iB << 16 | iG << 8 | iR; } else { - int j1 = (int)((float)(j >> 24 & 255) * red); - int k1 = (int)((float)(j >> 16 & 255) * green); - int l1 = (int)((float)(j >> 8 & 255) * blue); + iR = (int)((float)(j >> 24 & 255) * red); + iG = (int)((float)(j >> 16 & 255) * green); + iB = (int)((float)(j >> 8 & 255) * blue); j = j & 255; - j = j | j1 << 24 | k1 << 16 | l1 << 8; + j = j | iR << 24 | iG << 16 | iB << 8; + } + + final XRay xRay = (XRay) KevinClient.moduleManager.getModule("XRay"); + if (xRay.getState()&&xRay.getMode().get().equalsIgnoreCase("Translucent")) { + int color = 0; + color |= xRay.getOpacity().get() << 24; + color |= iR << 16; + color |= iG << 8; + color |= iB; + j = color; } } diff --git a/src/minecraft/net/minecraft/client/renderer/chunk/VisGraph.java b/src/minecraft/net/minecraft/client/renderer/chunk/VisGraph.java index 16d6705b..52925abb 100644 --- a/src/minecraft/net/minecraft/client/renderer/chunk/VisGraph.java +++ b/src/minecraft/net/minecraft/client/renderer/chunk/VisGraph.java @@ -24,7 +24,8 @@ public class VisGraph public void func_178606_a(BlockPos pos) { XRay xRay = (XRay) KevinClient.moduleManager.getModule("XRay"); - if (xRay.getState()&&xRay.getMode().get().equalsIgnoreCase("Simple")) return; + if (xRay.getState()) + return; this.field_178612_d.set(getIndex(pos), true); --this.field_178611_f; @@ -44,6 +45,12 @@ public SetVisibility computeVisibility() { SetVisibility setvisibility = new SetVisibility(); + final XRay xRay = (XRay) KevinClient.moduleManager.getModule("XRay"); + if (xRay.getState()&&xRay.getMode().get().equalsIgnoreCase("Translucent")) { + setvisibility.setAllVisible(true); + return setvisibility; + } + if (4096 - this.field_178611_f < 256) { setvisibility.setAllVisible(true);