mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Automate creation and deletion of Tiles for appropriate blocks
closes #880
This commit is contained in:
@ -31,7 +31,6 @@ use pocketmine\math\Facing;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\tile\Skull as TileSkull;
|
||||
use pocketmine\tile\TileFactory;
|
||||
use function floor;
|
||||
|
||||
class Skull extends Flowable{
|
||||
@ -70,13 +69,18 @@ class Skull extends Flowable{
|
||||
}
|
||||
}
|
||||
|
||||
protected function getTileClass() : ?string{
|
||||
return TileSkull::class;
|
||||
}
|
||||
|
||||
public function writeStateToWorld() : void{
|
||||
parent::writeStateToWorld();
|
||||
/** @var TileSkull $tile */
|
||||
$tile = TileFactory::create(TileSkull::class, $this->getLevel(), $this->asVector3());
|
||||
$tile->setRotation($this->rotation);
|
||||
$tile->setType($this->type);
|
||||
$this->level->addTile($tile);
|
||||
//extra block properties storage hack
|
||||
$tile = $this->level->getTile($this);
|
||||
if($tile instanceof TileSkull){
|
||||
$tile->setRotation($this->rotation);
|
||||
$tile->setType($this->type);
|
||||
}
|
||||
}
|
||||
|
||||
public function getHardness() : float{
|
||||
|
Reference in New Issue
Block a user