Skip to content

Commit

Permalink
Merge pull request #1399 from ManInMyVan/bpQ+
Browse files Browse the repository at this point in the history
Improve BadPacketsQ
  • Loading branch information
AoElite authored Apr 12, 2024
2 parents 2fda5b4 + 9fc46a9 commit bbe86d5
Showing 1 changed file with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,12 @@ public void onPacketReceive(PacketReceiveEvent event) {
if (event.getPacketType() == Client.ENTITY_ACTION) {
WrapperPlayClientEntityAction wrapper = new WrapperPlayClientEntityAction(event);

if (wrapper.getAction() == Action.START_JUMPING_WITH_HORSE) {
if (wrapper.getJumpBoost() < 0 || wrapper.getJumpBoost() > 100) {
if (flag()) {
alert("b=" + wrapper.getJumpBoost()); // Ban
if (shouldModifyPackets()) {
event.setCancelled(true);
}
}
if (wrapper.getJumpBoost() < 0 || wrapper.getJumpBoost() > 100 || wrapper.getEntityId() != player.entityID || (wrapper.getAction() != Action.START_JUMPING_WITH_HORSE && wrapper.getJumpBoost() != 0)) {
if (flagAndAlert("boost=" + wrapper.getJumpBoost() + ", action=" + wrapper.getAction() + ", entity=" + wrapper.getEntityId()) && shouldModifyPackets()) {
event.setCancelled(true);
player.onPacketCancel();
}
}
}
}
}
}

0 comments on commit bbe86d5

Please sign in to comment.