Skip to content

Commit bb4f6cb

Browse files
committed
baritone selection mode in nuker because i needed it
1 parent 295d0f0 commit bb4f6cb

File tree

1 file changed

+12
-0
lines changed
  • common/src/main/kotlin/com/lambda/module/modules/player

1 file changed

+12
-0
lines changed

common/src/main/kotlin/com/lambda/module/modules/player/Nuker.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import com.lambda.module.tag.ModuleTag
2424
import com.lambda.task.RootTask.run
2525
import com.lambda.task.Task
2626
import com.lambda.task.tasks.BuildTask.Companion.build
27+
import com.lambda.util.BaritoneUtils
2728
import com.lambda.util.BlockUtils.blockPos
2829
import com.lambda.util.BlockUtils.blockState
2930
import 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

Comments
 (0)