Skip to content

Commit

Permalink
feat: do not use below count - autoblock scaffold (#3434)
Browse files Browse the repository at this point in the history
  • Loading branch information
1zun4 authored Jul 14, 2024
1 parent 6992fc6 commit e9783de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ object ModuleScaffold : Module("Scaffold", Category.WORLD) {
PreferFullCubeBlocks,
PreferWalkableBlocks,
PreferAverageHardBlocks,
PreferStackSize(higher = true),
PreferStackSize(higher = false),
)

override fun enable() {
Expand Down Expand Up @@ -497,6 +497,7 @@ object ModuleScaffold : Module("Scaffold", Category.WORLD) {

private fun findBestValidHotbarSlotForTarget() =
findPlaceableSlots()
.filter { it.second.count > ScaffoldAutoBlockFeature.doNotUseBelowCount }
.maxWithOrNull { o1, o2 -> BLOCK_COMPARATOR_FOR_HOTBAR.compare(o1.second, o2.second) }
?.first

Expand Down Expand Up @@ -592,7 +593,8 @@ object ModuleScaffold : Module("Scaffold", Category.WORLD) {
val bestMainHandSlot = findBestValidHotbarSlotForTarget()

if (bestMainHandSlot != null) {
SilentHotbar.selectSlotSilently(this, bestMainHandSlot, ScaffoldAutoBlockFeature.slotResetDelay)
SilentHotbar.selectSlotSilently(this, bestMainHandSlot,
ScaffoldAutoBlockFeature.slotResetDelay)

return true
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ import net.ccbluex.liquidbounce.features.module.modules.world.scaffold.ModuleSca
object ScaffoldAutoBlockFeature : ToggleableConfigurable(ModuleScaffold, "AutoBlock", true) {
val alwaysHoldBlock by boolean("Always", false)
val slotResetDelay by int("SlotResetDelay", 5, 0..40, "ticks")
val doNotUseBelowCount by int("DoNotUseBelowCount", 1, 0..64)
}

0 comments on commit e9783de

Please sign in to comment.