Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #385
Browse files Browse the repository at this point in the history
qingshu-ui committed Oct 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 356c6ef commit 24b148b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/anticope/rejects/modules/VehicleOneHit.java
Original file line number Diff line number Diff line change
@@ -31,15 +31,20 @@ public VehicleOneHit() {
super(MeteorRejectsAddon.CATEGORY, "vehicle-one-hit", "Destroy vehicles with one hit.");
}

private boolean isManualSend = false;

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

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

0 comments on commit 24b148b

Please sign in to comment.