@@ -786,7 +786,9 @@ public void travel(@NotNull Vec3 pTravelVector) {
786
786
float vertical = this .isGoingUp () ? 1.0F : this .isGoingDown () ? -1.0F : 0F ;
787
787
788
788
float speedFactor = 1.0f ;
789
- if (this .isFlying () || this .isHovering ()) {
789
+ boolean isFlying = this .isFlying () || this .isHovering ();
790
+
791
+ if (isFlying ) {
790
792
speedFactor *= flightSpeedFactor ;
791
793
// Let server know we're flying before they kick us
792
794
this .setNoGravity (true );
@@ -811,7 +813,9 @@ public void travel(@NotNull Vec3 pTravelVector) {
811
813
812
814
// Vanilla travel has a smaller friction factor for Y axis
813
815
// Add more friction in case moving too fast on Y axis
814
- if (this .isFlying () || this .isHovering ()) {
816
+ if (isFlying ) {
817
+ // See LivingEntity#getFrictionInfluencedSpeed -> flyingSpeed (default: 0.02) is used when not on ground
818
+ this .flyingSpeed = getSpeed ();
815
819
this .setDeltaMovement (this .getDeltaMovement ().multiply (1.0f , 0.92f , 1.0f ));
816
820
}
817
821
} else if (rider instanceof Player ) {
@@ -820,16 +824,18 @@ public void travel(@NotNull Vec3 pTravelVector) {
820
824
// Happens when stepping up blocks
821
825
// Might because client & server's onGround flag is out of sync
822
826
// I can't get it fixed, so it's disabled
823
- this .noPhysics = DISABLE_MOVEMENT_CHECK ;
827
+ // this.noPhysics = DISABLE_MOVEMENT_CHECK;
824
828
}
825
829
826
- this .calculateEntityAnimation (this , false );
830
+ this .calculateEntityAnimation (this , isFlying );
827
831
this .tryCheckInsideBlocks ();
828
832
} else {
829
833
this .setNoGravity (false );
830
834
this .noPhysics = false ;
831
835
832
836
this .setSpeed (0.02F );
837
+ flyingSpeed = getSpeed ();
838
+
833
839
super .travel (pTravelVector );
834
840
}
835
841
} else {
@@ -849,6 +855,7 @@ public boolean doHurtTarget(@NotNull Entity entityIn) {
849
855
return false ;
850
856
}
851
857
858
+ // FIXME :: Unused
852
859
public ItemEntity createEgg (EntityHippogryph partner ) {
853
860
int i = Mth .floor (this .getX ());
854
861
int j = Mth .floor (this .getY ());
@@ -895,13 +902,16 @@ public void aiStep() {
895
902
if (dist < 8 ) {
896
903
attackTarget .hurt (DamageSource .mobAttack (this ), ((int ) this .getAttribute (Attributes .ATTACK_DAMAGE ).getValue ()));
897
904
attackTarget .hasImpulse = true ;
905
+ /*
906
+ // Disabled because it causes the target (player) to bounce upward
898
907
float f = Mth.sqrt((float) (0.5 * 0.5 + 0.5 * 0.5));
899
908
attackTarget.setDeltaMovement(attackTarget.getDeltaMovement().add(-0.5 / (double) f, 1, -0.5 / (double) f));
900
909
attackTarget.setDeltaMovement(attackTarget.getDeltaMovement().multiply(0.5D, 1, 0.5D));
901
910
902
911
if (attackTarget.isOnGround()) {
903
912
attackTarget.setDeltaMovement(attackTarget.getDeltaMovement().add(0, 0.3, 0));
904
913
}
914
+ */
905
915
}
906
916
}
907
917
if (!level .isClientSide && !this .isOverAir () && this .getNavigation ().isDone () && attackTarget != null && attackTarget .getY () - 3 > this .getY () && this .getRandom ().nextInt (15 ) == 0 && this .canMove () && !this .isHovering () && !this .isFlying ()) {
0 commit comments