meta = $meta; } public function getName() : string{ return "Burning Furnace"; } public function getHardness() : float{ return 3.5; } public function getToolType() : int{ return Tool::TYPE_PICKAXE; } public function getLightLevel() : int{ return 13; } public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ $faces = [ 0 => 4, 1 => 2, 2 => 5, 3 => 3 ]; $this->meta = $faces[$player instanceof Player ? $player->getDirection() : 0]; $this->getLevel()->setBlock($blockReplace, $this, true, true); Tile::createTile(Tile::FURNACE, $this->getLevel(), TileFurnace::createNBT($this, $face, $item, $player)); return true; } public function onActivate(Item $item, Player $player = null) : bool{ if($player instanceof Player){ $furnace = $this->getLevel()->getTile($this); if(!($furnace instanceof TileFurnace)){ $furnace = Tile::createTile(Tile::FURNACE, $this->getLevel(), TileFurnace::createNBT($this)); } if(isset($furnace->namedtag->Lock) and $furnace->namedtag->Lock instanceof StringTag){ if($furnace->namedtag->Lock->getValue() !== $item->getCustomName()){ return true; } } $player->addWindow($furnace->getInventory()); } return true; } public function getVariantBitmask() : int{ return 0; } public function getDrops(Item $item) : array{ if($item->isPickaxe() >= Tool::TIER_WOODEN){ return parent::getDrops($item); } return []; } }