1
0
mirror of https://github.com/kami-blue/client synced 2025-02-20 23:27:14 +00:00

finally fix antihunger elytraflight compatibility

This commit is contained in:
Bella 2020-04-17 13:07:21 -04:00
parent 0c3c210326
commit 11fceec376
No known key found for this signature in database
GPG Key ID: DBD4A6030080C8B3

View File

@ -25,7 +25,7 @@ public class AntiHunger extends Module {
@EventHandler
public Listener<PacketEvent.Send> packetListener = new Listener<>(event -> {
if (mc.player == null || mc.player.isElytraFlying()) return;
if (mc.player == null) return;
if (cancelMovementState.getValue() && event.getPacket() instanceof CPacketEntityAction) {
CPacketEntityAction packet = (CPacketEntityAction) event.getPacket();
@ -35,7 +35,8 @@ public class AntiHunger extends Module {
}
if (event.getPacket() instanceof CPacketPlayer) {
((CPacketPlayer) event.getPacket()).onGround = mc.player.fallDistance > 0 || mc.playerController.isHittingBlock;
// Trick the game to think that tha player is flying even if he is on ground. Also check if the player is flying with the Elytra.
((CPacketPlayer) event.getPacket()).onGround = (mc.player.fallDistance > 0 || mc.playerController.isHittingBlock) && mc.player.isElytraFlying();
}
});