Skip to content
This repository was archived by the owner on May 24, 2018. It is now read-only.

Commit 8846780

Browse files
committed
Fixed namespaces paths
1 parent df6efa3 commit 8846780

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

plugin.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ main: ExamplePlugin\MainClass
44
version: 1.0.0
55
api: [1.0.0]
66

7-
87
load: POSTWORLD
98
author: PocketMine Team
109
description: Example plugin showing the new API

src/ExamplePlugin/BroadcastPluginTask.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@
22

33
namespace ExamplePlugin;
44

5-
use PocketMine\Player;
6-
use PocketMine\Scheduler\PluginTask;
5+
use pocketmine\Player;
6+
use pocketmine\scheduler\PluginTask;
7+
use pocketmine\Server;
78

89
class BroadcastPluginTask extends PluginTask{
910

1011
public function onRun($currentTick){
11-
Player::broadcastMessage("[ExamplePlugin] I've ran on tick " . $currentTick);
12+
Server::getInstance()->broadcastMessage("[ExamplePlugin] I've ran on tick " . $currentTick);
1213
}
1314
}

src/ExamplePlugin/MainClass.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22

33
namespace ExamplePlugin;
44

5-
use PocketMine\Command\Command;
6-
use PocketMine\Command\CommandSender;
7-
use PocketMine\Event\Listener;
8-
use PocketMine\Event\Player\PlayerRespawnEvent;
9-
use PocketMine\Player;
10-
use PocketMine\Plugin\PluginBase;
11-
use PocketMine\Utils\TextFormat;
5+
use pocketmine\command\Command;
6+
use pocketmine\command\CommandSender;
7+
use pocketmine\event\Listener;
8+
use pocketmine\event\player\PlayerRespawnEvent;
9+
use pocketmine\Player;
10+
use pocketmine\plugin\PluginBase;
11+
use pocketmine\Server;
12+
use pocketmine\utils\TextFormat;
1213

1314
class MainClass extends PluginBase implements Listener{
1415

@@ -43,6 +44,6 @@ public function onCommand(CommandSender $sender, Command $command, $label, array
4344
* @ignoreCancelled false
4445
*/
4546
public function onSpawn(PlayerRespawnEvent $event){
46-
Player::broadcastMessage($event->getPlayer()->getDisplayName() . " has just spawned!");
47+
Server::getInstance()->broadcastMessage($event->getPlayer()->getDisplayName() . " has just spawned!");
4748
}
4849
}

0 commit comments

Comments
 (0)