Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
qingshu-ui committed Dec 26, 2023
2 parents 1b109d4 + d848b2d commit de0272e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/main/java/anticope/rejects/modules/AutoGrind.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private void onOpenScreen(OpenScreenEvent event) {

if (mc.currentScreen == null) break;

InvUtils.quickSwap().slot(i);
InvUtils.shiftClick().slot(i);
InvUtils.move().fromId(2).to(i);
}
}
Expand Down
13 changes: 4 additions & 9 deletions src/main/java/anticope/rejects/modules/VehicleOneHit.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,19 @@ public class VehicleOneHit extends Module {
.build()
);

private boolean ignorePackets;

public VehicleOneHit() {
super(MeteorRejectsAddon.CATEGORY, "vehicle-one-hit", "Destroy vehicles with one hit.");
}

@EventHandler
private void onPacketSend(PacketEvent.Send event) {
if (ignorePackets
|| !(event.packet instanceof PlayerInteractEntityC2SPacket)
|| !(mc.crosshairTarget instanceof EntityHitResult ehr)
|| (!(ehr.getEntity() instanceof AbstractMinecartEntity) && !(ehr.getEntity() instanceof BoatEntity))
if (!(event.packet instanceof PlayerInteractEntityC2SPacket)
|| !(mc.crosshairTarget instanceof EntityHitResult ehr)
|| (!(ehr.getEntity() instanceof AbstractMinecartEntity) && !(ehr.getEntity() instanceof BoatEntity))
) return;

ignorePackets = true;
for (int i = 0; i < amount.get() - 1; i++) {
mc.player.networkHandler.sendPacket(event.packet);
mc.player.networkHandler.getConnection().send(event.packet, null);
}
ignorePackets = false;
}
}

0 comments on commit de0272e

Please sign in to comment.