Skip to content

Commit c0cb1e1

Browse files
committed
fixed mouse click event listener
1 parent 8ac5452 commit c0cb1e1

File tree

1 file changed

+2
-7
lines changed
  • common/src/main/kotlin/com/lambda/module/modules/render

1 file changed

+2
-7
lines changed

common/src/main/kotlin/com/lambda/module/modules/render/ViewModel.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import com.lambda.event.events.TickEvent
77
import com.lambda.event.listener.SafeListener.Companion.listen
88
import com.lambda.module.Module
99
import com.lambda.module.tag.ModuleTag
10-
import com.lambda.util.Mouse
1110
import net.minecraft.client.network.AbstractClientPlayerEntity
1211
import net.minecraft.client.util.math.MatrixStack
1312
import net.minecraft.item.ItemStack
@@ -94,12 +93,8 @@ object ViewModel : Module(
9493

9594
init {
9695
listen<MouseEvent.Click> { event ->
97-
if (event.button.key == mc.options.attackKey.boundKey.code) {
98-
// For some reason click and release seem to be swapped???
99-
attackKeyTicksPressed = when (event.action) {
100-
Mouse.Action.Click -> -1
101-
Mouse.Action.Release -> 0
102-
}
96+
if (event.button == mc.options.attackKey.boundKey.code) {
97+
attackKeyTicksPressed = if (event.action == 0) -1 else 0
10398
}
10499
}
105100
listen<KeyboardEvent.Press> { event ->

0 commit comments

Comments
 (0)