Skip to content

Commit 3b236e1

Browse files
committed
fix logic for when middleClickCancel is disabled
1 parent 1d61224 commit 3b236e1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/kotlin/com/lambda/module/modules/movement/BetterFirework.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
package com.lambda.module.modules.movement
1919

20+
import com.lambda.Lambda
2021
import com.lambda.Lambda.mc
2122
import com.lambda.config.AutomationConfig.Companion.setDefaultAutomationConfig
2223
import com.lambda.config.applyEdits
@@ -29,7 +30,6 @@ import com.lambda.interaction.managers.hotbar.HotbarRequest
2930
import com.lambda.interaction.managers.inventory.InventoryRequest.Companion.inventoryRequest
3031
import com.lambda.interaction.material.StackSelection.Companion.selectStack
3132
import com.lambda.module.Module
32-
import com.lambda.module.modules.movement.BetterFirework.sendSwing
3333
import com.lambda.module.tag.ModuleTag
3434
import com.lambda.threading.runSafe
3535
import com.lambda.util.Communication.warn
@@ -51,8 +51,12 @@ object BetterFirework : Module(
5151
description = "Automatic takeoff with fireworks",
5252
tag = ModuleTag.MOVEMENT,
5353
) {
54-
private var activateButton by setting("Activate Key", Bind(0, 0, Mouse.Middle.ordinal), "Button to activate Firework")
54+
private var activateButton: Bind by setting("Activate Key", Bind(0, 0, Mouse.Middle.ordinal), "Button to activate Firework")
5555
.onPress {
56+
if (mc.crosshairTarget?.type == HitResult.Type.BLOCK &&
57+
!middleClickCancel &&
58+
activateButton.mouse == Lambda.mc.options.pickItemKey.boundKey.code) return@onPress
59+
5660
if (!player.isElytraEquipped) {
5761
warn("You need to equip an elytra to use this module!")
5862
return@onPress

0 commit comments

Comments
 (0)