Automate creation and deletion of Tiles for appropriate blocks

closes #880
This commit is contained in:
Dylan K. Taylor
2019-02-13 12:27:13 +00:00
parent 260c5dcf00
commit 01e7ebeb5c
13 changed files with 100 additions and 97 deletions

View File

@ -29,7 +29,6 @@ use pocketmine\math\Facing;
use pocketmine\math\Vector3;
use pocketmine\Player;
use pocketmine\tile\FlowerPot as TileFlowerPot;
use pocketmine\tile\TileFactory;
class FlowerPot extends Flowable{
@ -55,6 +54,10 @@ class FlowerPot extends Flowable{
return 0b1111; //vanilla uses various values, we only care about 1 and 0 for PE
}
protected function getTileClass() : ?string{
return TileFlowerPot::class;
}
public function getName() : string{
return "Flower Pot";
}
@ -68,12 +71,7 @@ class FlowerPot extends Flowable{
return false;
}
if(parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player)){
$this->level->addTile(TileFactory::createFromItem(TileFlowerPot::class, $this->getLevel(), $this->asVector3(), $item));
return true;
}
return false;
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
}
public function onNearbyBlockChange() : void{