Entity: replace separate height/width/eyeHeight fields with an EntitySizeInfo structure

this will make it easier to implement stuff like sleeping (properly), swimming and gliding without needing to duplicate all the fields.
This commit is contained in:
Dylan K. Taylor
2021-01-08 00:10:11 +00:00
parent 574b615b4c
commit e53b57732b
15 changed files with 103 additions and 60 deletions

View File

@ -1657,7 +1657,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
$entity->attack($ev);
$soundPos = $entity->getPosition()->add(0, $entity->height / 2, 0);
$soundPos = $entity->getPosition()->add(0, $entity->size->getHeight() / 2, 0);
if($ev->isCancelled()){
$this->getWorld()->addSound($soundPos, new EntityAttackNoDamageSound());
return false;