Skip to content

Commit

Permalink
Merge pull request #1428 from ManInMyVan/Post2
Browse files Browse the repository at this point in the history
fix post exempting all ENTITY_ACTION packets for 1.8c -> 1.9s
  • Loading branch information
AoElite authored Apr 12, 2024
2 parents 25889d9 + 79ab881 commit 9e918a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/ac/grim/grimac/checks/impl/post/PostCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientEntityAction;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientPlayerFlying;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityAnimation;

Expand Down Expand Up @@ -99,8 +100,7 @@ public void onPacketReceive(final PacketReceiveEvent event) {
&& isExemptFromSwingingCheck < player.lastTransactionReceived.get()) { // Exempt when the server sends animations because viaversion
if (sentFlying) post.add(event.getPacketType());
} else if (ENTITY_ACTION.equals(packetType) // ViaRewind sends START_FALL_FLYING packets async for 1.8 clients on 1.9+ servers
&& ((player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_9) // ViaRewind doesn't 1.9 players
|| PacketEvents.getAPI().getServerManager().getVersion().isOlderThanOrEquals(ServerVersion.V_1_8_8)))) { // No elytras
&& (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_9) || new WrapperPlayClientEntityAction(event).getAction() != WrapperPlayClientEntityAction.Action.START_FLYING_WITH_ELYTRA)) {
// https://github.com/GrimAnticheat/Grim/issues/824
if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_19_3) && player.compensatedEntities.getSelf().getRiding() != null) {
return;
Expand Down

0 comments on commit 9e918a3

Please sign in to comment.