2020import com .lambda .event .EventFlow ;
2121import com .lambda .event .events .EntityEvent ;
2222import com .lambda .event .events .PlayerEvent ;
23+ import com .lambda .interaction .BaritoneHandler ;
2324import com .lambda .interaction .managers .rotating .RotationManager ;
2425import com .lambda .module .modules .movement .elytrafly .ElytraFly ;
2526import com .lambda .module .modules .movement .elytrafly .ElytraFly .FlyMode ;
@@ -60,6 +61,8 @@ public void move(MovementType movementType, Vec3d movement) {}
6061 */
6162 @ WrapOperation (method = "updateVelocity" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/entity/Entity;getYaw()F" ))
6263 public float velocityYaw (Entity entity , Operation <Float > original ) {
64+ if (BaritoneHandler .isActive ()) return original .call (entity );
65+
6366 if ((Object ) this != getMc ().player ) return original .call (entity );
6467
6568 Float y = RotationManager .getMovementYaw ();
@@ -78,6 +81,8 @@ public float velocityYaw(Entity entity, Operation<Float> original) {
7881 */
7982 @ WrapOperation (method = "getRotationVec" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/entity/Entity;getYaw(F)F" ))
8083 float fixDirectionYaw (Entity entity , float tickDelta , Operation <Float > original ) {
84+ if (BaritoneHandler .isActive ()) return original .call (entity , tickDelta );
85+
8186 Vec2d rot = RotationManager .getRotationForVector (tickDelta );
8287 if (entity != getMc ().player || rot == null ) return original .call (entity , tickDelta );
8388
@@ -94,6 +99,8 @@ float fixDirectionYaw(Entity entity, float tickDelta, Operation<Float> original)
9499 */
95100 @ WrapOperation (method = "getRotationVec" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/entity/Entity;getPitch(F)F" ))
96101 float fixDirectionPitch (Entity entity , float tickDelta , Operation <Float > original ) {
102+ if (BaritoneHandler .isActive ()) return original .call (entity , tickDelta );
103+
97104 Vec2d rot = RotationManager .getRotationForVector (tickDelta );
98105 if (entity != getMc ().player || rot == null ) return original .call (entity , tickDelta );
99106
@@ -110,6 +117,8 @@ float fixDirectionPitch(Entity entity, float tickDelta, Operation<Float> origina
110117 */
111118 @ WrapOperation (method = "getRotationVector()Lnet/minecraft/util/math/Vec3d;" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/entity/Entity;getYaw()F" ))
112119 float fixDirectionYaw2 (Entity entity , Operation <Float > original ) {
120+ if (BaritoneHandler .isActive ()) return original .call (entity );
121+
113122 Vec2d rot = RotationManager .getRotationForVector (1.0 );
114123 if (entity != getMc ().player || rot == null ) return original .call (entity );
115124
@@ -126,6 +135,8 @@ float fixDirectionYaw2(Entity entity, Operation<Float> original) {
126135 */
127136 @ WrapOperation (method = "getRotationVector()Lnet/minecraft/util/math/Vec3d;" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/entity/Entity;getPitch()F" ))
128137 float fixDirectionPitch2 (Entity entity , Operation <Float > original ) {
138+ if (BaritoneHandler .isActive ()) return original .call (entity );
139+
129140 Vec2d rot = RotationManager .getRotationForVector (1.0 );
130141 if (entity != getMc ().player || rot == null ) return original .call (entity );
131142
@@ -155,12 +166,16 @@ private boolean modifyGetFlagGlowing(boolean original) {
155166
156167 @ WrapWithCondition (method = "changeLookDirection" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/entity/Entity;setYaw(F)V" ))
157168 private boolean wrapSetYaw (Entity instance , float yaw ) {
169+ if (BaritoneHandler .isActive ()) return true ;
170+
158171 if ((Object ) this != getMc ().player ) return true ;
159172 return RotationManager .getLockYaw () == null ;
160173 }
161174
162175 @ WrapWithCondition (method = "changeLookDirection" , at = @ At (value = "INVOKE" , target = "Lnet/minecraft/entity/Entity;setPitch(F)V" ))
163176 private boolean wrapSetPitch (Entity instance , float yaw ) {
177+ if (BaritoneHandler .isActive ()) return true ;
178+
164179 if ((Object ) this != getMc ().player ) return true ;
165180 return RotationManager .getLockPitch () == null ;
166181 }
0 commit comments