mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
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:
parent
8a7259aa73
commit
adbb53929e
@ -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(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user