Skip to content

Commit 35da1a6

Browse files
committed
1.3.3 compat but broken?
1 parent 6aeda5c commit 35da1a6

File tree

26 files changed

+517
-252
lines changed

26 files changed

+517
-252
lines changed

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ loom {
146146
}
147147
runConfigs {
148148
"client" {
149+
property("fml.coreMods.load", "me.odinmain.lwjgl.plugin.LWJGLLoadingPlugin")
149150
if (SystemUtils.IS_OS_MAC_OSX) {
150151
// This argument causes a crash on macOS
151152
vmArgs.remove("-XstartOnFirstThread")

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ org.gradle.jvmargs=-Xmx2g
33
baseGroup = com.github.subat0m1c.hatecheaters
44
mcVersion = 1.8.9
55
modid = hatecheaters
6-
version=0.2.1
6+
version=0.2.2
77
# requiredOdin and the latest action must have the same name if useActions is true.
88
requiredOdin=Odin-1.3.2.jar
99
odinRepository = odtheking/Odin
10-
useActions=false
10+
useActions=true

src/main/kotlin/com/github/subat0m1c/hatecheaters/modules/dungeons/BetterPartyFinder.kt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import com.github.subat0m1c.hatecheaters.utils.DungeonStats.displayDungeonData
1010
import com.github.subat0m1c.hatecheaters.utils.ItemUtils.witherImpactRegex
1111
import com.github.subat0m1c.hatecheaters.utils.LogHandler.Logger
1212
import com.github.subat0m1c.hatecheaters.utils.apiutils.HypixelApi.getProfile
13+
import me.odinmain.clickgui.settings.Setting.Companion.withDependency
14+
import me.odinmain.clickgui.settings.impl.*
1315
import me.odinmain.features.Module
14-
import me.odinmain.features.settings.Setting.Companion.withDependency
15-
import me.odinmain.features.settings.impl.*
1616
import me.odinmain.utils.noControlCodes
1717
import me.odinmain.utils.round
1818
import me.odinmain.utils.runIn
@@ -24,7 +24,7 @@ import me.odinmain.utils.skyblock.sendCommand
2424

2525
object BetterPartyFinder : Module(
2626
name = "Better Party Finder",
27-
desc = "Provides stats when a player joins your party. Includes autokick functionality. /hcitems to configure important items list.",
27+
description = "Provides stats when a player joins your party. Includes autokick functionality. /hcitems to configure important items list.",
2828
) {
2929
private val defaultSounds = arrayListOf("note.pling", "random.pop", "random.orb", "random.break", "mob.guardian.land.hit", "Custom")
3030

@@ -73,7 +73,6 @@ object BetterPartyFinder : Module(
7373
val reset by ActionSetting(
7474
"Play click sound",
7575
desc = "Plays the sound with the current settings.",
76-
false,
7776
::playCustomSound
7877
).withDependency { joinSound && soundDropdown }
7978

@@ -86,7 +85,7 @@ object BetterPartyFinder : Module(
8685
private val floors = arrayListOf("Entrance", "Floor 1", "Floor 2", "Floor 3", "Floor 4", "Floor 5", "Floor 6", "Floor 7")
8786
private val floor by SelectorSetting(
8887
"Floor",
89-
defaultSelected = "Floor 7",
88+
default = "Floor 7",
9089
floors,
9190
desc = "Determines which floor to check pb."
9291
)

src/main/kotlin/com/github/subat0m1c/hatecheaters/modules/dungeons/ClearSecrets.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import com.github.subat0m1c.hatecheaters.utils.ChatUtils.modMessage
88
import com.github.subat0m1c.hatecheaters.utils.ExtraStatsHandler
99
import com.github.subat0m1c.hatecheaters.utils.apiutils.HypixelApi.getSecrets
1010
import kotlinx.coroutines.*
11+
import me.odinmain.clickgui.settings.impl.BooleanSetting
1112
import me.odinmain.features.Module
12-
import me.odinmain.features.settings.impl.BooleanSetting
1313
import me.odinmain.utils.noControlCodes
1414
import me.odinmain.utils.runIn
1515
import me.odinmain.utils.skyblock.dungeon.DungeonPlayer
@@ -18,7 +18,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
1818

1919
object ClearSecrets : Module(
2020
"Clear Secrets",
21-
desc = "Displays each team members secrets on run complete.",
21+
description = "Displays each team members secrets on run complete.",
2222
) {
2323
private val compactMessage by BooleanSetting(
2424
"Compact Message",

src/main/kotlin/com/github/subat0m1c/hatecheaters/modules/render/ProfileViewer.kt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,23 @@ package com.github.subat0m1c.hatecheaters.modules.render
33
import com.github.subat0m1c.hatecheaters.HateCheaters.Companion.screen
44
import com.github.subat0m1c.hatecheaters.pvgui.v2.PVGui
55
import com.github.subat0m1c.hatecheaters.pvgui.v2.PVGui.loadPlayer
6-
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.modMessage
76
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.setHover
87
import com.github.subat0m1c.hatecheaters.utils.LogHandler.Logger
8+
import me.odinmain.clickgui.settings.AlwaysActive
9+
import me.odinmain.clickgui.settings.Setting.Companion.withDependency
10+
import me.odinmain.clickgui.settings.impl.*
911
import me.odinmain.features.Module
10-
import me.odinmain.features.settings.AlwaysActive
11-
import me.odinmain.features.settings.Setting.Companion.withDependency
12-
import me.odinmain.features.settings.impl.*
1312
import me.odinmain.utils.render.Color
14-
import me.odinmain.utils.ui.Colors
15-
import me.odinmain.utils.ui.clickgui.util.ColorUtil.withAlpha
13+
import me.odinmain.utils.render.Color.Companion.withAlpha
14+
import me.odinmain.utils.render.Colors
1615
import net.minecraft.event.ClickEvent
1716
import net.minecraftforge.client.event.ClientChatReceivedEvent
1817
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
1918

2019
@AlwaysActive
2120
object ProfileViewer : Module(
2221
name = "Profile Viewer",
23-
desc = "Lets you view profiles. /pv name or /hcpv name",
22+
description = "Lets you view profiles. /pv name or /hcpv name",
2423
) {
2524
val pvCommand by BooleanSetting(
2625
"PV Command",
@@ -37,7 +36,11 @@ object ProfileViewer : Module(
3736
default = false,
3837
desc = "Runs /pv when you click a name in chat. might have lots of compatibility issues."
3938
)
40-
val invwalk by BooleanSetting("GUI Move", default = false, desc = "Lets you move in the gui.")
39+
val invwalk by BooleanSetting(
40+
"GUI Move",
41+
default = false,
42+
desc = "Lets you move in the gui. USE AT YOUR OWN RISK. It should be fine in theory but hypixel is funky."
43+
)
4144
val scale by NumberSetting(
4245
"Scale",
4346
default = 1.5,
@@ -55,7 +58,7 @@ object ProfileViewer : Module(
5558
desc = "Maximum number of rows that can be displayed in the talisman page. Lower will give more performance, but will render less items."
5659
)
5760
private val themesList = arrayListOf("Classic", "Midnight", "Light", "Sunrise", "Custom")
58-
val themes by SelectorSetting("Theme", defaultSelected = "Classic", themesList, desc = "Preferred theme")
61+
val themes by SelectorSetting("Theme", default = "Classic", themesList, desc = "Preferred theme")
5962
val main by ColorSetting(
6063
"Main",
6164
default = Colors.MINECRAFT_DARK_GRAY,
@@ -145,14 +148,14 @@ object ProfileViewer : Module(
145148
val themeEntries = listOf(
146149
Theme(
147150
"Classic",
148-
Colors.MINECRAFT_DARK_GRAY,
151+
Color("555555"),
149152
Colors.MINECRAFT_BLUE,
150153
Colors.WHITE,
151154
Colors.MINECRAFT_GRAY,
152155
Colors.WHITE,
153156
"f",
154157
Colors.MINECRAFT_DARK_AQUA.withAlpha(0.8f),
155-
Colors.MINECRAFT_DARK_GRAY,
158+
Color("555555"),
156159
10f,
157160
0f,
158161
),

src/main/kotlin/com/github/subat0m1c/hatecheaters/modules/skyblock/HateCheatersModule.kt

Lines changed: 9 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ package com.github.subat0m1c.hatecheaters.modules.skyblock
22

33
import com.github.subat0m1c.hatecheaters.utils.networkutils.CheckUpdate
44
import com.github.subat0m1c.hatecheaters.utils.toasts.ToastRenderer
5+
import me.odinmain.clickgui.settings.AlwaysActive
6+
import me.odinmain.clickgui.settings.Setting.Companion.withDependency
7+
import me.odinmain.clickgui.settings.impl.BooleanSetting
8+
import me.odinmain.clickgui.settings.impl.SelectorSetting
9+
import me.odinmain.clickgui.settings.impl.StringSetting
510
import me.odinmain.features.Module
6-
import me.odinmain.features.settings.AlwaysActive
7-
import me.odinmain.features.settings.Setting.Companion.withDependency
8-
import me.odinmain.features.settings.impl.BooleanSetting
9-
import me.odinmain.features.settings.impl.SelectorSetting
10-
import me.odinmain.features.settings.impl.StringSetting
1111

1212
@AlwaysActive
1313
object HateCheatersModule : Module(
1414
name = "Hate Cheaters",
15-
desc = "Hate cheaters nonsense",
15+
description = "Hate cheaters nonsense",
1616
) {
1717
val toasts by BooleanSetting("Toasts", default = false, desc = "Enable toasts for various notifications.")
1818
val toastCorner by SelectorSetting(
@@ -36,7 +36,6 @@ object HateCheatersModule : Module(
3636
val server by StringSetting(
3737
"Api Server",
3838
default = "default",
39-
hidden = false,
4039
desc = "Server to be used to connect to the api. set to \"default\" to use the default. Only change if you know what you're doing. format: \"subdomain.domain.tld\""
4140
)
4241

@@ -80,38 +79,10 @@ object HateCheatersModule : Module(
8079
// @SubscribeEvent
8180
// fun onPacketReceive(event: PacketEvent.Receive) {
8281
// val packet = event.packet as? S38PacketPlayerListItem ?: return
83-
// modMessage(
84-
// """
85-
// Player List Packet:
82+
// LogHandler.Logger.info("""
8683
// Action: ${packet.action}
87-
// Entries: ${
88-
// packet.entries.joinToString("\n") {
89-
// """
90-
// {
91-
// name: ${it?.profile?.name},
92-
// id: ${it?.profile?.id},
93-
// gameMode: ${it?.gameMode},
94-
// ping: ${it?.ping},
95-
// displayName: ${it?.displayName}
96-
// other: ${
97-
// it?.profile?.properties?.entries()?.joinToString("\n") { (key, value) ->
98-
// """
99-
// {
100-
// key: $key
101-
// property: {
102-
// name: ${value.name}
103-
// value: ${value.value}
104-
// sig: ${value.signature}
105-
// }
106-
// }
107-
// """.trimIndent()
108-
// }
109-
// }
110-
// }
111-
// """.trimIndent()
112-
// }
113-
// }
114-
// """.trimIndent()
84+
// entries: ${packet.entries.joinToString("\n") { "display name: ${it.displayName}" } }
85+
// """.trimIndent()
11586
// )
11687
// }
11788

src/main/kotlin/com/github/subat0m1c/hatecheaters/pvgui/v2/PVGui.kt

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,13 @@ import com.github.subat0m1c.hatecheaters.pvgui.v2.pages.Overview.setPlayer
88
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.InvWalkInput
99
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.ProfileLazy
1010
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.modMessage
11-
import com.github.subat0m1c.hatecheaters.utils.apiutils.HypixelData.PlayerInfo
1211
import com.github.subat0m1c.hatecheaters.utils.apiutils.HypixelApi.getProfile
12+
import com.github.subat0m1c.hatecheaters.utils.apiutils.HypixelData.PlayerInfo
13+
import com.github.subat0m1c.hatecheaters.utils.odinwrappers.Shaders
14+
import me.odinmain.OdinMain
1315
import net.minecraft.client.gui.GuiScreen
1416
import net.minecraft.client.gui.ScaledResolution
15-
import net.minecraft.client.renderer.GlStateManager.scale
16-
import net.minecraft.client.renderer.GlStateManager.translate
17+
import net.minecraft.client.renderer.GlStateManager
1718
import net.minecraft.util.MovementInputFromOptions
1819

1920
object PVGui : GuiScreen() {
@@ -27,15 +28,24 @@ object PVGui : GuiScreen() {
2728

2829
var loadText = "Loading..."
2930

31+
private val sr get() = ScaledResolution(OdinMain.mc)
32+
3033
override fun drawScreen(mouseX: Int, mouseY: Int, partialTicks: Float) {
31-
val sr = ScaledResolution(mc)
32-
scale(1.0 / sr.scaleFactor, 1.0 / sr.scaleFactor, 1.0)
33-
translate(mc.displayWidth / 2.0, mc.displayHeight / 2.0, 1.0)
34-
scale(scale, scale, 1.0)
34+
Shaders.startDraw()
35+
Shaders.pushMatrix()
36+
Shaders.center()
37+
Shaders.scale(scale.toFloat())
38+
39+
GlStateManager.scale(1.0 / sr.scaleFactor, 1.0 / sr.scaleFactor, 1.0)
40+
GlStateManager.translate(OdinMain.mc.displayWidth / 2.0, OdinMain.mc.displayHeight / 2.0, 0.0)
41+
GlStateManager.scale(scale, scale, 1.0)
42+
3543
currentPage.page.preDraw()
36-
scale(1f / scale, 1f / scale, 1.0)
37-
translate(-mc.displayWidth / 2.0, -mc.displayHeight / 2.0, -1.0)
38-
scale(sr.scaleFactor.toDouble(), sr.scaleFactor.toDouble(), 1.0)
44+
Shaders.popMatrix()
45+
Shaders.stopDraw()
46+
// scale(1f / scale, 1f / scale, 1.0)
47+
// translate(-mc.displayWidth / 2.0, -mc.displayHeight / 2.0, -1.0)
48+
// scale(sr.scaleFactor.toDouble(), sr.scaleFactor.toDouble(), 1.0)
3949
super.drawScreen(mouseX, mouseY, partialTicks)
4050
}
4151

src/main/kotlin/com/github/subat0m1c/hatecheaters/pvgui/v2/Pages.kt

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,15 @@ import com.github.subat0m1c.hatecheaters.pvgui.v2.PVGui.profileName
88
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.Utils.getMouseX
99
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.Utils.getMouseY
1010
import com.github.subat0m1c.hatecheaters.pvgui.v2.utils.Utils.isObjectHovered
11-
import com.github.subat0m1c.hatecheaters.utils.ChatUtils.mcWidth
1211
import com.github.subat0m1c.hatecheaters.utils.apiutils.HypixelData.MemberData
1312
import com.github.subat0m1c.hatecheaters.utils.apiutils.HypixelData.PlayerInfo
1413
import com.github.subat0m1c.hatecheaters.utils.apiutils.HypixelData.PlayerInfo.Companion.dummyPlayer
14+
import com.github.subat0m1c.hatecheaters.utils.odinwrappers.*
1515
import me.odinmain.OdinMain.mc
1616
import me.odinmain.utils.minus
17-
import me.odinmain.utils.render.*
1817
import me.odinmain.utils.skyblock.PlayerUtils.playLoudSound
19-
import me.odinmain.utils.ui.Colors
2018
import net.minecraft.client.gui.ScaledResolution
2119
import net.minecraft.client.renderer.GlStateManager
22-
import net.minecraft.client.renderer.GlStateManager.translate
2320

2421
object Pages {
2522

@@ -72,27 +69,44 @@ object Pages {
7269
protected inline val mouseX get() = ((getMouseX * ScaledResolution(mc).scaleFactor - mc.displayWidth / 2) * 1f / scale) - sx
7370
protected inline val mouseY get() = ((getMouseY * ScaledResolution(mc).scaleFactor - mc.displayHeight / 2) * 1f / scale) - sy
7471

72+
// protected inline val mouseX: Double get() = getMouseX
73+
// protected inline val mouseY: Double get() = getMouseY
74+
7575
// todo make vertical button dsl for this
7676
fun preDraw() {
77-
GlStateManager.pushMatrix()
78-
translate(sx.toDouble(), sy.toDouble(), 0.0)
79-
roundedRectangle(0, 0, totalWidth, totalHeight, ct.main, ct.roundness, 1f)
77+
Shaders.pushMatrix()
78+
Shaders.translate(sx.toFloat(), sy.toFloat())
79+
GlStateManager.translate(sx.toDouble(), sy.toDouble(), 0.0)
80+
Shaders.rect(0, 0, totalWidth, totalHeight, ct.roundness, ct.main.hc())
8081

81-
roundedRectangle(lineX, lineY, ot, totalHeight-lineY*2, ct.line)
82+
Shaders.rect(lineX, lineY, ot, totalHeight - lineY * 2, 0f, ct.line.hc())
8283

8384
PageEntries.entries.forEachIndexed { i, page ->
8485
val pageY = lineY + ((pageHeight + lineY) * i)
85-
if (currentPage == page) roundedRectangle(lineY, pageY, pageWidth, pageHeight, ct.selected, radius = ct.roundness, edgeSoftness = 1f)
86-
else roundedRectangle(lineY, pageY, pageWidth, pageHeight, ct.button, radius = ct.roundness, edgeSoftness = 1f)
86+
if (currentPage == page) Shaders.rect(
87+
lineY,
88+
pageY,
89+
pageWidth,
90+
pageHeight,
91+
ct.roundness,
92+
ct.selected.hc()
93+
)
94+
else Shaders.rect(lineY, pageY, pageWidth, pageHeight, ct.roundness, ct.button.hc())
8795
val centerY = lineY + (pageHeight / 2 + ((pageHeight + lineY) * i))
88-
centeredText(page.name, pageCenter, centerY, color = ct.font, scale = 3.5)
96+
centeredText(page.name, pageCenter, centerY, color = ct.font.hc(), scale = 3.5f)
8997
}
9098

91-
roundedRectangle(lineY, lastY, pageWidth, lastHeight, ct.button, radius = ct.roundness, edgeSoftness = 1f)
99+
Shaders.rect(lineY, lastY, pageWidth, lastHeight, ct.roundness, ct.button.hc())
92100
val betaText = if (currentPage != PageEntries.Overview) player.name else "HCPV 0.0.1"
93-
centeredText(betaText, pageCenter, lastY + lastHeight / 2, color = ct.font, scale = if (betaText.length >= 8) 3 else 3.5)
101+
centeredText(
102+
betaText,
103+
pageCenter,
104+
lastY + lastHeight / 2,
105+
color = ct.font.hc(),
106+
scale = if (betaText.length >= 8) 3f else 3.5f
107+
)
94108
if (playerData != null) draw() else centeredText(loadText, mainCenterX, totalHeight / 2, 7f)
95-
GlStateManager.popMatrix()
109+
Shaders.popMatrix()
96110
}
97111

98112
fun handleClick(x: Int, y: Int, button: Int) {
@@ -116,8 +130,8 @@ object Pages {
116130
/**
117131
* The "Centered" parameter in [mcText()] does not center vertically, thus this should be used instead.
118132
*/
119-
fun centeredText(text: String, x: Number, y: Number, scale: Number = 1f, color: Color = Colors.WHITE, shadow: Boolean = true) =
120-
mcText(text, x - (text.mcWidth * scale.toDouble() / 2), y - (getMCTextHeight() * scale.toDouble()) / 2, scale, color, shadow, false)
133+
fun centeredText(text: String, x: Number, y: Number, scale: Float = 1f, color: Color = Colors.WHITE) =
134+
Text.text(text, x, y - Text.textHeight(scale) / 2, scale, color)
121135

122136
fun playClickSound() = playLoudSound("gui.button.press", 0.5f, 1.1f)
123137
}

0 commit comments

Comments
 (0)