Refactor flight's vanilla kick bypass

main
Charlotte Som 2022-02-04 11:49:58 +00:00
parent 638e77d104
commit 6991269976
1 changed files with 9 additions and 7 deletions

View File

@ -24,7 +24,7 @@ class Flight : Feature("Flight", FeatureCategory.MOVEMENT) {
} }
val spoofAbilityPackets by values.bool("Spoof Outgoing Ability Packets", true) 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 -> on { event: SendPacketEvent ->
val (packet) = event val (packet) = event
@ -54,14 +54,16 @@ class Flight : Feature("Flight", FeatureCategory.MOVEMENT) {
if (flyKickCounter == 16) if (flyKickCounter == 16)
lockY = event.y - 0.03126 lockY = event.y - 0.03126
if (world.getBlockCollisions( val playerNotColliding = world.getBlockCollisions(
null, null, player.boundingBox
player.boundingBox.offset(0.0, lockY - player.y, 0.0).expand(0.0625).stretch(0.0, -0.55, 0.0) .offset(0.0, lockY - player.y, 0.0)
.expand(0.0625)
.stretch(0.0, -0.55, 0.0)
).all(VoxelShape::isEmpty) ).all(VoxelShape::isEmpty)
) {
if (playerNotColliding)
event.y = lockY event.y = lockY
} }
}
if (flyKickCounter >= 24) if (flyKickCounter >= 24)
flyKickCounter = 0 flyKickCounter = 0