Skip to content

Commit

Permalink
Added FPS and Ping hud modules, removed HudEditor background blur
Browse files Browse the repository at this point in the history
  • Loading branch information
ya-ilya committed Jul 6, 2024
1 parent 132401b commit da409a3
Show file tree
Hide file tree
Showing 12 changed files with 41 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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, String>): String {
val httpConnection = URL(url).openConnection() as HttpURLConnection
val httpConnection = URI(url).toURL().openConnection() as HttpURLConnection

httpConnection.requestMethod = method
httpConnection.connectTimeout = 2000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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}"
})
Original file line number Diff line number Diff line change
@@ -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}"
})
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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<Entity, Color>()
private val renderMap = ConcurrentHashMap<Entity, Color>()

fun SettingContainer.espSetting(
name: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<BlockPos>()
private val holes = CopyOnWriteArrayList<BlockPos>()

init {
safeEventListener<TickEvent> {
Expand Down Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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<BlockPos, Color>()
private val renderMap = ConcurrentHashMap<BlockPos, Color>()

init {
safeEventListener<TickEvent> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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": "Создать альт майкрософт",
Expand Down Expand Up @@ -128,5 +130,6 @@
"module.Sprint.description": "Автоматически зажимает кнопку спринта",
"module.ESP.description": "Показывает сущностей через блоки",
"module.FullBright.description": "Изменяет гамму игры на максимум",
"module.HoleESP.description": "Показывает норы через блоки",
"module.StorageESP.description": "Показывает сундуки через блоки"
}
2 changes: 2 additions & 0 deletions progreso-client/src/main/resources/progreso.accesswidener
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit da409a3

Please sign in to comment.