here's an idea, i doubt anyone would even bother but here it is anyways you would need to condense the face part expecting face size X&Y to be equal chunk size = ideal display size / face size each chunk will be a square with chunk size as X&Y once you generated all chunks you could transform pixel into colour code, the majority one would be the represent for that said chunk this could work idk what's a better way to approach this
Someone made that on Github, i tested it works, it sends the face of the head of the player in DustParticle (with colors) PHP: public function onPlayerInteract(\pocketmine\event\player\PlayerInteractEvent $event){ $player = $event->getPlayer(); $level = $player->getLevel(); $skin = substr($player->getSkinData(), ($pos = (64 * 8 * 4)) - 4, $pos); for($x = 0; $x < 8; $x++){ for($y = 0; $y < 8; $y++){ $key = ((64 * $y) + 8 + $x) * 4; $level->addParticle(new \pocketmine\level\particle\DustParticle($player->add($xx = ($x - 4) * 0.3, $yy = 4 - ($y * 0.4), 0), $r = ord($skin{$key}), $g = ord($skin{$key+1}), $b = ord($skin{$key+2}), $a = ord($skin{$key+3}))); $level->addParticle(new \pocketmine\level\particle\DustParticle($player->add($xx, $yy + ($y * 0.15), 0), $r, $g, $b, $a)); $level->addParticle(new \pocketmine\level\particle\DustParticle($player->add($xx + ($x - 4) * 0.15, $yy + ($y * 0.2), 0), $r, $g, $b, $a)); $level->addParticle(new \pocketmine\level\particle\DustParticle($player->add($xx + ($x - 4) * 0.15, $yy, 0), $r, $g, $b, $a)); } } }
CRITICAL> ParseError: "syntax error, unexp ected 'public function onPlayerInte' (T_STRING), expecting functi on (T_FUNCTION)" (EXCEPTION)
Yeah, blame XenForo. There probably aren't any errors in that code, you'll have to rewrite the whole thing rather than copy-paste it. Trust me, it's annoying but there's no other way. Been dealing with this problem (might be encoding) since the old forum.
I've not seen any php lint that fixes the error for you, and unless you are using a really nice IDE, I believe a syntax checker will only give you the same error PM does. Plus, as Muqsit said, it should be fixed by typing the code yourself. Why copy-paste, anyway? You don't learn nearly as much that way. I've seen several threads about the same issue. The code may look absolutely fine to us, but maybe not to PM.