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

@ -28,10 +28,8 @@ use pocketmine\item\Item;
use pocketmine\item\TieredTool;
use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;
use pocketmine\math\Vector3;
use pocketmine\Player;
use pocketmine\tile\EnchantTable as TileEnchantingTable;
use pocketmine\tile\TileFactory;
class EnchantingTable extends Transparent{
@ -41,13 +39,8 @@ class EnchantingTable extends Transparent{
}
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
if(parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player)){
$this->level->addTile(TileFactory::createFromItem(TileEnchantingTable::class, $this->getLevel(), $this->asVector3(), $item));
return true;
}
return false;
protected function getTileClass() : ?string{
return TileEnchantingTable::class;
}
public function getHardness() : float{