Hello there, I'm trying to generate objects from particles. I've tried this code to generate circle: PHP: /*** @param int|float $radius* @param int|float $spacing (%)** @return \Generator*/public function generateCircle($radius, $spacing = 1): \Generator { $last = null; for($i = 0; $i < 360; $i += (3.6 * $spacing)) { $x = $radius * sin(deg2rad($i)); $z = $radius * cos(deg2rad($i)); yield [$x, $z]; }}generateCircele(1.6, 4); Then I put it to repeating task with delay 40 ticks. I've got this result. However when I shorened the delay to 1 tick, I've got incoplete circle. Is there any way to fix it?
Happened with PiggyCE's forcefield enchant also. Switching to a different particle resolved the issue
Spoiler: My code PHP: foreach(generateCircle() as $particle) { Player->getLevel()->addParticle($particle);} I'm using pmmp api PHP: public function addParticle(Particle $particle, array $players = null){ $pk = $particle->encode(); if(!is_array($pk)){ $pk = [$pk]; } if(count($pk) > 0){ if($players === null){ foreach($pk as $e){ $this->broadcastPacketToViewers($particle, $e); } }else{ $this->server->batchPackets($players, $pk, false); } } }