Skip to content

Commit 5f1ba4e

Browse files
committed
a step the right direction it just works worse now
1 parent 3e6d20a commit 5f1ba4e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/main/java/dev/dfonline/codeclient/action/impl/ScanPlot.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public boolean onReceivePacket(Packet<?> packet) {
5757
if(template == null) return false;
5858
scanList.add(Template.parse64(data));
5959
waitForResponse = false;
60+
progress += 1;
6061
net.sendPacket(new CreativeInventoryActionC2SPacket(slot.getSlot(), ItemStack.EMPTY));
6162
return true;
6263
}
@@ -65,6 +66,12 @@ public boolean onReceivePacket(Packet<?> packet) {
6566

6667
@Override
6768
public void onTick() {
69+
if(progress == blocks.size()) {
70+
if(!waitForResponse) {
71+
callback();
72+
}
73+
return;
74+
}
6875
var net = CodeClient.MC.getNetworkHandler();
6976
var player = CodeClient.MC.player;
7077
var inter = CodeClient.MC.interactionManager;
@@ -77,15 +84,8 @@ public void onTick() {
7784
inter.interactBlock(player, Hand.MAIN_HAND, new BlockHitResult(current.toCenterPos(), Direction.UP, current,false));
7885
if(sneaky) net.sendPacket(new ClientCommandC2SPacket(player, ClientCommandC2SPacket.Mode.RELEASE_SHIFT_KEY));
7986
waitForResponse = true;
80-
progress += 1;
8187
goTo = null;
8288
}
83-
if(progress == blocks.size()) {
84-
if(!waitForResponse) {
85-
callback();
86-
}
87-
return;
88-
}
8989
goTo = new GoTo(blocks.get(progress).toCenterPos().add(goToOffset), () -> {});
9090
goTo.init();
9191
}

0 commit comments

Comments
 (0)