Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ public class Nuker extends Module {
);

private final List<BlockPos> blocks = new ArrayList<>();
private BlockPos currentBlock = null;
private final Set<BlockPos> interacted = new ObjectOpenHashSet<>();

private boolean firstBlock;
Expand All @@ -305,6 +306,7 @@ public Nuker() {

@Override
public void onActivate() {
currentBlock = null;
firstBlock = true;
timer = 0;
noBlockTimer = 0;
Expand Down Expand Up @@ -450,6 +452,7 @@ else if (sortMode.get() != SortMode.None)

// Check if some block was found
if (blocks.isEmpty()) {
currentBlock = null;
interacted.clear();
// If no block was found for long enough then set firstBlock flag to true to not wait before breaking another again
if (noBlockTimer++ >= delay.get()) firstBlock = true;
Expand All @@ -459,6 +462,18 @@ else if (sortMode.get() != SortMode.None)
noBlockTimer = 0;
}

// Check if a block is already being mined
if (currentBlock != null) {
// Check if it's still valid
if (!BlockUtils.canInstaBreak(currentBlock) && !packetMine.get() && blocks.contains(currentBlock)) {
// Move it to the start of the list (will be iterated first)
blocks.remove(currentBlock);
blocks.addFirst(currentBlock);
} else {
currentBlock = null;
}
}

// Update timer
if (!firstBlock && !lastBlockPos.equals(blocks.getFirst())) {
timer = delay.get();
Expand All @@ -483,6 +498,8 @@ else if (sortMode.get() != SortMode.None)
if (enableRenderBreaking.get()) RenderUtils.renderTickingBlock(block, sideColor.get(), lineColor.get(), shapeModeBreak.get(), 0, 8, true, false);
lastBlockPos.set(block);

currentBlock = block;

count++;
if (!canInstaMine && !packetMine.get() /* With packet mine attempt to break everything possible at once */) break;
}
Expand Down