mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
Automate creation and deletion of Tiles for appropriate blocks
closes #880
This commit is contained in:
@ -30,7 +30,6 @@ use pocketmine\math\Facing;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\Player;
|
||||
use pocketmine\tile\Furnace as TileFurnace;
|
||||
use pocketmine\tile\TileFactory;
|
||||
|
||||
class Furnace extends Solid{
|
||||
|
||||
@ -61,6 +60,10 @@ class Furnace extends Solid{
|
||||
return 0b111;
|
||||
}
|
||||
|
||||
protected function getTileClass() : ?string{
|
||||
return TileFurnace::class;
|
||||
}
|
||||
|
||||
public function getName() : string{
|
||||
return "Furnace";
|
||||
}
|
||||
@ -99,12 +102,8 @@ class Furnace extends Solid{
|
||||
if($player !== null){
|
||||
$this->facing = Facing::opposite($player->getHorizontalFacing());
|
||||
}
|
||||
if(parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player)){
|
||||
$this->level->addTile(TileFactory::createFromItem(TileFurnace::class, $this->getLevel(), $this->asVector3(), $item));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player);
|
||||
}
|
||||
|
||||
public function onActivate(Item $item, Player $player = null) : bool{
|
||||
|
Reference in New Issue
Block a user