Skip to content

Commit 10ca5fe

Browse files
czhoAvanatiker
andauthored
Fixed #173, Various bug fixes and removed useless modules (#174)
* Removed AntiBot (why was this in an anarchy utility mod?) * Added Outline option to clickGui, Added shadow option to customFont, removed customFont option from Nametags * Added ElytraFix removed EndTeleport * Clean up Co-authored-by: Constructor <[email protected]>
1 parent 62764cc commit 10ca5fe

File tree

17 files changed

+78
-140
lines changed

17 files changed

+78
-140
lines changed

src/main/kotlin/com/lambda/client/gui/hudgui/elements/world/TextRadar.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package com.lambda.client.gui.hudgui.elements.world
33
import com.lambda.client.event.SafeClientEvent
44
import com.lambda.client.gui.hudgui.LabelHud
55
import com.lambda.client.manager.managers.FriendManager
6-
import com.lambda.client.module.modules.combat.AntiBot
76
import com.lambda.client.util.AsyncCachedValue
87
import com.lambda.client.util.color.ColorGradient
98
import com.lambda.client.util.color.ColorHolder
@@ -47,7 +46,6 @@ internal object TextRadar : LabelHud(
4746
val list = world.playerEntities.toList().asSequence()
4847
.filter { it != null && !it.isDead && it.health > 0.0f }
4948
.filter { it != player && it != mc.renderViewEntity }
50-
.filter { !AntiBot.isBot(it) }
5149
.filter { friend || !FriendManager.isFriend(it.name) }
5250
.map { it to player.getDistance(it) }
5351
.filter { it.second <= range }

src/main/kotlin/com/lambda/client/gui/rgui/component/BindButton.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.lambda.client.gui.rgui.component
22

33
import com.lambda.client.module.modules.client.ClickGUI
4+
import com.lambda.client.module.modules.client.CustomFont
45
import com.lambda.client.module.modules.client.GuiColors
56
import com.lambda.client.setting.settings.impl.other.BindSetting
67
import com.lambda.client.util.graphics.VertexHelper
@@ -42,6 +43,6 @@ class BindButton(
4243
protectedWidth = FontRenderAdapter.getStringWidth(valueText, 0.75f).toDouble()
4344
val posX = (renderWidth - protectedWidth - 2.0f).toFloat()
4445
val posY = renderHeight - 2.0f - FontRenderAdapter.getFontHeight(0.75f)
45-
FontRenderAdapter.drawString(valueText, posX, posY, color = GuiColors.text, scale = 0.75f)
46+
FontRenderAdapter.drawString(valueText, posX, posY, color = GuiColors.text, drawShadow = CustomFont.shadow, scale = 0.75f)
4647
}
4748
}

src/main/kotlin/com/lambda/client/gui/rgui/component/EnumSlider.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.lambda.client.gui.rgui.component
22

33
import com.lambda.client.module.modules.client.ClickGUI
4+
import com.lambda.client.module.modules.client.CustomFont
45
import com.lambda.client.module.modules.client.GuiColors
56
import com.lambda.client.setting.settings.impl.primitive.EnumSetting
67
import com.lambda.client.util.graphics.VertexHelper
@@ -49,6 +50,6 @@ class EnumSlider(val setting: EnumSetting<*>) : Slider(setting.name, 0.0, settin
4950
super.onRender(vertexHelper, absolutePos)
5051
val posX = (renderWidth - protectedWidth - 2.0f).toFloat()
5152
val posY = renderHeight - 2.0f - FontRenderAdapter.getFontHeight(0.75f)
52-
FontRenderAdapter.drawString(valueText, posX, posY, color = GuiColors.text, scale = 0.75f)
53+
FontRenderAdapter.drawString(valueText, posX, posY, color = GuiColors.text, drawShadow = CustomFont.shadow, scale = 0.75f)
5354
}
5455
}

src/main/kotlin/com/lambda/client/gui/rgui/component/SettingSlider.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.lambda.client.gui.rgui.component
22

33
import com.lambda.client.module.modules.client.ClickGUI
4+
import com.lambda.client.module.modules.client.CustomFont
45
import com.lambda.client.module.modules.client.GuiColors
56
import com.lambda.client.setting.settings.impl.number.FloatSetting
67
import com.lambda.client.setting.settings.impl.number.IntegerSetting
@@ -136,7 +137,7 @@ class SettingSlider(val setting: NumberSetting<*>) : Slider(setting.name, 0.0, s
136137
if (!listening) {
137138
val posX = (renderWidth - protectedWidth - 2.0f).toFloat()
138139
val posY = renderHeight - 2.0f - FontRenderAdapter.getFontHeight(0.75f)
139-
FontRenderAdapter.drawString(valueText, posX, posY, color = GuiColors.text, scale = 0.75f)
140+
FontRenderAdapter.drawString(valueText, posX, posY, color = GuiColors.text, drawShadow = CustomFont.shadow, scale = 0.75f)
140141
}
141142
}
142143
}

src/main/kotlin/com/lambda/client/gui/rgui/component/Slider.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.lambda.client.gui.rgui.component
22

33
import com.lambda.client.gui.rgui.InteractiveComponent
44
import com.lambda.client.module.modules.client.ClickGUI
5+
import com.lambda.client.module.modules.client.CustomFont
56
import com.lambda.client.module.modules.client.GuiColors
67
import com.lambda.client.module.modules.client.Tooltips
78
import com.lambda.client.util.TimedFlag
@@ -75,7 +76,7 @@ open class Slider(
7576
val newWidth = lineWidth + wordWidth
7677

7778
lineWidth = if (newWidth > 169.0f) {
78-
displayDescription.addLine(stringBuilder.toString())
79+
displayDescription.addLine(stringBuilder.toString(), color = GuiColors.text)
7980
stringBuilder.clear()
8081
-spaceWidth + wordWidth
8182
} else {
@@ -86,7 +87,7 @@ open class Slider(
8687
stringBuilder.append(' ')
8788
}
8889

89-
if (stringBuilder.isNotEmpty()) displayDescription.addLine(stringBuilder.toString())
90+
if (stringBuilder.isNotEmpty()) displayDescription.addLine(stringBuilder.toString(), color = GuiColors.text)
9091
}
9192
}
9293

@@ -121,7 +122,7 @@ open class Slider(
121122
}*/
122123
val text = if (isBold) TextFormatting.BOLD format componentName else componentName
123124

124-
FontRenderAdapter.drawString(text, 1.5f, 1.0f, color = GuiColors.text)
125+
FontRenderAdapter.drawString(text, 1.5f, 1.0f, CustomFont.shadow, color = GuiColors.text)
125126
//GlStateUtils.popScissor()
126127
}
127128

@@ -157,7 +158,8 @@ open class Slider(
157158
glTranslatef(posX, posY, 696.0f)
158159

159160
RenderUtils2D.drawRectFilled(vertexHelper, posEnd = Vec2d(textWidth, textHeight).plus(4.0), color = GuiColors.backGround.apply { a = (a * alpha).toInt() })
160-
RenderUtils2D.drawRectOutline(vertexHelper, posEnd = Vec2d(textWidth, textHeight).plus(4.0), lineWidth = 2.0f, color = GuiColors.primary.apply { a = (a * alpha).toInt() })
161+
if(ClickGUI.outline)
162+
RenderUtils2D.drawRectOutline(vertexHelper, posEnd = Vec2d(textWidth, textHeight).plus(4.0), lineWidth = ClickGUI.outlineSize, color = GuiColors.primary.apply { a = (a * alpha).toInt() })
161163

162164
displayDescription.draw(Vec2d(2.0, 2.0), 2, alpha)
163165

src/main/kotlin/com/lambda/client/gui/rgui/windows/BasicWindow.kt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,23 @@ open class BasicWindow(
2525

2626
override fun onRender(vertexHelper: VertexHelper, absolutePos: Vec2f) {
2727
super.onRender(vertexHelper, absolutePos)
28-
RenderUtils2D.drawRoundedRectFilled(vertexHelper, Vec2d(0.0, 0.0), Vec2f(renderWidth, renderHeight).toVec2d(), ClickGUI.radius, color = GuiColors.backGround)
29-
RenderUtils2D.drawRoundedRectOutline(vertexHelper, Vec2d(0.0, 0.0), Vec2f(renderWidth, renderHeight).toVec2d(), ClickGUI.radius, lineWidth = 2.5f, color = GuiColors.primary)
28+
RenderUtils2D.drawRoundedRectFilled(
29+
vertexHelper,
30+
Vec2d(0.0, 0.0),
31+
Vec2f(renderWidth, renderHeight).toVec2d(),
32+
ClickGUI.radius,
33+
color = GuiColors.backGround
34+
)
35+
if (ClickGUI.outline) {
36+
RenderUtils2D.drawRoundedRectOutline(
37+
vertexHelper,
38+
Vec2d(0.0, 0.0),
39+
Vec2f(renderWidth, renderHeight).toVec2d(),
40+
ClickGUI.radius,
41+
lineWidth = ClickGUI.outlineSize,
42+
color = GuiColors.primary
43+
)
44+
}
3045
}
3146

3247
}

src/main/kotlin/com/lambda/client/gui/rgui/windows/TitledWindow.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.lambda.client.gui.rgui.windows
22

3+
import com.lambda.client.module.modules.client.CustomFont
34
import com.lambda.client.module.modules.client.GuiColors
45
import com.lambda.client.util.graphics.VertexHelper
56
import com.lambda.client.util.graphics.font.FontRenderAdapter
@@ -22,6 +23,6 @@ open class TitledWindow(
2223

2324
override fun onRender(vertexHelper: VertexHelper, absolutePos: Vec2f) {
2425
super.onRender(vertexHelper, absolutePos)
25-
FontRenderAdapter.drawString(componentName, 3.0f, 3.0f, color = GuiColors.text)
26+
FontRenderAdapter.drawString(componentName, 3.0f, 3.0f, color = GuiColors.text, drawShadow = CustomFont.shadow)
2627
}
2728
}

src/main/kotlin/com/lambda/client/module/modules/client/ClickGUI.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ object ClickGUI : Module(
2121
private val scaleSetting = setting("Scale", 100, 50..400, 5)
2222
val radius by setting("Radius", 4.0, 0.0..10.0, 0.2)
2323
val blur by setting("Blur", 0.0f, 0.0f..1.0f, 0.05f)
24+
val outline by setting("Outline", true)
25+
val outlineSize by setting("Outline Size", 2.5f, 0.5f..3.5f,0.5f)
2426
val darkness by setting("Darkness", 0.25f, 0.0f..1.0f, 0.05f)
2527
val fadeInTime by setting("Fade In Time", 0.25f, 0.0f..1.0f, 0.05f)
2628
val fadeOutTime by setting("Fade Out Time", 0.1f, 0.0f..1.0f, 0.05f)

src/main/kotlin/com/lambda/client/module/modules/client/CustomFont.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ object CustomFont : Module(
2222
getMatchingFontName(value) ?: getMatchingFontName(prev) ?: DEFAULT_FONT_NAME
2323
})
2424
private val sizeSetting by setting("Size", 1.0f, 0.5f..2.0f, 0.05f)
25+
private val shadowSetting by setting("Shadow", false)
2526
private val gapSetting by setting("Gap", 0.0f, -10f..10f, 0.5f)
2627
private val lineSpaceSetting by setting("Line Space", 0.0f, -10f..10f, 0.05f)
2728
private val baselineOffsetSetting by setting("Baseline Offset", 0.0f, -10.0f..10.0f, 0.05f)
@@ -33,6 +34,7 @@ object CustomFont : Module(
3334
val lineSpace get() = size * (lineSpaceSetting * 0.05f + 0.77f)
3435
val lodBias get() = lodBiasSetting * 0.25f - 0.5f
3536
val baselineOffset get() = baselineOffsetSetting * 2.0f - 4.5f
37+
val shadow get() = shadowSetting
3638

3739
/** Available fonts on the system */
3840
val availableFonts: Map<String, String> by AsyncCachedValue(5L, TimeUnit.SECONDS) {

src/main/kotlin/com/lambda/client/module/modules/combat/AntiBot.kt

Lines changed: 0 additions & 69 deletions
This file was deleted.

src/main/kotlin/com/lambda/client/module/modules/combat/AutoLog.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ object AutoLog : Module(
9090
private fun SafeClientEvent.checkPlayers(): Boolean {
9191
for (entity in world.loadedEntityList) {
9292
if (entity !is EntityPlayer) continue
93-
if (AntiBot.isBot(entity)) continue
9493
if (entity.isFakeOrSelf) continue
9594
if (player.getDistance(entity) > playerDistance) continue
9695
if (!friends && FriendManager.isFriend(entity.name)) continue

src/main/kotlin/com/lambda/client/module/modules/combat/AutoMend.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ object AutoMend : Module(
206206
for (entity in mc.world.loadedEntityList) {
207207
if (entity !is EntityPlayer) continue
208208
if (entity.isFakeOrSelf) continue
209-
if (AntiBot.isBot(entity)) continue
210209
if (mc.player.getDistance(entity) > pauseNearbyRadius) continue
211210
if (FriendManager.isFriend(entity.name)) continue
212211
return true

src/main/kotlin/com/lambda/client/module/modules/combat/CombatSetting.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,19 +216,17 @@ object CombatSetting : Module(
216216
fun getPrediction(entity: Entity) = CombatManager.target?.let {
217217
if (motionPrediction) {
218218
val ticks = if (pingSync) (InfoCalculator.ping() / 25f).ceilToInt() else ticksAhead
219-
CombatManager.motionTracker.getPositionAndBBAhead(ticks) ?: it.positionVector to it.entityBoundingBox
219+
CombatManager.motionTracker.getPositionAndBBAhead(ticks) ?: (it.positionVector to it.entityBoundingBox)
220220
} else {
221221
it.positionVector to it.entityBoundingBox
222222
}
223-
} ?: entity.positionVector to entity.entityBoundingBox
223+
} ?: (entity.positionVector to entity.entityBoundingBox)
224224
/* End of crystal damage calculation */
225225

226226
/* Targeting */
227227
private fun SafeClientEvent.getTargetList(): LinkedList<EntityLivingBase> {
228228
val targetList = LinkedList<EntityLivingBase>()
229229
for (entity in getCacheList()) {
230-
if (AntiBot.isBot(entity)) continue
231-
232230
if (!tamed
233231
&& (entity is EntityTameable && entity.isTamed
234232
|| entity is AbstractHorse && entity.isTame)) continue
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.lambda.client.module.modules.misc
2+
3+
import net.minecraft.entity.item.EntityFireworkRocket
4+
import net.minecraft.network.play.server.SPacketPlayerPosLook
5+
import com.lambda.client.event.events.PacketEvent
6+
import com.lambda.client.module.Category
7+
import com.lambda.client.module.Module
8+
import com.lambda.client.util.threads.safeListener
9+
10+
object ElytraFix: Module(
11+
name = "ElytraFix",
12+
category = Category.MISC,
13+
description = "Fixes firework rubberband induced velocity desync",
14+
) {
15+
init {
16+
safeListener<PacketEvent.Receive> { event ->
17+
if (event.packet is SPacketPlayerPosLook && player.isElytraFlying) {
18+
world.getLoadedEntityList().filterIsInstance<EntityFireworkRocket>().forEach {
19+
world.removeEntity(it)
20+
}
21+
}
22+
}
23+
}
24+
}

src/main/kotlin/com/lambda/client/module/modules/player/EndTeleport.kt

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)