Skip to content

Commit

Permalink
Merge branch '2.0' of https://github.com/GrimAnticheat/Grim into 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
AoElite committed Nov 25, 2023
2 parents f24eba9 + da8e639 commit 3f65645
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,10 @@ private void check(PositionUpdate update) {

player.vehicleData.vehicleForward = (float) Math.min(0.98, Math.max(-0.98, player.vehicleData.nextVehicleForward));
player.vehicleData.vehicleHorizontal = (float) Math.min(0.98, Math.max(-0.98, player.vehicleData.nextVehicleHorizontal));
player.vehicleData.horseJump = player.vehicleData.nextHorseJump;
player.vehicleData.nextHorseJump = 0;
if (player.onGround) { // if vehicle is on ground, this gets set
player.vehicleData.horseJump = player.vehicleData.nextHorseJump;
player.vehicleData.nextHorseJump = 0;
}
player.minPlayerAttackSlow = 0;
player.maxPlayerAttackSlow = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,13 @@ public void onPacketSend(final PacketSendEvent event) {
if (inventory.getInventoryStorage().getSize() > slot.getSlot() && slot.getSlot() >= 0) {
inventory.getInventoryStorage().setItem(slot.getSlot(), slot.getItem());
}
} else if (slot.getWindowId() == 0) { // Player hotbar (ONLY!)
if (slot.getSlot() >= 36 && slot.getSlot() <= 45) {
} else if (slot.getWindowId() == 0) { // Player inventory
// This packet can only be used to edit the hotbar and offhand of the player's inventory if
// window ID is set to 0 (slots 36 through 45) if the player is in creative, with their inventory open,
// and not in their survival inventory tab. Otherwise, when window ID is 0, it can edit any slot in the player's inventory.
// if (slot.getSlot() >= 36 && slot.getSlot() <= 45) {
inventory.getSlot(slot.getSlot()).set(slot.getItem());
}
// }
} else if (slot.getWindowId() == openWindowID) { // Opened inventory (if not valid, client crashes)
menu.getSlot(slot.getSlot()).set(slot.getItem());
}
Expand Down

0 comments on commit 3f65645

Please sign in to comment.