@@ -27,7 +27,6 @@ import com.lambda.event.events.MouseEvent
2727import com.lambda.event.events.TickEvent
2828import com.lambda.event.listener.SafeListener.Companion.listen
2929import com.lambda.interaction.material.StackSelection.Companion.selectStack
30- import com.lambda.interaction.request.hotbar.HotbarManager
3130import com.lambda.interaction.request.hotbar.HotbarRequest
3231import com.lambda.interaction.request.inventory.InventoryRequest.Companion.inventoryRequest
3332import com.lambda.module.Module
@@ -163,10 +162,10 @@ object BetterFirework : Module(
163162 fun onInteract () =
164163 runSafe {
165164 when {
166- ! fireworkInteract -> false
167- player.inventory.selectedStack?.item != Items .FIREWORK_ROCKET -> false
168- player.isGliding -> false // No need to do special magic if we are already holding fireworks and flying
169- mc.crosshairTarget != null && mc.crosshairTarget!! .type != HitResult .Type .MISS && ! fireworkInteractCancel -> false
165+ ! fireworkInteract ||
166+ player.inventory.selectedStack?.item != Items .FIREWORK_ROCKET ||
167+ player.isGliding || // No need to do special magic if we are already holding fireworks and flying
168+ ( mc.crosshairTarget != null && mc.crosshairTarget!! .type != HitResult .Type .MISS && ! fireworkInteractCancel) -> false
170169 else -> {
171170 mc.itemUseCooldown + = 4
172171 val cancelInteract = player.canTakeoff || fireworkInteractCancel
@@ -187,8 +186,8 @@ object BetterFirework : Module(
187186 fun onPick () =
188187 runSafe {
189188 when {
190- mc.crosshairTarget?.type == HitResult .Type .BLOCK && ! middleClickCancel -> false
191- ! activateButton.isMouseBind || activateButton.mouse != mc.options.pickItemKey.boundKey.code -> false
189+ ( mc.crosshairTarget?.type == HitResult .Type .BLOCK && ! middleClickCancel) ||
190+ ( ! activateButton.isMouseBind || activateButton.mouse != mc.options.pickItemKey.boundKey.code) ||
192191 takeoffState != TakeoffState .None -> false // Prevent using multiple times
193192 else -> {
194193 if (player.canOpenElytra || player.isGliding) {
@@ -219,7 +218,7 @@ object BetterFirework : Module(
219218
220219 stack.bestItemMatch(player.hotbar)
221220 ?.let {
222- val request = HotbarManager .request( HotbarRequest (player.hotbar.indexOf(it), this @BetterFirework, keepTicks = 0 ) )
221+ val request = HotbarRequest (player.hotbar.indexOf(it), this @BetterFirework, keepTicks = 0 )
223222 .submit(queueIfClosed = false )
224223 if (request.done) {
225224 interaction.interactItem(player, Hand .MAIN_HAND )
@@ -238,7 +237,7 @@ object BetterFirework : Module(
238237 inventoryRequest {
239238 swap(swapSlotId, hotbarSlotToSwapWith)
240239 action {
241- val request = HotbarManager .request( HotbarRequest (hotbarSlotToSwapWith, this @BetterFirework, keepTicks = 0 , nowOrNothing = true ) )
240+ val request = HotbarRequest (hotbarSlotToSwapWith, this @BetterFirework, keepTicks = 0 , nowOrNothing = true )
242241 .submit(queueIfClosed = false )
243242 if (request.done) {
244243 interaction.interactItem(player, Hand .MAIN_HAND )
0 commit comments