@@ -24,6 +24,7 @@ import com.lambda.module.tag.ModuleTag
2424import com.lambda.task.RootTask.run
2525import com.lambda.task.Task
2626import com.lambda.task.tasks.BuildTask.Companion.build
27+ import com.lambda.util.BaritoneUtils
2728import com.lambda.util.BlockUtils.blockPos
2829import com.lambda.util.BlockUtils.blockState
2930import net.minecraft.util.math.BlockPos
@@ -38,6 +39,7 @@ object Nuker : Module(
3839 private val flatten by setting(" Flatten" , true )
3940 private val onlyBreakInstant by setting(" Only Break Instant" , true )
4041 private val fillFloor by setting(" Fill Floor" , false )
42+ private val baritoneSelection by setting(" Baritone Selection" , false , " Restricts nuker to your baritone selection" )
4143
4244 private var task: Task <* >? = null
4345
@@ -51,6 +53,16 @@ object Nuker : Module(
5153 .filter { ! flatten || it.y >= player.blockPos.y }
5254 .filter { ! onlyBreakInstant || blockState(it).getHardness(world, it) <= 1 }
5355 .filter { blockState(it).getHardness(world, it) >= 0 }
56+ .filter { pos ->
57+ if (! baritoneSelection) true
58+ else BaritoneUtils .primary.selectionManager.selections.any {
59+ val min = it.min()
60+ val max = it.max()
61+ pos.x >= min.x && pos.x <= max.x
62+ && pos.y >= min.y && pos.y <= max.y
63+ && pos.z >= min.z && pos.z <= max.z
64+ }
65+ }
5466 .associateWith { TargetState .Air }
5567
5668 if (fillFloor) {
0 commit comments