@@ -23,11 +23,14 @@ import com.lambda.module.Module
2323import com.lambda.module.modules.movement.BetterFirework.startFirework
2424import com.lambda.module.tag.ModuleTag
2525import com.lambda.threading.runSafe
26+ import com.lambda.util.Communication.info
2627import com.lambda.util.NamedEnum
2728import com.lambda.util.SpeedUnit
2829import com.lambda.util.Timer
30+ import com.lambda.util.world.fastEntitySearch
2931import net.minecraft.client.network.ClientPlayerEntity
30- import net.minecraft.entity.EntityType
32+ import net.minecraft.entity.projectile.FireworkRocketEntity
33+ import net.minecraft.text.Text
3134import net.minecraft.util.math.Vec3d
3235import kotlin.time.Duration.Companion.seconds
3336
@@ -75,7 +78,7 @@ object ElytraAttitudeControl : Module(
7578 init {
7679 listen<TickEvent .Pre > {
7780 if (! player.isGliding) return @listen
78- if (player.hasFirework && disableOnFirework ) return @listen
81+ if (disableOnFirework && player.hasFirework ) return @listen
7982
8083 val outputPitch = when (controlValue) {
8184 Mode .Speed -> {
@@ -121,11 +124,7 @@ object ElytraAttitudeControl : Module(
121124 }
122125
123126 val ClientPlayerEntity .hasFirework: Boolean
124- get() = clientWorld.getEntitiesByType(
125- EntityType .FIREWORK_ROCKET ,
126- boundingBox.expand(4.0 ),
127- { it.distanceTo(this ) < 4.0 }
128- ).isNotEmpty()
127+ get() = runSafe { return fastEntitySearch<FireworkRocketEntity >(4.0 ) { it.shooter == this .player }.any() } ? : false
129128
130129 class PIController (val valueP : () -> Double , val valueD : () -> Double , val valueI : () -> Double , val constant : () -> Double ) {
131130 var accumulator = 0.0 // Integral term accumulator
0 commit comments