diff --git a/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsE.java b/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsE.java index 6459b22b4d..03071493c4 100644 --- a/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsE.java +++ b/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsE.java @@ -6,6 +6,7 @@ import ac.grim.grimac.player.GrimPlayer; import com.github.retrooper.packetevents.event.PacketReceiveEvent; import com.github.retrooper.packetevents.protocol.packettype.PacketType; +import com.github.retrooper.packetevents.protocol.player.ClientVersion; import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientPlayerFlying; @CheckData(name = "BadPacketsE") @@ -23,8 +24,8 @@ public void onPacketReceive(PacketReceiveEvent event) { noReminderTicks = 0; } else if (WrapperPlayClientPlayerFlying.isFlying(event.getPacketType())) { noReminderTicks++; - } else if (event.getPacketType() == PacketType.Play.Client.STEER_VEHICLE || - event.getPacketType() == PacketType.Play.Client.VEHICLE_MOVE) { + } else if (event.getPacketType() == PacketType.Play.Client.STEER_VEHICLE + || (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_21_2) && player.inVehicle())) { noReminderTicks = 0; // Exempt vehicles } diff --git a/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsR.java b/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsR.java index 79b86e4909..d9ac8e12ff 100644 --- a/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsR.java +++ b/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsR.java @@ -41,9 +41,8 @@ public void onPacketReceive(final PacketReceiveEvent event) { if ((event.getPacketType() == PacketType.Play.Client.PLAYER_POSITION_AND_ROTATION || event.getPacketType() == PacketType.Play.Client.PLAYER_POSITION) && !player.compensatedEntities.getSelf().inVehicle()) { positions++; - } else if ((event.getPacketType() == PacketType.Play.Client.STEER_VEHICLE || - event.getPacketType() == PacketType.Play.Client.VEHICLE_MOVE) - && player.compensatedEntities.getSelf().inVehicle()) { + } else if ((event.getPacketType() == PacketType.Play.Client.STEER_VEHICLE || event.getPacketType() == PacketType.Play.Client.VEHICLE_MOVE) + && player.inVehicle()) { positions++; } } diff --git a/src/main/java/ac/grim/grimac/player/GrimPlayer.java b/src/main/java/ac/grim/grimac/player/GrimPlayer.java index 05c8ace8be..a36a5f371c 100644 --- a/src/main/java/ac/grim/grimac/player/GrimPlayer.java +++ b/src/main/java/ac/grim/grimac/player/GrimPlayer.java @@ -571,6 +571,10 @@ public boolean isTickingReliablyFor(int ticks) { || compensatedEntities.getSelf().inVehicle(); } + public boolean inVehicle() { + return compensatedEntities.getSelf().inVehicle(); + } + public boolean canThePlayerBeCloseToZeroMovement(int ticks) { return (!uncertaintyHandler.lastPointThree.hasOccurredSince(ticks)); }