Fixed creative flying glitch

This commit is contained in:
Sollace 2023-09-01 18:16:09 +01:00
parent 1f05e46648
commit a5aedf6c64
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -255,7 +255,7 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
entity.getAbilities().allowFlying = type.canFlyCreative(entity); entity.getAbilities().allowFlying = type.canFlyCreative(entity);
boolean creative = entity.getAbilities().creativeMode || entity.isSpectator(); boolean creative = entity.isCreative() || entity.isSpectator();
boolean startedFlyingCreative = !creative && isFlyingEither != entity.getAbilities().flying; boolean startedFlyingCreative = !creative && isFlyingEither != entity.getAbilities().flying;
@ -300,10 +300,8 @@ public class PlayerPhysics extends EntityPhysics<PlayerEntity> implements Tickab
} }
lastFlightType = type; lastFlightType = type;
if (!pony.isClient()) {
isFlyingSurvival = entity.getAbilities().flying && !creative; isFlyingSurvival = entity.getAbilities().flying && !creative;
isFlyingEither = isFlyingSurvival || (creative && entity.getAbilities().flying); isFlyingEither = isFlyingSurvival || (creative && entity.getAbilities().flying);
}
if (typeChanged || startedFlyingCreative) { if (typeChanged || startedFlyingCreative) {
entity.calculateDimensions(); entity.calculateDimensions();