mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
Items spawn, Tiles spawn, both are saved, blocks drop
This commit is contained in:
@ -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){
|
||||
|
@ -40,11 +40,6 @@ abstract class Tile extends Position{
|
||||
|
||||
public static $tileCount = 1;
|
||||
|
||||
/**
|
||||
* @var Tile[]
|
||||
*/
|
||||
public static $list = [];
|
||||
|
||||
/**
|
||||
* @var Tile[]
|
||||
*/
|
||||
@ -76,7 +71,6 @@ abstract class Tile extends Position{
|
||||
$this->name = "";
|
||||
$this->lastUpdate = microtime(true);
|
||||
$this->id = Tile::$tileCount++;
|
||||
Tile::$list[$this->id] = $this;
|
||||
$this->x = (int) $this->namedtag["x"];
|
||||
$this->y = (int) $this->namedtag["y"];
|
||||
$this->z = (int) $this->namedtag["z"];
|
||||
|
Reference in New Issue
Block a user