public function onCommand(CommandSender $sender, Command $command, $label, array $argument){
$username = strtolower($sender->getName());
if(!($sender Instanceof Player)){$sender->sendMessage("§l§fКомманда вводится только от имени игрока.");return;}
switch($command->getName()){
case "cmd":
break;
}}
Помогите плиз мне нужно передать параметре $particle в ReloadText API 3.0.0
Код плагина
public function Text(){
$config = $this->config->getAll();
foreach($config as $first => $second){
$get = $this->config->getAll()[$first];
$vec = explode(',', $get['X,Y,Z']);
$vec = new Vector3($vec[0], $vec[1], $vec[2]);
$particle = new FloatingTextParticle($vec, $get['text'], $get['head']);
$this->getServer()->getDefaultLevel()->addParticle($particle);
$this->getServer()->getScheduler()->scheduleDelayedRepeatingTask(new Timer($this->ReloadText($particle)), 20 * 10, 20 * 10);
$this->getLogger()->info("Loding");}
}
public function ReloadText(FloatingTextParticle $particle){
$particle->setInvisible();
$this->getLogger()->info("Remove");
$this->getServer()->getDefaultLevel()->addParticle($particle);
}
Код таймера
class Timer extends Task{
private $main;
public function __construct($main){
$this->main = $main;
}
public function onRun(int $tick){
$this->main->Text();
}
}