Removed entanglement between chunks and providers. WARNING: BREAKING API CHANGES.

- All entity and tile constructors now require a \pocketmine\level\Level instead of a \pocketmine\level\format\Chunk.
- Chunk->getProvider() and Chunk->setProvider() have been removed.
- Chunk::__construct() has had the $provider parameter removed.
- Chunk->unload() has had the unused $save parameter removed.
- ChunkEvents now take a Level parameter instead of going through the Chunk

API bump to 3.0.0-ALPHA4
This commit is contained in:
Dylan K. Taylor
2017-02-21 17:03:45 +00:00
parent 0a8826b21f
commit c21197ef17
37 changed files with 123 additions and 170 deletions

View File

@ -22,7 +22,7 @@
namespace pocketmine\tile;
use pocketmine\event\block\SignChangeEvent;
use pocketmine\level\format\Chunk;
use pocketmine\level\Level;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\IntTag;
use pocketmine\nbt\tag\StringTag;
@ -31,7 +31,7 @@ use pocketmine\utils\TextFormat;
class Sign extends Spawnable{
public function __construct(Chunk $chunk, CompoundTag $nbt){
public function __construct(Level $level, CompoundTag $nbt){
if(!isset($nbt->Text1)){
$nbt->Text1 = new StringTag("Text1", "");
}
@ -45,7 +45,7 @@ class Sign extends Spawnable{
$nbt->Text4 = new StringTag("Text4", "");
}
parent::__construct($chunk, $nbt);
parent::__construct($level, $nbt);
}
public function saveNBT(){