Skip to content

Commit 211140e

Browse files
committed
ignore when holding setting in PacketMine
1 parent 0f0b999 commit 211140e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/main/kotlin/com/lambda/module/modules/player/PacketMine.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import com.lambda.util.NamedEnum
4040
import com.lambda.util.math.distSq
4141
import com.lambda.util.math.lerp
4242
import com.lambda.util.math.setAlpha
43+
import net.minecraft.item.Item
4344
import net.minecraft.util.math.BlockPos
4445
import net.minecraft.util.math.Box
4546
import java.awt.Color
@@ -55,6 +56,7 @@ object PacketMine : Module(
5556
Renders("Renders")
5657
}
5758

59+
private val ignoreWhenHolding by setting("Ignore When Holding", emptySet<Item>(), description = "These items won't initiate a break if held when attacking a block").group(Group.General)
5860
private val rebreakMode by setting("Rebreak Mode", RebreakMode.Manual, "The method used to re-break blocks after they've been broken once").disabled { !breakConfig.rebreak }.group(Group.General)
5961
private val breakRadius by setting("Break Radius", 0, 0..5, 1, "Selects and breaks all blocks within the break radius of the selected block").group(Group.General)
6062
private val flatten by setting("Flatten", true, "Wont allow breaking extra blocks under your players position") { breakRadius > 0 }.group(Group.General)
@@ -133,6 +135,7 @@ object PacketMine : Module(
133135
listen<PlayerEvent.Attack.Block> { it.cancel() }
134136
listen<PlayerEvent.Breaking.Update> { event ->
135137
event.cancel()
138+
if (player.mainHandStack.item in ignoreWhenHolding) return@listen
136139
val pos = event.pos
137140
val positions = mutableListOf<BlockPos>().apply {
138141
if (breakRadius <= 0) {

0 commit comments

Comments
 (0)