Items spawn, Tiles spawn, both are saved, blocks drop

This commit is contained in:
Shoghi Cervantes
2014-05-24 17:25:37 +02:00
parent f2dc9cdff7
commit ec055fd8d1
9 changed files with 293 additions and 48 deletions

View File

@ -21,11 +21,18 @@
namespace pocketmine\tile;
use pocketmine\level\Level;
use pocketmine\nbt\tag\Compound;
use pocketmine\Player;
abstract class Spawnable extends Tile{
public abstract function spawnTo(Player $player);
public function __construct(Level $level, Compound $nbt){
parent::__construct($level, $nbt);
$this->spawnToAll();
}
public function spawnToAll(){
foreach($this->getLevel()->getPlayers() as $player){
if($player->spawned === true){