Fix stuff (#287)

Co-authored-by: Cloudburst <18114966+C10udburst@users.noreply.github.com>
This commit is contained in:
Patrick
2023-12-17 21:31:28 +01:00
committed by GitHub
parent 1f2f364de9
commit d848b2dd11
2 changed files with 5 additions and 10 deletions

View File

@@ -63,7 +63,7 @@ public class AutoGrind extends Module {
if (mc.currentScreen == null) break; if (mc.currentScreen == null) break;
InvUtils.quickSwap().slot(i); InvUtils.shiftClick().slot(i);
InvUtils.move().fromId(2).to(i); InvUtils.move().fromId(2).to(i);
} }
} }

View File

@@ -25,24 +25,19 @@ public class VehicleOneHit extends Module {
.build() .build()
); );
private boolean ignorePackets;
public VehicleOneHit() { public VehicleOneHit() {
super(MeteorRejectsAddon.CATEGORY, "vehicle-one-hit", "Destroy vehicles with one hit."); super(MeteorRejectsAddon.CATEGORY, "vehicle-one-hit", "Destroy vehicles with one hit.");
} }
@EventHandler @EventHandler
private void onPacketSend(PacketEvent.Send event) { private void onPacketSend(PacketEvent.Send event) {
if (ignorePackets if (!(event.packet instanceof PlayerInteractEntityC2SPacket)
|| !(event.packet instanceof PlayerInteractEntityC2SPacket) || !(mc.crosshairTarget instanceof EntityHitResult ehr)
|| !(mc.crosshairTarget instanceof EntityHitResult ehr) || (!(ehr.getEntity() instanceof AbstractMinecartEntity) && !(ehr.getEntity() instanceof BoatEntity))
|| (!(ehr.getEntity() instanceof AbstractMinecartEntity) && !(ehr.getEntity() instanceof BoatEntity))
) return; ) return;
ignorePackets = true;
for (int i = 0; i < amount.get() - 1; i++) { 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;
} }
} }