Workaround for player hitbox bug on respawn

this happens when a player respawns before their death animation ends. I don't know why, but their bounding box height suddenly becomes zero. This solves the bug by simply resending the height and width properties to viewers on respawn.

Closes #2135.
This commit is contained in:
Dylan K. Taylor 2018-04-04 20:11:16 +01:00
parent 9ed0d9d36f
commit a889a0e517
2 changed files with 3 additions and 0 deletions

View File

@ -3669,6 +3669,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
}
$this->sendData($this);
$this->sendData($this->getViewers());
$this->sendSettings();
$this->inventory->sendContents($this);

View File

@ -531,6 +531,8 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
$this->propertyManager->setString(self::DATA_NAMETAG, "");
$this->propertyManager->setLong(self::DATA_LEAD_HOLDER_EID, -1);
$this->propertyManager->setFloat(self::DATA_SCALE, 1);
$this->propertyManager->setFloat(self::DATA_BOUNDING_BOX_WIDTH, $this->width);
$this->propertyManager->setFloat(self::DATA_BOUNDING_BOX_HEIGHT, $this->height);
$this->fireTicks = $this->namedtag->getShort("Fire", 0);
if($this->isOnFire()){