mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
Automate creation and deletion of Tiles for appropriate blocks
closes #880
This commit is contained in:
@ -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{
|
||||
|
Reference in New Issue
Block a user