Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Commit

Permalink
Fix #11 #12 #13
Browse files Browse the repository at this point in the history
Updated world loading method (idc if it's bad, it works fine)
  • Loading branch information
Xenophilicy committed Jul 6, 2020
1 parent 8dfb06b commit 40c2011
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Highly maintained and updated fork of [TeaSpoon](https://github.com/CortexPE/Tea
***
**PLEASE NOTE: We do NOT provide any support for branches, forks, or unofficial versions of TableSpoon nor do we
support any unofficial or beta releases of PocketMine. We are NOT responsible for any damages or corruptions that
may occur by using this plugins. You assume ALL responsibility and accept the risks by using this plugin.**
may occur by using this plugin. You assume ALL responsibility and accept the risks by using this plugin.**


TableSpoon is not yet complete which means it **ships with many known and unknown issues and bugs** that you should be
TableSpoon is not yet complete which means it **ships with many unknown issues and bugs** that you should be
aware of before attempting to use certain features. Do not expect anything to "just work" as nothing is guaranteed
at this point in development (extremely alpha stage, duh). By using our releases, you acknowledge that there may be
non-commercialized/production features not implemented, misbehaving, or simply broken. **This is normal**, we will
Expand All @@ -33,7 +33,7 @@ You may contribute by opening a pull request to add features, fix bugs, or simpl
branch.

### Known issues (also see our todo list)
* Nether portal doesn't get created in Nether level
* A nether portal doesn't get created in Nether level
* End portal teleports over void
* Enchantment tables and anvils are not functional

Expand Down
4 changes: 2 additions & 2 deletions src/Xenophilicy/TableSpoon/TableSpoon.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
use Xenophilicy\TableSpoon\handlers\{EnchantHandler, PacketHandler};
use Xenophilicy\TableSpoon\inventory\BrewingManager;
use Xenophilicy\TableSpoon\item\{enchantment\Enchantment, ItemManager};
use Xenophilicy\TableSpoon\level\LevelManager;
use Xenophilicy\TableSpoon\level\weather\Weather;
use Xenophilicy\TableSpoon\network\PacketManager;
use Xenophilicy\TableSpoon\player\PlayerSession;
use Xenophilicy\TableSpoon\player\PlayerSessionManager;
use Xenophilicy\TableSpoon\task\DelayedLevelLoadTask;
use Xenophilicy\TableSpoon\task\TickLevelsTask;
use Xenophilicy\TableSpoon\tile\Tile;
use Xenophilicy\TableSpoon\utils\FishingLootTable;
Expand Down Expand Up @@ -68,7 +68,7 @@ public function onEnable(){
}

private function initManagers(){
LevelManager::init();
$this->getScheduler()->scheduleTask(new DelayedLevelLoadTask());
PlayerSessionManager::init();
CommandManager::init();
Enchantment::init();
Expand Down
25 changes: 25 additions & 0 deletions src/Xenophilicy/TableSpoon/task/DelayedLevelLoadTask.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
declare(strict_types=1);

namespace Xenophilicy\TableSpoon\task;

use pocketmine\level\Level;
use pocketmine\scheduler\Task;
use Xenophilicy\TableSpoon\level\LevelManager;
use Xenophilicy\TableSpoon\TableSpoon;

/**
* Class DelayedLevelLoadTask
* @package Xenophilicy\TableSpoon\task
*/
class DelayedLevelLoadTask extends Task{

/**
* @param int $currentTick
*/
public function onRun(int $currentTick){
LevelManager::init();
if(TableSpoon::$overworldLevel instanceof Level) return;
TableSpoon::getInstance()->getScheduler()->scheduleTask(new $this());
}
}

0 comments on commit 40c2011

Please sign in to comment.