mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
0.9.x setentitymotion packet added
This commit is contained in:
parent
532acb549d
commit
6cbc3824f3
7 changed files with 20 additions and 44 deletions
|
|
@ -1,10 +1,7 @@
|
|||
<?php
|
||||
|
||||
class SetEntityMotionPacket extends RakNetDataPacket{
|
||||
public $eid;
|
||||
public $speedX;
|
||||
public $speedY;
|
||||
public $speedZ;
|
||||
public $entities;
|
||||
|
||||
public function pid(){
|
||||
return ProtocolInfo::SET_ENTITY_MOTION_PACKET;
|
||||
|
|
@ -16,10 +13,13 @@ class SetEntityMotionPacket extends RakNetDataPacket{
|
|||
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putInt($this->eid);
|
||||
$this->putShort((int) ($this->speedX * 400));
|
||||
$this->putShort((int) ($this->speedY * 400));
|
||||
$this->putShort((int) ($this->speedZ * 400));
|
||||
$this->putInt(count($this->entities));
|
||||
foreach($this->entities as $d){
|
||||
$this->putInt($d[0]);
|
||||
$this->putShort((int) ($d[1]*8000));
|
||||
$this->putShort((int) ($d[2]*8000));
|
||||
$this->putShort((int) ($d[3]*8000));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue