diff --git a/src/minecraft/kevin/command/CommandManager.kt b/src/minecraft/kevin/command/CommandManager.kt index 71b37455..8f99ca8b 100644 --- a/src/minecraft/kevin/command/CommandManager.kt +++ b/src/minecraft/kevin/command/CommandManager.kt @@ -42,6 +42,10 @@ class CommandManager { commands[arrayOf("ReloadScripts","ReloadScript")] = ScriptManager commands[arrayOf("Admin")] = AdminDetector + + commands[arrayOf("DisableAllModule")] = DisableAllCommand() + + commands[arrayOf("ClearMainConfig")] = ClearMainConfigCommand() } fun execCommand(message: String): Boolean{ diff --git a/src/minecraft/kevin/command/commands/ClearMainConfigCommand.kt b/src/minecraft/kevin/command/commands/ClearMainConfigCommand.kt new file mode 100644 index 00000000..18770801 --- /dev/null +++ b/src/minecraft/kevin/command/commands/ClearMainConfigCommand.kt @@ -0,0 +1,18 @@ +package kevin.command.commands + +import kevin.command.ICommand +import kevin.main.KevinClient +import kevin.script.ScriptManager +import kevin.utils.ChatUtils + +class ClearMainConfigCommand : ICommand { + override fun run(args: Array?) { + KevinClient.moduleManager.getModules().forEach { KevinClient.eventManager.unregisterListener(it) } + KevinClient.eventManager.unregisterListener(KevinClient.moduleManager) + KevinClient.moduleManager.getModules().clear() + KevinClient.moduleManager.load() + ScriptManager.reAdd() + KevinClient.fileManager.saveConfig(KevinClient.fileManager.modulesConfig) + ChatUtils.messageWithStart("§aCleared main config.") + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/command/commands/DisableAllCommand.kt b/src/minecraft/kevin/command/commands/DisableAllCommand.kt new file mode 100644 index 00000000..264c1427 --- /dev/null +++ b/src/minecraft/kevin/command/commands/DisableAllCommand.kt @@ -0,0 +1,12 @@ +package kevin.command.commands + +import kevin.command.ICommand +import kevin.main.KevinClient +import kevin.utils.ChatUtils + +class DisableAllCommand : ICommand { + override fun run(args: Array?) { + KevinClient.moduleManager.getModules().forEach { it.state = false } + ChatUtils.messageWithStart("§aDisabled all modules.") + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/command/commands/HelpCommand.kt b/src/minecraft/kevin/command/commands/HelpCommand.kt index c4efb52a..6750bef6 100644 --- a/src/minecraft/kevin/command/commands/HelpCommand.kt +++ b/src/minecraft/kevin/command/commands/HelpCommand.kt @@ -21,6 +21,8 @@ class HelpCommand : ICommand { ChatUtils.message("§a.AutoDisableSet §9Add/Remove a module to AutoDisable List.") ChatUtils.message("§a.reloadScripts §9Reload Scripts.") ChatUtils.message("§a.reloadScript §9Reload Scripts.") - ChatUtils.message("§a.Admin Add admin name to detect list.") + ChatUtils.message("§a.Admin §9Add admin name to detect list.") + ChatUtils.message("§a.DisableAllModule §9Disable all modules.") + ChatUtils.message("§a.ClearMainConfig §9Clear main config.") } } \ No newline at end of file diff --git a/src/minecraft/kevin/file/ConfigManager.kt b/src/minecraft/kevin/file/ConfigManager.kt index fe882c49..35ed4709 100644 --- a/src/minecraft/kevin/file/ConfigManager.kt +++ b/src/minecraft/kevin/file/ConfigManager.kt @@ -85,7 +85,7 @@ object ConfigManager { 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) else warns["$key-$moduleValue"] = "The config file does not have a value for this option." + if (element != null) moduleValue.fromJson(element) else warns["$key-${moduleValue.name}"] = "The config file does not have a value for this option." } } else warns[key] = "Module does not exist." } diff --git a/src/minecraft/kevin/file/ImageManager.kt b/src/minecraft/kevin/file/ImageManager.kt index 17d715a7..044bd88e 100644 --- a/src/minecraft/kevin/file/ImageManager.kt +++ b/src/minecraft/kevin/file/ImageManager.kt @@ -4,6 +4,8 @@ import com.google.gson.JsonObject import com.google.gson.JsonParser import kevin.main.KevinClient import net.minecraft.client.Minecraft +import net.minecraft.client.renderer.texture.DynamicTexture +import net.minecraft.util.ResourceLocation import org.apache.commons.io.IOUtils import java.awt.image.BufferedImage import java.io.* @@ -13,7 +15,28 @@ import javax.imageio.ImageIO object ImageManager { var saveServerIcon = false private val jsonFile = File(KevinClient.fileManager.serverIconsDir,"config.json") + //load some textures + val resourceShadow1 = ResourceLocation("kevin/shadows/PanelBottom.png") + val resourceShadow2 = ResourceLocation("kevin/shadows/PanelBottomLeft.png") + val resourceShadow3 = ResourceLocation("kevin/shadows/PanelBottomRight.png") + val resourceShadow4 = ResourceLocation("kevin/shadows/PanelLeft.png") + val resourceShadow5 = ResourceLocation("kevin/shadows/PanelRight.png") + val resourceShadow6 = ResourceLocation("kevin/shadows/PanelTop.png") + val resourceShadow7 = ResourceLocation("kevin/shadows/PanelTopLeft.png") + val resourceShadow8 = ResourceLocation("kevin/shadows/PanelTopRight.png") + fun load(){ + val mc = Minecraft.getMinecraft() + mc.addScheduledTask{ + mc.textureManager.loadTexture(resourceShadow1, DynamicTexture(ImageIO.read(javaClass.getResourceAsStream("/resources/shadows/PanelBottom.png")))) + mc.textureManager.loadTexture(resourceShadow2, DynamicTexture(ImageIO.read(javaClass.getResourceAsStream("/resources/shadows/PanelBottomLeft.png")))) + mc.textureManager.loadTexture(resourceShadow3, DynamicTexture(ImageIO.read(javaClass.getResourceAsStream("/resources/shadows/PanelBottomRight.png")))) + mc.textureManager.loadTexture(resourceShadow4, DynamicTexture(ImageIO.read(javaClass.getResourceAsStream("/resources/shadows/PanelLeft.png")))) + mc.textureManager.loadTexture(resourceShadow5, DynamicTexture(ImageIO.read(javaClass.getResourceAsStream("/resources/shadows/PanelRight.png")))) + mc.textureManager.loadTexture(resourceShadow6, DynamicTexture(ImageIO.read(javaClass.getResourceAsStream("/resources/shadows/PanelTop.png")))) + mc.textureManager.loadTexture(resourceShadow7, DynamicTexture(ImageIO.read(javaClass.getResourceAsStream("/resources/shadows/PanelTopLeft.png")))) + mc.textureManager.loadTexture(resourceShadow8, DynamicTexture(ImageIO.read(javaClass.getResourceAsStream("/resources/shadows/PanelTopRight.png")))) + } if (!jsonFile.exists()) return val json = JsonParser().parse(IOUtils.toString(FileInputStream(jsonFile),"utf-8")).asJsonObject if (json.has("state")){ diff --git a/src/minecraft/kevin/hud/element/elements/Effects.kt b/src/minecraft/kevin/hud/element/elements/Effects.kt index 9e46c326..617d854d 100644 --- a/src/minecraft/kevin/hud/element/elements/Effects.kt +++ b/src/minecraft/kevin/hud/element/elements/Effects.kt @@ -1,61 +1,283 @@ package kevin.hud.element.elements +import kevin.altmanager.AltManager.drawTexturedModalRect 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.ListValue import kevin.utils.FontManager.AWTFontRenderer.Companion.assumeNonVolatile +import kevin.utils.RenderUtils +import net.minecraft.client.gui.inventory.GuiContainer +import net.minecraft.client.renderer.GlStateManager +import net.minecraft.client.renderer.OpenGlHelper import net.minecraft.client.resources.I18n import net.minecraft.potion.Potion +import org.lwjgl.opengl.GL11 +import org.lwjgl.opengl.GL11.GL_BLEND +import org.lwjgl.opengl.GL11.GL_DEPTH_TEST +import java.awt.Color @ElementInfo(name = "Effects") class Effects(x: Double = 5.0, y: Double = 50.0, scale: Float = 1F, side: Side = Side(Side.Horizontal.LEFT, Side.Vertical.MIDDLE)) : Element(x, y, scale, side) { + private val mode = ListValue("Mode", arrayOf("LiquidBounce", "Kevin-New", "Kevin-Shadow"), "LiquidBounce") + private val clientFont = BooleanValue("ClientFont", false) + private val timeColor = BooleanValue("TimeColor", true) + private val liquidColor = BooleanValue("LiquidColor", true) + private val progressBar = BooleanValue("ProgressBar", true) + private val amplifierNumberMode = ListValue("AmplifierNumberMode", arrayOf("Normal", "I-X+", "Number"), "I-X+") + + private val hashMap = HashMap,Boolean>>() + override fun drawElement(): Border { var y = 0F var width = 0F + var j = 0.0 + val l = 32.0 + val m = 35.0 + val i = 0.0 val fontRenderer = mc.fontRendererObj - assumeNonVolatile = true - - for (effect in mc.thePlayer!!.activePotionEffects) { - val potion = Potion.potionTypes[effect.potionID] - - val number = when { - effect.amplifier == 1 -> "II" - effect.amplifier == 2 -> "III" - effect.amplifier == 3 -> "IV" - effect.amplifier == 4 -> "V" - effect.amplifier == 5 -> "VI" - effect.amplifier == 6 -> "VII" - effect.amplifier == 7 -> "VIII" - effect.amplifier == 8 -> "IX" - effect.amplifier == 9 -> "X" - effect.amplifier > 10 -> "X+" - else -> "I" + val effects = mc.thePlayer.activePotionEffects + + return when (mode.get()) { + "LiquidBounce" -> { + assumeNonVolatile = true + + for (effect in effects) { + val potion = Potion.potionTypes[effect.potionID] + + val number = if (amplifierNumberMode equal "Normal" || amplifierNumberMode equal "I-X+") when { + effect.amplifier == 1 -> "II" + effect.amplifier == 2 -> "III" + effect.amplifier == 3 -> "IV" + effect.amplifier == 4 -> "V" + effect.amplifier == 5 -> "VI" + effect.amplifier == 6 -> "VII" + effect.amplifier == 7 -> "VIII" + effect.amplifier == 8 -> "IX" + effect.amplifier == 9 -> "X" + effect.amplifier > 10 -> "X+" + else -> "I" + } else (effect.amplifier+1).toString() + + val color = if (timeColor.get()) if (Potion.getDurationString(effect) == "**:**") "§9" + else if (Potion.getDurationString(effect).split(":")[1].toInt()<10 && Potion.getDurationString(effect).split(":")[0].toInt() == 0) "§c" + else if (Potion.getDurationString(effect).split(":")[0].toInt() == 0) "§e" + else "§a" else "§f" + + val name = "${I18n.format(potion.name)} $number §f: $color${Potion.getDurationString(effect)}" + + val liquidColor = if (liquidColor.get()) potion.liquidColor else Color.WHITE.rgb + + y += if (clientFont.get()) { + KevinClient.fontManager.font35!!.drawString(name, 0F, y, liquidColor, true) + KevinClient.fontManager.font35!!.fontHeight + } else { + fontRenderer.drawString(name, 0F, y, liquidColor, true) + fontRenderer.FONT_HEIGHT + } + + if (fontRenderer.getStringWidth(name).toFloat()>width) { width = fontRenderer.getStringWidth(name).toFloat() } + } + + assumeNonVolatile = false + + if (width == 0F) + width = 40F + + if (y == 0F) + y = -10F + + Border(width + 6F, -2F, -2F, y + 2F) } + "Kevin-New" -> { + if (effects.isNotEmpty()) { + hashMap.replaceAll { _,v -> v.first.first to v.first.second to false } + GL11.glPushMatrix() + for (effect in effects) { + RenderUtils.drawRectRoundedCorners(i, j, i + 140.0, j + 30.0, 5.0, Color(192, 192, 192, 128)) + val percent = + if (hashMap[effect.potionID] == null || hashMap[effect.potionID]!!.first.first < effect.duration || (!hashMap[effect.potionID]!!.first.second && effect.isPotionDurationMax)) { + hashMap[effect.potionID] = effect.duration to effect.isPotionDurationMax to true + 1.0 + } else { + val value = hashMap[effect.potionID]!! + hashMap[effect.potionID] = value.first.first to value.first.second to true + if (value.first.second) 1.0 else effect.duration.toDouble() / value.first.first.toDouble() * 1.0 + } + if (progressBar.get()) { + RenderUtils.drawRectRoundedCorners(i, j, i + (140.0*percent), j + 30.0, 5.0, if (timeColor.get()) if(percent > 0.5) Color(0, 192, 0, 128) else if (percent > 0.25) Color(192, 192, 0, 128) else Color(192, 0, 0, 128) else Color(114, 114, 114, 128)) + } + RenderUtils.drawBorderRoundedCorners(i, j, i + 140.0, j + 30.0, 5.0, 3F, Color(50, 50, 50, 128)) + j += l + } + GL11.glPopMatrix() + hashMap.filter { !it.value.second }.forEach { (t, _) -> hashMap.remove(t) } + j = 0.0 + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f) + GlStateManager.disableLighting() + for (effect in effects) { + val potion = Potion.potionTypes[effect.potionID] - val color = if (Potion.getDurationString(effect) == "**:**") "§9" - else if (Potion.getDurationString(effect).split(":")[1].toInt()<10 && Potion.getDurationString(effect).split(":")[0].toInt() == 0) "§c" - else if (Potion.getDurationString(effect).split(":")[0].toInt() == 0) "§e" - else "§a" + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f) + mc.textureManager.bindTexture(GuiContainer.inventoryBackground) - val name = "${I18n.format(potion.name)} $number §f: $color${Potion.getDurationString(effect)}" + if (potion.hasStatusIcon()) { + val i1 = potion.statusIconIndex + drawTexturedModalRect((i + 6F).toFloat(), (j + 7F).toFloat(), 0 + i1 % 8 * 18, 198 + i1 / 8 * 18, 18, 18) + } - fontRenderer.drawString(name, width, y, potion.liquidColor, true) - y += fontRenderer.FONT_HEIGHT - } + var s1 = I18n.format(potion.name) + + if (amplifierNumberMode equal "Normal") when (effect.amplifier) { + 1 -> s1 = "$s1 " + I18n.format("enchantment.level.2") + 2 -> s1 = "$s1 " + I18n.format("enchantment.level.3") + 3 -> s1 = "$s1 " + I18n.format("enchantment.level.4") + } else if (amplifierNumberMode equal "I-X+") { + s1 = "$s1 " + when { + effect.amplifier == 1 -> "II" + effect.amplifier == 2 -> "III" + effect.amplifier == 3 -> "IV" + effect.amplifier == 4 -> "V" + effect.amplifier == 5 -> "VI" + effect.amplifier == 6 -> "VII" + effect.amplifier == 7 -> "VIII" + effect.amplifier == 8 -> "IX" + effect.amplifier == 9 -> "X" + effect.amplifier > 10 -> "X+" + else -> "I" + } + } else { + s1 = "$s1 " + (effect.amplifier+1).toString() + } - assumeNonVolatile = false + fontRenderer.drawStringWithShadow( + s1, + (i + 10 + 18).toFloat(), + (j + 6).toFloat(), + if (liquidColor.get()) potion.liquidColor else 16777215 + ) + val s = Potion.getDurationString(effect) + if (clientFont.get()) + KevinClient.fontManager.font35!!.drawStringWithShadow( + s, + (i + 10 + 18).toFloat(), + (j + 6 + 10).toFloat(), + 8355711 + ) + else + fontRenderer.drawStringWithShadow( + s, + (i + 10 + 18).toFloat(), + (j + 6 + 10).toFloat(), + 8355711 + ) + j += l + } + } else hashMap.clear() + Border(-2F, -2F, 142F, j.toFloat()) + } + "Kevin-Shadow" -> { + if (effects.isNotEmpty()) { + hashMap.replaceAll { _,v -> v.first.first to v.first.second to false } + for (effect in effects) { + val percent = + if (hashMap[effect.potionID] == null || hashMap[effect.potionID]!!.first.first < effect.duration || (!hashMap[effect.potionID]!!.first.second && effect.isPotionDurationMax)) { + hashMap[effect.potionID] = effect.duration to effect.isPotionDurationMax to true + 1.0 + } else { + val value = hashMap[effect.potionID]!! + hashMap[effect.potionID] = value.first.first to value.first.second to true + if (value.first.second) 1.0 else effect.duration.toDouble() / value.first.first.toDouble() * 1.0 + } + if (progressBar.get()) { + RenderUtils.drawRect(i, j, i + (140.0*percent), j + 30.0, (if (timeColor.get()) if(percent > 0.5) Color(0, 192, 0, 128) else if (percent > 0.25) Color(192, 192, 0, 128) else Color(192, 0, 0, 128) else Color(50, 50, 50, 128)).rgb) + } + RenderUtils.drawShadow(i.toFloat(), j.toFloat(), 140F, 30F) + j += m + } + hashMap.filter { !it.value.second }.forEach { (t, _) -> hashMap.remove(t) } + j = 0.0 + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f) + GlStateManager.disableLighting() + for (effect in effects) { + val potion = Potion.potionTypes[effect.potionID] + + GlStateManager.color(1.0f, 1.0f, 1.0f, 1.0f) + mc.textureManager.bindTexture(GuiContainer.inventoryBackground) + + if (potion.hasStatusIcon()) { + GlStateManager.pushMatrix() + GL11.glDisable(GL_DEPTH_TEST) + GL11.glEnable(GL_BLEND) + GL11.glDepthMask(false) + OpenGlHelper.glBlendFunc(770, 771, 1, 0) + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F) + val i1 = potion.statusIconIndex + drawTexturedModalRect((i + 6F).toFloat(), (j + 7F).toFloat(), 0 + i1 % 8 * 18, 198 + i1 / 8 * 18, 18, 18) + GL11.glDepthMask(true) + GL11.glDisable(GL_BLEND) + GL11.glEnable(GL_DEPTH_TEST) + GlStateManager.popMatrix() + } - if (width == 0F) - width = 40F + var s1 = I18n.format(potion.name) - if (y == 0F) - y = -10F + if (amplifierNumberMode equal "Normal") when (effect.amplifier) { + 1 -> s1 = "$s1 " + I18n.format("enchantment.level.2") + 2 -> s1 = "$s1 " + I18n.format("enchantment.level.3") + 3 -> s1 = "$s1 " + I18n.format("enchantment.level.4") + } else if (amplifierNumberMode equal "I-X+") { + s1 = "$s1 " + when { + effect.amplifier == 1 -> "II" + effect.amplifier == 2 -> "III" + effect.amplifier == 3 -> "IV" + effect.amplifier == 4 -> "V" + effect.amplifier == 5 -> "VI" + effect.amplifier == 6 -> "VII" + effect.amplifier == 7 -> "VIII" + effect.amplifier == 8 -> "IX" + effect.amplifier == 9 -> "X" + effect.amplifier > 10 -> "X+" + else -> "I" + } + } else { + s1 = "$s1 " + (effect.amplifier+1).toString() + } - return Border(2F, fontRenderer.FONT_HEIGHT.toFloat(), -width - 2F, y + fontRenderer.FONT_HEIGHT - 2F) + fontRenderer.drawStringWithShadow( + s1, + (i + 10 + 18).toFloat(), + (j + 6).toFloat(), + if (liquidColor.get()) potion.liquidColor else 16777215 + ) + val s = Potion.getDurationString(effect) + if (clientFont.get()) + KevinClient.fontManager.font35!!.drawStringWithShadow( + s, + (i + 10 + 18).toFloat(), + (j + 6 + 10).toFloat(), + 8355711 + ) + else + fontRenderer.drawStringWithShadow( + s, + (i + 10 + 18).toFloat(), + (j + 6 + 10).toFloat(), + 8355711 + ) + j += m + } + } else hashMap.clear() + Border(-2F, -2F, 142F, j.toFloat()-3F) + } + else -> Border(6F, -6F, -6F, 6F) + } } } \ 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 77afd5e5..465448c2 100644 --- a/src/minecraft/kevin/hud/element/elements/TargetHUD.kt +++ b/src/minecraft/kevin/hud/element/elements/TargetHUD.kt @@ -38,7 +38,7 @@ class TargetHUD : Element() { private var lastTarget: Entity? = null override fun drawElement(): Border? { - val target = (KevinClient.moduleManager.getModule("KillAura") as KillAura).target + val target = (KevinClient.moduleManager.getModule("KillAura") as KillAura).target ?: (KevinClient.moduleManager.getModule("KillAura") as KillAura).sTarget when(mode.get()){ "Liquid" -> { if ((target) is EntityPlayer) { diff --git a/src/minecraft/kevin/main/KevinClient.kt b/src/minecraft/kevin/main/KevinClient.kt index 6de535e7..5cce776e 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 = "b2.0" + var version = "b2.1" var isStarting = true diff --git a/src/minecraft/kevin/module/ModuleManager.kt b/src/minecraft/kevin/module/ModuleManager.kt index e891efb0..f9d89463 100644 --- a/src/minecraft/kevin/module/ModuleManager.kt +++ b/src/minecraft/kevin/module/ModuleManager.kt @@ -33,6 +33,7 @@ class ModuleManager : Listenable { AutoWeapon(), BowAura(), Criticals(), + FastBow(), HitBox(), KillAura(), SuperKnockback(), @@ -74,6 +75,7 @@ class ModuleManager : Listenable { HideAndSeekHack, KillerDetector(), NameProtect(), + NoCommand, NoRotateSet(), NoScoreboard, ResourcePackSpoof(), diff --git a/src/minecraft/kevin/module/modules/combat/AntiKnockback.kt b/src/minecraft/kevin/module/modules/combat/AntiKnockback.kt index e2f0adc6..83288363 100644 --- a/src/minecraft/kevin/module/modules/combat/AntiKnockback.kt +++ b/src/minecraft/kevin/module/modules/combat/AntiKnockback.kt @@ -16,10 +16,10 @@ import kotlin.math.cos import kotlin.math.sin class AntiKnockback : Module("AntiKnockback","Allows you to modify the amount of knockback you take.", category = ModuleCategory.COMBAT) { - private val horizontalValue = FloatValue("Horizontal", 0F, 0F, 1F) - private val verticalValue = FloatValue("Vertical", 0F, 0F, 1F) + private val horizontalValue = FloatValue("Horizontal", 0F, -1F, 1F) + private val verticalValue = FloatValue("Vertical", 0F, -1F, 1F) private val modeValue = ListValue("Mode", arrayOf("Simple", "AAC", "AACPush", "AACZero", "AACv4", - "Reverse", "SmoothReverse", "Jump", "Glitch", "AAC5Packet"), "Simple") + "Reverse", "SmoothReverse", "Jump", "Glitch", "AAC5Packet", "MatrixReduce", "MatrixSimple", "MatrixReverse"), "Simple") // Reverse private val reverseStrengthValue = FloatValue("ReverseStrength", 1F, 0.1F, 1F) @@ -157,6 +157,24 @@ class AntiKnockback : Module("AntiKnockback","Allows you to modify the amount of thePlayer.onGround = true } else velocityInput = false + "matrixreduce" -> { + if (mc.thePlayer.hurtTime > 0) { + if (mc.thePlayer.onGround) { + if (mc.thePlayer.hurtTime <= 6) { + mc.thePlayer.motionX *= 0.70 + mc.thePlayer.motionZ *= 0.70 + } + if (mc.thePlayer.hurtTime <= 5) { + mc.thePlayer.motionX *= 0.80 + mc.thePlayer.motionZ *= 0.80 + } + } else if (mc.thePlayer.hurtTime <= 10) { + mc.thePlayer.motionX *= 0.60 + mc.thePlayer.motionZ *= 0.60 + } + } + } + } } @@ -167,17 +185,17 @@ class AntiKnockback : Module("AntiKnockback","Allows you to modify the amount of val packet = event.packet if (packet is S12PacketEntityVelocity) { - val packetEntityVelocity = packet - - if ((mc.theWorld?.getEntityByID(packetEntityVelocity.entityID) ?: return) != thePlayer) + if ((mc.theWorld?.getEntityByID(packet.entityID) ?: return) != thePlayer) return velocityTimer.reset() when (modeValue.get().toLowerCase()) { "simple" -> { - if (explosion && explosionCheck.get()) {explosion=false;return} + if (explosion && explosionCheck.get()) { + explosion = false;return + } val horizontal = horizontalValue.get() val vertical = verticalValue.get() @@ -185,9 +203,9 @@ class AntiKnockback : Module("AntiKnockback","Allows you to modify the amount of if (horizontal == 0F && vertical == 0F) event.cancelEvent() - packetEntityVelocity.motionX = (packetEntityVelocity.motionX * horizontal).toInt() - packetEntityVelocity.motionY = (packetEntityVelocity.motionY * vertical).toInt() - packetEntityVelocity.motionZ = (packetEntityVelocity.motionZ * horizontal).toInt() + packet.motionX = (packet.motionX * horizontal).toInt() + packet.motionY = (packet.motionY * vertical).toInt() + packet.motionZ = (packet.motionZ * horizontal).toInt() } "aac", "reverse", "smoothreverse", "aaczero" -> velocityInput = true @@ -206,6 +224,20 @@ class AntiKnockback : Module("AntiKnockback","Allows you to modify the amount of velocityInput = true event.cancelEvent() } + + "matrixsimple" -> { + packet.motionX = (packet.motionX * 0.36).toInt() + packet.motionZ = (packet.motionZ * 0.36).toInt() + if (mc.thePlayer.onGround) { + packet.motionX = (packet.motionX * 0.9).toInt() + packet.motionZ = (packet.motionZ * 0.9).toInt() + } + } + + "matrixreverse" -> { + packet.motionX = (packet.motionX * -0.3).toInt() + packet.motionZ = (packet.motionZ * -0.3).toInt() + } } } else if (packet is S27PacketExplosion) { if (packet.func_149149_c() != 0F || diff --git a/src/minecraft/kevin/module/modules/combat/FastBow.kt b/src/minecraft/kevin/module/modules/combat/FastBow.kt new file mode 100644 index 00000000..df849d8d --- /dev/null +++ b/src/minecraft/kevin/module/modules/combat/FastBow.kt @@ -0,0 +1,47 @@ +package kevin.module.modules.combat + +import kevin.event.EventTarget +import kevin.event.UpdateEvent +import kevin.module.IntegerValue +import kevin.module.Module +import kevin.module.ModuleCategory +import kevin.utils.RotationUtils +import net.minecraft.item.ItemBow +import net.minecraft.network.play.client.C03PacketPlayer +import net.minecraft.network.play.client.C07PacketPlayerDigging +import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement +import net.minecraft.util.BlockPos +import net.minecraft.util.EnumFacing + +class FastBow : Module("FastBow", "Allows you to use bow faster.", category = ModuleCategory.COMBAT) { + private val packetsValue = IntegerValue("Packets", 20, 3, 20) + @EventTarget + fun onUpdate(event: UpdateEvent) { + if (!mc.thePlayer.isUsingItem) { + return + } + + val currentItem = mc.thePlayer.inventory.getCurrentItem() + + if (currentItem != null && (currentItem.item)is ItemBow) { + + mc.netHandler.addToSendQueue(C08PacketPlayerBlockPlacement(BlockPos.ORIGIN, 255, currentItem, 0F, 0F, 0F)) + + val yaw = if (RotationUtils.targetRotation != null) + RotationUtils.targetRotation.yaw + else + mc.thePlayer.rotationYaw + + val pitch = if (RotationUtils.targetRotation != null) + RotationUtils.targetRotation.pitch + else + mc.thePlayer.rotationPitch + + for (i in 0 until packetsValue.get()) + mc.netHandler.addToSendQueue(C03PacketPlayer.C05PacketPlayerLook(yaw, pitch, true)) + + mc.netHandler.addToSendQueue(C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN)) + mc.thePlayer.itemInUseCount = currentItem.maxItemUseDuration - 1 + } + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/combat/KillAura.kt b/src/minecraft/kevin/module/modules/combat/KillAura.kt index b6d14e23..25ef73c0 100644 --- a/src/minecraft/kevin/module/modules/combat/KillAura.kt +++ b/src/minecraft/kevin/module/modules/combat/KillAura.kt @@ -7,6 +7,8 @@ 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.module.modules.movement.Fly +import kevin.module.modules.world.Scaffold import kevin.utils.* import net.minecraft.client.gui.inventory.GuiContainer import net.minecraft.enchantment.EnchantmentHelper @@ -65,10 +67,18 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", // Bypass private val swingValue = BooleanValue("Swing", true) private val keepSprintValue = BooleanValue("KeepSprint", true) + private val scaffoldCheck = BooleanValue("ScaffoldCheck", true) + + //Timing + private val attackTimingValue = ListValue("AttackTiming", arrayOf("Pre", "Post", "Update", "Pre&Post", "Update&Pre", "Update&Post", "Update&Pre&Post"), "Update") + private val extraBlockTimingValue // vanilla will send block packet at pre + = ListValue("ExtraBlockTiming", arrayOf("NoExtra", "Pre", "Post", "Update", "Pre&Post", "Update&Pre", "Update&Post", "Update&Pre&Post"), "NoExtra") + private val afterTickTimingValue = ListValue("AfterTickBlockTiming", arrayOf("Pre", "Post", "Both"), "Post") // AutoBlock private val autoBlockValue = ListValue("AutoBlock", arrayOf("Off", "Packet", "AfterTick", "Keep"), "Packet") private val interactAutoBlockValue = BooleanValue("InteractAutoBlock", true) + private val blockStatusCheck = BooleanValue("BlockStatusCheck", true) private val blockRate = IntegerValue("BlockRate", 100, 1, 100) // Raycast @@ -133,10 +143,12 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", */ // Target + var sTarget: Entity? = null var target: Entity? = null private var currentTarget: Entity? = null private var hitable = false private val prevTargetEntities = mutableListOf() + private val discoveredTargets = mutableListOf() // Attack delay private val attackTimer = MSTimer() @@ -168,31 +180,62 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", */ override fun onDisable() { target = null + sTarget = null currentTarget = null hitable = false prevTargetEntities.clear() + discoveredTargets.clear() attackTimer.reset() clicks = 0 stopBlocking() } + private val afterTick + get() = autoBlockValue equal "AfterTick" + /** * Motion event */ @EventTarget fun onMotion(event: MotionEvent) { + if (afterTick&&( + afterTickTimingValue equal "Both" || + (afterTickTimingValue equal "Pre" && event.eventState == EventState.PRE) || + (afterTickTimingValue equal "Post" && event.eventState == EventState.POST) + )) { + if (target != null && currentTarget != null) { + updateHitable() + if(canBlock) + startBlocking(currentTarget!!, hitable) + } + } + + if (attackTimingValue equal "Update&Pre&Post" || attackTimingValue equal "Pre&Post" || + ((attackTimingValue equal "Pre" || attackTimingValue equal "Update&Pre") && event.eventState == EventState.PRE) || + ((attackTimingValue equal "Post" || attackTimingValue equal "Update&Post") && event.eventState == EventState.POST) + ) { + runAttackLoop() + } + + if (!afterTick&&(extraBlockTimingValue equal "Update&Pre&Post" || extraBlockTimingValue equal "Pre&Post" || + ((extraBlockTimingValue equal "Pre" || extraBlockTimingValue equal "Update&Pre") && event.eventState == EventState.PRE) || + ((extraBlockTimingValue equal "Post" || extraBlockTimingValue equal "Update&Post") && event.eventState == EventState.POST) + )) { + runBlock() + } + if (event.eventState == EventState.POST) { target ?: return currentTarget ?: return // Update hitable updateHitable() - +/* // AutoBlock if (autoBlockValue.get().equals("AfterTick", true) && canBlock) startBlocking(currentTarget!!, hitable) - +*/ return } @@ -266,8 +309,10 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", // Target currentTarget = target - if (!targetModeValue.get().equals("Switch", ignoreCase = true) && isEnemy(currentTarget)) + if (!targetModeValue.get().equals("Switch", ignoreCase = true) && isEnemy(currentTarget)) { target = currentTarget + sTarget = currentTarget + } } @EventTarget(ignoreCondition = true) @@ -305,21 +350,31 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", if (cancelRun) { target = null + sTarget = null currentTarget = null hitable = false stopBlocking() + discoveredTargets.clear() return } if (noInventoryAttackValue.get() && ((mc.currentScreen)is GuiContainer || System.currentTimeMillis() - containerOpen < noInventoryDelayValue.get())) { target = null + sTarget = null currentTarget = null hitable = false if ((mc.currentScreen)is GuiContainer) containerOpen = System.currentTimeMillis() return } + if (attackTimingValue equal "Update&Pre&Post" || attackTimingValue equal "Update&Pre" || attackTimingValue equal "Update&Post" || attackTimingValue equal "Update") + runAttackLoop() + if (!afterTick&&(extraBlockTimingValue equal "Update&Pre&Post" || extraBlockTimingValue equal "Update&Pre" || extraBlockTimingValue equal "Update&Post" || extraBlockTimingValue equal "Update")) + runBlock() + } + + private fun runAttackLoop() { if (target != null && currentTarget != null) { while (clicks > 0) { runAttack() @@ -328,6 +383,22 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", } } + private fun runBlock() { + if (discoveredTargets.isNotEmpty() && canBlock) { + val target = this.target ?: discoveredTargets.first() + if (mc.thePlayer.getDistanceToEntityBox(target) <= rangeValue.get()) { + startBlocking( + target, + interactAutoBlockValue.get() && (mc.thePlayer.getDistanceToEntityBox(target) < maxRange) + ) + } else { + if (!mc.thePlayer.isBlocking) { + stopBlocking() + } + } + } + } + /** * Render event */ @@ -335,15 +406,18 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", fun onRender3D(event: Render3DEvent) { if (cancelRun) { target = null + sTarget = null currentTarget = null hitable = false stopBlocking() + discoveredTargets.clear() return } if (noInventoryAttackValue.get() && ((mc.currentScreen) is GuiContainer || System.currentTimeMillis() - containerOpen < noInventoryDelayValue.get())) { target = null + sTarget = null currentTarget = null hitable = false if ((mc.currentScreen) is GuiContainer) containerOpen = System.currentTimeMillis() @@ -439,6 +513,7 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", private fun updateTarget() { // Reset fixed target to null target = null + sTarget = null // Settings val hurtTime = hurtTimeValue.get() @@ -446,7 +521,7 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", val switchMode = targetModeValue.get().equals("Switch", ignoreCase = true) // Find possible targets - val targets = mutableListOf() + discoveredTargets.clear() val theWorld = mc.theWorld!! val thePlayer = mc.thePlayer!! @@ -459,25 +534,26 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", val entityFov = RotationUtils.getRotationDifference(entity) if (distance <= maxRange && (fov == 180F || entityFov <= fov) && (entity !is EntityLivingBase || entity.hurtTime <= hurtTime)) - targets.add(entity) + discoveredTargets.add(entity) } // Sort targets by priority when (priorityValue.get().toLowerCase()) { - "distance" -> targets.sortBy { thePlayer.getDistanceToEntityBox(it) } // Sort by distance - "health" -> targets.sortBy { if (it is EntityLivingBase) it.health else thePlayer.getDistanceToEntityBox(it).toFloat() } // Sort by health - "direction" -> targets.sortBy { RotationUtils.getRotationDifference(it) } // Sort by FOV - "livingtime" -> targets.sortBy { -it.ticksExisted } // Sort by existence + "distance" -> discoveredTargets.sortBy { thePlayer.getDistanceToEntityBox(it) } // Sort by distance + "health" -> discoveredTargets.sortBy { if (it is EntityLivingBase) it.health else thePlayer.getDistanceToEntityBox(it).toFloat() } // Sort by health + "direction" -> discoveredTargets.sortBy { RotationUtils.getRotationDifference(it) } // Sort by FOV + "livingtime" -> discoveredTargets.sortBy { -it.ticksExisted } // Sort by existence } // Find best target - for (entity in targets) { + for (entity in discoveredTargets) { // Update rotations to current target if (!updateRotations(entity)) // when failed then try another target continue // Set target to current entity target = entity + sTarget = entity return } @@ -566,7 +642,7 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", } // Start blocking after attack - if ((autoBlockValue.get().equals("Packet", true)||keepAutoBlock) && (thePlayer.isBlocking || canBlock)) + if ((autoBlockValue equal "Packet"||keepAutoBlock) && (thePlayer.isBlocking || canBlock)) startBlocking(entity, interactAutoBlockValue.get()) } @@ -643,6 +719,10 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", if (!(blockRate.get() > 0 && Random().nextInt(100) <= blockRate.get())) return + if (blockingStatus&&blockStatusCheck.get()) { + return + } + if (interact) { val positionEye = mc.renderViewEntity?.getPositionEyes(1F) @@ -690,6 +770,8 @@ class KillAura : Module("KillAura","Automatically attacks targets around you.", private val cancelRun: Boolean inline get() = mc.thePlayer!!.isSpectator || !isAlive(mc.thePlayer!!) || KevinClient.moduleManager.getModule("Blink")!!.state || KevinClient.moduleManager.getModule("FreeCam")!!.state || (KevinClient.moduleManager.getModule("TP")!!.state&&(KevinClient.moduleManager.getModule("TP") as TP).mode.get().equals("AAC",true)) + || (KevinClient.moduleManager.getModule("Fly")!!.state&&(KevinClient.moduleManager.getModule("Fly")!! as Fly).mode.get().equals("Vulcan",true)) + || (scaffoldCheck.get()&&KevinClient.moduleManager.getModule("Scaffold")!!.state) /** * Check if [entity] is alive diff --git a/src/minecraft/kevin/module/modules/exploit/Disabler.kt b/src/minecraft/kevin/module/modules/exploit/Disabler.kt index 98747f97..31d8ea86 100644 --- a/src/minecraft/kevin/module/modules/exploit/Disabler.kt +++ b/src/minecraft/kevin/module/modules/exploit/Disabler.kt @@ -23,7 +23,7 @@ import kotlin.math.roundToInt import kotlin.math.sqrt object Disabler : Module("Disabler","Disable some anti-cheat check.",category = ModuleCategory.EXPLOIT) { - val modeValue = ListValue("Mode",arrayOf("MineplexCombat","OldHypixel","VerusCombat","VerusMove","VerusRidingSpoof","Flying","Spectate","SpectateSpoof","SpectateSpoof2","VulcanGeyser","C13+InfiniteC0C","NoGroundTouch","NoGroundTouch2","MemetrixScaffold","FakeLag","RidingSpoof","Kauri","Basic"),"MinePlexCombat") + val modeValue = ListValue("Mode",arrayOf("MineplexCombat","OldHypixel","VerusCombat","VerusMove","VerusRidingSpoof","Flying","Spectate","SpectateSpoof","SpectateSpoof2","VulcanGeyser","C13+InfiniteC0C","NoGroundTouch","NoGroundTouch2","MemetrixScaffold","FakeLag","RidingSpoof","Kauri","Basic","LessFlag"),"MinePlexCombat") private val debug = BooleanValue("Debug", false) private val memeAACValue = BooleanValue("MemetrixWithAAC5", false) private val fakeLagPosValue = BooleanValue("FakeLagPosition", true) @@ -128,7 +128,7 @@ object Disabler : Module("Disabler","Disable some anti-cheat check.",category = @EventTarget fun onPacket(event: PacketEvent){ - val packet=event.packet + val packet = event.packet when(modeValue.get().lowercase()){ "mineplexcombat" -> { @@ -355,6 +355,31 @@ object Disabler : Module("Disabler","Disable some anti-cheat check.",category = PacketUtils.sendPacketNoEvent(C13PacketPlayerAbilities(mc.thePlayer.capabilities)) PacketUtils.sendPacketNoEvent(C0CPacketInput(Float.MAX_VALUE, Float.MAX_VALUE, false, false)) } + + "lessflag" -> { + if (packet is S08PacketPlayerPosLook) { + val x = packet.x - mc.thePlayer.posX + val y = packet.y - mc.thePlayer.posY + val z = packet.z - mc.thePlayer.posZ + val diff = sqrt(x * x + y * y + z * z) + if (diff <= 8) { + event.cancelEvent() + PacketUtils.sendPacketNoEvent( + C03PacketPlayer.C06PacketPlayerPosLook( + packet.x, + packet.y, + packet.z, + packet.getYaw(), + packet.getPitch(), + true + ) + ) + debugMessage("Flag Reduced") + } else { + debugMessage("Too Far Away") + } + } + } } } diff --git a/src/minecraft/kevin/module/modules/exploit/ForceUnicodeChat.kt b/src/minecraft/kevin/module/modules/exploit/ForceUnicodeChat.kt index 46848515..0a726e8b 100644 --- a/src/minecraft/kevin/module/modules/exploit/ForceUnicodeChat.kt +++ b/src/minecraft/kevin/module/modules/exploit/ForceUnicodeChat.kt @@ -9,7 +9,7 @@ import kevin.module.TextValue import net.minecraft.network.play.client.C01PacketChatMessage class ForceUnicodeChat : Module("ForceUnicodeChat", "Allows you to send unicode messages in chat.", category = ModuleCategory.EXPLOIT) { - private val mode = ListValue("Mode", arrayOf("All","Prefix","Prefix-In"),"Prefix") + private val mode = ListValue("Mode", arrayOf("All","Prefix","Infix"),"Prefix") private val prefix = TextValue("Prefix",",U") override val tag: String @@ -23,7 +23,7 @@ class ForceUnicodeChat : Module("ForceUnicodeChat", "Allows you to send unicode val prefixMode = mode.get().equals("Prefix",true) if (prefixMode && !message.startsWith(prefix.get())) return if (prefixMode) message = message.removePrefix(prefix.get()) - val prefixIn = mode.get().equals("Prefix-In",true) + val prefixIn = mode.get().equals("Infix",true) if (prefixIn && !message.contains(prefix.get())) return if (prefixIn){ val list = message.split(prefix.get()) diff --git a/src/minecraft/kevin/module/modules/exploit/Phase.kt b/src/minecraft/kevin/module/modules/exploit/Phase.kt index 5bd24744..f90ac4e8 100644 --- a/src/minecraft/kevin/module/modules/exploit/Phase.kt +++ b/src/minecraft/kevin/module/modules/exploit/Phase.kt @@ -6,25 +6,33 @@ import kevin.module.Module import kevin.module.ModuleCategory import kevin.utils.BlockUtils import kevin.utils.MovementUtils +import kevin.utils.PacketUtils import kevin.utils.TickTimer import net.minecraft.block.BlockAir -import net.minecraft.client.network.NetHandlerPlayClient import net.minecraft.network.play.client.C03PacketPlayer +import net.minecraft.network.play.server.S08PacketPlayerPosLook import net.minecraft.util.AxisAlignedBB import net.minecraft.util.BlockPos -import java.util.* import kotlin.math.cos import kotlin.math.sin +import kotlin.math.sqrt class Phase : Module("Phase", "Allows you to walk through blocks.", category = ModuleCategory.EXPLOIT) { - private val modeValue = ListValue("Mode", arrayOf("Vanilla", "Skip", "Spartan", "Clip", "AAC3.5.0", "Mineplex"), "Vanilla") + private val modeValue = ListValue("Mode", arrayOf("Vanilla", "Skip", "Spartan", "Clip", "AAC3.5.0", "Mineplex", "Matrix"), "Vanilla") private val tickTimer = TickTimer() private var mineplexClip = false private val mineplexTickTimer = TickTimer() + private var matrixClip = false + private val matrixTickTimer = TickTimer() + + override fun onDisable() { + mc.timer.timerSpeed = 1f + } + @EventTarget fun onUpdate(event: UpdateEvent) { @@ -34,7 +42,7 @@ class Phase : Module("Phase", "Allows you to walk through blocks.", category = M BlockUtils.collideBlockIntersects(mc.thePlayer.entityBoundingBox) { block -> (block)!is BlockAir } - if (isInsideBlock && !modeValue.get().equals("Mineplex",true)) { + if (isInsideBlock && !modeValue.get().equals("Mineplex",true) && !(modeValue equal "Matrix")) { mc.thePlayer.noClip = true mc.thePlayer.motionY = 0.0 mc.thePlayer.onGround = false @@ -142,7 +150,7 @@ class Phase : Module("Phase", "Allows you to walk through blocks.", category = M ) { block -> (block)!is BlockAir } && event.boundingBox != null && event.boundingBox!!.maxY > mc.thePlayer - .entityBoundingBox.minY && !modeValue.get().equals("Mineplex",true) + .entityBoundingBox.minY && !modeValue.get().equals("Mineplex",true) && !(modeValue equal "Matrix") ) { val axisAlignedBB = event.boundingBox ?: return event.boundingBox = ( @@ -168,6 +176,27 @@ class Phase : Module("Phase", "Allows you to walk through blocks.", category = M packet.z = (packet.z + cos(yaw) * 0.00000001) } } + if (modeValue equal "Matrix") { + if (packet is S08PacketPlayerPosLook) { + val x = packet.x - mc.thePlayer.posX + val y = packet.y - mc.thePlayer.posY + val z = packet.z - mc.thePlayer.posZ + val diff = sqrt(x * x + y * y + z * z) + if (diff <= 8) { + event.cancelEvent() + PacketUtils.sendPacketNoEvent( + C03PacketPlayer.C06PacketPlayerPosLook( + packet.x, + packet.y, + packet.z, + packet.getYaw(), + packet.getPitch(), + true + ) + ) + } + } + } } @EventTarget @@ -187,6 +216,25 @@ class Phase : Module("Phase", "Allows you to walk through blocks.", category = M mc.thePlayer.setPosition(mc.thePlayer.posX + -sin(direction) * offset, mc.thePlayer.posY, mc.thePlayer.posZ + cos(direction) * offset) } } + if (modeValue equal "Matrix") { + if (mc.thePlayer.isCollidedHorizontally) { + matrixClip = true + mc.timer.timerSpeed = 0.05f + } + if (!matrixClip) return + matrixTickTimer.update() + event.x = 0.0 + event.z = 0.0 + if (matrixTickTimer.hasTimePassed(4)) { + matrixTickTimer.reset() + matrixClip = false + mc.timer.timerSpeed = 1f + } else if (matrixTickTimer.hasTimePassed(2)) { + val offset = if (matrixTickTimer.hasTimePassed(3)) 1.6 else 0.06 + val direction: Double = MovementUtils.direction + mc.thePlayer.setPosition(mc.thePlayer.posX + -sin(direction) * offset, mc.thePlayer.posY, mc.thePlayer.posZ + cos(direction) * offset) + } + } } @EventTarget fun onPushOut(event: PushOutEvent) = event.cancelEvent() diff --git a/src/minecraft/kevin/module/modules/misc/AutoCommand.kt b/src/minecraft/kevin/module/modules/misc/AutoCommand.kt index 0775d833..a3488174 100644 --- a/src/minecraft/kevin/module/modules/misc/AutoCommand.kt +++ b/src/minecraft/kevin/module/modules/misc/AutoCommand.kt @@ -42,7 +42,7 @@ class AutoCommand : Module("AutoCommand","Send commands automatically.",category } override val tag: String - get() = "Auto ${if(autoJoin.get()) "Join" else ""} ${if(autoLoginValue.get()) "Login" else ""} ${if(autoRegisterValue.get()) "Register" else ""}" + get() = "Auto${if(autoJoin.get()) " Join" else ""}${if(autoLoginValue.get()) " Login" else ""}${if(autoRegisterValue.get()) " Register" else ""}" @EventTarget fun onPacket(event: PacketEvent){ diff --git a/src/minecraft/kevin/module/modules/misc/NoCommand.kt b/src/minecraft/kevin/module/modules/misc/NoCommand.kt new file mode 100644 index 00000000..350ff32c --- /dev/null +++ b/src/minecraft/kevin/module/modules/misc/NoCommand.kt @@ -0,0 +1,5 @@ +package kevin.module.modules.misc + +import kevin.module.Module + +object NoCommand : Module("NoCommand", "Disable client command.") \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/Fly.kt b/src/minecraft/kevin/module/modules/movement/Fly.kt index d16f8229..8cbe4616 100644 --- a/src/minecraft/kevin/module/modules/movement/Fly.kt +++ b/src/minecraft/kevin/module/modules/movement/Fly.kt @@ -5,13 +5,15 @@ 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.matrix.Matrix +import kevin.module.modules.movement.flys.matrix.NewMatrix +import kevin.module.modules.movement.flys.matrix.NewMatrixClip 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.module.modules.movement.flys.vulcan.Vulcan import kevin.utils.* import org.lwjgl.input.Keyboard import java.awt.Color @@ -23,10 +25,12 @@ class Fly : Module("Fly","Allow you fly", Keyboard.KEY_F,ModuleCategory.MOVEMENT AAC5, Teleport, VerusAuto, - //NCPNew, (未完成) NCPFly, OldNCP, - Matrix + Matrix, // from FDP + NewMatrix, // from FDP + NewMatrixClip, // from FDP + Vulcan // from FDP ) private val names: Array diff --git a/src/minecraft/kevin/module/modules/movement/HighJump.kt b/src/minecraft/kevin/module/modules/movement/HighJump.kt index 5b114f1b..5ff785c1 100644 --- a/src/minecraft/kevin/module/modules/movement/HighJump.kt +++ b/src/minecraft/kevin/module/modules/movement/HighJump.kt @@ -19,12 +19,12 @@ import kotlin.math.cos import kotlin.math.sin class HighJump : Module("HighJump", "Allows you to jump higher.", category = ModuleCategory.MOVEMENT) { - private val heightValue = FloatValue("Height", 2f, 1.1f, 5f) + private val heightValue = FloatValue("Height", 2f, 0.5f, 5f) private val modeValue = ListValue("Mode", arrayOf("Vanilla", "Damage", "AACv3", "DAC", "Mineplex", "Timer", "Matrix","MatrixWater"), "Vanilla") private val glassValue = BooleanValue("OnlyGlassPane", false) - private val timerValue = FloatValue("Timer",0.1f,0.01f,1f) - private val waitTimeValue = IntegerValue("WaitTime",1,0,5) - private val flyValue = BooleanValue("Fly",false) + private val timerValue = FloatValue("Timer-Timer",0.1f,0.01f,1f) + private val waitTimeValue = IntegerValue("Timer-WaitTime",1,0,5) + private val flyValue = BooleanValue("Timer-Glide",false) private var jumpState = 1 private var fly = false diff --git a/src/minecraft/kevin/module/modules/movement/InvMove.kt b/src/minecraft/kevin/module/modules/movement/InvMove.kt index 834b3f65..ea5c4936 100644 --- a/src/minecraft/kevin/module/modules/movement/InvMove.kt +++ b/src/minecraft/kevin/module/modules/movement/InvMove.kt @@ -62,5 +62,5 @@ class InvMove : Module("InvMove","Allows you to walk while an inventory is opene } override val tag: String? - get() = if (fakeSprint.get()) "FakeSprint" else null + get() = if (fakeSprint.get()&&bypass.get()) "FakeSprint & NoPacket" else if (fakeSprint.get()) "FakeSprint" else if (bypass.get()) "NoPacket" else null } \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/LongJump.kt b/src/minecraft/kevin/module/modules/movement/LongJump.kt index e12bf336..29baa9d9 100644 --- a/src/minecraft/kevin/module/modules/movement/LongJump.kt +++ b/src/minecraft/kevin/module/modules/movement/LongJump.kt @@ -2,73 +2,33 @@ package kevin.module.modules.movement import kevin.event.* import kevin.module.* -import kevin.utils.MSTimer import kevin.utils.MovementUtils import net.minecraft.network.play.server.S27PacketExplosion import net.minecraft.util.EnumFacing -import kotlin.math.cos -import kotlin.math.sin class LongJump : Module("LongJump", "Allows you to jump further.", category = ModuleCategory.MOVEMENT) { - private val modeValue = ListValue("Mode", arrayOf("NCP", "AACv1", "AACv2", "AACv3", "Mineplex", "Mineplex2", "Mineplex3", "Redesky", "ExplosionBoost", "Timer"), "NCP") + private val modeValue = ListValue("Mode", arrayOf("NCP", "AACv1", "AACv2", "AACv3", "Mineplex", "Mineplex2", "Mineplex3", "Redesky", "ExplosionBoost"), "NCP") private val ncpBoostValue = FloatValue("NCPBoost", 4.25f, 1f, 10f) private val autoJumpValue = BooleanValue("AutoJump", false) private val explosionBoostHigh = FloatValue("ExplosionBoostHigh",0.00F,0.01F,1F) private val explosionBoostLong = FloatValue("ExplosionBoostLong",0.25F,0.01F,1F) - private val timer = FloatValue("Timer",0.1F,0.1F,1F) - private val speed = FloatValue("Speed",3F,0.5F,5F) - private val delay = IntegerValue("Delay",0,0,500) private var jumped = false private var canBoost = false private var teleported = false private var canMineplexBoost = false private var explosion = false - private val msTimer = MSTimer() - private var timerState = 0 override fun onEnable() { - if (modeValue equal "Timer"){ - mc.timer.timerSpeed = timer.get() - msTimer.reset() - } + } override fun onDisable() { - if (modeValue equal "Timer") { - mc.timer.timerSpeed = 1F - timerState = 0 - } + } @EventTarget fun onUpdate(event: UpdateEvent?) { val thePlayer = mc.thePlayer ?: return - if ((modeValue equal "Timer")&&msTimer.hasTimePassed(delay.get().toLong())){ - when(timerState){ - 0 -> { - val radiansYaw = mc.thePlayer!!.rotationYaw * Math.PI / 180 - mc.thePlayer!!.motionX = speed.get() * -sin(radiansYaw) - mc.thePlayer!!.motionZ = speed.get() * cos(radiansYaw) - if (mc.thePlayer.onGround) mc.thePlayer.jump() - timerState = 1 - return - } - 1 -> { - mc.timer.timerSpeed = 1F - timerState = 2 - msTimer.reset() - return - } - 2 -> { - if (msTimer.hasTimePassed(300)){ - mc.thePlayer!!.motionX = .0 - mc.thePlayer!!.motionZ = .0 - state = false - } - } - } - } - if (jumped) { val mode = modeValue.get() diff --git a/src/minecraft/kevin/module/modules/movement/NoSlow.kt b/src/minecraft/kevin/module/modules/movement/NoSlow.kt index 9ad47d0c..dba69255 100644 --- a/src/minecraft/kevin/module/modules/movement/NoSlow.kt +++ b/src/minecraft/kevin/module/modules/movement/NoSlow.kt @@ -1,18 +1,19 @@ package kevin.module.modules.movement -import kevin.event.EventState -import kevin.event.EventTarget -import kevin.event.MotionEvent -import kevin.event.SlowDownEvent +import kevin.event.* import kevin.main.KevinClient import kevin.module.* import kevin.module.modules.combat.KillAura +import kevin.utils.MSTimer import kevin.utils.MovementUtils +import kevin.utils.PacketUtils import net.minecraft.item.* -import net.minecraft.network.play.client.C07PacketPlayerDigging -import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement +import net.minecraft.network.Packet +import net.minecraft.network.play.INetHandlerPlayServer +import net.minecraft.network.play.client.* import net.minecraft.util.BlockPos import net.minecraft.util.EnumFacing +import java.util.* class NoSlow : Module("NoSlow", "Cancels slowness effects caused by soulsand and using items.", category = ModuleCategory.MOVEMENT) { @@ -25,11 +26,26 @@ class NoSlow : Module("NoSlow", "Cancels slowness effects caused by soulsand and private val bowForwardMultiplier = FloatValue("BowForwardMultiplier", 1.0F, 0.2F, 1.0F) private val bowStrafeMultiplier = FloatValue("BowStrafeMultiplier", 1.0F, 0.2F, 1.0F) - private val packetMode = ListValue("PacketMode", arrayOf("None","AntiCheat","AAC5"),"None") + private val packetMode = ListValue("PacketMode", arrayOf("None","AntiCheat","AAC5","Matrix","Vulcan"),"None") val soulsandValue = BooleanValue("Soulsand", true) val liquidPushValue = BooleanValue("LiquidPush", true) + private var lastBlockingStat = false + private var nextTemp = false + private var waitC03 = false + private val msTimer = MSTimer() + private var packetBuf = LinkedList>() + private val isBlocking: Boolean + get() = (mc.thePlayer.isUsingItem || (KevinClient.moduleManager.getModule("KillAura")!! as KillAura).blockingStatus) && mc.thePlayer.heldItem != null && mc.thePlayer.heldItem.item is ItemSword + + override fun onDisable() { + msTimer.reset() + nextTemp = false + waitC03 = false + packetBuf.clear() + } + @EventTarget fun onMotion(event: MotionEvent) { val thePlayer = mc.thePlayer ?: return @@ -63,6 +79,59 @@ class NoSlow : Module("NoSlow", "Cancels slowness effects caused by soulsand and } } + @EventTarget + fun onUpdate(event: UpdateEvent) { + if(mc.thePlayer == null || mc.theWorld == null) + return + if((packetMode.equals("Matrix") || packetMode.equals("Vulcan")) && (lastBlockingStat || isBlocking)) { + if(msTimer.hasTimePassed(230) && nextTemp) { + nextTemp = false + PacketUtils.sendPacketNoEvent(C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos(-1, -1, -1), EnumFacing.DOWN)) + if(packetBuf.isNotEmpty()) { + var canAttack = false + for(packet in packetBuf) { + if(packet is C03PacketPlayer) { + canAttack = true + } + if(!((packet is C02PacketUseEntity || packet is C0APacketAnimation) && !canAttack)) { + PacketUtils.sendPacketNoEvent(packet) + } + } + packetBuf.clear() + } + } + if(!nextTemp) { + lastBlockingStat = isBlocking + if (!isBlocking) { + return + } + PacketUtils.sendPacketNoEvent(C08PacketPlayerBlockPlacement(BlockPos(-1, -1, -1), 255, mc.thePlayer.inventory.getCurrentItem(), 0f, 0f, 0f)) + nextTemp = true + waitC03 = packetMode.equals("Vulcan") + msTimer.reset() + } + } + } + + @EventTarget + fun onPacket(event: PacketEvent) { + if(mc.thePlayer == null || mc.theWorld == null) + return + val packet = event.packet + if((packetMode.equals("Matrix") || packetMode.equals("Vulcan")) && nextTemp) { + if((packet is C07PacketPlayerDigging || packet is C08PacketPlayerBlockPlacement) && isBlocking) { + event.cancelEvent() + }else if (packet is C03PacketPlayer || packet is C0APacketAnimation || packet is C0BPacketEntityAction || packet is C02PacketUseEntity || packet is C07PacketPlayerDigging || packet is C08PacketPlayerBlockPlacement) { + if (packetMode.equals("Vulcan") && waitC03 && packet is C03PacketPlayer) { + waitC03 = false + return + } + packetBuf.add(packet as Packet) + event.cancelEvent() + } + } + } + override val tag: String get() = packetMode.get() diff --git a/src/minecraft/kevin/module/modules/movement/Speed.kt b/src/minecraft/kevin/module/modules/movement/Speed.kt index 9815e5d8..270a00bb 100644 --- a/src/minecraft/kevin/module/modules/movement/Speed.kt +++ b/src/minecraft/kevin/module/modules/movement/Speed.kt @@ -5,21 +5,27 @@ import kevin.module.* import kevin.module.modules.movement.speeds.SpeedMode import kevin.module.modules.movement.speeds.aac.AAC5Fast import kevin.module.modules.movement.speeds.aac.AAC5Long +import kevin.module.modules.movement.speeds.matrix.MatrixNew import kevin.module.modules.movement.speeds.other.AutoJump +import kevin.module.modules.movement.speeds.other.Custom import kevin.module.modules.movement.speeds.other.YPort import kevin.module.modules.movement.speeds.verus.VerusHop import kevin.module.modules.movement.speeds.verus.VerusYPort +import kevin.module.modules.movement.speeds.vulcan.VulcanHop import kevin.utils.MovementUtils import net.minecraft.network.play.server.S12PacketEntityVelocity class Speed : Module("Speed","Allows you to move faster.", category = ModuleCategory.MOVEMENT) { private val speeds = arrayListOf( + Custom, // from FDP AAC5Long, AAC5Fast, YPort, AutoJump, VerusYPort, - VerusHop + VerusHop, + MatrixNew, //from FDP + VulcanHop //from FDP ) private val names: Array @@ -71,8 +77,8 @@ class Speed : Module("Speed","Allows you to move faster.", category = ModuleCate override val values: List> get(){ val valueList = arrayListOf>() - speeds.forEach { valueList.addAll(it.values) } valueList.addAll(super.values) + speeds.forEach { valueList.addAll(it.values) } return valueList.toList() } } \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/flys/matrix/Matrix.kt b/src/minecraft/kevin/module/modules/movement/flys/matrix/Matrix.kt new file mode 100644 index 00000000..04eca51a --- /dev/null +++ b/src/minecraft/kevin/module/modules/movement/flys/matrix/Matrix.kt @@ -0,0 +1,77 @@ +package kevin.module.modules.movement.flys.matrix + +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") { // from FDP + 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/matrix/NewMatrix.kt b/src/minecraft/kevin/module/modules/movement/flys/matrix/NewMatrix.kt new file mode 100644 index 00000000..32060aa0 --- /dev/null +++ b/src/minecraft/kevin/module/modules/movement/flys/matrix/NewMatrix.kt @@ -0,0 +1,72 @@ +package kevin.module.modules.movement.flys.matrix + +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 +import net.minecraft.network.play.server.S08PacketPlayerPosLook +import kotlin.math.* + +object NewMatrix : FlyMode("NewMatrix") { //from FDP + private val speed = FloatValue("${valuePrefix}Speed", 2.0f, 1.0f, 3.0f) + private val jumpTimer = FloatValue("${valuePrefix}JumpTimer", 0.1f, 0.1f, 2f) + private val boostTimer = FloatValue("${valuePrefix}BoostTimer", 1f, 0.5f, 3f) + private var boostMotion = 0 + + override fun onEnable() { + boostMotion = 0 + } + + override fun onUpdate(event: UpdateEvent) { + if (boostMotion == 0) { + val yaw = Math.toRadians(mc.thePlayer.rotationYaw.toDouble()) + mc.netHandler.addToSendQueue( + C03PacketPlayer.C04PacketPlayerPosition( + mc.thePlayer.posX, + mc.thePlayer.posY, + mc.thePlayer.posZ, + true + ) + ) + mc.netHandler.addToSendQueue( + C03PacketPlayer.C04PacketPlayerPosition( + mc.thePlayer.posX + -sin(yaw) * 1.5, + mc.thePlayer.posY + 1, + mc.thePlayer.posZ + cos(yaw) * 1.5, + false + ) + ) + boostMotion = 1 + mc.timer.timerSpeed = jumpTimer.get() + } else if (boostMotion == 2) { + MovementUtils.strafe(speed.get()) + mc.thePlayer.motionY = 0.8 + boostMotion = 3 + } else if (boostMotion < 5) { + boostMotion++ + } else if (boostMotion >= 5) { + mc.timer.timerSpeed = boostTimer.get() + if (mc.thePlayer.posY < fly.launchY - 1.0) { + boostMotion = 0 + } + } + } + + override fun onDisable() { + mc.timer.timerSpeed = 1f + } + + override fun onPacket(event: PacketEvent) { + val packet = event.packet + if(mc.currentScreen == null && packet is S08PacketPlayerPosLook) { + mc.thePlayer.setPosition(packet.x, packet.y, packet.z) + mc.netHandler.addToSendQueue(C03PacketPlayer.C06PacketPlayerPosLook(packet.x, packet.y, packet.z, packet.yaw, packet.pitch, false)) + if (boostMotion == 1) { + boostMotion = 2 + } + event.cancelEvent() + } + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/flys/matrix/NewMatrixClip.kt b/src/minecraft/kevin/module/modules/movement/flys/matrix/NewMatrixClip.kt new file mode 100644 index 00000000..2d37e64a --- /dev/null +++ b/src/minecraft/kevin/module/modules/movement/flys/matrix/NewMatrixClip.kt @@ -0,0 +1,115 @@ +package kevin.module.modules.movement.flys.matrix + +import kevin.event.PacketEvent +import kevin.event.UpdateEvent +import kevin.module.FloatValue +import kevin.module.IntegerValue +import kevin.module.ListValue +import kevin.module.modules.movement.flys.FlyMode +import kevin.utils.MSTimer +import net.minecraft.network.Packet +import net.minecraft.network.play.INetHandlerPlayServer +import net.minecraft.network.play.client.* +import java.util.concurrent.LinkedBlockingQueue + +object NewMatrixClip : FlyMode("NewMatrixClip") { //from FDP + private val clipMode = ListValue("${valuePrefix}BypassMode", arrayOf("Clip1","Clip2","Clip3","CustomClip"), "Clip2") + // private val clipSmart = BoolValue("${valuePrefix}Clip2-SmartClip", true).displayable { clipMode.equals("Clip2") } + private val customClip = IntegerValue("${valuePrefix}Custom-ClipDelay",736,500,1500) + private val customBlink = IntegerValue("${valuePrefix}Custom-BlinkDelay",909,500,1500) + private val yclip = FloatValue("${valuePrefix}YClip", 10f, 5f, 20f) + private val packets = LinkedBlockingQueue>() + private val timer = MSTimer() + private val timer2 = MSTimer() + + private var blinkTime = 0 + private var clipTime = 0 + // private var clipTimes = 0 + private var disableLogger = false +// private var shouldClip = true + + override fun onEnable() { + timer.reset() + timer2.reset() +// clipTimes = 0 +// shouldClip = true + } + + override fun onUpdate(event: UpdateEvent) { +// if (!shouldClip) return + + when (clipMode.get().lowercase()) { + "clip1" -> { + blinkTime = 736 + clipTime = 909 + } + "clip2" -> { + blinkTime = 1000 + clipTime = 909 +/* if (clipTimes == 2) { + if (!clipSmart.get()) { + LiquidBounce.hud.addNotification(Notification("Clip success", "To successfully clip disable fly now", NotifyType.SUCCESS, 2000)) + } else { + if (timer2.hasTimePassed(150)) { + shouldClip = false + LiquidBounce.hud.addNotification(Notification("Smart Clip", "Smart Clip stopped cliping, you can disable fly now.", NotifyType.WARNING, 5000)) + LiquidBounce.hud.addNotification(Notification("Smart Clip", "If you have tped back, disable Smart Clip or try again.", NotifyType.WARNING, 5000)) + } else if (clipTimes > 2) { + if (!clipSmart.get()) { + LiquidBounce.hud.addNotification(Notification("Clip fail", "Clipped too many times, disable fly and try again", NotifyType.ERROR, 3000)) + } + } +*/ + } + "clip3" -> { + blinkTime = 909 + clipTime = 1000 + } + "CustomClip" -> { + blinkTime = customBlink.get() + clipTime = customClip.get() + } + } + mc.thePlayer.motionY = 0.0 + mc.thePlayer.motionX = 0.0 + mc.thePlayer.motionZ = 0.0 + + + if(timer.hasTimePassed(blinkTime.toLong())) { + timer.reset() + try { + disableLogger = true + while (!packets.isEmpty()) { + mc.netHandler.addToSendQueue(packets.take()) + } + disableLogger = false + } finally { + disableLogger = false + } + } + if(timer2.hasTimePassed((clipTime.toLong()))) { + timer2.reset() +// clipTimes ++ + mc.thePlayer.setPosition(mc.thePlayer.posX , mc.thePlayer.posY + yclip.get(), mc.thePlayer.posZ) + } + } + + override fun onDisable() { + } + + override fun onPacket(event: PacketEvent) { + val packet = event.packet + if (mc.thePlayer == null || disableLogger) return + if (packet is C03PacketPlayer) { + event.cancelEvent() + } + if (packet is C03PacketPlayer.C04PacketPlayerPosition || packet is C03PacketPlayer.C06PacketPlayerPosLook || + packet is C08PacketPlayerBlockPlacement || + packet is C0APacketAnimation || + packet is C0BPacketEntityAction || packet is C02PacketUseEntity + ) { + event.cancelEvent() + packets.add(packet as Packet) + } + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/flys/vulcan/Vulcan.kt b/src/minecraft/kevin/module/modules/movement/flys/vulcan/Vulcan.kt new file mode 100644 index 00000000..9950492d --- /dev/null +++ b/src/minecraft/kevin/module/modules/movement/flys/vulcan/Vulcan.kt @@ -0,0 +1,154 @@ +package kevin.module.modules.movement.flys.vulcan + +import kevin.event.PacketEvent +import kevin.event.UpdateEvent +import kevin.module.FloatValue +import kevin.module.modules.movement.flys.FlyMode +import kevin.utils.BlockUtils +import kevin.utils.ChatUtils +import kevin.utils.MovementUtils +import net.minecraft.network.play.client.C03PacketPlayer +import net.minecraft.network.play.client.C0BPacketEntityAction +import net.minecraft.network.play.server.S08PacketPlayerPosLook +import net.minecraft.util.BlockPos +import kotlin.math.sqrt + +object Vulcan : FlyMode("Vulcan") { // from FDP + private val timerValue = FloatValue("${valuePrefix}Speed", 1f, 0.1f, 6f) + + private var isSuccess = false + private var vticks = 0 + private var doCancel = false + private var stage = FlyStage.FLYING + private var startX = 0.0 + private var startZ = 0.0 + private var startY = 0.0 + + override fun onEnable() { + ChatUtils.messageWithStart("§8[§c§lVulcan-Fly§8] §cThis Fly Is From FDP Client!") + vticks = 0 + doCancel = false + if(mc.thePlayer.posY % 1 != 0.0) { + fly.state = false + ChatUtils.messageWithStart("§8[§c§lVulcan-Fly§8] §cPlease stand on a solid block to fly!") + isSuccess = true + return + } + stage = FlyStage.FLYING + isSuccess = false + ChatUtils.messageWithStart("§8[§c§lVulcan-Fly§8] §aPlease press Sneak before you land on ground!") + //ChatUtils.messageWithStart("§8[§c§lVulcan-Fly§8] §7Tips: DO NOT Use killaura when you're flying!") + startX = mc.thePlayer.posX + startY = mc.thePlayer.posY + startZ = mc.thePlayer.posZ + } + + override fun onDisable() { + mc.timer.timerSpeed = 1.0f + if (!isSuccess) { + mc.thePlayer.setPosition(startX, startY, startZ) + ChatUtils.messageWithStart("§8[§c§lVulcan-Fly§8] §cFly attempt Failed...") + ChatUtils.messageWithStart("§8[§c§lVulcan-Fly§8] §cIf it keeps happen, DONT use it again in CURRENT gameplay") + } + } + + override fun onUpdate(event: UpdateEvent) { + when(stage) { + FlyStage.FLYING -> { + isSuccess = false + + mc.thePlayer.motionX = 0.0 + mc.thePlayer.motionY = 0.0 + mc.thePlayer.motionZ = 0.0 + + MovementUtils.strafe(timerValue.get()) + doCancel = true + + if(mc.gameSettings.keyBindSneak.pressed) { + MovementUtils.strafe(0.45f) + //More easy to land on ground .... + } + if(mc.gameSettings.keyBindSneak.pressed && mc.thePlayer.ticksExisted % 2 == 1) { + val fixedY = mc.thePlayer.posY - (mc.thePlayer.posY % 1) + val underBlock2 = BlockUtils.getBlock(BlockPos(mc.thePlayer.posX, fixedY - 1, mc.thePlayer.posZ)) ?: return + if(underBlock2.isFullBlock) { + stage = FlyStage.WAIT_APPLY + mc.thePlayer.motionX = 0.0 + mc.thePlayer.motionY = 0.0 + mc.thePlayer.motionZ = 0.0 + mc.thePlayer.jumpMovementFactor = 0.00f + doCancel = false + mc.thePlayer.onGround = false + var fixedX = mc.thePlayer.posX - (mc.thePlayer.posX % 1) + var fixedZ = mc.thePlayer.posZ - (mc.thePlayer.posZ % 1) + if(fixedX>0) { + fixedX += 0.5 + }else{ + fixedX -= 0.5 + } + if(fixedZ>0) { + fixedZ += 0.5 + }else{ + fixedZ -= 0.5 + } + mc.thePlayer.setPosition(fixedX, fixedY, fixedZ) + mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, fixedY , mc.thePlayer.posZ, true)) + doCancel = true + ChatUtils.messageWithStart("§8[§c§lVulcan-Fly§8] §aWaiting for landing...") + } else { + ChatUtils.messageWithStart("§8[§c§lVulcan-Fly§8] §cYou can only land on a solid block!") + } + } + } + FlyStage.WAIT_APPLY -> { + vticks++ + doCancel = false + if(vticks == 60) { + ChatUtils.messageWithStart("§8[§c§lVulcan-Fly§8] §cSeems took a long time! Please turn off the Fly manually") + } + mc.timer.timerSpeed = 1f + mc.thePlayer.motionX = 0.0 + mc.thePlayer.motionY = 0.0 + mc.thePlayer.motionZ = 0.0 + mc.thePlayer.jumpMovementFactor = 0.00f + val fixedY = mc.thePlayer.posY - (mc.thePlayer.posY % 1) + if(mc.theWorld.getCollisionBoxes(mc.thePlayer.entityBoundingBox.offset(0.0, -10.0, 0.0)).isEmpty() && mc.theWorld.getCollisionBoxes(mc.thePlayer.entityBoundingBox.offset(0.0, -12.0, 0.0)).isEmpty()) { + mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, fixedY - 10, mc.thePlayer.posZ, true)) + }else { + mc.netHandler.addToSendQueue(C03PacketPlayer.C04PacketPlayerPosition(mc.thePlayer.posX, fixedY - 1024, mc.thePlayer.posZ, true)) + } + doCancel = true + } + } + } + + override fun onPacket(event: PacketEvent) { + val packet = event.packet + + if(packet is C03PacketPlayer) { + if(doCancel) { + event.cancelEvent() + doCancel = false + } + packet.onGround = true + } else if(packet is S08PacketPlayerPosLook) { + if (stage == FlyStage.WAIT_APPLY) { + if(sqrt((packet.x-mc.thePlayer.posX)*(packet.x-mc.thePlayer.posX) + +(packet.y-mc.thePlayer.posY)*(packet.y-mc.thePlayer.posY) + +(packet.z-mc.thePlayer.posZ)*(packet.z-mc.thePlayer.posZ)) < 1.4) { + isSuccess = true + fly.state = false + return + } + } + event.cancelEvent() + } else if(packet is C0BPacketEntityAction) { + event.cancelEvent() + } + } + + enum class FlyStage { + FLYING, + WAIT_APPLY + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/speeds/matrix/MatrixNew.kt b/src/minecraft/kevin/module/modules/movement/speeds/matrix/MatrixNew.kt new file mode 100644 index 00000000..bcbba29d --- /dev/null +++ b/src/minecraft/kevin/module/modules/movement/speeds/matrix/MatrixNew.kt @@ -0,0 +1,27 @@ +package kevin.module.modules.movement.speeds.matrix + +import kevin.event.UpdateEvent +import kevin.module.modules.movement.speeds.SpeedMode +import kevin.utils.MovementUtils + +object MatrixNew : SpeedMode("MatrixNew") { //from FDP + override fun onUpdate(event: UpdateEvent) { + mc.timer.timerSpeed = 1.0f + + if (!MovementUtils.isMoving || mc.thePlayer.isInWater || mc.thePlayer.isInLava || + mc.thePlayer.isOnLadder || mc.thePlayer.isRiding) return + + if (mc.thePlayer.onGround) { + mc.thePlayer.jump() + mc.timer.timerSpeed = 0.9f + } else { + if (mc.thePlayer.fallDistance <= 0.1) { + mc.timer.timerSpeed = 1.5f + } else if (mc.thePlayer.fallDistance < 1.3) { + mc.timer.timerSpeed = 0.7f + } else { + mc.timer.timerSpeed = 1.0f + } + } + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/speeds/other/Custom.kt b/src/minecraft/kevin/module/modules/movement/speeds/other/Custom.kt new file mode 100644 index 00000000..65441758 --- /dev/null +++ b/src/minecraft/kevin/module/modules/movement/speeds/other/Custom.kt @@ -0,0 +1,221 @@ +package kevin.module.modules.movement.speeds.other + +import kevin.event.UpdateEvent +import kevin.module.BooleanValue +import kevin.module.FloatValue +import kevin.module.IntegerValue +import kevin.module.ListValue +import kevin.module.modules.movement.speeds.SpeedMode +import kevin.utils.MovementUtils +import net.minecraft.client.settings.GameSettings + +object Custom : SpeedMode("Custom") { // from FDP + private val speedValue = FloatValue("CustomSpeed", 1.6f, 0f, 2f) + private val doLaunchSpeedValue = BooleanValue("CustomDoLaunchSpeed", true) + private val launchSpeedValue = FloatValue("CustomLaunchSpeed", 1.6f, 0.2f, 2f) + private val doMinimumSpeedValue = BooleanValue("CustomDoMinimumSpeed", true) + private val minimumSpeedValue = FloatValue("CustomMinimumSpeed", 0.25f, 0.1f, 2f) + private val addYMotionValue = FloatValue("CustomAddYMotion", 0f, 0f, 2f) + private val doCustomYValue = BooleanValue("CustomDoModifyJumpY", true) + private val yValue = FloatValue("CustomY", 0.42f, 0f, 4f) + private val upTimerValue = FloatValue("CustomUpTimer", 1f, 0.1f, 2f) + private val jumpTimerValue = FloatValue("CustomJumpTimer", 1.25f, 0.1f, 2f) + private val downTimerValue = FloatValue("CustomDownTimer", 1f, 0.1f, 2f) + private val strafeValue = ListValue("CustomStrafe", arrayOf("Strafe", "Boost", "Plus", "PlusOnlyUp", "PlusOnlyDown", "Non-Strafe"), "Boost") + private val plusMode = ListValue("PlusBoostMode", arrayOf("Add", "Multiply"), "Add") + private val plusMultiply = FloatValue("PlusMultiplyAmount", 1.1f, 1f, 2f) + private val groundStay = IntegerValue("CustomGroundStay", 0, 0, 10) + private val groundResetXZValue = BooleanValue("CustomGroundResetXZ", false) + private val resetXZValue = BooleanValue("CustomResetXZ", false) + private val resetYValue = BooleanValue("CustomResetY", false) + private val GroundSpaceKeyPressed = BooleanValue("CustomPressSpaceKeyOnGround", true) + private val AirSpaceKepPressed = BooleanValue("CustomPressSpaceKeyInAir", false) + private val usePreMotion = BooleanValue("CustomUsePreMotion", true) + + + + private var groundTick = 0 + + + override fun onPreMotion() { + if (!usePreMotion.get()) return + if (MovementUtils.isMoving) { + mc.timer.timerSpeed = if (mc.thePlayer.motionY> 0) { upTimerValue.get() } else { downTimerValue.get() } + + when { + mc.thePlayer.onGround -> { + if (groundTick >= groundStay.get()) { + if (GroundSpaceKeyPressed.get()) { + mc.gameSettings.keyBindJump.pressed = GameSettings.isKeyDown(mc.gameSettings.keyBindJump) + } + mc.timer.timerSpeed = jumpTimerValue.get() + mc.thePlayer.jump() + if (doLaunchSpeedValue.get()) { + MovementUtils.strafe(launchSpeedValue.get()) + } + if (doCustomYValue.get()) { + if (yValue.get() != 0f) { + mc.thePlayer.motionY = yValue.get().toDouble() + } + } + } else if (groundResetXZValue.get()) { + mc.thePlayer.motionX = 0.0 + mc.thePlayer.motionZ = 0.0 + } + groundTick++ + } + else -> { + groundTick = 0 + if (AirSpaceKepPressed.get()) { + mc.gameSettings.keyBindJump.pressed = GameSettings.isKeyDown(mc.gameSettings.keyBindJump) + } + if (doMinimumSpeedValue.get() && MovementUtils.speed < minimumSpeedValue.get()) { + MovementUtils.strafe(minimumSpeedValue.get()) + } + when (strafeValue.get().lowercase()) { + "strafe" -> MovementUtils.strafe(speedValue.get()) + "non-strafe" -> MovementUtils.strafe() + "boost" -> MovementUtils.strafe() + "plus" -> { + when (plusMode.get().lowercase()) { + "plus" -> MovementUtils.move(speedValue.get() * 0.1f) + "multiply" -> { + mc.thePlayer.motionX *= plusMultiply.get() + mc.thePlayer.motionZ *= plusMultiply.get() + } + } + } + "plusonlyup" -> { + if (mc.thePlayer.motionY > 0) { + when (plusMode.get().lowercase()) { + "plus" -> MovementUtils.move(speedValue.get() * 0.1f) + "multiply" -> { + mc.thePlayer.motionX *= plusMultiply.get() + mc.thePlayer.motionZ *= plusMultiply.get() + } + } + } else { + MovementUtils.strafe() + } + } + "plusonlydown" -> { + if (mc.thePlayer.motionY < 0) { + when (plusMode.get().lowercase()) { + "plus" -> MovementUtils.move(speedValue.get() * 0.1f) + "multiply" -> { + mc.thePlayer.motionX *= plusMultiply.get() + mc.thePlayer.motionZ *= plusMultiply.get() + } + } + } else { + MovementUtils.strafe() + } + } + } + mc.thePlayer.motionY += addYMotionValue.get() * 0.03 + } + } + } else if (resetXZValue.get()) { + mc.thePlayer.motionX = 0.0 + mc.thePlayer.motionZ = 0.0 + } + } + + override fun onUpdate(event: UpdateEvent) { + if (usePreMotion.get()) return + if (MovementUtils.isMoving) { + mc.timer.timerSpeed = if (mc.thePlayer.motionY> 0) { upTimerValue.get() } else { downTimerValue.get() } + + when { + mc.thePlayer.onGround -> { + if (groundTick >= groundStay.get()) { + if (GroundSpaceKeyPressed.get()) { + mc.gameSettings.keyBindJump.pressed = GameSettings.isKeyDown(mc.gameSettings.keyBindJump) + } + mc.timer.timerSpeed = jumpTimerValue.get() + mc.thePlayer.jump() + if (doLaunchSpeedValue.get()) { + MovementUtils.strafe(launchSpeedValue.get()) + } + if (doCustomYValue.get()) { + if (yValue.get() != 0f) { + mc.thePlayer.motionY = yValue.get().toDouble() + } + } + } else if (groundResetXZValue.get()) { + mc.thePlayer.motionX = 0.0 + mc.thePlayer.motionZ = 0.0 + } + groundTick++ + } + else -> { + groundTick = 0 + if (AirSpaceKepPressed.get()) { + mc.gameSettings.keyBindJump.pressed = GameSettings.isKeyDown(mc.gameSettings.keyBindJump) + } + if (doMinimumSpeedValue.get() && MovementUtils.speed < minimumSpeedValue.get()) { + MovementUtils.strafe(minimumSpeedValue.get()) + } + when (strafeValue.get().lowercase()) { + "strafe" -> MovementUtils.strafe(speedValue.get()) + "non-strafe" -> MovementUtils.strafe() + "boost" -> MovementUtils.strafe() + "plus" -> { + when (plusMode.get().lowercase()) { + "plus" -> MovementUtils.move(speedValue.get() * 0.1f) + "multiply" -> { + mc.thePlayer.motionX *= plusMultiply.get() + mc.thePlayer.motionZ *= plusMultiply.get() + } + } + } + "plusonlyup" -> { + if (mc.thePlayer.motionY > 0) { + when (plusMode.get().lowercase()) { + "plus" -> MovementUtils.move(speedValue.get() * 0.1f) + "multiply" -> { + mc.thePlayer.motionX *= plusMultiply.get() + mc.thePlayer.motionZ *= plusMultiply.get() + } + } + } else { + MovementUtils.strafe() + } + } + "plusonlydown" -> { + if (mc.thePlayer.motionY < 0) { + when (plusMode.get().lowercase()) { + "plus" -> MovementUtils.move(speedValue.get() * 0.1f) + "multiply" -> { + mc.thePlayer.motionX *= plusMultiply.get() + mc.thePlayer.motionZ *= plusMultiply.get() + } + } + } else { + MovementUtils.strafe() + } + } + } + mc.thePlayer.motionY += addYMotionValue.get() * 0.03 + } + } + } else if (resetXZValue.get()) { + mc.thePlayer.motionX = 0.0 + mc.thePlayer.motionZ = 0.0 + } + } + + + + override fun onEnable() { + if (resetXZValue.get()) { + mc.thePlayer.motionX = 0.0 + mc.thePlayer.motionZ = 0.0 + } + if (resetYValue.get()) mc.thePlayer.motionY = 0.0 + } + + override fun onDisable() { + mc.timer.timerSpeed = 1f + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/movement/speeds/vulcan/VulcanHop.kt b/src/minecraft/kevin/module/modules/movement/speeds/vulcan/VulcanHop.kt new file mode 100644 index 00000000..4be0c8e8 --- /dev/null +++ b/src/minecraft/kevin/module/modules/movement/speeds/vulcan/VulcanHop.kt @@ -0,0 +1,51 @@ +package kevin.module.modules.movement.speeds.vulcan + +import kevin.event.UpdateEvent +import kevin.module.modules.movement.speeds.SpeedMode +import kevin.utils.MovementUtils +import net.minecraft.client.settings.GameSettings +import kotlin.math.abs + +object VulcanHop : SpeedMode("VulcanHop") { // from FDP + + private var wasTimer = false + + override fun onUpdate(event: UpdateEvent) { + if (wasTimer) { + mc.timer.timerSpeed = 1.00f + wasTimer = false + } + if (abs(mc.thePlayer.movementInput.moveStrafe) < 0.1f) { + mc.thePlayer.jumpMovementFactor = 0.026499f + }else { + mc.thePlayer.jumpMovementFactor = 0.0244f + } + mc.gameSettings.keyBindJump.pressed = GameSettings.isKeyDown(mc.gameSettings.keyBindJump) + + if (MovementUtils.speed < 0.215f && !mc.thePlayer.onGround) { + MovementUtils.strafe(0.215f) + } + if (mc.thePlayer.onGround && MovementUtils.isMoving) { + mc.gameSettings.keyBindJump.pressed = false + mc.thePlayer.jump() + if (!mc.thePlayer.isAirBorne) { + return //Prevent flag with Fly + } + mc.timer.timerSpeed = 1.25f + wasTimer = true + MovementUtils.strafe() + if(MovementUtils.speed < 0.5f) { + MovementUtils.strafe(0.4849f) + } + }else if (!MovementUtils.isMoving) { + mc.timer.timerSpeed = 1.00f + mc.thePlayer.motionX = 0.0 + mc.thePlayer.motionZ = 0.0 + } + } + + override fun onDisable() { + mc.timer.timerSpeed = 1.00f + wasTimer = false + } +} \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/player/AutoTool.kt b/src/minecraft/kevin/module/modules/player/AutoTool.kt index 283eae84..cbc383a6 100644 --- a/src/minecraft/kevin/module/modules/player/AutoTool.kt +++ b/src/minecraft/kevin/module/modules/player/AutoTool.kt @@ -20,8 +20,6 @@ class AutoTool : Module(name = "AutoTool", description = "Automatically selects @EventTarget fun onClick(event: ClickBlockEvent) { switchSlot(event.clickedBlock ?: return) - switchTimer.reset() - needReset = true } @EventTarget fun onUpdate(event: UpdateEvent){ if (needReset) { @@ -64,5 +62,7 @@ class AutoTool : Module(name = "AutoTool", description = "Automatically selects mc.thePlayer!!.inventory.currentItem = bestSlot } } + switchTimer.reset() + needReset = true } } \ No newline at end of file diff --git a/src/minecraft/kevin/module/modules/player/FastUse.kt b/src/minecraft/kevin/module/modules/player/FastUse.kt index 630dcbd1..3bd28308 100644 --- a/src/minecraft/kevin/module/modules/player/FastUse.kt +++ b/src/minecraft/kevin/module/modules/player/FastUse.kt @@ -1,23 +1,16 @@ package kevin.module.modules.player +//import kevin.event.UpdateState + import kevin.event.EventTarget import kevin.event.MoveEvent import kevin.event.UpdateEvent - -//import kevin.event.UpdateState - import kevin.module.* import kevin.utils.MSTimer -import kevin.utils.RotationUtils -import net.minecraft.item.ItemBow import net.minecraft.item.ItemBucketMilk import net.minecraft.item.ItemFood import net.minecraft.item.ItemPotion import net.minecraft.network.play.client.C03PacketPlayer -import net.minecraft.network.play.client.C07PacketPlayerDigging -import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement -import net.minecraft.util.BlockPos -import net.minecraft.util.EnumFacing class FastUse : Module("FastUse", "Allows you to use items faster.", category = ModuleCategory.PLAYER) { private val modeValue = ListValue("Mode", arrayOf("Instant", "NCP", "AAC", "Custom"), "NCP") @@ -28,9 +21,6 @@ class FastUse : Module("FastUse", "Allows you to use items faster.", category = private val customSpeedValue = IntegerValue("CustomSpeed", 2, 1, 35) private val customTimer = FloatValue("CustomTimer", 1.1f, 0.5f, 2f) - val fastBow = BooleanValue("FastBow",false) - private val packetsValue = IntegerValue("FastBowPackets", 20, 3, 20) - private val msTimer = MSTimer() private var usedTimer = false @@ -53,31 +43,6 @@ class FastUse : Module("FastUse", "Allows you to use items faster.", category = val usingItem = thePlayer.itemInUse!!.item - if (fastBow.get()){ - val currentItem = thePlayer.inventory.getCurrentItem() - - if (currentItem != null && (currentItem.item)is ItemBow) { - - mc.netHandler.addToSendQueue(C08PacketPlayerBlockPlacement(BlockPos.ORIGIN, 255, currentItem, 0F, 0F, 0F)) - - val yaw = if (RotationUtils.targetRotation != null) - RotationUtils.targetRotation.yaw - else - thePlayer.rotationYaw - - val pitch = if (RotationUtils.targetRotation != null) - RotationUtils.targetRotation.pitch - else - thePlayer.rotationPitch - - for (i in 0 until packetsValue.get()) - mc.netHandler.addToSendQueue(C03PacketPlayer.C05PacketPlayerLook(yaw, pitch, true)) - - mc.netHandler.addToSendQueue(C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN)) - thePlayer.itemInUseCount = currentItem.maxItemUseDuration - 1 - } - } - if ((usingItem)is ItemFood || (usingItem)is ItemBucketMilk || (usingItem)is ItemPotion) { when (modeValue.get().toLowerCase()) { "instant" -> { diff --git a/src/minecraft/kevin/module/modules/player/InventoryCleaner.kt b/src/minecraft/kevin/module/modules/player/InventoryCleaner.kt index f5207f13..bffe7b04 100644 --- a/src/minecraft/kevin/module/modules/player/InventoryCleaner.kt +++ b/src/minecraft/kevin/module/modules/player/InventoryCleaner.kt @@ -1,6 +1,9 @@ package kevin.module.modules.player -import kevin.event.* +import kevin.event.ClickWindowEvent +import kevin.event.EventTarget +import kevin.event.PacketEvent +import kevin.event.UpdateEvent import kevin.main.KevinClient import kevin.module.* import kevin.module.modules.combat.AutoArmor @@ -13,6 +16,7 @@ import net.minecraft.item.* import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement import net.minecraft.network.play.client.C0DPacketCloseWindow import net.minecraft.network.play.client.C16PacketClientStatus +import net.minecraft.potion.Potion class InventoryCleaner : Module(name = "InventoryCleaner", description = "Automatically throws away useless items.", category = ModuleCategory.PLAYER) { private val maxDelayValue: IntegerValue = object : IntegerValue("MaxDelay", 600, 0, 1000) { @@ -41,8 +45,11 @@ class InventoryCleaner : Module(name = "InventoryCleaner", description = "Automa private val maxBlocks = IntegerValue("MaxBlocks",4,1,36) private val maxBuckets = IntegerValue("MaxBuckets",2,0,36) private val maxThrowableItems = IntegerValue("MaxThrowableItems",0,0,36) + private val maxPotions = IntegerValue("MaxPotions",9,0,36) - private val items = arrayOf("None", "Ignore", "Sword", "Bow", "Pickaxe", "Axe", "Food", "Block", "Water", "Gapple", "Pearl", "Throwable") + private val keepBadEffectPotions = BooleanValue("KeepBadEffectPotions", false) + + private val items = arrayOf("None", "Ignore", "Sword", "Bow", "Pickaxe", "Axe", "Food", "Block", "Water", "Gapple", "Pearl", "Throwable", "GoodPotion", "BadPotion") private val sortSlot1Value = ListValue("SortSlot-1", items, "Sword") private val sortSlot2Value = ListValue("SortSlot-2", items, "Bow") private val sortSlot3Value = ListValue("SortSlot-3", items, "Pickaxe") @@ -77,9 +84,9 @@ class InventoryCleaner : Module(name = "InventoryCleaner", description = "Automa val garbageItems = items(9, if (hotbarValue.get()) 45 else 36) .filter { - !isUseful(it.value, it.key) + !isUseful(it.value, it.key)/* ||(it.value.item is ItemBlock&&blocks > maxBlocks.get()) - ||(it.value.item is ItemBucket&&buckets > maxBuckets.get()) + ||(it.value.item is ItemBucket&&buckets > maxBuckets.get())*/ } .keys .toMutableList() @@ -132,6 +139,15 @@ class InventoryCleaner : Module(name = "InventoryCleaner", description = "Automa .forEach { _ -> throwables+=1 } return throwables } + //Potions + private val potions: Int + get() { + var potions = 0 + mc.thePlayer.inventory.mainInventory + .filter { it!=null&&it.item!=null&&it.item is ItemPotion } + .forEach { _ -> potions+=1 } + return potions + } fun isUseful(itemStack: ItemStack, slot: Int): Boolean { return try { @@ -189,7 +205,7 @@ class InventoryCleaner : Module(name = "InventoryCleaner", description = "Automa } else item is ItemFood || itemStack.unlocalizedName == "item.arrow" || ((item is ItemBlock && item.block !is BlockBush)&&(blocks<=maxBlocks.get()||!this.state)) || item is ItemBed || itemStack.unlocalizedName == "item.diamond" || itemStack.unlocalizedName == "item.ingotIron" || - item is ItemPotion || item is ItemEnderPearl || item is ItemEnchantedBook || (item is ItemBucket&&(buckets<=maxBuckets.get()||!this.state)) || itemStack.unlocalizedName == "item.stick" || + (item is ItemPotion && (keepBadEffectPotions.get()||!item.getEffects(itemStack).any { Potion.potionTypes[it.potionID].isBadEffect }) && (potions<=maxPotions.get()||!this.state)) || item is ItemEnderPearl || item is ItemEnchantedBook || (item is ItemBucket&&(buckets<=maxBuckets.get()||!this.state)) || itemStack.unlocalizedName == "item.stick" || ignoreVehiclesValue.get() && (item is ItemBoat || item is ItemMinecart) || ((item is ItemSnowball||item is ItemEgg)&&(throwables<=maxThrowableItems.get()||!this.state)) } catch (ex: Exception) { true @@ -291,7 +307,7 @@ class InventoryCleaner : Module(name = "InventoryCleaner", description = "Automa val item = stack.item if (item is ItemFood && item !is ItemAppleGold && !type(index).equals("Food", ignoreCase = true)) { - val replaceCurr = ItemUtils.isStackEmpty(slotStack) + val replaceCurr = ItemUtils.isStackEmpty(slotStack) || slotStack?.item !is ItemFood || slotStack.item is ItemAppleGold return if (replaceCurr) index else null } @@ -306,7 +322,7 @@ class InventoryCleaner : Module(name = "InventoryCleaner", description = "Automa if (item is ItemBlock && !InventoryUtils.BLOCK_BLACKLIST.contains(item.block) && !type(index).equals("Block", ignoreCase = true)) { - val replaceCurr = ItemUtils.isStackEmpty(slotStack) + val replaceCurr = ItemUtils.isStackEmpty(slotStack) || slotStack?.item !is ItemBlock || (slotStack.item is ItemBlock && InventoryUtils.BLOCK_BLACKLIST.contains((slotStack.item as ItemBlock).block)) return if (replaceCurr) index else null } @@ -320,7 +336,7 @@ class InventoryCleaner : Module(name = "InventoryCleaner", description = "Automa val item = stack.item if ((item is ItemSnowball||item is ItemEgg) && !type(index).equals("Throwable", ignoreCase = true)) { - val replaceCurr = ItemUtils.isStackEmpty(slotStack) + val replaceCurr = ItemUtils.isStackEmpty(slotStack) || (slotStack?.item !is ItemSnowball && slotStack?.item !is ItemEgg) return if (replaceCurr) index else null } @@ -369,6 +385,34 @@ class InventoryCleaner : Module(name = "InventoryCleaner", description = "Automa } } } + + "goodpotion" -> { + thePlayer.inventory.mainInventory.forEachIndexed { index, stack -> + if (stack != null) { + val item = stack.item + + if (item is ItemPotion && !item.getEffects(stack).any { Potion.potionTypes[it.potionID].isBadEffect } && !type(index).equals("Potion", ignoreCase = true)) { + val replaceCurr = ItemUtils.isStackEmpty(slotStack) || slotStack?.item !is ItemPotion || (slotStack.item as ItemPotion).getEffects(slotStack).any { Potion.potionTypes[it.potionID].isBadEffect } + + return if (replaceCurr) index else null + } + } + } + } + + "badpotion" -> { + thePlayer.inventory.mainInventory.forEachIndexed { index, stack -> + if (stack != null) { + val item = stack.item + + if (item is ItemPotion && item.getEffects(stack).any { Potion.potionTypes[it.potionID].isBadEffect } && !type(index).equals("Potion", ignoreCase = true)) { + val replaceCurr = ItemUtils.isStackEmpty(slotStack) || slotStack?.item !is ItemPotion || !(slotStack.item as ItemPotion).getEffects(slotStack).any { Potion.potionTypes[it.potionID].isBadEffect } + + return if (replaceCurr) index else null + } + } + } + } } return null diff --git a/src/minecraft/kevin/module/modules/render/Renderer.kt b/src/minecraft/kevin/module/modules/render/Renderer.kt index 7767175b..a86abf88 100644 --- a/src/minecraft/kevin/module/modules/render/Renderer.kt +++ b/src/minecraft/kevin/module/modules/render/Renderer.kt @@ -483,7 +483,7 @@ object Renderer : Module("Renderer","Allows you to modify some renderings.",cate } val killAura = KevinClient.moduleManager.getModule("Killaura") as KillAura - if (killAura.state&&killAura.target!=null){ + if (killAura.state&&(killAura.target!=null||killAura.sTarget!=null)){ head.rotateAngleX = RotationUtils.serverRotation.pitch / (180f / Math.PI.toFloat()) } diff --git a/src/minecraft/kevin/module/modules/render/Rotations.kt b/src/minecraft/kevin/module/modules/render/Rotations.kt index 1a837b71..9822ef2a 100644 --- a/src/minecraft/kevin/module/modules/render/Rotations.kt +++ b/src/minecraft/kevin/module/modules/render/Rotations.kt @@ -50,7 +50,7 @@ class Rotations : Module("Rotations", description = "Allows you to see server-si private fun shouldRotate(): Boolean { val killAura = KevinClient.moduleManager.getModule("KillAura") as KillAura - return (getState("KillAura") && killAura.target != null) + return (getState("KillAura") && (killAura.target != null || killAura.sTarget != null)) || getState("Scaffold") || getState("Breaker") || getState("Nuker")/**getState(Tower::class.java) || getState(BowAimbot::class.java) || || getState(CivBreak::class.java) || diff --git a/src/minecraft/kevin/module/modules/world/Breaker.kt b/src/minecraft/kevin/module/modules/world/Breaker.kt index 7046dec5..f3d56104 100644 --- a/src/minecraft/kevin/module/modules/world/Breaker.kt +++ b/src/minecraft/kevin/module/modules/world/Breaker.kt @@ -72,7 +72,7 @@ class Breaker : Module("Breaker",description = "Destroys selected blocks around if (noHitValue.get()) { val killAura = KevinClient.moduleManager.getModule("KillAura") as KillAura - if (killAura.state && killAura.target != null) + if (killAura.state && (killAura.target != null || killAura.sTarget != null)) return } diff --git a/src/minecraft/kevin/module/modules/world/Scaffold.kt b/src/minecraft/kevin/module/modules/world/Scaffold.kt index 1ece9046..7a8d2257 100644 --- a/src/minecraft/kevin/module/modules/world/Scaffold.kt +++ b/src/minecraft/kevin/module/modules/world/Scaffold.kt @@ -6,8 +6,7 @@ import kevin.module.* import kevin.utils.* import kevin.utils.BlockUtils.canBeClicked import kevin.utils.BlockUtils.isReplaceable -import net.minecraft.block.Block -import net.minecraft.block.BlockBush +import net.minecraft.block.* import net.minecraft.client.gui.ScaledResolution import net.minecraft.client.renderer.GlStateManager import net.minecraft.client.settings.GameSettings @@ -19,11 +18,8 @@ import net.minecraft.network.play.client.C09PacketHeldItemChange import net.minecraft.network.play.client.C0APacketAnimation import net.minecraft.network.play.client.C0BPacketEntityAction import net.minecraft.stats.StatList -import net.minecraft.util.BlockPos -import net.minecraft.util.EnumFacing +import net.minecraft.util.* import net.minecraft.util.MathHelper.wrapAngleTo180_float -import net.minecraft.util.MovingObjectPosition -import net.minecraft.util.Vec3 import org.lwjgl.opengl.GL11 import java.awt.Color import java.util.* @@ -88,17 +84,31 @@ class Scaffold : Module("Scaffold", "Automatically places blocks beneath your fe private val edgeDistanceValue = FloatValue("EagleEdgeDistance", 0f, 0f, 0.5f) // Expand + private val expandMode = ListValue("ExpandMode", arrayOf("LiquidBounce", "Sigma"), "LiquidBounce") + private val expandOnlyMove = BooleanValue("ExpandOnlyMove", true) + private val expandOnlyMoveOnlyGround = BooleanValue("ExpandOnlyMoveOnlyGround", true) private val expandLengthValue = IntegerValue("ExpandLength", 0, 0, 6) + private val shouldExpand + get() = expandLengthValue.get()!=0&&!(jumpCheckValue.get()&&mc.gameSettings.keyBindJump.isKeyDown)&&!(downCheckValue.get()&&shouldGoDown)&&(!expandOnlyMove.get()||(MovementUtils.isMoving||(expandOnlyMoveOnlyGround.get()&&!mc.thePlayer.onGround))) + // Rotation Options + private val rotationValues = arrayOf("Off", "Normal", "AAC") private val strafeMode = ListValue("Strafe", arrayOf("Off", "AAC"), "Off") - private val rotationsValue = BooleanValue("Rotations", true) + private val rotationsValue = ListValue("Rotations", rotationValues, "Normal") + private val towerRotationsValue = ListValue("TowerRotations", rotationValues, "Normal") + private val aacYawOffsetValue = IntegerValue("AACYawOffset", 0, 0, 90) private val silentRotationValue = BooleanValue("SilentRotation", true) private val keepRotationValue = BooleanValue("KeepRotation", true) private val keepLengthValue = IntegerValue("KeepRotationLength", 0, 0, 20) + private val towerState + get() = mc.gameSettings.keyBindJump.isKeyDown + private val rotationsOn + get() = !if (towerState) towerRotationsValue equal "Off" else rotationsValue equal "Off" + // XZ/Y range - private val searchMode = ListValue("XYZSearch", arrayOf("Auto", "AutoCenter", "Manual"), "AutoCenter") + private val searchMode = ListValue("XYZSearch", arrayOf("Auto", "AutoCenter", "Manual", "Sigma"), "AutoCenter") private val xzRangeValue = FloatValue("xzRange", 0.8f, 0f, 1f) private var yRangeValue = FloatValue("yRange", 0.8f, 0f, 1f) private val minDistValue = FloatValue("MinDist", 0.0f, 0.0f, 0.2f) @@ -427,7 +437,7 @@ class Scaffold : Module("Scaffold", "Automatically places blocks beneath your fe return update() - if (rotationsValue.get() + if (rotationsOn && (keepRotationValue.get() || !lockRotationTimer.hasTimePassed(keepLengthValue.get())) && lockRotation != null ) { @@ -471,7 +481,7 @@ class Scaffold : Module("Scaffold", "Automatically places blocks beneath your fe } // Lock Rotation - if (rotationsValue.get() + if (rotationsOn && (keepRotationValue.get() || !lockRotationTimer.hasTimePassed(keepLengthValue.get())) && lockRotation != null && strafeMode.get().equals("Off", true) @@ -482,7 +492,7 @@ class Scaffold : Module("Scaffold", "Automatically places blocks beneath your fe } // Face block - if ((facesBlock || !rotationsValue.get()) && placeModeValue.get() + if ((facesBlock || !rotationsOn) && placeModeValue.get() .equals(eventState.stateName, true) ) place() @@ -519,7 +529,7 @@ class Scaffold : Module("Scaffold", "Automatically places blocks beneath your fe ) InventoryUtils.findAutoBlockBlock() == -1 && !isHeldItemBlock else !isHeldItemBlock ) return - findBlock(expandLengthValue.get()!=0&&!(jumpCheckValue.get()&&mc.gameSettings.keyBindJump.isKeyDown)&&!(downCheckValue.get()&&shouldGoDown)) + findBlock(shouldExpand) } private fun setRotation(rotation: Rotation) { @@ -530,6 +540,213 @@ class Scaffold : Module("Scaffold", "Automatically places blocks beneath your fe mc.thePlayer!!.rotationPitch = rotation.pitch } } +/* + private enum class X8Direction(val range: Pair, val cross: Boolean, val leftRight: Double? = null, val x4: Boolean = false, val x: Int = 1, val z: Int = 1) { + South(-22.5 to 22.5, false, x4 = true), //南 + WestSouth(22.5 to 67.5, false, 45.0, x = -1, z = 1), //西南 + West(67.5 to 112.5, false, x4 = true), //西 + WestNorth(112.5 to 157.5, false, 135.0, x = -1, z = -1), //西北 + North(157.5 to -157.5, true, x4 = true), //北 + EastNorth(-157.5 to -112.5, false, -135.0, x = 1, z = -1), //东北 + East(-112.5 to -67.5, false, x4 = true), //东 + EastSouth(-67.5 to -22.5, false, -45.0, x = 1, z = 1), //东南 + } + private enum class EnumLeftRight { + Left,Right + } + private val getDirection: Pair + get() { + val rotationYaw = wrapAngleTo180_float(mc.thePlayer.rotationYaw) + val x8Direction = X8Direction.values().find { + if (it.cross) + rotationYaw >= it.range.first || rotationYaw < it.range.second + else + rotationYaw >= it.range.first && rotationYaw < it.range.second + } ?: X8Direction.North + val leftRight = if (x8Direction.leftRight != null) + if (rotationYaw >= x8Direction.range.first && rotationYaw < x8Direction.leftRight) + EnumLeftRight.Left + else + EnumLeftRight.Right + else + EnumLeftRight.Left + return x8Direction to leftRight + } +*/ + + private fun isAirBlock(block: Block): Boolean { + return if (block.material.isReplaceable) { + !(block is BlockSnow && block.getBlockBoundsMaxY() > 0.125) + } else false + } + private fun getExpandCords(x: Double, z: Double, forward: Double, strafe: Double, YAW: Float, expandLength: Double): Pair { + var underPos = BlockPos(x, mc.thePlayer.posY - 1, z) + var underBlock = mc.theWorld.getBlockState(underPos).block + var xCalc = x//-999.0 + var zCalc = z//-999.0 + var dist = 0.0 + val expandDist = expandLength * 2 + while (!isAirBlock(underBlock)) { + xCalc = x + zCalc = z + dist++ + if (dist > expandDist) { + dist = expandDist + } + xCalc += (forward * 0.45 * cos(Math.toRadians(YAW + 90.0)) + strafe * 0.45 * sin(Math.toRadians(YAW + 90.0))) * dist + zCalc += (forward * 0.45 * sin(Math.toRadians(YAW + 90.0)) - strafe * 0.45 * cos(Math.toRadians(YAW + 90.0))) * dist + if (dist == expandDist) { + break + } + underPos = BlockPos(xCalc, mc.thePlayer.posY - 1, zCalc) + underBlock = mc.theWorld.getBlockState(underPos).block + } + return xCalc to zCalc + } + private fun isPosSolid(pos: BlockPos): Boolean { + val block = mc.theWorld.getBlockState(pos).block + return ((block.material.isSolid || !block.isTranslucent || block.isBlockNormalCube || block is BlockLadder || block is BlockCarpet + || block is BlockSnow || block is BlockSkull) + && !block.material.isLiquid && block !is BlockContainer) + } + private fun getBlockData(pos: BlockPos): Pair? { + when { + isPosSolid(pos.add(0, -1, 0)) -> return pos.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos.add(-1, 0, 0)) -> return pos.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos.add(1, 0, 0)) -> return pos.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos.add(0, 0, 1)) -> return pos.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos.add(0, 0, -1)) -> return pos.add(0, 0, -1) to EnumFacing.SOUTH + } + val pos1 = pos.add(-1, 0, 0) + when { + isPosSolid(pos1.add(0, -1, 0)) -> return pos1.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos1.add(-1, 0, 0)) -> return pos1.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos1.add(1, 0, 0)) -> return pos1.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos1.add(0, 0, 1)) -> return pos1.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos1.add(0, 0, -1)) -> return pos1.add(0, 0, -1) to EnumFacing.SOUTH + } + val pos2 = pos.add(1, 0, 0) + when { + isPosSolid(pos2.add(0, -1, 0)) -> return pos2.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos2.add(-1, 0, 0)) -> return pos2.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos2.add(1, 0, 0)) -> return pos2.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos2.add(0, 0, 1)) -> return pos2.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos2.add(0, 0, -1)) -> return pos2.add(0, 0, -1) to EnumFacing.SOUTH + } + val pos3 = pos.add(0, 0, 1) + when { + isPosSolid(pos3.add(0, -1, 0)) -> return pos3.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos3.add(-1, 0, 0)) -> return pos3.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos3.add(1, 0, 0)) -> return pos3.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos3.add(0, 0, 1)) -> return pos3.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos3.add(0, 0, -1)) -> return pos3.add(0, 0, -1) to EnumFacing.SOUTH + } + val pos4 = pos.add(0, 0, -1) + when { + isPosSolid(pos4.add(0, -1, 0)) -> return pos4.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos4.add(-1, 0, 0)) -> return pos4.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos4.add(1, 0, 0)) -> return pos4.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos4.add(0, 0, 1)) -> return pos4.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos4.add(0, 0, -1)) -> return pos4.add(0, 0, -1) to EnumFacing.SOUTH + isPosSolid(pos1.add(0, -1, 0)) -> return pos1.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos1.add(-1, 0, 0)) -> return pos1.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos1.add(1, 0, 0)) -> return pos1.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos1.add(0, 0, 1)) -> return pos1.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos1.add(0, 0, -1)) -> return pos1.add(0, 0, -1) to EnumFacing.SOUTH + isPosSolid(pos2.add(0, -1, 0)) -> return pos2.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos2.add(-1, 0, 0)) -> return pos2.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos2.add(1, 0, 0)) -> return pos2.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos2.add(0, 0, 1)) -> return pos2.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos2.add(0, 0, -1)) -> return pos2.add(0, 0, -1) to EnumFacing.SOUTH + isPosSolid(pos3.add(0, -1, 0)) -> return pos3.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos3.add(-1, 0, 0)) -> return pos3.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos3.add(1, 0, 0)) -> return pos3.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos3.add(0, 0, 1)) -> return pos3.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos3.add(0, 0, -1)) -> return pos3.add(0, 0, -1) to EnumFacing.SOUTH + isPosSolid(pos4.add(0, -1, 0)) -> return pos4.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos4.add(-1, 0, 0)) -> return pos4.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos4.add(1, 0, 0)) -> return pos4.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos4.add(0, 0, 1)) -> return pos4.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos4.add(0, 0, -1)) -> return pos4.add(0, 0, -1) to EnumFacing.SOUTH + } + val pos5 = pos.add(0, -1, 0) + when { + isPosSolid(pos5.add(0, -1, 0)) -> return pos5.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos5.add(-1, 0, 0)) -> return pos5.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos5.add(1, 0, 0)) -> return pos5.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos5.add(0, 0, 1)) -> return pos5.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos5.add(0, 0, -1)) -> return pos5.add(0, 0, -1) to EnumFacing.SOUTH + } + val pos6 = pos5.add(1, 0, 0) + when { + isPosSolid(pos6.add(0, -1, 0)) -> return pos6.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos6.add(-1, 0, 0)) -> return pos6.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos6.add(1, 0, 0)) -> return pos6.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos6.add(0, 0, 1)) -> return pos6.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos6.add(0, 0, -1)) -> return pos6.add(0, 0, -1) to EnumFacing.SOUTH + } + val pos7 = pos5.add(-1, 0, 0) + when { + isPosSolid(pos7.add(0, -1, 0)) -> return pos7.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos7.add(-1, 0, 0)) -> return pos7.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos7.add(1, 0, 0)) -> return pos7.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos7.add(0, 0, 1)) -> return pos7.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos7.add(0, 0, -1)) -> return pos7.add(0, 0, -1) to EnumFacing.SOUTH + } + val pos8 = pos5.add(0, 0, 1) + when { + isPosSolid(pos8.add(0, -1, 0)) -> return pos8.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos8.add(-1, 0, 0)) -> return pos8.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos8.add(1, 0, 0)) -> return pos8.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos8.add(0, 0, 1)) -> return pos8.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos8.add(0, 0, -1)) -> return pos8.add(0, 0, -1) to EnumFacing.SOUTH + } + val pos9 = pos5.add(0, 0, -1) + when { + isPosSolid(pos9.add(0, -1, 0)) -> return pos9.add(0, -1, 0) to EnumFacing.UP + isPosSolid(pos9.add(-1, 0, 0)) -> return pos9.add(-1, 0, 0) to EnumFacing.EAST + isPosSolid(pos9.add(1, 0, 0)) -> return pos9.add(1, 0, 0) to EnumFacing.WEST + isPosSolid(pos9.add(0, 0, 1)) -> return pos9.add(0, 0, 1) to EnumFacing.NORTH + isPosSolid(pos9.add(0, 0, -1)) -> return pos9.add(0, 0, -1) to EnumFacing.SOUTH + } + return null + } + private fun randomNumber(max: Double, min: Double) = + Math.random() * (max - min) + min + private fun getVec3(pos: BlockPos, face: EnumFacing): Vec3 { + var x = pos.x + 0.5 + var y = pos.y + 0.5 + var z = pos.z + 0.5 + x += face.frontOffsetX.toDouble() / 2 + z += face.frontOffsetZ.toDouble() / 2 + y += face.frontOffsetY.toDouble() / 2 + if (face == EnumFacing.UP || face == EnumFacing.DOWN) { + x += randomNumber(0.3, -0.3) + z += randomNumber(0.3, -0.3) + } else { + y += randomNumber(0.3, -0.3) + } + if (face == EnumFacing.WEST || face == EnumFacing.EAST) { + z += randomNumber(0.3, -0.3) + } + if (face == EnumFacing.SOUTH || face == EnumFacing.NORTH) { + x += randomNumber(0.3, -0.3) + } + return Vec3(x, y, z) + } + private fun getRotations(block: BlockPos, face: EnumFacing): Rotation { + val x = block.x + 0.5 - mc.thePlayer.posX + face.frontOffsetX.toDouble() / 2 + val z = block.z + 0.5 - mc.thePlayer.posZ + face.frontOffsetZ.toDouble() / 2 + val y = block.y + 0.5 + val d1 = mc.thePlayer.posY + mc.thePlayer.eyeHeight - y + val d3 = MathHelper.sqrt_double(x * x + z * z).toDouble() + var yaw = (atan2(z, x) * 180.0 / Math.PI).toFloat() - 90.0f + val pitch = (atan2(d1, d3) * 180.0 / Math.PI).toFloat() + if (yaw < 0.0f) { + yaw += 360f + } + return Rotation(yaw, pitch) + } // Search for new target block private fun findBlock(expand: Boolean) { @@ -554,23 +771,49 @@ class Scaffold : Module("Scaffold", "Automatically places blocks beneath your fe return if (expand) { - for (i in 0 until expandLengthValue.get()) { - if (search( - blockPosition.add( - when (mc.thePlayer!!.horizontalFacing) { - EnumFacing.WEST -> -i - EnumFacing.EAST -> i - else -> 0 - }, 0, - when (mc.thePlayer!!.horizontalFacing) { - EnumFacing.NORTH -> -i - EnumFacing.SOUTH -> i - else -> 0 - } - ), false - ) - ) - return + when(expandMode.get()) { + "LiquidBounce" -> { + for (i in 0 until expandLengthValue.get()) { + if (search( + blockPosition.add( + when (mc.thePlayer!!.horizontalFacing) { + EnumFacing.WEST -> -i + EnumFacing.EAST -> i + else -> 0 + }, 0, + when (mc.thePlayer!!.horizontalFacing) { + EnumFacing.NORTH -> -i + EnumFacing.SOUTH -> i + else -> 0 + } + ), false + ) + ) + return + } + } + "Sigma" -> { + /*if (isReplaceable(blockPosition)&&search(blockPosition, !shouldGoDown)) + return*/ + var x = mc.thePlayer.posX + var z = mc.thePlayer.posZ + //if (!mc.thePlayer.isCollidedHorizontally) { + val expandCords = getExpandCords( + x, + z, + mc.thePlayer.movementInput.moveForward.toDouble(), + mc.thePlayer.movementInput.moveStrafe.toDouble(), + mc.thePlayer.rotationYaw, + expandLengthValue.get().toDouble() + ) + /*if (expandCords.first == -999.0 || expandCords.second == -999.0) + return*/ + x = expandCords.first + z = expandCords.second + //} + if (search(BlockPos(x, blockPosition.y.toDouble(), z),false)) + return + } } } else if (searchValue.get()) { for (x in -1..1) { @@ -725,25 +968,52 @@ class Scaffold : Module("Scaffold", "Automatically places blocks beneath your fe @EventTarget fun onRender3D(event: Render3DEvent) { if (!markValue.get()) return - for (i in 0 until if (expandLengthValue.get()!=0) expandLengthValue.get() + 1 else 2) { - val blockPos = BlockPos( - mc.thePlayer!!.posX + when (mc.thePlayer!!.horizontalFacing) { - EnumFacing.WEST -> -i.toDouble() - EnumFacing.EAST -> i.toDouble() - else -> 0.0 - }, - if (sameY() && launchY <= mc.thePlayer!!.posY) launchY - 1.0 else mc.thePlayer!!.posY - (if (mc.thePlayer!!.posY == mc.thePlayer!!.posY + 0.5) 0.0 else 1.0) - if (shouldGoDown) 1.0 else 0.0, - mc.thePlayer!!.posZ + when (mc.thePlayer!!.horizontalFacing) { - EnumFacing.NORTH -> -i.toDouble() - EnumFacing.SOUTH -> i.toDouble() - else -> 0.0 + if (!shouldExpand || expandMode equal "LiquidBounce") { + for (i in 0 until if (shouldExpand) expandLengthValue.get() + 1 else 2) { + val blockPos = BlockPos( + mc.thePlayer!!.posX + when (mc.thePlayer!!.horizontalFacing) { + EnumFacing.WEST -> -i.toDouble() + EnumFacing.EAST -> i.toDouble() + else -> 0.0 + }, + if (sameY() && launchY <= mc.thePlayer!!.posY) launchY - 1.0 else mc.thePlayer!!.posY - (if (mc.thePlayer!!.posY == mc.thePlayer!!.posY + 0.5) 0.0 else 1.0) - if (shouldGoDown) 1.0 else 0.0, + mc.thePlayer!!.posZ + when (mc.thePlayer!!.horizontalFacing) { + EnumFacing.NORTH -> -i.toDouble() + EnumFacing.SOUTH -> i.toDouble() + else -> 0.0 + } + ) + val placeInfo: PlaceInfo? = PlaceInfo.get(blockPos) + if (isReplaceable(blockPos) && placeInfo != null) { + RenderUtils.drawBlockBox(blockPos, Color(68, 117, 255, 100), false) + break } - ) - val placeInfo: PlaceInfo? = PlaceInfo.get(blockPos) - if (isReplaceable(blockPos) && placeInfo != null) { - RenderUtils.drawBlockBox(blockPos, Color(68, 117, 255, 100), false) - break } + } else { + //if (!mc.thePlayer.isCollidedHorizontally) { + val expandCords = getExpandCords( + mc.thePlayer.posX, + mc.thePlayer.posZ, + mc.thePlayer.movementInput.moveForward.toDouble(), + mc.thePlayer.movementInput.moveStrafe.toDouble(), + mc.thePlayer.rotationYaw, + expandLengthValue.get()+1.0 + ) + val blockPos = BlockPos(expandCords.first, mc.thePlayer!!.posY - (if (mc.thePlayer!!.posY == mc.thePlayer!!.posY + 0.5) 0.0 else 1.0), expandCords.second) + val placeInfo: PlaceInfo? = PlaceInfo.get(blockPos) + if (isReplaceable(blockPos) && placeInfo != null) { + RenderUtils.drawBlockBox(blockPos, Color(68, 117, 255, 100), false) + } + //} + } + } + + private fun calculateRotation(rotation: Rotation): Rotation { + return if (towerState) when(towerRotationsValue.get()) { + else -> rotation + } else when(rotationsValue.get()) { + "AAC" -> Rotation(mc.thePlayer.rotationYaw + (if (mc.thePlayer.movementInput.moveForward < 0) 0 else 180) + aacYawOffsetValue.get(), rotation.pitch) + else -> rotation } } @@ -770,102 +1040,112 @@ class Scaffold : Module("Scaffold", "Automatically places blocks beneath your fe mc.thePlayer!!.posZ ) var placeRotation: PlaceRotation? = null - for (facingType in EnumFacing.values()) { - val neighbor = blockPosition.offset(facingType) - if (!canBeClicked(neighbor)) continue - val dirVec = Vec3(facingType.directionVec) - val auto = searchMode.get().equals("Auto", true) - val center = searchMode.get().equals("AutoCenter", true) - var xSearch = if (auto) 0.1 else 0.5 - xzRV / 2 - while (xSearch <= if (auto) 0.9 else 0.5 + xzRV / 2) { - var ySearch = if (auto) 0.1 else 0.5 - yRV / 2 - while (ySearch <= if (auto) 0.9 else 0.5 + yRV / 2) { - var zSearch = if (auto) 0.1 else 0.5 - xzRV / 2 - while (zSearch <= if (auto) 0.9 else 0.5 + xzRV / 2) { - val posVec = Vec3(blockPosition).addVector( - if (center) 0.5 else xSearch, - if (center) 0.5 else ySearch, - if (center) 0.5 else zSearch - ) - val distanceSqPosVec = eyesPos.squareDistanceTo(posVec) - val hitVec = posVec.add(Vec3(dirVec.xCoord * 0.5, dirVec.yCoord * 0.5, dirVec.zCoord * 0.5)) - if (checks && (eyesPos.squareDistanceTo(hitVec) > 18.0 || distanceSqPosVec > eyesPos.squareDistanceTo( - posVec.add(dirVec) - ) || mc.theWorld!!.rayTraceBlocks( - eyesPos, hitVec, - false, - true, - false - ) != null) - ) { - zSearch += if (auto) 0.1 else xzSSV - continue - } + if (searchMode equal "Sigma" && !shouldGoDown) { // Sigma的搜索无法处理下降 + val data = getBlockData(blockPosition) + if (data != null) { + placeRotation = PlaceRotation(PlaceInfo(data.first, data.second, getVec3(data.first, data.second)), getRotations(data.first, data.second)) + } else return false + } else { + for (facingType in EnumFacing.values()) { + val neighbor = blockPosition.offset(facingType) + if (!canBeClicked(neighbor)) continue + val dirVec = Vec3(facingType.directionVec) + val auto = searchMode.get().equals("Auto", true) + val center = searchMode.get().equals("AutoCenter", true) + var xSearch = if (auto) 0.1 else 0.5 - xzRV / 2 + while (xSearch <= if (auto) 0.9 else 0.5 + xzRV / 2) { + var ySearch = if (auto) 0.1 else 0.5 - yRV / 2 + while (ySearch <= if (auto) 0.9 else 0.5 + yRV / 2) { + var zSearch = if (auto) 0.1 else 0.5 - xzRV / 2 + while (zSearch <= if (auto) 0.9 else 0.5 + xzRV / 2) { + val posVec = Vec3(blockPosition).addVector( + if (center) 0.5 else xSearch, + if (center) 0.5 else ySearch, + if (center) 0.5 else zSearch + ) + val distanceSqPosVec = eyesPos.squareDistanceTo(posVec) + val hitVec = posVec.add(Vec3(dirVec.xCoord * 0.5, dirVec.yCoord * 0.5, dirVec.zCoord * 0.5)) + if (checks && (eyesPos.squareDistanceTo(hitVec) > 18.0 || distanceSqPosVec > eyesPos.squareDistanceTo( + posVec.add(dirVec) + ) || mc.theWorld!!.rayTraceBlocks( + eyesPos, hitVec, + false, + true, + false + ) != null) + ) { + zSearch += if (auto) 0.1 else xzSSV + continue + } - // Face block - val diffX = hitVec.xCoord - eyesPos.xCoord - val diffY = hitVec.yCoord - eyesPos.yCoord - val diffZ = hitVec.zCoord - eyesPos.zCoord - val diffXZ = sqrt(diffX * diffX + diffZ * diffZ) - if ((facingType == EnumFacing.NORTH || facingType == EnumFacing.EAST || facingType == EnumFacing.SOUTH || facingType == EnumFacing.WEST) && minDistValue.get() > 0) { - val diff: Double = abs(if (facingType == EnumFacing.NORTH || facingType == EnumFacing.SOUTH) diffZ else diffX) - if (diff < minDistValue.get() || diff > 0.3f) { + // Face block + val diffX = hitVec.xCoord - eyesPos.xCoord + val diffY = hitVec.yCoord - eyesPos.yCoord + val diffZ = hitVec.zCoord - eyesPos.zCoord + val diffXZ = sqrt(diffX * diffX + diffZ * diffZ) + if ((facingType == EnumFacing.NORTH || facingType == EnumFacing.EAST || facingType == EnumFacing.SOUTH || facingType == EnumFacing.WEST) && minDistValue.get() > 0) { + val diff: Double = + abs(if (facingType == EnumFacing.NORTH || facingType == EnumFacing.SOUTH) diffZ else diffX) + if (diff < minDistValue.get() || diff > 0.3f) { + zSearch += if (auto) 0.1 else xzSSV + continue + } + } + val rotation = Rotation( + wrapAngleTo180_float(Math.toDegrees(atan2(diffZ, diffX)).toFloat() - 90f), + wrapAngleTo180_float(-Math.toDegrees(atan2(diffY, diffXZ)).toFloat()) + ) + val rotationVector = RotationUtils.getVectorForRotation(rotation) + val vector = eyesPos.addVector( + rotationVector.xCoord * distanceSqPosVec, + rotationVector.yCoord * distanceSqPosVec, + rotationVector.zCoord * distanceSqPosVec + ) + val obj = mc.theWorld!!.rayTraceBlocks( + eyesPos, vector, + false, + false, + true + ) + if (obj!!.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK || obj.blockPos!! != neighbor) { zSearch += if (auto) 0.1 else xzSSV continue } - } - val rotation = Rotation( - wrapAngleTo180_float(Math.toDegrees(atan2(diffZ, diffX)).toFloat() - 90f), - wrapAngleTo180_float(-Math.toDegrees(atan2(diffY, diffXZ)).toFloat()) - ) - val rotationVector = RotationUtils.getVectorForRotation(rotation) - val vector = eyesPos.addVector( - rotationVector.xCoord * distanceSqPosVec, - rotationVector.yCoord * distanceSqPosVec, - rotationVector.zCoord * distanceSqPosVec - ) - val obj = mc.theWorld!!.rayTraceBlocks( - eyesPos, vector, - false, - false, - true - ) - if (obj!!.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK || obj.blockPos!! != neighbor) { + if (placeRotation == null || RotationUtils.getRotationDifference(rotation) < RotationUtils.getRotationDifference( + placeRotation.rotation + ) + ) { + placeRotation = + PlaceRotation(PlaceInfo(neighbor, facingType.opposite, hitVec), rotation) + } + zSearch += if (auto) 0.1 else xzSSV - continue - } - if (placeRotation == null || RotationUtils.getRotationDifference(rotation) < RotationUtils.getRotationDifference( - placeRotation.rotation - ) - ) { - placeRotation = PlaceRotation(PlaceInfo(neighbor, facingType.opposite, hitVec), rotation) } - - zSearch += if (auto) 0.1 else xzSSV + ySearch += if (auto) 0.1 else ySSV } - ySearch += if (auto) 0.1 else ySSV + xSearch += if (auto) 0.1 else xzSSV } - xSearch += if (auto) 0.1 else xzSSV } } if (placeRotation == null) return false - if (rotationsValue.get()) { + if (rotationsOn) { + val calculatedRotation = calculateRotation(placeRotation.rotation) if (minTurnSpeedValue.get() < 180) { val limitedRotation = RotationUtils.limitAngleChange( RotationUtils.serverRotation, - placeRotation.rotation, + calculatedRotation, (Math.random() * (maxTurnSpeedValue.get() - minTurnSpeedValue.get()) + minTurnSpeedValue.get()).toFloat() ) if ((10 * wrapAngleTo180_float(limitedRotation.yaw)).roundToInt() == (10 * wrapAngleTo180_float( - placeRotation.rotation.yaw + calculatedRotation.yaw )).roundToInt() && (10 * wrapAngleTo180_float(limitedRotation.pitch)).roundToInt() == (10 * wrapAngleTo180_float( - placeRotation.rotation.pitch + calculatedRotation.pitch )).roundToInt() ) { - setRotation(placeRotation.rotation) - lockRotation = placeRotation.rotation + setRotation(calculatedRotation) + lockRotation = calculatedRotation facesBlock = true } else { setRotation(limitedRotation) @@ -873,8 +1153,8 @@ class Scaffold : Module("Scaffold", "Automatically places blocks beneath your fe facesBlock = false } } else { - setRotation(placeRotation.rotation) - lockRotation = placeRotation.rotation + setRotation(calculatedRotation) + lockRotation = calculatedRotation facesBlock = true } lockRotationTimer.reset() @@ -906,5 +1186,5 @@ class Scaffold : Module("Scaffold", "Automatically places blocks beneath your fe return amount } override val tag: String - get() = if (!(towerModeValue equal "Jump")&&mc.gameSettings.keyBindJump.isKeyDown) "Tower" else if (mc.gameSettings.keyBindJump.isKeyDown) "JumpUp" else if (shouldGoDown) "Down" else if (expandLengthValue.get()!=0) "Expand" else "Normal" + get() = if (!(towerModeValue equal "Jump")&&mc.gameSettings.keyBindJump.isKeyDown) "Tower" else if (mc.gameSettings.keyBindJump.isKeyDown) "JumpUp" else if (shouldGoDown) "Down" else if (shouldExpand) "Expand" else "Normal" } \ No newline at end of file diff --git a/src/minecraft/kevin/script/ScriptManager.kt b/src/minecraft/kevin/script/ScriptManager.kt index 34fe244c..652cdb1a 100644 --- a/src/minecraft/kevin/script/ScriptManager.kt +++ b/src/minecraft/kevin/script/ScriptManager.kt @@ -49,6 +49,28 @@ object ScriptManager : ICommand { Minecraft.logger.info("[ScriptManager] Reloaded ClickGui.") } + fun reAdd() { + val dir = KevinClient.fileManager.scripts + if (!dir.exists()) return + val files = dir.listFiles() ?: return + Minecraft.logger.info("[ScriptManager] Re add scripts...") + val time = System.currentTimeMillis() + scripts.clear() + files.forEach { + try { + val script = Script(it) + script.initScript() + scripts += script + } catch (e: Throwable){ + Minecraft.logger.error("[ScriptManager] Error loading script ${it.name}!",e) + } + } + Minecraft.logger.info("[ScriptManager] Re add ${scripts.size} script(s),${System.currentTimeMillis()-time}ms.") + KevinClient.clickGUI = ClickGui.ClickGUI() + KevinClient.newClickGui = ClickGui.NewClickGui() + Minecraft.logger.info("[ScriptManager] Reloaded ClickGui.") + } + class Script(private val scriptFile: File) : MinecraftInstance() { lateinit var scriptName: String lateinit var scriptVersion: String diff --git a/src/minecraft/kevin/utils/MovementUtils.kt b/src/minecraft/kevin/utils/MovementUtils.kt index f9837803..34fbe42f 100644 --- a/src/minecraft/kevin/utils/MovementUtils.kt +++ b/src/minecraft/kevin/utils/MovementUtils.kt @@ -1,6 +1,7 @@ package kevin.utils -import java.lang.Math.* +import java.lang.Math.toRadians +import kotlin.math.* object MovementUtils : MinecraftInstance() { val speed: Float @@ -43,4 +44,11 @@ object MovementUtils : MinecraftInstance() { if (thePlayer.moveStrafing < 0f) rotationYaw += 90f * forward return toRadians(rotationYaw.toDouble()) } + + fun move(speed: Float) { + if (!isMoving) return + val yaw = direction + mc.thePlayer.motionX += -sin(yaw) * speed + mc.thePlayer.motionZ += cos(yaw) * speed + } } \ No newline at end of file diff --git a/src/minecraft/kevin/utils/PacketUtils.kt b/src/minecraft/kevin/utils/PacketUtils.kt index 31ad3f91..3e00c0a9 100644 --- a/src/minecraft/kevin/utils/PacketUtils.kt +++ b/src/minecraft/kevin/utils/PacketUtils.kt @@ -1,12 +1,22 @@ package kevin.utils +import kevin.event.EventTarget +import kevin.event.Listenable +import kevin.event.WorldEvent import net.minecraft.network.Packet -object PacketUtils : MinecraftInstance() { +object PacketUtils : MinecraftInstance(), Listenable { val packetList = arrayListOf>() fun sendPacketNoEvent(packet: Packet<*>){ packetList.add(packet) mc.netHandler.addToSendQueue(packet) } + + @EventTarget + fun onWorld(event: WorldEvent) { + packetList.clear() + } + + override fun handleEvents() = true } \ No newline at end of file diff --git a/src/minecraft/kevin/utils/RenderUtils.java b/src/minecraft/kevin/utils/RenderUtils.java index 78fe44da..8828ca94 100644 --- a/src/minecraft/kevin/utils/RenderUtils.java +++ b/src/minecraft/kevin/utils/RenderUtils.java @@ -12,6 +12,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; +import net.minecraft.util.ResourceLocation; import net.minecraft.util.Timer; import org.lwjgl.opengl.GL11; @@ -19,6 +20,8 @@ import java.util.HashMap; import java.util.Map; +import static java.lang.Math.cos; +import static java.lang.Math.sin; import static org.lwjgl.opengl.GL11.*; public final class RenderUtils extends MinecraftInstance{ @@ -275,6 +278,45 @@ public static void drawBorder(float x, float y, float x2, float y2, float width, glDisable(GL_LINE_SMOOTH); } + public static void drawShadow(float x, float y, float width, float height) { + drawTexturedRect(x - 9, y - 9, 9, 9, "PanelTopLeft"); + drawTexturedRect(x - 9, y + height, 9, 9, "PanelBottomLeft"); + drawTexturedRect(x + width, y + height, 9, 9, "PanelBottomRight"); + drawTexturedRect(x + width, y - 9, 9, 9, "PanelTopRight"); + drawTexturedRect(x - 9, y, 9, height, "PanelLeft"); + drawTexturedRect(x + width, y, 9, height, "PanelRight"); + drawTexturedRect(x, y - 9, width, 9, "PanelTop"); + drawTexturedRect(x, y + height, width, 9, "PanelBottom"); + } + + public static void drawTexturedRect(float x, float y, float width, float height, String image) { + glPushMatrix(); + final boolean enableBlend = glIsEnabled(GL_BLEND); + final boolean disableAlpha = !glIsEnabled(GL_ALPHA_TEST); + if (!enableBlend) glEnable(GL_BLEND); + if (!disableAlpha) glDisable(GL_ALPHA_TEST); + mc.getTextureManager().bindTexture(new ResourceLocation("kevin/shadows/" + image + ".png")); + GlStateManager.color(1F, 1F, 1F, 1F); + RenderUtils.drawModalRectWithCustomSizedTexture(x, y, 0, 0, width, height, width, height); + if (!enableBlend) glDisable(GL_BLEND); + if (!disableAlpha) glEnable(GL_ALPHA_TEST); + glPopMatrix(); + } + + public static void drawModalRectWithCustomSizedTexture(float x, float y, float u, float v, float width, float height, float textureWidth, float textureHeight) + { + float f = 1.0F / textureWidth; + float f1 = 1.0F / textureHeight; + Tessellator tessellator = Tessellator.getInstance(); + WorldRenderer worldrenderer = tessellator.getWorldRenderer(); + worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX); + worldrenderer.pos(x, (y + height), 0.0D).tex((u * f), ((v + height) * f1)).endVertex(); + worldrenderer.pos((x + width), (y + height), 0.0D).tex(((u + width) * f), ((v + height) * f1)).endVertex(); + worldrenderer.pos((x + width), y, 0.0D).tex(((u + width) * f), (v * f1)).endVertex(); + worldrenderer.pos(x, y, 0.0D).tex((u * f), (v * f1)).endVertex(); + tessellator.draw(); + } + public static void drawRectRoundedCorners(final double x,final double y,final double x2,final double y2,final double radius,final Color color){ final double X1 = Math.min(x,x2); final double X2 = Math.max(x,x2); @@ -292,6 +334,64 @@ public static void drawRectRoundedCorners(final double x,final double y,final do drawSector(X2-radius,Y1+radius,270,360,radius,color); } + public static void drawBorderRoundedCorners(final double x,final double y,final double x2,final double y2,final double radius,final float width,final Color color) { + final double X1 = Math.min(x,x2); + final double X2 = Math.max(x,x2); + final double Y1 = Math.min(y,y2); + final double Y2 = Math.max(y,y2); + + if (radius*2>X2-X1 || radius*2>Y2-Y1) return; + + /* + A 1 B + ↓ ↓ ↓ + /-------------\ + 2-> | | <-3 + | | + \-------------/ + ↑ ↑ ↑ + C 4 D + */ + + glEnable(GL_BLEND); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + glColor(color); + drawLine(X1 + radius , Y1, X2 - radius, Y1, width); // 1 + drawLine(X1 , Y1 + radius, X1, Y2 - radius, width); // 2 + drawLine(X2 , Y1 + radius, X2, Y2 - radius, width); // 3 + drawLine(X1 + radius , Y2, X2 - radius, Y2, width); // 4 + glDisable(GL_BLEND); + + arc(X1 + radius, Y1 + radius, 180, 270, radius, width, color); //A + arc(X2 - radius, Y1 + radius, 270, 360, radius, width, color); //B + arc(X1 + radius, Y2 - radius, 90 , 180, radius, width, color); //C + arc(X2 - radius, Y2 - radius, 0 , 90 , radius, width, color); //D + } + + public static void arc(final double x,final double y,int angle1,int angle2,final double radius,final float width,final Color color) { + if (angle1 > angle2) { + int temp = angle2; + angle2 = angle1; + angle1 = temp; + } + glEnable(GL_BLEND); + glDisable(GL_TEXTURE_2D); + GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); + glLineWidth(width); + glColor(color); + glBegin(GL_LINE_STRIP); + + for(double i = angle2; i >= angle1; i-=1) { + double ldx = cos(i * Math.PI / 180.0) * radius; + double ldy = sin(i * Math.PI / 180.0) * radius; + glVertex2d(x + ldx, y + ldy); + } + + glEnd(); + glEnable(GL_TEXTURE_2D); + glDisable(GL_BLEND); + } + public static void drawSector(final double x,final double y,int angle1,int angle2,final double radius,final Color color){ if (angle1 > angle2) { int temp = angle2; @@ -305,8 +405,8 @@ public static void drawSector(final double x,final double y,int angle1,int angle glBegin(GL11.GL_TRIANGLE_FAN); glVertex2d(x, y); for(double i = angle2; i >= angle1; i-=1) { - double ldx = Math.cos(i * Math.PI / 180.0) * radius; - double ldy = Math.sin(i * Math.PI / 180.0) * radius; + double ldx = cos(i * Math.PI / 180.0) * radius; + double ldy = sin(i * Math.PI / 180.0) * radius; glVertex2d(x + ldx, y + ldy); } glVertex2d(x, y); diff --git a/src/minecraft/kevin/utils/RotationUtils.java b/src/minecraft/kevin/utils/RotationUtils.java index caaaab9a..21329edb 100644 --- a/src/minecraft/kevin/utils/RotationUtils.java +++ b/src/minecraft/kevin/utils/RotationUtils.java @@ -121,7 +121,7 @@ public static void faceBow(final Entity target, final boolean silent, final bool final double posZ = target.posZ + (predict ? (target.posZ - target.prevPosZ) * predictSize : 0) - (player.posZ + (predict ? (player.posZ - player.prevPosZ) : 0)); final double posSqrt = Math.sqrt(posX * posX + posZ * posZ); - float velocity = (KevinClient.moduleManager.getModule("FastUse").getState() && ((FastUse) KevinClient.moduleManager.getModule("FastUse")).getFastBow().get()) ? 1F : player.getItemInUseDuration() / 20F; + float velocity = KevinClient.moduleManager.getModule("FastBow").getState() ? 1F : player.getItemInUseDuration() / 20F; velocity = (velocity * velocity + velocity * 2) / 3; if (velocity > 1) velocity = 1; diff --git a/src/minecraft/net/minecraft/client/entity/EntityPlayerSP.java b/src/minecraft/net/minecraft/client/entity/EntityPlayerSP.java index 7bf542d8..bdb92984 100644 --- a/src/minecraft/net/minecraft/client/entity/EntityPlayerSP.java +++ b/src/minecraft/net/minecraft/client/entity/EntityPlayerSP.java @@ -297,8 +297,12 @@ protected void joinEntityItemWithWorld(EntityItem itemIn) */ public void sendChatMessage(String message) { - if (!KevinClient.commandManager.execCommand(message)) { + if (KevinClient.moduleManager.getModule("NoCommand").getState()) { this.sendQueue.addToSendQueue(new C01PacketChatMessage(message)); + } else { + if (!KevinClient.commandManager.execCommand(message)) { + this.sendQueue.addToSendQueue(new C01PacketChatMessage(message)); + } } } diff --git a/src/minecraft/net/minecraft/client/gui/GuiChat.java b/src/minecraft/net/minecraft/client/gui/GuiChat.java index c1b0038d..25a5d916 100644 --- a/src/minecraft/net/minecraft/client/gui/GuiChat.java +++ b/src/minecraft/net/minecraft/client/gui/GuiChat.java @@ -304,7 +304,7 @@ public void drawScreen(int mouseX, int mouseY, float partialTicks) this.inputField.drawTextBox(); IChatComponent ichatcomponent = this.mc.ingameGUI.getChatGUI().getChatComponent(Mouse.getX(), Mouse.getY()); - if (ichatcomponent != null && ichatcomponent.getChatStyle().getChatHoverEvent() != null) + if (ichatcomponent != null/* && ichatcomponent.getChatStyle().getChatHoverEvent() != null*/) { this.handleComponentHover(ichatcomponent, mouseX, mouseY); } diff --git a/src/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java b/src/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java index 19f9e3cd..62718156 100644 --- a/src/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java +++ b/src/minecraft/net/minecraft/client/gui/inventory/GuiContainer.java @@ -25,7 +25,7 @@ public abstract class GuiContainer extends GuiScreen { /** The location of the inventory background texture */ - protected static final ResourceLocation inventoryBackground = new ResourceLocation("textures/gui/container/inventory.png"); + public static final ResourceLocation inventoryBackground = new ResourceLocation("textures/gui/container/inventory.png"); /** The X size of the inventory window in pixels. */ protected int xSize = 176; diff --git a/src/minecraft/net/minecraft/client/model/ModelBiped.java b/src/minecraft/net/minecraft/client/model/ModelBiped.java index d3597bde..02342610 100644 --- a/src/minecraft/net/minecraft/client/model/ModelBiped.java +++ b/src/minecraft/net/minecraft/client/model/ModelBiped.java @@ -187,7 +187,7 @@ public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageI final Scaffold scaffold = (Scaffold) KevinClient.moduleManager.getModule("Scaffold"); final Breaker breaker = (Breaker) KevinClient.moduleManager.getModule("Breaker"); final Nuker nuker = (Nuker) KevinClient.moduleManager.getModule("Nuker"); - final boolean needRotate = (killAura.getState() && killAura.getTarget() != null) || scaffold.getState() || (breaker.getState() && breaker.getCurrentDamage() > 0) || (nuker.getState() && nuker.getCurrentDamage() > 0); + final boolean needRotate = (killAura.getState() && (killAura.getTarget() != null || killAura.getSTarget() != null)) || scaffold.getState() || (breaker.getState() && breaker.getCurrentDamage() > 0) || (nuker.getState() && nuker.getCurrentDamage() > 0); if (KevinClient.moduleManager.getModule("Rotations").getState() && RotationUtils.serverRotation != null && entityIn instanceof EntityPlayer && entityIn.equals(Minecraft.getMinecraft().thePlayer) && needRotate) { diff --git a/src/minecraft/resources/shadows/PanelBottom.png b/src/minecraft/resources/shadows/PanelBottom.png new file mode 100644 index 00000000..a7940fb5 Binary files /dev/null and b/src/minecraft/resources/shadows/PanelBottom.png differ diff --git a/src/minecraft/resources/shadows/PanelBottomLeft.png b/src/minecraft/resources/shadows/PanelBottomLeft.png new file mode 100644 index 00000000..5a672c40 Binary files /dev/null and b/src/minecraft/resources/shadows/PanelBottomLeft.png differ diff --git a/src/minecraft/resources/shadows/PanelBottomRight.png b/src/minecraft/resources/shadows/PanelBottomRight.png new file mode 100644 index 00000000..1c691ee1 Binary files /dev/null and b/src/minecraft/resources/shadows/PanelBottomRight.png differ diff --git a/src/minecraft/resources/shadows/PanelLeft.png b/src/minecraft/resources/shadows/PanelLeft.png new file mode 100644 index 00000000..c5cfafb0 Binary files /dev/null and b/src/minecraft/resources/shadows/PanelLeft.png differ diff --git a/src/minecraft/resources/shadows/PanelRight.png b/src/minecraft/resources/shadows/PanelRight.png new file mode 100644 index 00000000..b3d4a4b1 Binary files /dev/null and b/src/minecraft/resources/shadows/PanelRight.png differ diff --git a/src/minecraft/resources/shadows/PanelTop.png b/src/minecraft/resources/shadows/PanelTop.png new file mode 100644 index 00000000..3c3e9f2f Binary files /dev/null and b/src/minecraft/resources/shadows/PanelTop.png differ diff --git a/src/minecraft/resources/shadows/PanelTopLeft.png b/src/minecraft/resources/shadows/PanelTopLeft.png new file mode 100644 index 00000000..c1c35efa Binary files /dev/null and b/src/minecraft/resources/shadows/PanelTopLeft.png differ diff --git a/src/minecraft/resources/shadows/PanelTopRight.png b/src/minecraft/resources/shadows/PanelTopRight.png new file mode 100644 index 00000000..0525949f Binary files /dev/null and b/src/minecraft/resources/shadows/PanelTopRight.png differ