Fix flying clip bug

This commit is contained in:
Moulberry 2021-09-14 17:37:57 +08:00
parent 7737d0e5b3
commit 73ea79bed2

View File

@ -1658,6 +1658,15 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
refreshAbilities();
}
@Override
public void setSneaking(boolean sneaking) {
if(isFlying()) { //If we are flying, don't set the players pose to sneaking as this can clip them through blocks
this.entityMeta.setSneaking(sneaking);
} else {
super.setSneaking(sneaking);
}
}
/**
* Gets if the player is currently flying.
*