mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 09:49:50 +00:00
Fixed ExplodePacket
fixed-float my ass!
This commit is contained in:
parent
2024e9ecdf
commit
61b857a81c
@ -35,6 +35,7 @@ class ExplodePacket extends DataPacket{
|
||||
public $x;
|
||||
public $y;
|
||||
public $z;
|
||||
/** @var float */
|
||||
public $radius;
|
||||
/** @var Vector3[] */
|
||||
public $records = [];
|
||||
@ -46,7 +47,7 @@ class ExplodePacket extends DataPacket{
|
||||
|
||||
public function decode(){
|
||||
$this->getVector3f($this->x, $this->y, $this->z);
|
||||
$this->radius = $this->getLFloat();
|
||||
$this->radius = (float) ($this->getVarInt() / 32);
|
||||
$count = $this->getUnsignedVarInt();
|
||||
for($i = 0; $i < $count; ++$i){
|
||||
$x = $y = $z = null;
|
||||
@ -58,7 +59,7 @@ class ExplodePacket extends DataPacket{
|
||||
public function encode(){
|
||||
$this->reset();
|
||||
$this->putVector3f($this->x, $this->y, $this->z);
|
||||
$this->putLFloat($this->radius);
|
||||
$this->putVarInt((int) ($this->radius * 32));
|
||||
$this->putUnsignedVarInt(count($this->records));
|
||||
if(count($this->records) > 0){
|
||||
foreach($this->records as $record){
|
||||
|
Loading…
x
Reference in New Issue
Block a user