Skip to content

Commit

Permalink
Fixed flight fall damage bug 7959622
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNomadrg committed Jun 21, 2022
1 parent 57f52b7 commit 5861f02
Showing 1 changed file with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,20 +89,11 @@ private void onSendPacket(PacketEvent.Send event) {
|| ((IPlayerMoveC2SPacket) event.packet).getTag() == 1337) return;


if ((mc.player.isFallFlying() || Modules.get().isActive(Flight.class)) && mc.player.getVelocity().y < 1) {
BlockHitResult result = mc.world.raycast(new RaycastContext(
mc.player.getPos(),
mc.player.getPos().subtract(0, 0.5, 0),
RaycastContext.ShapeType.OUTLINE,
RaycastContext.FluidHandling.NONE,
mc.player)
);

if (result != null && result.getType() == HitResult.Type.BLOCK) {
((PlayerMoveC2SPacketAccessor) event.packet).setOnGround(true);
}
}
else {
if (!Modules.get().isActive(Flight.class)) {
if (mc.player.isFallFlying()) return;
if (mc.player.getVelocity().y > -0.5) return;
((PlayerMoveC2SPacketAccessor) event.packet).setOnGround(true);
} else {
((PlayerMoveC2SPacketAccessor) event.packet).setOnGround(true);
}
}
Expand Down

0 comments on commit 5861f02

Please sign in to comment.