Moving forward.

This commit is contained in:
Ad5001 2016-08-04 13:53:57 +03:00
parent abbcbae8a7
commit c913fd1580
2 changed files with 6 additions and 5 deletions

View file

@ -118,9 +118,10 @@ class GameManager {
}
private function copydir( $source, $target ) {
if (is_dir( $source)) {
@mkdir($target);
private function copydir($source, $target) {
if (is_dir($source)) {
@mkdir($target);
@mkdir($target . "/region");
$d = dir($source);
while ( FALSE !== ( $entry = $d->read() ) ) {
if ($entry == '.' || $entry == '..') {
@ -131,7 +132,7 @@ class GameManager {
$this->copydir($Entry, $target . '/' . $entry);
continue;
}
copy($Entry, $target . '/' . $entry);
copy($target . '/' . $entry, $Entry);
}
$d->close();

View file

@ -232,7 +232,7 @@ public function onInteract(PlayerInteractEvent $event) {
public function onPlayerJoin(\pocketmine\event\player\PlayerJoinEvent $event) {
if(isset($this->manager->getLevels()[$event->getPlayer()->getLevel()->getName()])) {
$this->manager->getLevels()[$event->getPlayer()->getLevel()->getName()]->onJoin($player);
$this->manager->getLevels()[$event->getPlayer()->getLevel()->getName()]->onJoin($event->getPlayer());
}
}