From 6991269976bd9b0251c3e0243fecef25c0e1124e Mon Sep 17 00:00:00 2001 From: videogame hacker Date: Fri, 4 Feb 2022 11:49:58 +0000 Subject: [PATCH] Refactor flight's vanilla kick bypass --- .../som/hibiscus/features/movement/Flight.kt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/codes/som/hibiscus/features/movement/Flight.kt b/src/main/kotlin/codes/som/hibiscus/features/movement/Flight.kt index 8375a2f..72c781f 100644 --- a/src/main/kotlin/codes/som/hibiscus/features/movement/Flight.kt +++ b/src/main/kotlin/codes/som/hibiscus/features/movement/Flight.kt @@ -24,7 +24,7 @@ class Flight : Feature("Flight", FeatureCategory.MOVEMENT) { } val spoofAbilityPackets by values.bool("Spoof Outgoing Ability Packets", true) - val vanillaKickBypass by values.bool("Vanilla Kick Bypass", false) + val vanillaKickBypass by values.bool("Vanilla Kick Bypass", true) on { event: SendPacketEvent -> val (packet) = event @@ -54,13 +54,15 @@ class Flight : Feature("Flight", FeatureCategory.MOVEMENT) { if (flyKickCounter == 16) lockY = event.y - 0.03126 - if (world.getBlockCollisions( - null, - player.boundingBox.offset(0.0, lockY - player.y, 0.0).expand(0.0625).stretch(0.0, -0.55, 0.0) - ).all(VoxelShape::isEmpty) - ) { + val playerNotColliding = world.getBlockCollisions( + null, player.boundingBox + .offset(0.0, lockY - player.y, 0.0) + .expand(0.0625) + .stretch(0.0, -0.55, 0.0) + ).all(VoxelShape::isEmpty) + + if (playerNotColliding) event.y = lockY - } } if (flyKickCounter >= 24)