diff --git a/progreso-api/src/main/kotlin/org/progreso/api/extensions/Http.kt b/progreso-api/src/main/kotlin/org/progreso/api/extensions/Http.kt index 853c1be..90068ea 100644 --- a/progreso-api/src/main/kotlin/org/progreso/api/extensions/Http.kt +++ b/progreso-api/src/main/kotlin/org/progreso/api/extensions/Http.kt @@ -3,13 +3,13 @@ package org.progreso.api.extensions import org.progreso.api.Api import java.io.DataOutputStream import java.net.HttpURLConnection -import java.net.URL +import java.net.URI private const val USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36 Edg/117.0.2045.47" fun request(url: String, method: String, data: String, headers: Map): String { - val httpConnection = URL(url).openConnection() as HttpURLConnection + val httpConnection = URI(url).toURL().openConnection() as HttpURLConnection httpConnection.requestMethod = method httpConnection.connectTimeout = 2000 diff --git a/progreso-client/src/main/kotlin/org/progreso/client/gui/clickgui/ClickGUI.kt b/progreso-client/src/main/kotlin/org/progreso/client/gui/clickgui/ClickGUI.kt index d62d78d..d2e1f6f 100644 --- a/progreso-client/src/main/kotlin/org/progreso/client/gui/clickgui/ClickGUI.kt +++ b/progreso-client/src/main/kotlin/org/progreso/client/gui/clickgui/ClickGUI.kt @@ -36,8 +36,6 @@ open class ClickGUI(title: String) : Screen(Text.of(title)) { } override fun render(context: DrawContext, mouseX: Int, mouseY: Int, delta: Float) { - super.render(context, mouseX, mouseY, delta) - windows.forEach { it.render(context, mouseX, mouseY) } } diff --git a/progreso-client/src/main/kotlin/org/progreso/client/gui/clickgui/HudEditor.kt b/progreso-client/src/main/kotlin/org/progreso/client/gui/clickgui/HudEditor.kt index 434ea87..fed9ed1 100644 --- a/progreso-client/src/main/kotlin/org/progreso/client/gui/clickgui/HudEditor.kt +++ b/progreso-client/src/main/kotlin/org/progreso/client/gui/clickgui/HudEditor.kt @@ -33,7 +33,7 @@ object HudEditor : ClickGUI("HudEditor") { val mouseXInt: Int = mouseX.toInt() val mouseYInt: Int = mouseY.toInt() - HUD_MODULES.filter { it.isHover(mouseXInt, mouseYInt) }.forEach { + HUD_MODULES.filter { it.enabled && it.isHover(mouseXInt, mouseYInt) }.forEach { it.dragging = true it.dragX = mouseXInt - it.x it.dragY = mouseYInt - it.y diff --git a/progreso-client/src/main/kotlin/org/progreso/client/modules/hud/FPS.kt b/progreso-client/src/main/kotlin/org/progreso/client/modules/hud/FPS.kt new file mode 100644 index 0000000..f291dcf --- /dev/null +++ b/progreso-client/src/main/kotlin/org/progreso/client/modules/hud/FPS.kt @@ -0,0 +1,10 @@ +package org.progreso.client.modules.hud + +import org.progreso.api.module.AbstractModule +import org.progreso.client.Client.Companion.mc +import org.progreso.client.modules.SimpleTextHudModule + +@AbstractModule.AutoRegister +object FPS : SimpleTextHudModule({ + "FPS: ${mc.client.currentFps}" +}) \ No newline at end of file diff --git a/progreso-client/src/main/kotlin/org/progreso/client/modules/hud/Ping.kt b/progreso-client/src/main/kotlin/org/progreso/client/modules/hud/Ping.kt new file mode 100644 index 0000000..63acb6e --- /dev/null +++ b/progreso-client/src/main/kotlin/org/progreso/client/modules/hud/Ping.kt @@ -0,0 +1,10 @@ +package org.progreso.client.modules.hud + +import org.progreso.api.module.AbstractModule +import org.progreso.client.Client.Companion.mc +import org.progreso.client.modules.SimpleTextHudModule + +@AbstractModule.AutoRegister +object Ping : SimpleTextHudModule({ + "Ping: ${mc.networkHandler.getPlayerListEntry(mc.player.uuid)?.latency ?: 0}" +}) \ No newline at end of file diff --git a/progreso-client/src/main/kotlin/org/progreso/client/modules/hud/Welcomer.kt b/progreso-client/src/main/kotlin/org/progreso/client/modules/hud/Welcomer.kt index e77ca32..544f115 100644 --- a/progreso-client/src/main/kotlin/org/progreso/client/modules/hud/Welcomer.kt +++ b/progreso-client/src/main/kotlin/org/progreso/client/modules/hud/Welcomer.kt @@ -2,9 +2,10 @@ package org.progreso.client.modules.hud import org.progreso.api.module.AbstractModule import org.progreso.client.Client.Companion.mc +import org.progreso.client.accessors.TextAccessor.i18n import org.progreso.client.modules.SimpleTextHudModule @AbstractModule.AutoRegister object Welcomer : SimpleTextHudModule({ - "Welcome to Progreso Client, ${mc.player.name.string}!" + i18n("module.welcomer.text", mc.player.name.string) }) \ No newline at end of file diff --git a/progreso-client/src/main/kotlin/org/progreso/client/modules/render/ESP.kt b/progreso-client/src/main/kotlin/org/progreso/client/modules/render/ESP.kt index 51ef47d..ddbfe79 100644 --- a/progreso-client/src/main/kotlin/org/progreso/client/modules/render/ESP.kt +++ b/progreso-client/src/main/kotlin/org/progreso/client/modules/render/ESP.kt @@ -18,6 +18,7 @@ import org.progreso.client.events.safeEventListener import org.progreso.client.gui.clickgui.element.elements.ColorElement.Companion.copy import org.progreso.client.util.render.* import java.awt.Color +import java.util.concurrent.ConcurrentHashMap import kotlin.properties.ReadWriteProperty import kotlin.reflect.KProperty @@ -28,7 +29,7 @@ object ESP : AbstractModule() { private val animals by espSetting("Animals", false, Color.GREEN) private val self by setting("Self", false) - private val renderMap = mutableMapOf() + private val renderMap = ConcurrentHashMap() fun SettingContainer.espSetting( name: String, diff --git a/progreso-client/src/main/kotlin/org/progreso/client/modules/render/HoleESP.kt b/progreso-client/src/main/kotlin/org/progreso/client/modules/render/HoleESP.kt index adbf787..bb69efc 100644 --- a/progreso-client/src/main/kotlin/org/progreso/client/modules/render/HoleESP.kt +++ b/progreso-client/src/main/kotlin/org/progreso/client/modules/render/HoleESP.kt @@ -13,16 +13,17 @@ import org.progreso.client.gui.clickgui.element.elements.ColorElement.Companion. import org.progreso.client.util.render.* import org.progreso.client.util.world.getBlocksInRadius import java.awt.Color +import java.util.concurrent.CopyOnWriteArrayList @AbstractModule.AutoRegister object HoleESP : AbstractModule() { private val DEFAULT_BOX = Box(0.0, 0.0, 0.0, 1.0, 1.0, 1.0) + private val HOLE_DIRECTIONS = Direction.entries.filter { it != Direction.UP } private val radius by setting("Radius", 5, 3..25) private val color by setting("Color", Color.RED) - private val holeDirections = Direction.entries.filter { it != Direction.UP } - private val holes = mutableListOf() + private val holes = CopyOnWriteArrayList() init { safeEventListener { @@ -54,7 +55,7 @@ object HoleESP : AbstractModule() { private fun isHole(pos: BlockPos): Boolean { if (!isAir(pos)) return false - if (!holeDirections.map { pos.offset(it) }.all { isObsidianOrBedrock(it) }) return false + if (!HOLE_DIRECTIONS.map { pos.offset(it) }.all { isObsidianOrBedrock(it) }) return false if (!isAir(pos.offset(Direction.UP))) return false return true } diff --git a/progreso-client/src/main/kotlin/org/progreso/client/modules/render/StorageESP.kt b/progreso-client/src/main/kotlin/org/progreso/client/modules/render/StorageESP.kt index 58b5291..0001791 100644 --- a/progreso-client/src/main/kotlin/org/progreso/client/modules/render/StorageESP.kt +++ b/progreso-client/src/main/kotlin/org/progreso/client/modules/render/StorageESP.kt @@ -13,6 +13,7 @@ import org.progreso.client.modules.render.ESP.espSetting import org.progreso.client.util.render.* import org.progreso.client.util.world.blockEntities import java.awt.Color +import java.util.concurrent.ConcurrentHashMap @AbstractModule.AutoRegister object StorageESP : AbstractModule() { @@ -25,7 +26,7 @@ object StorageESP : AbstractModule() { private val hopper by espSetting("Hopper", true, Color.GRAY) private val shulkerBox by espSetting("ShulkerBox", true, Color(0x6e, 0x4d, 0x6e).brighter()) - private val renderMap = mutableMapOf() + private val renderMap = ConcurrentHashMap() init { safeEventListener { diff --git a/progreso-client/src/main/resources/assets/progreso/lang/en_us.json b/progreso-client/src/main/resources/assets/progreso/lang/en_us.json index 16a19fc..3dec4fb 100644 --- a/progreso-client/src/main/resources/assets/progreso/lang/en_us.json +++ b/progreso-client/src/main/resources/assets/progreso/lang/en_us.json @@ -72,6 +72,8 @@ "module.notifications.visualrange_enter_message": "[Notifications] %s entered to visual range", "module.notifications.visualrange_leave_message": "[Notifications] %s left visual range", + "module.welcomer.text": "Welcome to Progreso Client, %s!", + "gui.alts.title": "Alts", "gui.alts.title.add_offline_alt": "Add offline alt", "gui.alts.title.add_microsoft_alt": "Add microsoft alt", @@ -128,5 +130,6 @@ "module.Sprint.description": "Automatically makes the player sprint", "module.ESP.description": "Draws entities through blocks", "module.FullBright.description": "Changes game gamma to maximum", + "module.HoleESP.description": "Draws holes through blocks", "module.StorageESP.description": "Draws storages through blocks" } \ No newline at end of file diff --git a/progreso-client/src/main/resources/assets/progreso/lang/ru_ru.json b/progreso-client/src/main/resources/assets/progreso/lang/ru_ru.json index 8348ae4..d55fdfd 100644 --- a/progreso-client/src/main/resources/assets/progreso/lang/ru_ru.json +++ b/progreso-client/src/main/resources/assets/progreso/lang/ru_ru.json @@ -72,6 +72,8 @@ "module.notifications.visualrange_enter_message": "[Notifications] %s вошел в зону видимости", "module.notifications.visualrange_leave_message": "[Notifications] %s покинул зону видимости", + "module.welcomer.text": "Добро пожаловать в Progreso Client, %s!", + "gui.alts.title": "Альты", "gui.alts.title.add_offline_alt": "Создать оффлайн альт", "gui.alts.title.add_microsoft_alt": "Создать альт майкрософт", @@ -128,5 +130,6 @@ "module.Sprint.description": "Автоматически зажимает кнопку спринта", "module.ESP.description": "Показывает сущностей через блоки", "module.FullBright.description": "Изменяет гамму игры на максимум", + "module.HoleESP.description": "Показывает норы через блоки", "module.StorageESP.description": "Показывает сундуки через блоки" } \ No newline at end of file diff --git a/progreso-client/src/main/resources/progreso.accesswidener b/progreso-client/src/main/resources/progreso.accesswidener index 3984a66..115564f 100644 --- a/progreso-client/src/main/resources/progreso.accesswidener +++ b/progreso-client/src/main/resources/progreso.accesswidener @@ -6,4 +6,6 @@ mutable field net/minecraft/client/MinecraftClient session Lnet/minecraft/client accessible field net/minecraft/client/MinecraftClient sessionService Lcom/mojang/authlib/minecraft/MinecraftSessionService; mutable field net/minecraft/client/MinecraftClient sessionService Lcom/mojang/authlib/minecraft/MinecraftSessionService; +accessible field net/minecraft/client/MinecraftClient currentFps I + accessible method net/minecraft/client/gui/screen/Screen addDrawableChild (Lnet/minecraft/client/gui/Element;)Lnet/minecraft/client/gui/Element; \ No newline at end of file