mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Entities spawn with their motion
This commit is contained in:
@ -547,6 +547,12 @@ class Entity extends Position{
|
||||
"meta" => $this->meta,
|
||||
"stack" => $this->stack,
|
||||
));
|
||||
$player->dataPacket(MC_SET_ENTITY_MOTION, array(
|
||||
"eid" => $this->eid,
|
||||
"speedX" => (int) ($this->speedX * 400),
|
||||
"speedY" => (int) ($this->speedY * 400),
|
||||
"speedZ" => (int) ($this->speedZ * 400),
|
||||
));
|
||||
break;
|
||||
case ENTITY_MOB:
|
||||
$player->dataPacket(MC_ADD_MOB, array(
|
||||
@ -557,6 +563,12 @@ class Entity extends Position{
|
||||
"z" => $this->z,
|
||||
"metadata" => $this->getMetadata(),
|
||||
));
|
||||
$player->dataPacket(MC_SET_ENTITY_MOTION, array(
|
||||
"eid" => $this->eid,
|
||||
"speedX" => (int) ($this->speedX * 400),
|
||||
"speedY" => (int) ($this->speedY * 400),
|
||||
"speedZ" => (int) ($this->speedZ * 400),
|
||||
));
|
||||
break;
|
||||
case ENTITY_OBJECT:
|
||||
if($this->type === OBJECT_PAINTING){
|
||||
@ -579,6 +591,12 @@ class Entity extends Position{
|
||||
"z" => $this->z,
|
||||
"did" => -$this->data["Tile"],
|
||||
));
|
||||
$player->dataPacket(MC_SET_ENTITY_MOTION, array(
|
||||
"eid" => $this->eid,
|
||||
"speedX" => (int) ($this->speedX * 400),
|
||||
"speedY" => (int) ($this->speedY * 400),
|
||||
"speedZ" => (int) ($this->speedZ * 400),
|
||||
));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user