Skip to content

Commit

Permalink
feat(MaceKill): auto select (#5392)
Browse files Browse the repository at this point in the history
  • Loading branch information
MukjepScarlet authored Jan 25, 2025
1 parent 8e0db36 commit 9893040
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ import net.ccbluex.liquidbounce.event.events.AttackEntityEvent
import net.ccbluex.liquidbounce.event.handler
import net.ccbluex.liquidbounce.features.module.Category
import net.ccbluex.liquidbounce.features.module.ClientModule
import net.ccbluex.liquidbounce.utils.client.SilentHotbar
import net.ccbluex.liquidbounce.utils.entity.warp
import net.ccbluex.liquidbounce.utils.inventory.Slots
import net.minecraft.item.Items
import net.minecraft.util.shape.VoxelShapes
import kotlin.math.abs
Expand All @@ -47,8 +49,10 @@ object ModuleMaceKill : ClientModule("MaceKill", Category.COMBAT) {
val mainHandStack = player.mainHandStack

if (mainHandStack.item != Items.MACE) {
// TODO: Auto Select Mace
return@handler
// Auto Select Mace
val maceIndex = Slots.Hotbar.findSlotIndex(Items.MACE) ?: return@handler

SilentHotbar.selectSlotSilently(this, maceIndex, 1)
}

val height = determineHeight()
Expand Down Expand Up @@ -86,7 +90,7 @@ object ModuleMaceKill : ClientModule("MaceKill", Category.COMBAT) {
val newBoundingBox = boundingBox.offset(0.0, i.toDouble(), 0.0)

// Check if the player would collide with a block
if (world.getBlockCollisions(player, newBoundingBox).all { shape -> shape == VoxelShapes.empty() }) {
if (world.getBlockCollisions(player, newBoundingBox).all(VoxelShapes.empty()::equals)) {
return i
}
}
Expand Down

0 comments on commit 9893040

Please sign in to comment.