mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 01:39:52 +00:00
Updated AnimatePacket with extra float handling
This commit is contained in:
parent
6c5ca9b256
commit
5ce860c2f5
@ -31,17 +31,23 @@ class AnimatePacket extends DataPacket{
|
|||||||
|
|
||||||
public $action;
|
public $action;
|
||||||
public $eid;
|
public $eid;
|
||||||
|
public $float; //Boat rowing time?
|
||||||
|
|
||||||
public function decode(){
|
public function decode(){
|
||||||
$this->action = $this->getVarInt();
|
$this->action = $this->getVarInt();
|
||||||
$this->eid = $this->getEntityRuntimeId();
|
$this->eid = $this->getEntityRuntimeId();
|
||||||
//TODO: check extra float which appears when 0x80 bitflag is set
|
if($this->action & 0x80){
|
||||||
|
$this->float = $this->getLFloat();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function encode(){
|
public function encode(){
|
||||||
$this->reset();
|
$this->reset();
|
||||||
$this->putVarInt($this->action);
|
$this->putVarInt($this->action);
|
||||||
$this->putEntityRuntimeId($this->eid);
|
$this->putEntityRuntimeId($this->eid);
|
||||||
|
if($this->action & 0x80){
|
||||||
|
$this->putLFloat($this->float);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handle(NetworkSession $session) : bool{
|
public function handle(NetworkSession $session) : bool{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user