Skip to content

Commit 7d1b2a5

Browse files
Proper swing hand for nuker
1 parent a1a55dd commit 7d1b2a5

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

  • src/main/java/meteordevelopment/meteorclient/systems/modules/world

src/main/java/meteordevelopment/meteorclient/systems/modules/world/Nuker.java

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import meteordevelopment.orbit.EventHandler;
2828
import meteordevelopment.orbit.EventPriority;
2929
import net.minecraft.block.Block;
30+
import net.minecraft.network.packet.c2s.play.HandSwingC2SPacket;
3031
import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket;
3132
import net.minecraft.util.Hand;
3233
import net.minecraft.util.math.Direction;
@@ -157,13 +158,6 @@ public class Nuker extends Module {
157158
.build()
158159
);
159160

160-
private final Setting<Boolean> swingHand = sgGeneral.add(new BoolSetting.Builder()
161-
.name("swing-hand")
162-
.description("Swing hand client side.")
163-
.defaultValue(true)
164-
.build()
165-
);
166-
167161
private final Setting<Boolean> packetMine = sgGeneral.add(new BoolSetting.Builder()
168162
.name("packet-mine")
169163
.description("Attempt to instamine everything at once.")
@@ -224,6 +218,13 @@ public class Nuker extends Module {
224218

225219
// Rendering
226220

221+
private final Setting<Boolean> swing = sgRender.add(new BoolSetting.Builder()
222+
.name("swing")
223+
.description("Whether to swing hand client-side.")
224+
.defaultValue(true)
225+
.build()
226+
);
227+
227228
private final Setting<Boolean> enableRenderBounding = sgRender.add(new BoolSetting.Builder()
228229
.name("bounding-box")
229230
.description("Enable rendering bounding box for Cube and Uniform Cube.")
@@ -485,15 +486,18 @@ else if (sortMode.get() != SortMode.None)
485486
private void breakBlock(BlockPos blockPos) {
486487
if (interact.get()) {
487488
// Interact mode
488-
BlockUtils.interact(new BlockHitResult(blockPos.toCenterPos(), BlockUtils.getDirection(blockPos), blockPos, true), Hand.MAIN_HAND, swingHand.get());
489+
BlockUtils.interact(new BlockHitResult(blockPos.toCenterPos(), BlockUtils.getDirection(blockPos), blockPos, true), Hand.MAIN_HAND, swing.get());
489490
} else if (packetMine.get()) {
490491
// Packet mine mode
491492
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.START_DESTROY_BLOCK, blockPos, BlockUtils.getDirection(blockPos)));
492-
mc.player.swingHand(Hand.MAIN_HAND);
493+
494+
if (swing.get()) mc.player.swingHand(Hand.MAIN_HAND);
495+
else mc.getNetworkHandler().sendPacket(new HandSwingC2SPacket(Hand.MAIN_HAND));
496+
493497
mc.getNetworkHandler().sendPacket(new PlayerActionC2SPacket(PlayerActionC2SPacket.Action.STOP_DESTROY_BLOCK, blockPos, BlockUtils.getDirection(blockPos)));
494498
} else {
495499
// Legit mine mode
496-
BlockUtils.breakBlock(blockPos, swingHand.get());
500+
BlockUtils.breakBlock(blockPos, swing.get());
497501
}
498502
}
499503

0 commit comments

Comments
 (0)