Fixed scaling issues with height and width on the client, close #819

Seems these metadata fields are actually the _base_ height/width. Setting the scale will cause the client to calculate bounding boxes with the scale already taken into account. This caused the scale to be applied twice on the client.
This commit is contained in:
Dylan K. Taylor 2017-05-05 16:51:15 +01:00
parent 8a7259aa73
commit adbb53929e

View File

@ -409,6 +409,7 @@ abstract class Entity extends Location implements Metadatable{
$this->width *= $multiplier;
$this->height *= $multiplier;
$this->eyeHeight *= $multiplier;
$halfWidth = $this->width / 2;
$this->boundingBox->setBounds(
@ -421,8 +422,6 @@ abstract class Entity extends Location implements Metadatable{
);
$this->setDataProperty(self::DATA_SCALE, self::DATA_TYPE_FLOAT, $value);
$this->setDataProperty(self::DATA_BOUNDING_BOX_WIDTH, self::DATA_TYPE_FLOAT, $this->width);
$this->setDataProperty(self::DATA_BOUNDING_BOX_HEIGHT, self::DATA_TYPE_FLOAT, $this->height);
}
public function isSneaking(){