Shows a list of voters for your PocketMine-MP Server on a floating text!
After another person has voted:
As of commit e547488 TopVoter plugin offers an API that allows other plugins to access it's data and edit it.
Getting the list of voters:
TopVoter::getInstance()->getVoters();
Setting voters on the list:
TopVoter::getInstance()->setVoters($value);
Updating and resending the particles:
TopVoter::getInstance()->updateParticle();
TopVoter::getInstance()->sendParticle();
Using this piece of code, you can see what text will be shown on the particle. TopVoter::updateParticle()
will return it to you:
$text = TopVoter::getInstance()->updateParticle();
echo $text;