Fixing signs, starting a fix on spec errors, should work now :D
This commit is contained in:
parent
1ead9c7570
commit
859c286585
5 changed files with 60 additions and 30 deletions
|
@ -11,6 +11,10 @@ class Example extends Game {
|
|||
|
||||
public function onGameStop() {
|
||||
$this->getLogger()->info("Game stoped");
|
||||
foreach($this->getLevel()->getPlayers() as $p) {
|
||||
$p->setGamemode(0);
|
||||
$p->teleport($this->getServer()->getDefaultLevel()->getSafeSpawn());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -26,6 +30,13 @@ class Example extends Game {
|
|||
}
|
||||
|
||||
|
||||
public function onPlayerDeath(\pocketmine\event\PlayerDeathEvent $event) {
|
||||
if(($this->getPlugin()->getInGamePlayers($this->getLevel()) - 1) == 0) {
|
||||
$this->stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getName() : string {
|
||||
return "Example";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue