mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 15:19:56 +00:00
add LevelEventPacket::standardParticle() sugar
This commit is contained in:
parent
3274db3ddc
commit
e52ba7201c
@ -129,6 +129,10 @@ class LevelEventPacket extends DataPacket implements ClientboundPacket{
|
|||||||
return $pk;
|
return $pk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function standardParticle(int $particleId, int $data, Vector3 $pos) : self{
|
||||||
|
return self::create(self::EVENT_ADD_PARTICLE_MASK | $particleId, $data, $pos);
|
||||||
|
}
|
||||||
|
|
||||||
protected function decodePayload() : void{
|
protected function decodePayload() : void{
|
||||||
$this->evid = $this->getVarInt();
|
$this->evid = $this->getVarInt();
|
||||||
$this->position = $this->getVector3();
|
$this->position = $this->getVector3();
|
||||||
|
@ -38,6 +38,6 @@ class GenericParticle implements Particle{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function encode(Vector3 $pos){
|
public function encode(Vector3 $pos){
|
||||||
return LevelEventPacket::create(LevelEventPacket::EVENT_ADD_PARTICLE_MASK | $this->id, $this->data, $pos);
|
return LevelEventPacket::standardParticle($this->id, $this->data, $pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user