Particle::encode() now always returns ClientboundPacket[]

This commit is contained in:
Dylan K. Taylor
2020-10-31 15:51:17 +00:00
parent 5a320f22b7
commit 66edf5a165
38 changed files with 73 additions and 76 deletions

View File

@ -49,7 +49,7 @@ class DragonEggTeleportParticle implements Particle{
return $v;
}
public function encode(Vector3 $pos){
public function encode(Vector3 $pos) : array{
$data = ($this->zDiff < 0 ? 1 << 26 : 0) |
($this->yDiff < 0 ? 1 << 25 : 0) |
($this->xDiff < 0 ? 1 << 24 : 0) |
@ -57,6 +57,6 @@ class DragonEggTeleportParticle implements Particle{
(abs($this->yDiff) << 8) |
abs($this->zDiff);
return LevelEventPacket::create(LevelEventPacket::EVENT_PARTICLE_DRAGON_EGG_TELEPORT, $data, $pos);
return [LevelEventPacket::create(LevelEventPacket::EVENT_PARTICLE_DRAGON_EGG_TELEPORT, $data, $pos)];
}
}