Skip to content

Commit 93b6bd9

Browse files
committed
Temporary tag cleanup
1 parent 70a6fe6 commit 93b6bd9

File tree

10 files changed

+39
-33
lines changed

10 files changed

+39
-33
lines changed

common/src/main/kotlin/com/lambda/module/modules/render/FakePlayer.kt renamed to common/src/main/kotlin/com/lambda/module/modules/combat/FakePlayer.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.lambda.module.modules.render
1+
package com.lambda.module.modules.combat
22

33
import com.lambda.module.Module
44
import com.lambda.module.tag.ModuleTag
@@ -10,7 +10,7 @@ import java.util.*
1010
object FakePlayer : Module(
1111
name = "FakePlayer",
1212
description = "Spawns a fake player",
13-
defaultTags = setOf(ModuleTag.MISC, ModuleTag.RENDER)
13+
defaultTags = setOf(ModuleTag.COMBAT, ModuleTag.RENDER)
1414
) {
1515
private val playerName by setting("Name", "Steve")
1616

common/src/main/kotlin/com/lambda/module/modules/render/RenderTest.kt renamed to common/src/main/kotlin/com/lambda/module/modules/debug/RenderTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.lambda.module.modules.render
1+
package com.lambda.module.modules.debug
22

33
import com.lambda.Lambda.mc
44
import com.lambda.event.events.RenderEvent
@@ -35,13 +35,13 @@ object RenderTest : Module(
3535
init {
3636
filled.build {
3737
val flag = mc.crosshairTarget?.blockResult?.blockPos?.let { box = Box(it) } != null
38-
color = this@RenderTest.color.setAlpha((color.a + flag.toIntSign() * 0.05).coerceAtMost(0.2))
38+
color = color.setAlpha((color.a + flag.toIntSign() * 0.05).coerceAtMost(0.2))
3939
}
4040

4141
outline.build {
4242
val block = mc.crosshairTarget?.blockResult
4343
val flag = block?.blockPos?.let { box = Box(it) } != null
44-
color = this@RenderTest.color.setAlpha(color.a + flag.toIntSign() * 0.2)
44+
color = color.setAlpha(color.a + flag.toIntSign() * 0.2)
4545
sides = block?.side?.mask ?: sides
4646
}
4747

common/src/main/kotlin/com/lambda/module/modules/movement/EntityControl.kt

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,35 @@ import com.lambda.util.world.WorldUtils.getEntities
99
import net.minecraft.entity.passive.AbstractHorseEntity
1010
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket
1111

12+
// ToDo: Rework this module. All mountables should work, solution should be more elegant.
1213
object EntityControl : Module(
1314
name = "EntityControl",
1415
description = "Control mountable entities",
15-
defaultTags = setOf(ModuleTag.MOVEMENT, ModuleTag.BYPASS)
16+
defaultTags = setOf(ModuleTag.MOVEMENT)
1617
) {
17-
private val page by setting("Page", Page.General)
18+
private val page by setting("Page", Page.GENERAL)
1819

1920
/* General */
20-
private val forceMount by setting("Force Mount", true, description = "Attempts to force mount chested entities.", visibility = { page == Page.General })
21+
private val forceMount by setting("Force Mount", true, description = "Attempts to force mount chested entities.", visibility = { page == Page.GENERAL }).apply {
22+
onValueChange { _, _ ->
23+
horses.forEach { horse -> horse.updateSaddle() }
24+
}
25+
}
2126

2227
/* Movement */
23-
private val speed by setting("Entity Speed", 2.0, 0.1..10.0, 0.1, description = "Speed for entities.", visibility = { page == Page.Movement })
28+
private val speed by setting("Entity Speed", 2.0, 0.1..10.0, 0.1, description = "Speed for entities.", visibility = { page == Page.MOVEMENT })
2429

2530
private enum class Page {
26-
General, Movement
31+
GENERAL, MOVEMENT
2732
}
2833

29-
private val theHonses = mutableListOf<AbstractHorseEntity>() // Petah, the honse is here
34+
private val horses = mutableListOf<AbstractHorseEntity>()
3035

3136
init {
3237
listener<TickEvent.Pre> {
33-
getEntities(player.pos, 8.0, theHonses, { horse, _ -> horse.setHorseFlag(4, true) })
38+
if (forceMount) {
39+
getEntities(player.pos, 8.0, horses, { horse, _ -> horse.setHorseFlag(4, true) })
40+
}
3441
}
3542

3643
/*listener<MovementEvent.Pre> {
@@ -53,8 +60,7 @@ object EntityControl : Module(
5360
}
5461

5562
onDisable {
56-
theHonses.forEach { horse -> horse.updateSaddle() }
57-
theHonses.clear()
63+
horses.clear()
5864
}
5965
}
6066
}

common/src/main/kotlin/com/lambda/module/modules/movement/RocketExtend.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,22 @@ import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket
1515
object RocketExtend : Module(
1616
name = "RocketExtend",
1717
description = "Extends rocket length on grim",
18-
defaultTags = setOf(ModuleTag.MOVEMENT)
18+
defaultTags = setOf(ModuleTag.MOVEMENT, ModuleTag.GRIM)
1919
) {
2020
private var extendedRockets = mutableListOf<FireworkRocketEntity>()
2121
private var pingPacket: CommonPongC2SPacket? = null
2222
private var lastPingTime = -1L
23-
private val keepAliveTime by setting("Keepalive timeout seconds", 45, 0..60, 1)
23+
private val keepAliveTime by setting("Keepalive Timeout", 45, 0..60, 1, unit = " s")
2424

2525
init {
2626
listener<PacketEvent.Receive.Pre> { event ->
2727
if (event.packet is PlayerPositionLookS2CPacket) reset()
2828

2929
if (event.packet is EntitiesDestroyS2CPacket) {
3030
event.packet.entityIds.map(world::getEntityById)
31-
.filterPointer(extendedRockets, { _, id -> event.packet.entityIds.removeInt(id) }) { rocket -> rocket.shooter == player }
31+
.filterPointer(extendedRockets, { _, id -> event.packet.entityIds.removeInt(id) }) { rocket ->
32+
rocket.shooter == player
33+
}
3234
}
3335
}
3436

common/src/main/kotlin/com/lambda/module/modules/movement/SafeWalk.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import net.minecraft.entity.LivingEntity
99
object SafeWalk : Module(
1010
name = "SafeWalk",
1111
description = "Keeps you at the edge",
12-
defaultTags = setOf(ModuleTag.MOVEMENT)
12+
defaultTags = setOf(ModuleTag.MOVEMENT, ModuleTag.GRIM)
1313
) {
1414
private val sneakOnLedge by setting("Sneak On Ledge", true)
1515
private val ledgeDistance by setting("Ledge Distance", 0.25, 0.0..0.5, 0.05, unit = " blocks")

common/src/main/kotlin/com/lambda/module/modules/world/Timer.kt renamed to common/src/main/kotlin/com/lambda/module/modules/movement/Timer.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.lambda.module.modules.world
1+
package com.lambda.module.modules.movement
22

33
import com.lambda.event.events.ClientEvent
44
import com.lambda.event.listener.SafeListener.Companion.listener
@@ -8,7 +8,7 @@ import com.lambda.module.tag.ModuleTag
88
object Timer : Module(
99
name = "Timer",
1010
description = "Modify client tick speed.",
11-
defaultTags = setOf(ModuleTag.WORLD)
11+
defaultTags = setOf(ModuleTag.MOVEMENT, ModuleTag.WORLD)
1212
) {
1313
private val timer by setting("Timer", 50, 0..1000, 5, unit = "ms/tick")
1414

common/src/main/kotlin/com/lambda/module/modules/client/Rubberband.kt renamed to common/src/main/kotlin/com/lambda/module/modules/network/Rubberband.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.lambda.module.modules.client
1+
package com.lambda.module.modules.network
22

33
import com.lambda.event.events.PacketEvent
44
import com.lambda.event.listener.SafeListener.Companion.listener
@@ -21,7 +21,7 @@ import java.awt.Color
2121
object Rubberband : Module(
2222
name = "Rubberband",
2323
description = "Info about rubberbands",
24-
defaultTags = setOf(ModuleTag.CLIENT)
24+
defaultTags = setOf(ModuleTag.NETWORK, ModuleTag.DEBUG)
2525
) {
2626
private val showLastPacketInfo by setting("Show Last Packet", true)
2727
private val showConnectionState by setting("Show Connection State", true)

common/src/main/kotlin/com/lambda/module/modules/network/ServerSpoof.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import java.awt.Color
1717
object ServerSpoof : Module(
1818
name = "ServerSpoof",
1919
description = "Decide yourself if you want to accept the server resource pack.",
20-
defaultTags = setOf(ModuleTag.NETWORK, ModuleTag.BYPASS)
20+
defaultTags = setOf(ModuleTag.NETWORK)
2121
) {
2222
private val spoofClientBrand by setting("Spoof Client Brand", true)
2323
private val spoofName by setting("Spoof Name", "vanilla", visibility = { spoofClientBrand })

common/src/main/kotlin/com/lambda/module/modules/player/Nuker.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import com.lambda.event.events.TickEvent
44
import com.lambda.event.listener.SafeListener.Companion.listener
55
import com.lambda.interaction.visibilty.VisibilityChecker.getVisibleSurfaces
66
import com.lambda.module.Module
7+
import com.lambda.module.tag.ModuleTag
78
import com.lambda.util.Communication.info
89
import com.lambda.util.KeyCode
910
import com.lambda.util.math.VecUtils.dist
@@ -13,7 +14,7 @@ import net.minecraft.util.math.Vec3i
1314
object Nuker : Module(
1415
name = "Nuker",
1516
description = "Breaks blocks around you",
16-
defaultKeybind = KeyCode.Comma
17+
defaultTags = setOf(ModuleTag.PLAYER, ModuleTag.AUTOMATION)
1718
) {
1819
private val flatten by setting("Flatten", true)
1920

common/src/main/kotlin/com/lambda/module/tag/ModuleTag.kt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,15 @@ data class ModuleTag(override val name: String) : Nameable {
2121
val MOVEMENT = ModuleTag("Movement")
2222
val RENDER = ModuleTag("Render")
2323
val PLAYER = ModuleTag("Player")
24-
val WORLD = ModuleTag("World")
25-
val MISC = ModuleTag("Misc")
2624
val CLIENT = ModuleTag("Client")
27-
28-
// Do something with this ?
29-
val HIDDEN = ModuleTag("Hidden")
3025
val NETWORK = ModuleTag("Network")
31-
val GRIM = ModuleTag("Grim")
32-
val BYPASS = ModuleTag("Bypass")
33-
val AUTOMATION = ModuleTag("Automation")
3426
val DEBUG = ModuleTag("Debug")
3527

36-
val defaults = listOf(COMBAT, MOVEMENT, RENDER, PLAYER, WORLD, DEBUG, CLIENT)
28+
// currently secondary tags
29+
val WORLD = ModuleTag("World")
30+
val AUTOMATION = ModuleTag("Automation")
31+
val GRIM = ModuleTag("Grim")
32+
33+
val defaults = listOf(COMBAT, MOVEMENT, RENDER, PLAYER, CLIENT, NETWORK, DEBUG)
3734
}
3835
}

0 commit comments

Comments
 (0)